Overcoming the Challenges of Adding Machine Learning to Your Products
Deploying the Model for Machine Learning
Building the Model |
Convert Machine Learning Model from Cloud-based to Embedded
Now let's move on to deploying your model. You have this model, which exists in the cloud and consists of mathematical filters, transformations, and some Python® code. Ultimately, you need to convert it to a target format that can be programmed into an MCU or MPU. You might need to change its precision; for instance, you could be using 64-bit doubles that need to be converted to floats or integers. This process might require you to regenerate the model. Finally, you want to export it as a C library, taking into account the architecture, and then integrate it into your code.
Select your Compiler Target (MCU or MPU)
What silicon platform is required for your machine learning model? Which one should you choose for your model?
At the high end, such as for smart embedded vision, you have options like PolarFire® Field Programmable Gate Arrays (FPGAs). For Human-Machine Interface (HMI) applications or low-rate data vision, such as one or two frames per second, you can use MPUs (e.g., SAMA7) or high-end 32-bit MCUs (e.g., SAME54). If you are dealing with simple data (such as for predictive maintenance, sensor monitoring, or light signal detection) you can opt for lower-end 32-bit MCUs (e.g., SAMD21) or even smaller 8-bit MCUs (e.g., PIC18 or AVR®).
Create and Download the Knowledge Pack
You need to export your model. MPLAB® Machine Learning Development Suite is user-friendly, allowing you to export your model for various compiler targets. It will also generate generic GNU Compiler Collection (GCC) based code. You select the processor and the platform you are building it for, and then it will ultimately produce a ZIP file including a library file (.a file) and header files. It is also possible to output it as source code, but that requires a separate license for the Machine Learning Development Suite.