This assignment introduces you to the exciting world of TinyML and edge AI hardware by guiding you through the process of building a keyword-spotting system using Edge Impulse. You will deploy your model on both a smartphone and an Arduino Nano 33 BLE Sense board to evaluate its performance and usability on resource-constrained hardware.
- Learn how to build and train a keyword-spotting model using Edge Impulse.
- Deploy the trained model to both a smartphone and embedded hardware (Arduino Nano 33 BLE Sense).
- Analyze and report on the model's performance, including trade-offs between accuracy and inference speed.
-
Create an Edge Impulse Account:
- Go to Edge Impulse and sign up.
- Create a new project.
-
Follow the Tutorial:
- Complete the Edge Impulse tutorial on building a keyword-spotting model:
Responding to Your Voice.
- Complete the Edge Impulse tutorial on building a keyword-spotting model:
-
Deploy to Your Smartphone:
- Follow the tutorial to deploy the model to your smartphone:
Using Your Mobile Phone.
- Follow the tutorial to deploy the model to your smartphone:
-
Bring Your Laptop:
- Deployment is quick (less than an hour), but ensure you have your laptop with you.
-
Required Hardware:
- Use the Arduino Nano 33 BLE Sense board, (only 2 boards available) as part of the TinyML Arduino Learning Kit, which includes:
- 1 Arduino Nano 33 BLE Sense board
- 1 OV7675 Camera
- 1 Arduino Tiny Machine Learning Shield
- 1 USB A to Micro USB Cable
(Use only the Arduino Nano 33 BLE Sense board for this assignment.)
- Use the Arduino Nano 33 BLE Sense board, (only 2 boards available) as part of the TinyML Arduino Learning Kit, which includes:
-
Install the Arduino IDE:
- Download and install the Arduino IDE: Arduino IDE.
-
Set Up Arduino IDE:
- In Arduino IDE, navigate to Tools > Boards > Boards Manager, search for
nano 33
, and install Arduino Mbed OS Nano Boards. - Select the Nano 33 BLE Sense board from Tools > Board.
- In Arduino IDE, navigate to Tools > Boards > Boards Manager, search for
-
Prepare and Deploy the Model:
- After training in Edge Impulse:
- Navigate to the Deployment page.
- Select Arduino Library and choose INT8 Quantization.
- Click Build to download the deployment ZIP file.
- In Arduino IDE:
- Include the ZIP file as a library: Sketch > Include Library > Add .zip Library.
- Exit and re-enter the Arduino IDE to ensure the library is loaded.
- Open the example code from:
File > Examples > YOUR_PROJECT_NAME_inferencing > nano_ble_33_sense > nano_ble_33_sense_microphone_continuous. - Verify and upload the code to the board.
- Open the serial monitor (Tools > Serial Monitor) to observe outputs.
(First-time compilation may take ~20 minutes.)
- After training in Edge Impulse:
- How to Deploy a Model to Arduino:
YouTube Video - TinyML on Arduino Using Edge Impulse:
Cytron Blog Post (Optional: Try controlling an LED with voice commands.)
Submit a PDF file with the following:
- Questions:
- Does the model perform as accurately as expected on your smartphone? List a few methods to improve the model's accuracy.
- When building a model for resource-limited hardware, how do you balance fast inference times with acceptable model accuracy? What trade-offs did you encounter?
- Include screenshots of the training performance from step 6 of the deployment process.
- Videos:
- Record and provide links to:
- The keyword-spotting model working on your smartphone.
- The keyword-spotting model working on the embedded Arduino board.
- Record and provide links to:
- Reflections:
- Share your experience deploying the model to your smartphone and Arduino board. Mention any technical difficulties or interesting observations.
- Compilation Time:
- Be patient during the Arduino IDE's first compilation; it can take up to 20 minutes.
Happy experimenting!