Skip to main content

Machine Learning with Physical Computing

What is TensorFlow?

TensorFlow is an open-source machine learning framework developed by Google. It provides a comprehensive ecosystem of tools, libraries, and community resources for building and deploying machine learning models across a variety of platforms, from servers to mobile devices and embedded systems.

With TensorFlow, developers can easily design, train, and deploy machine learning models for various tasks such as image recognition, natural language processing, and more. TensorFlow offers high-level APIs for building and training models, as well as lower-level operations for fine-grained control and optimization.

How Machine Learning work with Physical Computing

TensorFlow Lite for Microcontrollers is a lightweight version of TensorFlow designed specifically for microcontrollers and other resource-constrained devices. It enables developers to run small machine-learning models directly on microcontrollers, allowing for on-device inference without the need for network connectivity or reliance on cloud services.

TensorFlow Lite for Microcontrollers provides tools and libraries for converting trained TensorFlow models into a format suitable for microcontrollers, as well as APIs for integrating these models into embedded applications. It supports a variety of microcontroller platforms and architectures, making it accessible for a wide range of embedded development projects.

With TensorFlow Lite for Microcontrollers, developers can implement machine learning capabilities directly on devices such as sensors, wearables, and IoT devices, enabling intelligent edge computing and real-time inference without requiring constant communication with external servers.

This tutorial is developed based on the tutorial by Sandeep Mistry and Dominic Pajak. This tutorial is modified for NANO 33 SENSE REV2 board. If you are using other NANO boards, please refer to Mistry and Pajak's tutorial.

 Warning
Versions of everything are important for this to work. Make sure you download and install the correct one AND have the right board!

Set up Arduino IDE

Software: Arduino IDE 1.8.19 [14/5/2024].

1. Install board packages

Go to Tools - `BOARrd

2. Install board packages

Install Libraries

Collect Data

Train a Model

  1. Google Collab: arduino_tinyml.ipynb (You will need a Google account and make a copy of the notebook, if you are not sure about Google Colab, please attend workshop.)

  2. TensorFlow Version supported by Google Colab: from versions: 2.8.0rc0 to the latest [14/5/2024]

Start Classification!