Tiny Machine Learning
Tiny Machine Learning
Arduino Education
June 23rd 2021
University
Agenda
● Day to day tasks like scrolling through social media, taking a picture, checking the weather, all depend on
machine learning models.
● Machine learning systems can quickly apply knowledge and training from large datasets to excel at facial
recognition, speech recognition, object recognition, translation, and many other tasks.
● Machine learning allows a system to learn to recognize patterns on its own and make predictions,
contrary to hand-coding a software program with specific instructions to complete a task.
https://www.expert.ai/blog/machine-learning-definition/
Machine Learning
4
Machine Learning applications for everyday life
● Fraud detection
● Face recognition
https://www.cnet.com/news/
5
Why to learn ML?
● Predictive inventory ● Alerts & diagnosis from real ● Aircraft scheduling
planning time patient data ● Customer complaint resolution
● Recommendation engines ● Disease identification ● Traffic patterns
● Market segmentation & ● Proactive health ● Safety monitoring
targeting management ● Dynamic pricing
● Risk analytics
● Power usage analytics ● Predictive maintenance
● Sales & marketing campaign
● Energy demand & supply ● Propensity to buy
management
administration ● Demand forecasting
● Customer segmentation
● Smart grid management ● Process optimization
● Fraud detection
6
Challenges of Machine Learning
Machine Learning allows a computer to internalize
concepts found in data to form predictions for new
situations.
To reach reliable levels of accuracy, models require large Photo by Taylor Vick on Unsplash
datasets to ‘learn’ from.
7
Challenges of Machine Learning
When you take a picture, you want the machine learning magic to happen instantly.
In this case, you we would want the machine learning model to run locally.
When you say “Alexa” or “Ok, Google”, you want your devices to respond to instantly.
2. Privacy & data acquisition: Machine Learning requires massive data sets to train on, and
these should be inclusive/unbiased, and of good quality
8
University
Collaboration of machine learning and embedded ultra-low power internet of things devices that
explores the types of models you can run on small, low-powered devices like microcontrollers.
10
Advantages of Tiny Machine Learning
1. Low Power Consumption: Microcontrollers consume very little power. This enables them to run
without being charged for a really long time.
2. Low Latency: Since the model runs on the edge, the data doesn't have to be sent to a server to run
inference. This reduces the latency of the output.
3. Low Bandwidth: As the data doesn’t have to be sent to the server constantly, less internet bandwidth is
used.
4. Privacy: Since the model is running on the edge, your data is not stored in any servers
(privacy by design)
11
Tiny machine learning
Tiny ML started with Ok google.
Ok google it is a machine learning model that runs on all of our phones, does not run on a big data centre.
It runs in the single processing little chip that is always on.
12
What do we need?
1. Hardware:
2. Software - Framework
TensorFlow Lite is the most popular and has the most community support.
Using TensorFlow Lite Micro, we can deploy models on microcontrollers.
Arduino IDE: There is an arduino library available for TensorFlow Lite, on the
Nano 33 BLE Sense
It comes with 4 examples showing how to run speech, accelerometer and
image machine learning on a microcontroller.
3. Resources
13
Arduino content NOT included TINY Machine Learning KIT
14
Arduino content NOT included
TINY Machine Learning KIT
Arduino Nano 33 BLE Sense
● Senses: movement,
COURSE 1 acceleration, rotation,
● Understand what machine learning (ML) Is temperature, humidity,
● Deep learning and embedded machine barometric pressure,
learning
● Understand neural networks sounds, gestures,
● Background responsibilities and Real proximity, color, and light
Examples intensity.
COURSE 2
● Train your device using your own datasets Custom Arduino shield to attach
● Using external training models for your your components
project
● Basics of AI, real user cases and scenarios
● Know and play with some of the most used
technics
● Real world industry applications
COURSE 3
● Hardware basics Camera module (OV7675)
● Code your own projects with TinyML
● Train your TinyML device
● Deploy, test, and correct your TinyML External content:
projects ● There is NO Arduino content for this kit
● Use the freely available content & Arduino IDE
courses from Harvard University Tensor Flow
at EdX Google Colab
15
edX: Tiny machine learning course
16
edX: Tiny machine learning course
17
18
University
20
Tiny machine workflow
Re-train Model
Raw data Prepare data Train model Evaluate model Deploy model
● Classification
Extract features ● Anomaly detection
● Forecasting
What you need: Nano Ble 33 sense, Arduino IDE, Tensorflow and Jupiter notebook.
-Go to Sketches/IMU_Capture/IMU_Capture.ino
22
Gesture classification
23
Gesture classification
We copy that info and create 2 csv files: one for punch and
other for flex
You can go through the code that does all the training and
also the snipet of code that takes the model generated by
tensorflow and gets the file converted into a “ .h” file for
Arduino.
24
Gesture classification
25
Tiny machine Learning example - Portenta
Creating a Basic Face Filter With OpenMV editor The Haar Cascade Algorithm
Algorithms can be trained to detect the desired type of
In this tutorial you will build a MicroPython application
object.
with OpenMV that uses the Portenta Vision Shield to
detect faces and overlay them with a custom bitmap
image.
26
Tiny Machine Learning
applications
Epilet
TinyML-powered bracelet for detecting
epileptic seizures
TapLock
Uses tinyML on Arduino to protect
your bike from thieves
PUPPI
A tiny, portable, edge ML device
ready to interpret a dog's mood
based on vocal signals.
27
University
Coming soon
What do you need to get started?
● ML theory: Knowing the basics of ML theory will give you a foundation to build on,
and help you troubleshoot when something goes wrong.
● Math and stats: ML is a math heavy discipline, so if you plan to modify ML models
or build new ones from scratch, familiarity with the underlying math concepts is
crucial to the process.
Build your own projects: Getting hands on experience with ML is the best way to
put the concepts learned to the test.
29
Arduino Education
30
Arduino Tiny Machine Learning Kit
Research:
-Interview with teachers, experts on the field.
-Needs, content, learning approach.
31
32
University
Thank you!