TinyML Cookbook, published by Packt

Overview

TinyML Cookbook

TinyML Cookbook

This is the code repository for TinyML Cookbook, published by Packt.

Author: Gian Marco Iodice
Publisher: Packt

About the book

This book is about 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.

TinyML is an exciting field full of opportunities. With a small budget, we can give life to objects that interact with the world around us smartly and transform the way we live for the better. However, this field can be hard to approach if we come from an ML background with a little familiarity with embedded systems such as microcontrollers. Therefore, this book wants to dispel these barriers and make TinyML also accessible to developers with no embedded programming experience through practical examples. Each chapter will be a self-contained project to learn how to use some of the technologies at the heart of TinyML, interface with electronic components like sensors, and deploy ML models on memory-constrained devices.

Who is this book for

This book is for ML developers/engineers interested in developing machine learning applications on microcontrollers through practical examples quickly. The book will help you expand your knowledge towards the revolution of tiny machine learning (TinyML) by building end-to-end smart projects with real-world data sensors on Arduino Nano 33 BLE Sense and Raspberry Pi Pico.

Basic familiarity with C/C++, Python programming, and a command-line interface (CLI) is required. However, no prior knowledge of microcontrollers is necessary.

Technical requirements

You will need a computer (either a laptop or desktop) with an x86-64 architecture and at least one USB port for programming Arduino Nano 33 BLE Sense and Raspberry Pi Pico microcontroller boards. For the first six chapters, you can use Ubuntu 18.04 (or later) or Windows (for example, Windows 10) as an operating system (OS). However, you will need Ubuntu 18.04 (or later) for chapter 7 and chapter 8.

The only software prerequisites for your computer are:

  • Python (Python 3.7 recommended)
  • Text editor (for example, gedit on Ubuntu)
  • Media player (for example, VLC)
  • Image viewer (for example, the default app in Ubuntu or Windows 10)
  • Web browser (for example, Google Chrome)

Arduino Nano 33 BLE Sense and Raspberry Pi Pico programs will be developed directly in the web browser with the Arduino Web Editor. However, you may also consider using the local Arduino IDE following the instructions provided at this link.

The following table summarizes the hardware devices and software tools covered in each chapter:

Chapter Devices SW tools Electronic components
1 - Arduino Nano 33 BLE Sense
- Raspberry Pi Pico
- Arduino Web Editor None
2 - Arduino Nano 33 BLE Sense
- Raspberry Pi Pico
- Arduino Web Editor - A micro-USB cable
- 1x half-size breadboard
- 1x red LED
- 1x 220 Ohm resistor
- 1x 3 AA battery holder
- 1x 4 AA battery holder
- 4x AA batteries
- 5x jumper wires
3 - Arduino Nano 33 BLE Sense
- Raspberry Pi Pico
- Arduino Web Editor
- Google Colaboratory
- A micro-USB cable
- 1x half-size breadboard
- 1x AM2302 module with the DHT22 sensor
- 5x jumper wires
4 - Arduino Nano 33 BLE Sense
- Raspberry Pi Pico
- Arduino Web Editor
- Edge Impulse
- Python
- A micro-USB cable
- 1x half-size breadboard
- 1x electrect microphone amplifier - MAX9814
- 2x 220 Ohm resistor
- 1x 100 Ohm resistor
- 1x red LED
- 1x green LED
- 1x blue LED
- 1x push-button
- 11x jumper wires
5 - Arduino Nano 33 BLE Sense - Arduino Web Editor
- Google Colaboratory
- Python
- A micro-USB cable
- 1x half-size breadboard
- 1x OV7670 camera module
- 1x push-button
- 18 jumper wires
6 - Raspberry Pi Pico - Arduino Web Editor
- Edge Impulse
- Python
- A micro-USB cable
- 1x half-size breadboard
- 1x MPU-6050 IMU
- 4x jumper wires
7 - Arm Cortex-M3 Virtual Platform (QEMU) - Google Colaboratory
- Python
- Zephyr project
None
8 - Virtual Arm Ethos-U55 microNPU - Arm Corstone-300 FVP
- Python
- TVM
None

Citation

To cite TinyML Cookbook in publications use:

@book{iodice2022tinymlcookbook,
  title={TinyML Cookbook: Combine artificial intelligence and ultra-low-power embedded devices to make the world smarter},
  author={Gian Marco Iodice},
  year={2022},
  publisher={Packt},
  isbn = {9781801814973},
  url = {https://www.packtpub.com/product/tinyml-cookbook/9781801814973}
}

About the author

Gian Marco Iodice is team and tech lead in the Machine Learning Group at Arm, who co-created the Arm Compute Library in 2017. Arm Compute Library is currently the most performant library for ML on Arm, and it’s deployed on billions of devices worldwide – from servers to smartphones.

Gian Marco holds an MSc degree, with honors, in electronic engineering from the University of Pisa (Italy) and has several years of experience developing ML and computer vision algorithms on edge devices. Now, he's leading the ML performance optimization on Arm Mali GPUs.

In 2020, Gian Marco co-founded the TinyML UK meetup group to encourage knowledge sharing, educate, and inspire the next generation of ML developers on tiny and power-efficient devices.

You might also like...
Launched in 2018 Actively developed and supported. Supports tkinter, Qt, WxPython, Remi (in browser). Create custom layout GUI's simply.  Python 2.7 & 3 Support. 200+ Demo programs & Cookbook for rapid start. Extensive documentation.  Examples using Machine Learning(GUI, OpenCV Integration,  Chatterbot), Floating Desktop Widgets, Matplotlib + Pyplot integration, add GUI to command line scripts, PDF & Image Viewer. For both beginning and advanced programmers .
Chapter 1 of the AWS Cookbook

Chapter 1 - Security Set and export your default region: export AWS_REGION=us-east-1 Set your AWS ACCOUNT ID:: AWS_ACCOUNT_ID=$(aws sts get-caller-ide

Mommas-cookbook - A Repository About Mom's Recipes
Mommas-cookbook - A Repository About Mom's Recipes

Mommas Cookbook A Repository for Mom's Recipes Contents bacalhau à Gomes de Sá Beef-Rendang bacalhau à Gomes de Sá, recommended by @s0undt3ch One of t

Backtest 1000s of minute-by-minute trading algorithms for training AI with automated pricing data from: IEX, Tradier and FinViz. Datasets and trading performance automatically published to S3 for building AI training datasets for teaching DNNs how to trade. Runs on Kubernetes and docker-compose. >150 million trading history rows generated from +5000 algorithms. Heads up: Yahoo's Finance API was disabled on 2019-01-03 https://developer.yahoo.com/yql/ One webpage for every book ever published!
One webpage for every book ever published!

Open Library Open Library is an open, editable library catalog, building towards a web page for every book ever published. Are you looking to get star

Provided is code that demonstrates the training and evaluation of the work presented in the paper:
Provided is code that demonstrates the training and evaluation of the work presented in the paper: "On the Detection of Digital Face Manipulation" published in CVPR 2020.

FFD Source Code Provided is code that demonstrates the training and evaluation of the work presented in the paper: "On the Detection of Digital Face M

This repository allows you to anonymize sensitive information in images/videos. The solution is fully compatible with the DL-based training/inference solutions that we already published/will publish for Object Detection and Semantic Segmentation.
The implementation of the algorithm in the paper "Safe Deep Semi-Supervised Learning for Unseen-Class Unlabeled Data" published in ICML 2020.

DS3L This is the code for paper "Safe Deep Semi-Supervised Learning for Unseen-Class Unlabeled Data" published in ICML 2020. Setups The code is implem

This is the repo for the paper `SumGNN: Multi-typed Drug Interaction Prediction via Efficient Knowledge Graph Summarization'. (published in Bioinformatics'21)

SumGNN: Multi-typed Drug Interaction Prediction via Efficient Knowledge Graph Summarization This is the code for our paper ``SumGNN: Multi-typed Drug

Repository of conference publications and source code for first-/ second-authored papers published at NeurIPS, ICML, and ICLR.

Repository of conference publications and source code for first-/ second-authored papers published at NeurIPS, ICML, and ICLR.

code for modular summarization work published in ACL2021 by Krishna et al

This repository contains the code for running modular summarization pipelines as described in the publication Krishna K, Khosla K, Bigham J, Lipton ZC

code for modular summarization work published in ACL2021 by Krishna et al

This repository contains the code for running modular summarization pipelines as described in the publication Krishna K, Khosla K, Bigham J, Lipton ZC

Image transformations designed for Scene Text Recognition (STR) data augmentation. Published at ICCV 2021 Workshop on Interactive Labeling and Data Augmentation for Vision.

Data Augmentation for Scene Text Recognition (ICCV 2021 Workshop) (Pronounced as "strog") Paper Arxiv Why it matters? Scene Text Recognition (STR) req

The papers published in top-tier AI conferences in recent years.

AI-conference-papers The papers published in top-tier AI conferences in recent years. Paper table AAAI ICLR CVPR ICML ICCV ECCV NIPS 2019 ✔️ ✔️ ✔️ ✔️

Tensorflow 2 implementation of the paper: Learning and Evaluating Representations for Deep One-class Classification published at ICLR 2021

Deep Representation One-class Classification (DROC). This is not an officially supported Google product. Tensorflow 2 implementation of the paper: Lea

Fully reproducible, Dockerized, step-by-step, tutorial on how to mock a
Fully reproducible, Dockerized, step-by-step, tutorial on how to mock a "real-time" Kafka data stream from a timestamped csv file. Detailed blog post published on Towards Data Science.

time-series-kafka-demo Mock stream producer for time series data using Kafka. I walk through this tutorial and others here on GitHub and on my Medium

My published benchmark for a Kaggle Simulations Competition
My published benchmark for a Kaggle Simulations Competition

Lux AI Working Title Bot Please refer to the Kaggle notebook for the comment section. The comment section contains my explanation on my code structure

Comments
  • How to Cite?

    How to Cite?

    Could you please provide a BibTeX entry? Maybe smth. along the lines of this in your Readme.md

    @book{iodice2020tinyml,
      title={TinyML Cookbook: Combine artificial intelligence and ultra-low-power embedded devices to make the world smarter},
      author={Gian Marco Iodice},
      year={2022},
      publisher={Packt Publishing}
    }
    

    or add a CITATION.cff?

    Thank you for the great book!

    opened by fabianpedd 2
  • EI_CLASSIFIER_SLICES_PER_MODEL_WINDOW Error

    EI_CLASSIFIER_SLICES_PER_MODEL_WINDOW Error

    Hi, My sample rate is 1600Hz, the window size is 1000 ms, and, the window increase 500ms. I created a project in Edge Impulse and then deployed the card it worked and it was able to infer words but when I try to blink the led part with that code I have an that is "Error sample buffer overrun. Decrease the number of slices per model window (EI_CLASSIFIER_SLICES_PER_MODEL_WINDOW)" The default value for EI_CLASSIFIER_SLICES_PER_MODEL_WINDOW is 4. But then I tried 3,2 and 1. However, the error continued. How can I solve this problem? Please help me.

    help wanted 
    opened by asumandemireriden 0
Owner
Packt
Providing books, eBooks, video tutorials, and articles for IT developers, administrators, and users.
Packt
The implementation of the algorithm in the paper "Safe Deep Semi-Supervised Learning for Unseen-Class Unlabeled Data" published in ICML 2020.

DS3L This is the code for paper "Safe Deep Semi-Supervised Learning for Unseen-Class Unlabeled Data" published in ICML 2020. Setups The code is implem

Guolz 36 Oct 19, 2022
This is the repo for the paper `SumGNN: Multi-typed Drug Interaction Prediction via Efficient Knowledge Graph Summarization'. (published in Bioinformatics'21)

SumGNN: Multi-typed Drug Interaction Prediction via Efficient Knowledge Graph Summarization This is the code for our paper ``SumGNN: Multi-typed Drug

Yue Yu 58 Dec 21, 2022
null 190 Jan 3, 2023
Image transformations designed for Scene Text Recognition (STR) data augmentation. Published at ICCV 2021 Workshop on Interactive Labeling and Data Augmentation for Vision.

Data Augmentation for Scene Text Recognition (ICCV 2021 Workshop) (Pronounced as "strog") Paper Arxiv Why it matters? Scene Text Recognition (STR) req

Rowel Atienza 152 Dec 28, 2022
Tensorflow 2 implementation of the paper: Learning and Evaluating Representations for Deep One-class Classification published at ICLR 2021

Deep Representation One-class Classification (DROC). This is not an officially supported Google product. Tensorflow 2 implementation of the paper: Lea

Google Research 137 Dec 23, 2022
My published benchmark for a Kaggle Simulations Competition

Lux AI Working Title Bot Please refer to the Kaggle notebook for the comment section. The comment section contains my explanation on my code structure

Tong Hui Kang 29 Aug 22, 2022
A comprehensive list of published machine learning applications to cosmology

ml-in-cosmology This github attempts to maintain a comprehensive list of published machine learning applications to cosmology, organized by subject ma

George Stein 290 Dec 29, 2022
Code to reproduce the results for Statistically Robust Neural Network Classification, published in UAI 2021

Code to reproduce the results for Statistically Robust Neural Network Classification, published in UAI 2021

null 1 Jun 2, 2022
Repository for "Improving evidential deep learning via multi-task learning," published in AAAI2022

Improving evidential deep learning via multi task learning It is a repository of AAAI2022 paper, “Improving evidential deep learning via multi-task le

deargen 11 Nov 19, 2022
This is the code repository for 40 Algorithms Every Programmer Should Know , published by Packt.

40 Algorithms Every Programmer Should Know, published by Packt

Packt 721 Jan 2, 2023