|
Raspberry Pi Pico |
x 1 | |
|
A000005Arduino
|
x 1 |
|
Neuton Tiny MLNeuton
|
TinyML experiment on building a weather station
Story
Lately, I’ve been really passionate about the field of TinyML, actively researching how to enable ML-driven solutions on low-powered devices, and I came across a newly released book, “TinyML Cookbook”, written by Gian Marco Iodice, a team and tech lead in the Machine Learning Group at Arm.
To my mind, this book is the most self-explanatory guide on TinyML existing today as the author gives a comprehensive overview of the concept in general and illustrates it with a lot of cool practical cases, so-called “recipes”. I took one of such recipes and decided to repeat the experiment of building an 8-bit model for predicting the probability of snow.
For more interest, I decided to build my model on another platform instead of the one suggested by the author (he implemented the case using TensorFlow Lite). I opted for a free-to-use platform, Neuton TinyML, in order to compare metrics of the resultant models which had to be deployable on memory-constrained MCUs (the author conducted the experiment on an Arduino Nano and a Raspberry Pi Pico).
Frankly speaking, I got quite exciting outcomes. Keep reading to learn the details :)
Original Process
The original process is described in Chapter 3 of the “TinyML Cookbook” where the author gives a detailed explanation of all the development stages of a TF-based application for an MCU, including:
- Import of weather data from WorldWeatherOnline
- Dataset preparation
- Model training with TF
- Model quantization with a TFLite converter
- Using the built-in temperature and humidity sensor on an Arduino Nano
- Using the DHT22 sensor with a Raspberry Pi Pico
- Preparing the input features for the model inference
- On-device inference with TFLu
For clarity, the process can be represented as such a scheme:
The author also provided a useful link so that everyone can easily get the source code: https://github.com/PacktPublishing/TinyML-Cookbook/blob/main/Chapter03/ColabNotebooks/preparing_model.ipynb
Alternative Way
The example that the author gives in his book is indeed a good working case, especially since everything is described in the book to the smallest detail, and links to all the necessary resources are given.
However, I thought about how to improve the proposed workflow and reduce the number of steps by eliminating the need for quantization. Here’s the workflow that I created with Neuton TinyML:
Step-by-step Workflow
The main aim of my experiment was precisely the creation of a model to check the metrics. My workflow on the Neuton TinyML platform can be described in the following steps:
- Upload a new solution and uploaded a training dataset.
- Upload a validation dataset.
- Select a target variable “Target”.
- Choose the target metric “Accuracy”, enable the TinyML mode, and select 8-bit depth.
- Start model training.
Here are the metrics of the resultant model:
To my mind, the most noteworthy outcome that I got is that the model turned out to be super compact (0.4 Kb) without any additional compression or quantization, and the small size didn’t affect the accuracy at all (which is 88%).
If we compare the models created using the approach of the author of the book and my approach, we get the following results:
Thus, I can conclude that when using the Neuton TinyML platform, I was able to speed up the process of creating a model, as well as get better results in terms of size without compromising accuracy.
In fact, the book, “TinyML Cookbook” also describes other interesting cases, such as voice recognition, gesture-based interface building, and indoor scene classification, among others. Thank you, Gian Marco Iodice, for writing a cool book that inspires people to conduct experiments in the TinyML field.
TinyML experiment on building a weather station
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by AlexMiller112
- Gesture-based remote control device IntroductionThis project demonstrates a gesture based remote control device using Silabs xG24 Dev Ki...
- Ultra-Tiny Solution of Daily Activities Recognition IntroDespite the incredible variety of wearable devices today, most of the AI features come down to ...
- TinyML experiment on building a weather station StoryLately, I’ve been really passionate about the field of TinyML, actively researching how to enab...
- Tiny ML Air Writing Recognition with Nicla Sense ME StoryLess than half a year ago, a new Arduino’s board, Nicla Sense ME (Motion & Environment), hi...
- Making Famous Magic Wand 33x Faster IntroThis case is a remake of a well-known “magic wand” experiment. Last year, Pete Warden, the famo...
- Real-time Food Quality Prediction With each passing year, the issue of food waste becomes more acute for the environment. A recent Foo...
- TinyML Monitoring Air Quality on 8-bit Microcontroller StoryI’d like to share my experiment on how to easily create your own tiny machine learning model an...
- Detecting Unstable Electrical Grid with TinyML IntroductionElectricity is the heart of modern social and economic development. More and more countr...
- Tabular Data VS Computer Vision: Detecting Room Occupancy StoryToday, room occupancy detection is widely used in public places as a way to provide safety, man...
- Tiny ML for Big Hearts on an 8-bit Microcontroller StoryIn the course of the pandemic, the interest in creating more innovative medical devices has run...
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
124 0 0 -
DIY Laser Power Meter with Arduino
173 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
163 0 2 -