element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino Projects
  • Products
  • Arduino
  • Arduino Projects
  • More
  • Cancel
Arduino Projects
Blog Case from the Newly Released TinyML Cookbook
  • Blog
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: KateVasilenko
  • Date Created: 6 Jun 2022 3:42 PM Date Created
  • Views 1410 views
  • Likes 4 likes
  • Comments 0 comments
  • arduino_projects
  • weather
  • weather station
  • machine learning
  • Neuton
  • neuton tiny ml
  • rain
  • arduino
Related
Recommended

Case from the Newly Released TinyML Cookbook

KateVasilenko
KateVasilenko
6 Jun 2022

Check out how to repeat a TinyML experiment on building a weather station from the new “TinyML Cookbook” and make the model smaller

image

Things used in this project:

Hardware components

Raspberry Pi Pico×1
Arduino Nano×1

Software apps and online services

Neuton Tiny ML

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:

image

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


You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

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:

image

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.


You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image


Here are the metrics of the resultant model:
image

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:


image

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.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube