1
You might not find it incredibly useful to build an
artificial nose that can tell coffee and tea apart,
and I would agree. But what if you could teach the
nose to alert you when your food is burning, or
when your favorite fruit is perfectly ripe?
In Make: Volume 75, Helen Leigh introduced
TinyML as well as Edge Impulse, a great tool
that tremendously simplifies the development
of AI models for constrained devices like
microcontrollers. (Also see "Deeper Learning"
on page 22.)
Here’s how to use Edge Impulse to train a
new model for your artificial nose, so it can start
classifying the things you care about.
1. Head to studio.edgeimpulse.com/public/2389/
latest and clone the base Edge Impulse project
into your own account (Figure
1
). This will allow
you to augment the original dataset with your own
classes of scents, or even replace it altogether.
2. Connect the artificial nose to your computer
over USB, and make sure it is in Training Mode
(Figure
2
).
3. Install the Edge Impulse command line tools
(docs.edgeimpulse.com/docs/cli-installation) on
your computer and launch the data forwarder
using the command:
edge-impulse-data-forwarder --frequency 10
4. Follow the data forwarder instructions in the
console to log into your Edge Impulse account.
The data forwarder will remotely tether the serial
output of your nose to the Edge Impulse project
you cloned in the first step, and sensor data will
directly appear in your project!
5. Name the 4 sensor axes: Nitrogen dioxide,
Carbon monoxide, Ethyl alcohol, and
Volatile organic compounds (Figure
3
).
6. Your device should now show up in the Data
Acquisition section of your Edge Impulse project.
Acquire and label as many samples as you need
for the different things you want your artificial
nose to detect.
7. Retrain the model based on your newly
collected data samples, using the conveniently
named Retrain Model action. If you’re not happy
with the performance of your model (Figure
4
),
collect some more samples. Rinse and repeat!
8. Finally, use the Deployment menu to export
your project as an Arduino library. This will allow
you to download a ZIP file containing the neural
network you just trained. Replace the lib/ei-
artificial_nose-arduino source folder of the nose’s
firmware with the contents of your new ZIP file.
9. Use pio run to recompile the firmware and
upload it to the Wio Terminal.Your nose
is retrained.
TEACH A FAUX
NOSE NEW TRICKS
HOW TO TRAIN YOUR ARTIFICIAL NOSE WITH
EDGE IMPULSE
2
3
4
NOTE: Make sure to acquire at least 2–3 minutes
worth of sensor data for each scent, and a roughly
equal number of samples for each category, so that
your AI model can be trained correctly.
37
makezine.com
M77_032-37_SS_Nose_F1.indd 37M77_032-37_SS_Nose_F1.indd 37 4/11/21 1:25 PM4/11/21 1:25 PM
..................Content has been hidden....................

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