Simplify AI Development with SCM-32 Model Zoo
Table of Contents
- Introduction
- What is the SCM-32 Model Zoo?
- Why Use the SCM-32 Model Zoo?
- Step 1: Setting up the Project
- Step 2: Training the Model
- Step 3: Deploying the Model
- Conclusion
- Pros and Cons
- Highlights
- FAQ
Introduction
Developing an AI application can be a challenging process, but with the SCM-32 Model Zoo, it just got a whole lot easier. As a user and data scientist at St. Michael Electronics, I am here to walk you through the steps of creating an image classification application on SCM-32 using the SCM-32 models.
What is the SCM-32 Model Zoo?
The SCM-32 Model Zoo is a public GitHub repository that houses AI models, including footprints and accuracy references, as well as training and deployment scripts for various use cases. It serves as a useful guide to help users through the process of developing optimized applications on STM-32 targets.
Why Use the SCM-32 Model Zoo?
The SCM-32 Model Zoo simplifies the process of training deep learning models on St microcontrollers. It automates tasks that developers usually carry out themselves, making it easier and more efficient to train and deploy neural network models on STM-32 MCUs for image classification.
Step 1: Setting up the Project
- Clone the repository from GitHub onto your workspace using the following command:
git clone [repository_url]
- Install all the necessary prerequisites as indicated in the documentation.
- Go to the Model Zoo directory and create a Python virtual environment or use an existing one.
- Install all the required Python packages from the
requirements.txt
file.
- Open the project in your preferred code editor to start training your image classification model.
Step 2: Training the Model
- Browse the Model Directory to find the best fit model for your application, considering latency, footprint, and accuracy.
- In the Training directory, place your dataset in the appropriate structure under the Dataset Directory.
- Configure the training parameters in the
user_config.ml
file.
- Launch the Python training script by running
python train.py
in the terminal.
- Watch as the training flow unfolds, defining the model topology, loading and pre-processing the dataset, and analyzing the model's memory footprint.
- Visualize the results of the training with accuracy and loss curves, as well as the confusion matrix.
- Perform post-training quantization to reduce the model's memory usage efficiently.
- Use the SCM-32-QBA developer cloud service to benchmark the quantized model on an SCM-32 target.
- Check the accuracy of the quantized model to ensure its performance.
Step 3: Deploying the Model
- Access the deployment directory and modify the required settings in the
user_config.yaml
file.
- Connect your SCM-32 board to your computer using the USB port.
- Launch the deployment process by executing the
deploy.py
script in the terminal.
- Login to the SCM-32-QBA developer cloud service.
- Read the benchmark information of your model and convert the TF Lite model into optimized C code.
- Use the Python wrapper to build and flash the application into your board.
- Once the deployment flow is complete, you can see the image classification application running in real-time on the board, displaying inference details such as predicted labels and accuracy.
Conclusion
The SCM-32 Model Zoo and the accompanying step-by-step guide make it accessible for developers to integrate AI into embedded solutions for SCM-32 boards. By simplifying the process of training and deploying neural network models, the SCM-32 Model Zoo opens up new possibilities for AI applications on STM-32 MCUs.
Pros and Cons
Pros:
- Simplifies the process of training deep learning models on SCM-32 MCUs
- Provides a comprehensive repository of AI models and scripts
- Offers an efficient way to deploy and benchmark models on SCM-32 boards
Cons:
- Requires familiarity with Python and deep learning concepts
- Limited to SCM-32 MCUs and datasets
- Dependency on the SCM-32-QBA developer cloud service
Highlights
- The SCM-32 Model Zoo is a user-friendly solution for developing optimized AI applications on SCM-32.
- It automates tasks and provides pre-selected models, making it easier to train and deploy neural network models on SCM-32 MCUs.
- The training flow includes post-training quantization and provides a way to benchmark the model's performance.
- The SCM-32-QBA developer cloud service offers additional tools for analyzing and optimizing the models.
FAQ
Q: Can I use the SCM-32 Model Zoo for other microcontrollers?
A: No, the SCM-32 Model Zoo is specifically designed for SCM-32 MCUs.
Q: Can I use my own dataset with the SCM-32 Model Zoo?
A: Yes, you can place your dataset in the appropriate structure under the Dataset Directory and configure the training parameters accordingly.
Q: Is the SCM-32 Model Zoo suitable for beginners?
A: While the SCM-32 Model Zoo provides a user-friendly interface, some familiarity with Python and deep learning concepts is recommended.
Q: Can I deploy the trained models on multiple SCM-32 boards?
A: Yes, you can easily deploy the trained models on multiple SCM-32 boards by following the deployment process for each board separately.
Q: What is the performance impact of post-training quantization?
A: Post-training quantization reduces the model's memory usage, but it may slightly affect the accuracy. However, the impact is usually minimal, as seen in the provided benchmark results.
Q: Are there any resources available for further learning?
A: Yes, you can visit the SCM-32 website for more interesting AI stuff and explore the provided notebook examples for additional guidance.
Resources: