element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
  • 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 Tiny ML Air Writing Recognition with Nicla Sense ME
  • 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:33 PM Date Created
  • Views 1327 views
  • Likes 4 likes
  • Comments 0 comments
  • arduino nicla sense me
  • machine learning
  • Neuton
  • neuton tiny ml
  • bosch
  • nicla
  • arm
  • arduino
Related
Recommended

Tiny ML Air Writing Recognition with Nicla Sense ME

KateVasilenko
KateVasilenko
6 Jun 2022

Experimenting with air-writing recognition on Arduino’s smallest board

image

Things used in this project:

Hardware components

Arduino Nicla Sense ME×1
Arm Cortex M4×1
Bosch Sensortec technology×1

Software apps and online services

Neuton Tiny ML

Story

Less than half a year ago, a new Arduino’s board, Nicla Sense ME (Motion & Environment), hit the market. And, needless to say, I couldn't wait for a chance to try this brand new device and explore its capabilities.


image

Nicla Sense ME is currently the smallest board across the entire Arduino PRO family of boards for industrial applications. It comes with a range of Bosch Sensortecsmart motion and environmental sensors, and I’m quite sure that this device will be widely applicable in industrial IoT, as it’s great for various research projects and commercial use.

Just have a look at its unique characteristics:

image

I’m really excited about the pace of development of the TinyML field because such small devices coupled with tiny machine learning capabilities indeed demonstrate enormous potential for many industries and domains.

Now, let me share my findings after an experiment with Nicla Sense ME.

Procedure:

In my experiment, I decided to play with in-air handwriting using an accelerometer-based pen device for handwriting recognition applications in order to test the ability of Nicla Sense ME to identify and process data about handwritten numbers on the edge. Compared to handwriting based on touch devices, this task is much more complex and challenging.

The device on which the experiment was carried out consisted of a triaxial accelerometer and Nicla Sense ME. The accelerations generated by hand motions were processed on MCU for further inference using the Neuton TinyML model.

Step 1: Model Training

For model training, I created my own dataset by capturing data containing 200 samples for each handwritten digit (from 0 to 9). Each sample was recorded for 2 seconds with a frequency of 100 Hz. It's easy to calculate how many times I had to move my hands in the air to collect this data, and it's even easier to imagine what my family members were thinking about me :)

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


Training Dataset

I merge captured samples to a single CSV file and add a target variable using Python script. The resultant dataset consisted of three features (accelerometer axes) and 400000 rows (200 samples by 200 rows for each digit).

I uploaded the dataset in a CSV format to the Neuton TinyML platform, selected the target variable (Digit), target metric (Accuracy). And then I enabled the TinyML option, selected 8-bit calculations without float support. For this case, I activated the Digital Signal Processing option for automatic data preprocessing and feature extraction. The model was trained automatically, and nothing needed to be compressed.


image

image

image

The platform allows us to see a preprocessed dataset. It merged 200 samples in one row and added some statistical features (min, max, mean, etc.)

image


I chose Neuton for this experiment since the platform automatically builds models that are optimal in size and accuracy. I also tried to train the same model with TensorFlow. Сheck out the comparison of the resultant metrics:

image

Just have a look at the dramatic difference in the number of coefficients, Neuton's model has 42 times fewer coefficients than a TensorFlow one!

Step 2: Embedding into a Microcontroller

After the training was completed, I downloaded the archive containing all the necessary files for the embedding to the microcontrollers firmware project.

image

I uploaded all the components to GitHub so that you can easily replicate my experiment for yourself: https://github.com/Neuton-tinyML/nicla_digits

Step 3: Running On-device Inferences

I connected my device to a PC via USB to display inference results. Check out the outcomes of my experiment on the video below:

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


As you can see, the sensor accuracy is really high so it managed to identify all the numbers with great probability. The model operates right on the device and weighs about 1 KB. That’s what I call real TinyML!

Conclusion:

I believe that the future belongs to such incredibly tiny machine learning solutions. The ability to sense and accurately process various types of data in real-time, at low energy consumption but with high computing power opens up new opportunities in many fields. The implementation of such solutions can, for instance, streamline robotic science, ease the detection of seismic activities and dangerous gases in the air, advance IoT devices that we use on a daily basis, and a lot more — the scenarios are infinite! Isn’t that inspiring?

Please write in the comments below what other experiments you want me to do with Nicla Sense ME!

  • 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