|
| 1 | +.. _psoc6_mpy_deepcraft_integration: |
| 2 | + |
| 3 | +MicroPython - DEEPCRAFT™ Integration |
| 4 | +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 5 | + |
| 6 | +`DEEPCRAFT™ <https://www.infineon.com/cms/en/design-support/software/deepcraft-edge-ai-solutions/>`_ is Infineon's comprehensive new Edge AI software & tools offering designed to fastrack edge machine learning |
| 7 | +application development. |
| 8 | + |
| 9 | +`DEEPCRAFT™ Studio`_ is a development platform for AI on edge devices. It provides unique modeling capabilities |
| 10 | +to make custom edge AI models for PSOC-based hardware. Its integration with MicroPython allows an easy end-to-end |
| 11 | +application development and deployment journey. |
| 12 | + |
| 13 | +Follow along to build your first edge Machine Learning (ML) application with MicroPython and DEEPCRAFT™ Studio. 🚀 |
| 14 | + |
| 15 | +Overview |
| 16 | +========= |
| 17 | +This solution follows a standard edge ML application workflow, consisting of two primary phases: training and inferencing. |
| 18 | +The training phase is efficiently managed within DEEPCRAFT™ Studio. |
| 19 | + |
| 20 | +The diagrams below provide a detailed overview of the workflows for both phases, highlighting the tools and steps involved, |
| 21 | +from data acquisition to model deployment. |
| 22 | + |
| 23 | +.. image:: img/training_phase.png |
| 24 | + :width: 1000 |
| 25 | + |
| 26 | +During the training phase, the edge device executes a MicroPython script that streams raw sensor data to a host machine. A capture server running on the host |
| 27 | +receives this data and stores it as timestamped files. These files are then imported into DEEPCRAFT™ Studio, where they undergo labeling, preprocessing, |
| 28 | +and are used to train a machine learning model tailored to the specific application. With MicroPython integration, the trained model can be effortlessly converted |
| 29 | +into a runtime-loadable format and deployed to the device's filesystem. This streamlined workflow, which supports iterative tuning for optimal accuracy, |
| 30 | +greatly simplifies the model conversion and deployment process. |
| 31 | + |
| 32 | + |
| 33 | +.. image:: img/inferencing_phase.png |
| 34 | + :width: 1000 |
| 35 | + |
| 36 | +After achieving satisfactory accuracy, the model is ready for deployment in the final application. During this phase, a MicroPython script stored on the edge device's filesystem |
| 37 | +manages sensor data acquisition and feeds it to the dynamically loaded model. The pre-trained model processes the input data and generates class probabilities based on the learned patterns. |
| 38 | +These outputs can then be utilized to trigger actions through peripherals (e.g., LEDs, buzzers) or transmitted to external interfaces, such as a web dashboard, for visualization. |
| 39 | + |
| 40 | +With this streamlined development workflow, let's proceed to build a complete edge ML application step by step. |
| 41 | + |
| 42 | +Pre-requisites |
| 43 | +================ |
| 44 | + |
| 45 | +Ensure the following tools are installed on your system: |
| 46 | + |
| 47 | +1. `DEEPCRAFT™ Studio`_ |
| 48 | +2. `Capture Server cloned in your local <https://bitbucket.org/imagimob/captureserver/src/master/>`_ |
| 49 | + |
| 50 | +Supported Boards |
| 51 | +================== |
| 52 | +- `CY8CKIT-062S2-AI <https://www.infineon.com/cms/en/product/evaluation-boards/cy8ckit-062s2-ai/>`_ |
| 53 | + |
| 54 | +1. Data Acquisition |
| 55 | +====================== |
| 56 | + |
| 57 | +This part is covered in the `data acquisition repository <https://github.com/Infineon/deepcraft-micropython-data-acquisition>`_, which provides |
| 58 | +instructions and examples for data acquisition using MicroPython. |
| 59 | + |
| 60 | +2. Model Deployment |
| 61 | +===================== |
| 62 | + |
| 63 | +This part is covered in the `model converter repository <https://github.com/Infineon/deepcraft-micropython-converter>`_, which provides instructions |
| 64 | +on how to convert a DEEPCRAFT™ model into a MicroPython-compatible format and deploy it on the PSOC board. |
| 65 | + |
| 66 | +Example Projects |
| 67 | +================== |
| 68 | +- `Edge AI-based baby cry detector with Home Assistant integration <https://www.hackster.io/Infineon_Team/ai-baby-cry-detector-with-home-assistant-integration-05576f>`_ |
| 69 | + |
| 70 | +.. _DEEPCRAFT™ Studio: https://softwaretools.infineon.com/tools/com.ifx.tb.tool.deepcraftstudio |
0 commit comments