Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
TinyML Cookbook

You're reading from   TinyML Cookbook Combine machine learning with microcontrollers to solve real-world problems

Arrow left icon
Product type Paperback
Published in Nov 2023
Publisher Packt
ISBN-13 9781837637362
Length 664 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Gian Marco Iodice Gian Marco Iodice
Author Profile Icon Gian Marco Iodice
Gian Marco Iodice
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Getting Ready to Unlock ML on Microcontrollers FREE CHAPTER 2. Unleashing Your Creativity with Microcontrollers 3. Building a Weather Station with TensorFlow Lite for Microcontrollers 4. Using Edge Impulse and the Arduino Nano to Control LEDs with Voice Commands 5. Recognizing Music Genres with TensorFlow and the Raspberry Pi Pico – Part 1 6. Recognizing Music Genres with TensorFlow and the Raspberry Pi Pico – Part 2 7. Detecting Objects with Edge Impulse Using FOMO on the Raspberry Pi Pico 8. Classifying Desk Objects with TensorFlow and the Arduino Nano 9. Building a Gesture-Based Interface for YouTube Playback with Edge Impulse and the Raspberry Pi Pico 10. Deploying a CIFAR-10 Model for Memory-Constrained Devices with the Zephyr OS on QEMU 11. Running ML Models on Arduino and the Arm Ethos-U55 microNPU Using Apache TVM 12. Enabling Compelling tinyML Solutions with On-Device Learning and scikit-learn on the Arduino Nano and Raspberry Pi Pico 13. Conclusion
14. Other Books You May Enjoy
15. Index

To get the most out of this book

For most of the chapters, with the exception of Chapter 10, Deploying a CIFAR-10 Model for Memory-Constrained Devices with the Zephyr OS on QEMU, you will need a computer (either a laptop or desktop) running Linux (preferably Ubuntu 20.04+), macOS, or Windows operating systems on an x86_64 architecture. Additionally, your computer should have a minimum of two USB ports.

In Chapter 10, you will specifically require a computer running either Linux (preferably Ubuntu 20.04+) or macOS on an x86_64 architecture.

It is worth noting that most projects can also be developed on Macs powered by Apple silicon, such as M1 or M2 chips. However, at the time of writing, there is no support for the SparkFun RedBoard Artemis Nano on Apple silicon devices.

The only software prerequisites for your computer are:

  • Python (Python 3.7+)
  • A text editor (for example, gedit on Ubuntu)
  • A media player (for example, VLC)
  • An image viewer (for example, the default image viewer in your OS)
  • A web browser (for example, Google Chrome)

During our tinyML journey, we will require different software tools to cover ML development and embedded programming. Thanks to Arduino, Edge Impulse, and Google, these tools will be in the cloud, browser-based, and have a free plan for our usage.

You can develop projects on the Arduino Nano 33 BLE Sense and Raspberry Pi Pico directly in your web browser using the Arduino Web Editor (https://create.arduino.cc). However, at the time of writing, the Arduino Web Editor has a limit of 25 compilations per day. Therefore, you may consider upgrading to any paid plan or using the free local Arduino IDE (https://www.arduino.cc/en/software) to get unlimited compilations. For those interested in the free local Arduino IDE, we have provided the instructions to install the local Arduino IDE on GitHub (https://github.com/PacktPublishing/TinyML-Cookbook_2E/tree/main/Docs/setup_local_arduino_ide.md).

For projects involving the SparkFun RedBoard Artemis Nano, you must use the local Arduino IDE. You can find the setup instructions for developing projects on this microcontroller by following this link: https://github.com/PacktPublishing/TinyML-Cookbook_2E/blob/main/Docs/setup_sparkfun_artemis_nano.md.

The projects we will develop together require sensors and additional electronic components to build realistic tinyML prototypes and experience the complete development workflow. These components are listed at the beginning of each chapter and in the README.md file within the corresponding chapter folder on GitHub.

Since we will build real electronic circuits, we require an electronic components kit with at least a solderless breadboard, colored LEDs, resistors, push-buttons, and jumper wires. Don’t worry if you are a beginner in electronics. You will learn more about these components in the first two chapters of this book. Furthermore, we have prepared a beginner shopping list on GitHub so you know precisely what to buy: https://github.com/PacktPublishing/TinyML-Cookbook_2E/tree/main/Docs/shopping_list.md.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/TinyML-Cookbook_2E.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781837637362.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “To do so, import the os Python module to use its listdir() method, which lists all the files in a specified directory.”

A block of code is set as follows:

def representative_data_gen():
  data = tf.data.Dataset.from_tensor_slices(x_test)
  for i_value in data.batch(1).take(100):
    i_value_f32 = tf.dtypes.cast(i_value, tf.float32)
    yield [i_value_f32]

Any command-line input or output is written as follows:

$ arduino-cli core install arduino:mbed_nano

Bold: Indicates a new term, an important word, or words that you see on the screen. For instance, words in menus or dialog boxes appear in the text like this. For example: “Scan the quick response (QR) code with your smartphone to pair the device with Edge Impulse.”

Warnings or important notes appear like this.

Tips and tricks appear like this.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image