on the road is extremely important for self-driving
vehicles. Additionally, detecting the presence of
people can be used to control lights and HVAC
systems in an office building or identifying
intruders for a security system. However, image
classification and object detection are often
computationally expensive. As a result, you will
need a powerful microcontroller or single-board
computer for many such applications.
TINYML POWER REQUIREMENTS
Machine learning usually boils down to a series of
complex matrix operations —in essence, math.
Almost every microcontroller and single-board
computer can perform math operations, which
means embedded systems are generally capable
of doing machine learning. Some architectures
offer features that make these operations faster,
such as floating-point units or special multiply-
accumulate instructions. However, the biggest
concern is often, “Does my processor have
enough power?”
Helen Leigh discusses the computing
requirements for TinyML in her “Machine
Learning on Microcontrollersarticle. In the
article, I am quoted saying, “I like to have at least
a 32-bit processor running at 80MHz with 50kB
of RAM and 100kB of flash to start doing anything
useful with machine learning.” Let’s look at
things a little further. I’ve made a chart with basic
guidelines for speed and memory requirements
for a few machine learning applications (Figure
N
). These recommended specifications come
from personal experience and are negotiable.
Motion and Distance: Using machine learning
to classify various gestures or perform regression
on a series of distance measurements requires a
relatively low-powered microcontroller. Often, a
sample is a few values taken from a sensor at a
rate of less than 1kHz. My go-to microcontroller
for this application would be an ARM Cortex-M0+,
such as the SAMD21 found on the Arduino
Zero. However, some makers have successfully
employed simple machine learning algorithms
on even less powerful microcontrollers, such
as the ATmega328P (Arduino Uno) or even the
diminutive ATtiny85.
Sound and Voice: Recording and analyzing
sounds often require more processing power.
Pete Warden is the lead developer of the
Google TensorFlow Mobile team, which created
TensorFlow Lite Micro, a popular framework
used in many TinyML applications. He illustrates
another potential use of TinyML: low-cost
cameras paired with machine learning that can
read old gauges and displays. In his article, he
mentions how he has worked with “multiple
teams who have legacy hardware that they need
to monitor, in environments as varied as oil
refineries, crop fields, office buildings, cars, and
homes. Some of the devices are decades old,
so until now the only option to enable remote
monitoring and data gathering was to replace
the system entirely with a more modern version.
Inexpensive, networked cameras could be used
as an alternative solution to monitoring such
devices without needing to fully replace the system.
Josef Müller demonstrates this low-cost
gauge-reading device (github.com/jomjol/AI-on-
the-edge-device). He uses an ESP32 and camera
to read the numbers on a water meter and report
the measurements to a server (Figure
M
).
Computer vision is a popular application of
machine learning. For example, detecting objects
DEEPER LEARNING: Going Further With TinyML
M
30 makercampus.com
L
Josef Müller, EmotiBit, Shawn Hymel
M77_022-31_SS_MLdeepDive_F1.indd 30M77_022-31_SS_MLdeepDive_F1.indd 30 4/11/21 12:59 PM4/11/21 12:59 PM
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.144.69