
The Arduino sketch and the downloaded library are attached. To use the sketch, 1st include the library in Arduino IDE from Manage library-> Include as ZIP file (already discussed in Video), then run the sketch.
This is the Arduino sketch to control RGB LED using VOICE. Before running this, ensure you have successfully installed the trained model library as a ZIP file. Also, check the library header file name in the Arduino sketch. In the attached example it is #include <nano_RP2040_PDM_inferencing.h>, in your case, replace the name. To find header file (H file) name, open the downloaded ZIP file, check 'src' and check the name of .h file. Use that name.
The whole project library is attached as ZIP file. Also, you can use it.
The objective is to develop an ML model using Scikit-learn's Decision Tree classifier and identify a circular or wavy gesture. The trained Python model is exported in C to use in Arduino IDE. Note: You may use an Uno board to deploy this model. For this case you need one external accelerometer and the axis should be properly calibrated to match with training data.
Recording IMU data (accelerometer and gyro data) and saving it into a CSV file for two gesture shapes: circle and wave. Approx 2min data sample for each class is recorded. The sampling freq is 20Hz (20 samples per second). The arduino sketch used for data collection is attached and available under resource.
Download provided Jupyter Notebook file (.ipynb) from Resource. Open Google colab or any other platform. You can use it on a local machine if you have Jupyter Notebook installed.
You are advised to follow the lecture video, first, download the notebook file and open it in Google colab or any other environment that supports Jupyter Notebook. After that, follow the next lecture and at the same time, run the notebook as instructed. Do not run the whole notebook at the beginning. Because, at a later stage, some other supported files will be incorporated.
Plotting raw data samples to get some ideas/information about important features. It is found that not all data (accelerometer-3 axis and gyro-3 axis) are important for this work. Some may be excluded.
This lecture is about the creation of a frames(sliding window) from the total dataset. For this type of time series data, 1st sliding window is created by taking 'n' no of samples at a time, then some statistical parameters (features) are extracted. Then those features will be fed to ML model for training.
Training of Decision tree classifier model and evaluating model performance in terms of accuracy score on train and test dataset and printing confusion matrix
Deployment of Scikit-learn decision tree classifier model to Arduino-compatible C code to use in Arduino IDE. Before proceeding, don't forget to download the Tree2C.py file from Resource and place it/upload it to colab.
This section discusses how to include the generated C code to Arduino sketch and how to create the main sketch to record IMU data which will be passed the model for prediction.
This lecture includes description of arduino sketch code and discusses how to extract features in sketch of live data and how to include all these functions as a separate header file
After uploading the sketch, the model is tested with live Accelerometer data for detection of gesture.
**Note: This course is not finalized yet. As you know, the TinyML field is constantly growing and developing. So, keeping in mind more sections with theoretical explanations with hands-on project ideas will be included in the near future.
Tiny machine learning, which targets battery-operated devices, is broadly defined as a rapidly expanding field of machine learning technologies and applications that includes hardware (dedicated integrated circuits), algorithms, and software that can perform on-device sensor data analytics at extremely low power, typically in the mW range and below. It eliminates the requirement to send data to the cloud for classification thus providing more security. Also, power-hungry processors are being replaced by a tiny MCU. Of course, there are limitations. The limitations came from limited hardware resources, clock speed, etc. Still, there are several application areas where high computation is not required and a machine learning-based solution is desirable. In that case, TinyML will come into the picture. It can be used to detect anomalies in machinery in a factory, it can predict maintenance requirements of the instruments, healthcare field, and so on. The application domain of TinyML is wide and the future is bright.
The primary objective of this course is to be familiar with TinyML development starting from data collection, model training, testing, and deployment. A low-cost Arduino nano RP2040 connect board having 265KB RAM and 16MB flash with in built accelerometer, Gyroscope, Microphone, temperature sensor, and wireless connectivity module (WiFi+Bluetooth) is used in this course and all example demonstrated here is tested on this board.