Book description
Work through over 50 recipes to develop smart applications on Arduino Nano 33 BLE Sense and Raspberry Pi Pico using the power of machine learning
Key Features
- Train and deploy ML models on Arduino Nano 33 BLE Sense and Raspberry Pi Pico
- Work with different ML frameworks such as TensorFlow Lite for Microcontrollers and Edge Impulse
- Explore cutting-edge technologies such as microTVM and Arm Ethos-U55 microNPU
Book Description
This book explores TinyML, a fast-growing field at the unique intersection of machine learning and embedded systems to make AI ubiquitous with extremely low-powered devices such as microcontrollers.
The TinyML Cookbook starts with a practical introduction to this multidisciplinary field to get you up to speed with some of the fundamentals for deploying intelligent applications on Arduino Nano 33 BLE Sense and Raspberry Pi Pico. As you progress, you’ll tackle various problems that you may encounter while prototyping microcontrollers, such as controlling the LED state with GPIO and a push-button, supplying power to microcontrollers with batteries, and more. Next, you’ll cover recipes relating to temperature, humidity, and the three “V” sensors (Voice, Vision, and Vibration) to gain the necessary skills to implement end-to-end smart applications in different scenarios. Later, you’ll learn best practices for building tiny models for memory-constrained microcontrollers. Finally, you’ll explore two of the most recent technologies, microTVM and microNPU that will help you step up your TinyML game.
By the end of this book, you’ll be well-versed with best practices and machine learning frameworks to develop ML apps easily on microcontrollers and have a clear understanding of the key aspects to consider during the development phase.
What you will learn
- Understand the relevant microcontroller programming fundamentals
- Work with real-world sensors such as the microphone, camera, and accelerometer
- Run on-device machine learning with TensorFlow Lite for Microcontrollers
- Implement an app that responds to human voice with Edge Impulse
- Leverage transfer learning to classify indoor rooms with Arduino Nano 33 BLE Sense
- Create a gesture-recognition app with Raspberry Pi Pico
- Design a CIFAR-10 model for memory-constrained microcontrollers
- Run an image classifier on a virtual Arm Ethos-U55 microNPU with microTVM
Who this book is for
This book is for machine learning developers/engineers interested in developing machine learning applications on microcontrollers through practical examples quickly. Basic familiarity with C/C++, the Python programming language, and the command-line interface (CLI) is required. However, no prior knowledge of microcontrollers is necessary.
Table of contents
- TinyML Cookbook
- Foreword
- Contributors
- About the author
- About the reviewers
- Preface
-
Chapter 1: Getting Started with TinyML
- Technical requirements
- Introducing TinyML
- Summary of DL
- Learning the difference between power and energy
- Programming microcontrollers
- Presenting Arduino Nano 33 BLE Sense and Raspberry Pi Pico
- Setting up Arduino Web Editor, TensorFlow, and Edge Impulse
- Running a sketch on Arduino Nano and Raspberry Pi Pico
- Join us on Discord!
- Chapter 2: Prototyping with Microcontrollers
-
Chapter 3: Building a Weather Station with TensorFlow Lite for Microcontrollers
- Technical requirements
- Importing weather data from WorldWeatherOnline
- Preparing the dataset
- Training the ML model with TF
- Evaluating the model's effectiveness
- Quantizing the model with the TFLite converter
- Using the built-in temperature and humidity sensor on Arduino Nano
- Using the DHT22 sensor with the Raspberry Pi Pico
- Preparing the input features for the model inference
- On-device inference with TFLu
-
Chapter 4: Voice Controlling LEDs with Edge Impulse
- Technical requirements
- Acquiring audio data with a smartphone
- Extracting MFCC features from audio samples
- Designing and training a NN model
- Tuning model performance with EON Tuner
- Live classifications with a smartphone
- Live classifications with the Arduino Nano
- Continuous inferencing on the Arduino Nano
- Building the circuit with the Raspberry Pi Pico to voice control LEDs
- Audio sampling with ADC and timer interrupts on the Raspberry Pi Pico
-
Chapter 5: Indoor Scene Classification with TensorFlow Lite for Microcontrollers and the Arduino Nano
- Technical requirements
- Taking pictures with the OV7670 camera module
- Grabbing camera frames from the serial port with Python
- Converting QQVGA images from YCbCr422 to RGB888
- Building the dataset for indoor scene classification
- Transfer learning with Keras
- Preparing and testing the quantized TFLite model
- Reducing RAM usage by fusing crop, resize, rescale, and quantize
-
Chapter 6: Building a Gesture-Based Interface for YouTube Playback
- Technical requirements
- Communicating with the MPU-6050 IMU through I2C
- Acquiring accelerometer data
- Building the dataset with the Edge Impulse data forwarder tool
- Designing and training the ML model
- Live classifications with the Edge Impulse data forwarder tool
- Gesture recognition on Raspberry Pi Pico with Arm Mbed OS
- Building a gesture-based interface with PyAutoGUI
-
Chapter 7: Running a Tiny CIFAR-10 Model on a Virtual Platform with the Zephyr OS
- Technical requirements
- Getting started with the Zephyr OS
- Designing and training a tiny CIFAR-10 model
- Evaluating the accuracy of the TFLite model
- Converting a NumPy image to a C-byte array
- Preparing the skeleton of the TFLu project
- Building and running the TFLu application on QEMU
- Join us on Discord!
- Chapter 8: Toward the Next TinyML Generation with microNPU
- Other Books You May Enjoy
Product information
- Title: TinyML Cookbook
- Author(s):
- Release date: April 2022
- Publisher(s): Packt Publishing
- ISBN: 9781801814973
You might also like
book
TinyML Cookbook - Second Edition
Over 70 recipes to help you develop smart applications on Arduino Nano 33 BLE Sense, Raspberry …
book
bash Cookbook
The key to mastering any Unix system, especially Linux and Mac OS X, is a thorough …
book
Practical MLOps
Getting your models into production is the fundamental challenge of machine learning. MLOps offers a set …
book
FastAPI
FastAPI is a young yet solid framework that takes advantage of newer Python features in a …