
Tiny Machine Learning just got a LOT Easier!
A non-fluff, approachable book to become a fluent TinyML practitioner with the Arduino framework, starting from zero prior knowledge!
Want to learn TinyML, but you feel lost?
You're not alone.
TinyML is one of the most exciting frontiers in tech today — bringing the power of machine learning to tiny, low-power devices like the Arduino. With TinyML, you can build smart sensors, create intelligent gadgets, and bring AI to places where it was never possible before.
But getting started is tough:
- Tutorials are scattered and often outdated
- Most guides are too theoretical or assume advanced knowledge
- Example code rarely works as expected
- It's hard to connect the dots and make real progress
This is precisely why this book exists. We make TinyML accessible by taking a fundamentally different approach:
- Beginner-friendly and clearly structured
- Focus on hands-on projects, not heavy theory
- Step-by-step instructions that actually work
- Learn by building - includes 6 projects you can easily replicate
Want a proof?
Telling something will be easy is a thing, showing something is easy is another story. Here's a couple examples of the type of projects and code you will find in the book that will actually run on a Arduino Nano BLE Sense.
Audio Wake Word detection
Chapter 6 is devoted to audio wake word detection (a.k.a. keyword spotting) using the Edge Impulse low-code platform. After you have collected data and trained a model, you can deploy the said model to your board with the following few lines of code.
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("Keyword spotting with Edge Impulse");
// match the volume with the one used for data collection!
mic.frequency("16 khz");
mic.volume(30);
mic.begin();
impulse.begin();
}
void loop() {
// await for audio data to be ready
mic.await();
// feed data to the impulse queue
if (!impulse.queue(mic)) {
Serial.println(impulse.error());
return;
}
// skip non wake word
if (impulse.label() != "wakeword")
return;
Serial.print("Wake word detected with confidence ");
Serial.println(impulse.confidence());
// customize here with your own logic
}
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("Keyword spotting with Edge Impulse");
// match the volume with the one used for data collection!
mic.frequency("16 khz");
mic.volume(30);
mic.begin();
impulse.begin();
}
void loop() {
// await for audio data to be ready
mic.await();
// feed data to the impulse queue
if (!impulse.queue(mic)) {
Serial.println(impulse.error());
return;
}
// skip non wake word
if (impulse.label() != "wakeword")
return;
Serial.print("Wake word detected with confidence ");
Serial.println(impulse.confidence());
// customize here with your own logic
}
Custom Conv2D TensorFlow network
Chapter 8 is a more in-depth explanation about the TensorFlow network and how you can train your own network. Once done, deploying the network to your board is as easy as it can get. Judge by yourself.
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("TensorFlow 2D CNN demo");
cnn.begin();
}
void loop() {
// run classification on sample image
if (!cnn.predict(dogImage)) {
Serial.println(nn.error());
return;
}
// print results
Serial.print("Expected dog, predicted ");
Serial.print(cnn.label);
Serial.print(" with confidence ");
Serial.println(cnn.confidence);
delay(1000);
}
void setup() {
Serial.begin(115200);
while (!Serial);
Serial.println("TensorFlow 2D CNN demo");
cnn.begin();
}
void loop() {
// run classification on sample image
if (!cnn.predict(dogImage)) {
Serial.println(nn.error());
return;
}
// print results
Serial.print("Expected dog, predicted ");
Serial.print(cnn.label);
Serial.print(" with confidence ");
Serial.println(cnn.confidence);
delay(1000);
}
What's inside?
The book contains 340 pages organized as follows.
Chapter 1: Tiny Machine Learning
A brief introduction to what we mean by tiny and the bare minimum Machine Learning glossary required to follow the rest of the book.
Chapter 2/3: Tabular Data Classification / Regression
A non-TensorFlow approach to classification/regression of data that comes from sensors and can organized in tabular format.
Chapter 4: Time Series Classification using Edge Impulse
Leverage the Edge Impulse low-code platform to train a model able to recognize the movements we're performing using accelerometer data (uses TensorFlow under the hoods).
Chapter 5: Time Series Classification using Python
Use the magnetometer of the Arduino BLE Sense to recognize the gestures we perform to control a music player. Doesn't rely on TensorFlow.
Chapter 6: Audio Wake Word detection using Edge Impulse
Use Edge Impulse to recognize an activation keyword (Hey Arduino). Showcases the usage of Generative AI to produce synthetic data to make your model more robust.
Chapter 7: Object Detection using Edge Impulse
Using an ESP32-CAM you can recognize objects of interest in your video stream at an astonishing rate of 20 FPS.
Chapter 8: TensorFlow from Scratch
If none of the above solutions apply to your specific project, you can still leverage the full power of TensorFlow to define and train a custom Neural Network that can be deployed to any supported board.