Everything About TinyML – Basics, Courses, Projects & More!

Updated on Feb 6th, 2024

TinyML is one of the hottest trends in the embedded computing field right now, with 2.5 billion TinyML-enabled devices estimated to reach the market in the next decade and a projected market value exceeding $70 billion in just five years. If you want to get in on what all the excitement is about but aren’t sure where to start, this one-stop guide is specifically for you. Learn about what TinyML is, the opportunities it offers, and how anybody can get themselves started in this exciting field!


What is TinyML?

Tiny Machine Learning (TinyML) is a field of machine learning that focuses on the development and deployment of ML models on low power, low-footprint microcontroller devices like an Arduino, for example.

Machine learning is a field of computer systems that aims to develop self-improving algorithms and statistical models. This is done with massive amounts of data, which a model analyses and extracts patterns from in order to learn and improve on a given task. This seemingly simple paradigm has led to groundbreaking advancements in complex tasks like forecasting, anomaly detection, and computer vision!

The Benefits & Importance of TinyML

Why is TinyML so important, you ask? Simple – because it’s tiny!

The microcontrollers that TinyML models are designed for are small and power efficient; capable of running on battery power for years at a time! Furthermore, these microcontrollers are far more affordable than full-sized computers or servers, which makes their use far more accessible and practical for small businesses or even individuals. This unique combination of power efficiency and affordability also means that TinyML is perfectly poised for large-scale applications in embedded computing applications, like IoT!

At the same time, TinyML is a subset of what is known as Edge AI, or edge artificial intelligence. It leverages the advantages of edge computing – computing in the local space as opposed to in the cloud – to deliver several key advantages, namely:

  • Low latency of local computing for real time applications
  • Reduced bandwidth costs from lower requirements for remote communication
  • Excellent reliability that persists even when network connectivity is lost
  • Improved security with fewer transmissions and local data storage

Edge AI, similar to TinyML, is about deploying machine learning models at the edge. However, more powerful hardware might be used, which range from single board computers (SBCs) to even edge servers. If you want to learn more about Edge AI, I’ve written extensively about it in a previous article, as well as how it holds the potential to change IoT – click here for the full read!

Limitations of TinyML

Microcontrollers have kilobytes of RAM and megabytes of memory, which is many times smaller than even the lowest-performing SBCs. Thus, it’s natural that there are limitations in the types of models that can be run with TinyML on microcontrollers in comparison to regular edge ML on more powerful devices like a Raspberry Pi or Jetson Nano. Some examples are shown in the table below:

ML ApplicationsTinyML on MicrocontrollersEdge ML on SBCs / Servers
Forecasting & Anomaly DetectionYes, with limited model sizeYes
Image RecognitionYes, with lower-resolution and speedYes, real time processing with high-end hardware
Audio RecognitionKeyword / wake word detection onlyFull natural language processing (NLP)

As you can see, there are caveats to even the most common TinyML applications which you should be aware of, especially in terms of model size and processing speed. Natural language processing which uses deep neural networks with many layers, for example, is currently out of the reach of TinyML. Nonetheless, the accessibility and power efficiency offered by TinyML remain extremely valuable to various applications, which I will share more about shortly!

Clarifying TinyML for Beginners – Learning vs Inference

Conventionally, machine learning occurs in two stages – learning and inferencing. At present, TinyML only handles inferencing.

During learning, the ML model adjusts its internal configurations based on the data that it receives in order to achieve a better result on its given task. To achieve this, the data is passed forward through the model, where a loss is calculated. The feedback from this loss is then passed backward through the model for the adjustments to be made. This is repeated for multiple inputs, up to billions or even trillions of times! As you can imagine, this is extremely resource-intensive and difficult to perform effectively even on some laptops, let alone microcontrollers with drastic limitations in computing resources.

Note: Loss in machine learning refers to a penalty for a bad output like an incorrect classification. During training, machine learning models make adjustments to reduce this loss as much as possible. In this way, their performance improves over time.

Inference, on the other hand, refers to using the model to make some conclusions on input data. For example, we might provide a weather predictor with some temperature or humidity values to receive a prediction for whether it will rain. While state of the art machine learning models still require a significant amount of hardware to run effectively, it’s possible to optimise models for lightweight inferencing on the edge – this is precisely where TinyML comes in!

For a clearer picture, have a look at the following infographic:

Source: Gartner Inc.

To summarise, TinyML in its current state is only capable of using lightweight models to perform ML inferencing on microcontrollers. So, we aren’t doing any kind of training in TinyML, though this might be possible in the distant future – who knows!


TinyML Applications

“If you can run a neural network model at an energy cost of below 1 mW, it makes a lot of entirely new applications possible. This might seem like a somewhat arbitrary number, but if you translate it into concrete terms, it means a device running on a coin battery has a lifetime of a year. That results in a product that’s small enough to fit into any environment and able to run for a useful amount of time without any human intervention.” – Pete Warden, TensorFlow Mobile Technical Lead

TinyML runs on ultra-tiny MCUs like Seeed Studio XIAO ESP32S3 Sense!

TinyML applications excel in embedded applications with size and power constraints. With microcontrollers as small as the tip of your thumb and consuming limited power in spite of prolonged operation, TinyML can be easily applied in numerous scenarios to create always-on smart applications that make predictions, process complex data, and administer solutions!

Predictive Maintenance

By retrofitting industrial machinery with TinyML, we can monitor the performance characteristics of a machine and deliver maintenance ahead of failure. This minimises equipment downtime and repair costs, which improves both business revenue and workplace safety.

For example, some mining companies are using TinyML to predict faults in the wheels, bearings and axles on their rail cars in order to streamline their material transport operations. With a comfortable timeframe of at least a week to resolve operational issues before incurring damages, unscheduled maintenance events have been reduced by 50% – representing savings of ~$34 million over five years.

Smart Agriculture

TinyML serves to improve the performance of smart agriculture techniques by providing real time analysis of environmental factors to improve crop growth in precision agriculture. With the rise of autonomous greenhouses, TinyML is also helping agricultural experts in making decisions that maximise crop yield by learning from past data. On the other hand, we can even use TinyML devices to analyse the conditions and behaviour of individual livestock to make intelligent conclusions about their state of health in real time.

Smart Cities

TinyML will also play a critical role in developing smart cities with small, low-power devices that can be deployed virtually everywhere. These smart devices might be used to monitor and optimise traffic, analyse carbon footprints, or even develop vision-based security systems. For example, the addition of TinyML to traffic junctions could enable road traffic optimisation in real time. By further leveraging the interconnectivity of IoT, such benefits could be multiplied manifold through a network effect in these cities!

On-Demand Healthcare

TinyML finally has an important role to play in providing persistent, on-demand healthcare. For example, motion-based fall detectors can recognise instances of falls in children or elderly, while keyword detection can pick up cries for help. Furthermore, TinyML is now enabling affordable solutions in on-demand medical diagnostics, which can be used in rural areas to supplement limited healthcare facilities.


Software for TinyML – Frameworks & Platforms

While specialised hardware for TinyML is playing catch up, most implementations currently rely heavily on software to optimise machine learning models while retaining their effectiveness. Here are some frameworks and platforms that you should definitely know about!

SenseCraft AI

SenseCraft AI is a platform that enables easy AI model training and deployment with no-code/low-code. It supports Seeed products natively, ensuring complete adaptability of the trained models to Seeed products. Moreover, deploying models through this platform offers immediate visualization of identification results on the website, enabling prompt assessment of model performance.

Ideal for tinyML applications, it allows you to effortlessly deploy off-the-shelf or custom AI models by connecting the device, selecting a model, and viewing identification results.

TensorFlow Lite Micro

TensorFlow is Google’s open-source machine learning framework which helps in developing machine learning models quickly. For TinyML, there is TensorFlow Lite Micro, which is a specialised version of TensorFlow for microcontrollers. TFLite Micro is written in C++ 11 and requires a 32-bit platform, and is mostly compatible with Arm Cortex-M Series processors. An ESP32 port is available as well.

TFLite Micro allows you to easily compress regular TensorFlow models into just a few kilobytes, and comes with numerous example models like the Hello World or Magic Wand to demonstrate various TinyML basics and capabilities. In addition, it supports a good number of popular microcontrollers, such as the Arduino Nano BLE 33 Sense and our very own Wio Terminal.

While the field of TinyML is still relatively new and experimental, TensorFlow Lite Micro is one of the most popular frameworks being used, which means you’ll be able to leverage a substantial amount of community experience and support in your own projects.

Edge Impulse

Edge Impulse is a platform that specifically targets the development of TinyML applications. With an easy-to-use web-based interface, Edge Impulse is arguably the easiest solution for anyone to collect data, train a model, and finally deploy it on a microcontroller. Best of all, it’s free for developers, albeit with some limits on the number of projects you can create and compute time.

Edge Impulse’s Web Interface

Developing TinyML with Edge Impulse also allows you to take advantage of their Edge Optimised Neural (EON) compiler, which can run a neural network with 25-55% less RAM and 35% less storage compared to TFLite for Microcontrollers – a significant point to consider!

Like TFLite Micro, Edge Impulse supports a substantial list of microcontrollers and development boards, also including the Arduino Nano 33 BLE Sense and Wio Terminal. Supported devices can easily record and upload datasets in a matter of minutes, but other devices can also use their Data forwarder to do the same with just a little more effort.

OpenMV

OpenMV is another TinyML development platform, this time specialising in computer vision applications. This includes machine learning applied onto any kind of image or video like object recognition or image classification. The platform is built around their OpenMV Cam H7, which is a microcontroller board that runs on the ARM Cortex M7 processor and is Micropython programmable.

OpenMV’s IDE in Action

In addition, OpenMV offers a cross-platform IDE that features a powerful code editor, debug terminal, and framebuffer viewer with histogram display – all of which are key components of developing computer vision applications in TinyML! We’ve previously shared extensively about OpenMV in a previous article, so I won’t go into more detail here. If you’re interested, click here to learn more!


Hardware for TinyML

When it comes to hardware for TinyML, the Arduino Nano 33 BLE Sense is considered by many to be the de facto standard. Along with considerable compute from a 32-bit ARM Cortex-M4F microcontroller with 1MB flash and 256KB RAM, it houses a number of on-board sensors, microphone, and bluetooth that can be use to tackle various applications.

Depending on your specific requirements, however, you might be better off considering some of the following products. Let’s go!

Grove – Vision AI Module V2

It’s an MCU-based vision AI module powered by Himax WiseEye2 HX6538 processor, featuring rm Cortex-M55 and Ethos-U55. It integrates Arm Helium technology, which is finely optimized for vector data processing, enables:

  • Award-winning low power consumption
  • Significant uplift in DSP and ML capabilities
  • Designed for battery-powered endpoint AI applications

With support for Tensorflow and Pytorch frameworks, it allows users to deploy both off-the-shelf and custom AI models from Seeed Studio SenseCraft AI. Additionally, the module features a range of interfaces, including IIC, UART, SPI, and Type-C, allowing easy integration with popular products like Seeed Studio XIAO, Grove, Raspberry Pi, BeagleBoard, and ESP-based products for further development.

Seeed Studio XIAO ESP32S3 Sense & Seeed Studio XIAO nRF52840 Sense

Seeed Studio XIAO Series are diminutive development boards, sharing a similar hardware structure, where the size is literally thumb-sized. The code name “XIAO” here represents its half feature “Tiny”, and the other half will be “Puissant”.

Seeed Studio XIAO ESP32S3 Sense integrates an OV2640 camera sensor, digital microphone, and SD card support. Combining embedded ML computing power and photography capability, this development board can be your great tool to get started with intelligent voice and vision AI.

Seeed Studio XIAO nRF52840 Sense is carrying Bluetooth 5.0 wireless capability and is able to operate with low power consumption. Featuring onboard IMU and PDM, it can be your best tool for embedded Machine Learning projects.

Click here to learn more about the XIAO family!

Arduino Nano RP2040 Connect

The latest Nano RP2040 Connect from Arduino takes on the familiar Nano form factor, and is built around Raspberry Pi’s RP2040 microcontroller with an additional suite of connectivity and sensor peripherals like a microphone for voice-enabled projects!

It most excitingly carries an AI-enabled 6-axis IMU that can be incredibly versatile for applications requiring motion sensing, such as pedometry, free fall detection, tap detection, 6D orientation and more! You can also easily integrate the Nano RP2040 Connect in IoT projects, thanks to the onboard u-blox NINA-W102 radio module that gives both WiFi and BLE connectivity!

Wio Terminal

Wio Terminal is your complete AI platform to get started with TinyML and IoT – Built around the ATSAMD51P19 and ARM Cortex-M4F at 120MHz for high compatibility with various ML frameworks for microcontrollers. In addition to integrated WiFi & Bluetooth, it has an onboard 2.4” LCD Display, IMU, microphone, buzzer, microSD card slot, light sensor & infrared emitter to tackle any kind of application.

The Wio Terminal is officially supported by Edge Impulse and TensorFlow Lite, which means that you can easily design and deploy ML applications with it! We’re also excited to announce the launch of our Hello World of AI page, where you can explore the endless possibilities with hardware, software, and learning resources – like our TinyML with Wio Terminal course, which is free for everyone to use!


Learn TinyML – Textbooks & Resources

There are countless resources that can help you learn TinyML, ranging from textbooks to courses.

Did you know that the term “TinyML” was first coined by Pete Warden in TinyML: Machine Learning with TensorFlow Lite on Arduino and Ultra-Low-Power Microcontrollers, a book written by him and Daniel Situnayake? While the book unfortunately isn’t free, it goes all the way from the conceptual origins of TinyML to practical steps for implementation, and is a both comprehensive and insightful guide to getting started. You can learn more about the book through this link!

Harvard’s TinyML Series on edX

Another really popular set of materials is none other than Harvard University’s series of TinyML courses, which takes you through the fundamentals, applications, and finally deployment of TinyML models. The best part? These courses are absolutely free for any keen learner – though you can choose to pay and receive a certificate upon completing the course. Now anyone can be a TinyML expert!

Have a look at the full course details on edX by clicking here!

Learn TinyML with Wio Terminal!

Last but not least, I’m excited to share our very own free course, Learn TinyML with Wio Terminal! Here at Seeed, we’re highly committed to becoming the most integrated platform for accelerating IoT integration, industrial solutions and edge AI applications. Learn to explore the Wio Terminal as an integrated TinyML platform, with step-by-step lessons and 5 complete projects that you can reference!

You can also access each of these 5 projects in the Learn TinyML using Wio Terminal and Arduino IDE series, listed below, which already have their individual blog posts up on our website. Now, you can really get started learning easily!


TinyML in the Community

The field of TinyML has garnered significant interest from enthusiastic developers worldwide, despite being relatively young. One notable event is the tinyML© Summit, which brings together technical experts and decision-makers at a senior level in the global tinyML community to discuss cutting-edge technologies and solutions. From April 22-24 this year, the tinyML© Summit will serve as the ultimate meeting place for trailblazing suppliers, forward-thinking end-users, ingenious engineers, and visionary business leaders to converge and exchange ideas. Join now to unlock the potential of Tiny ML!

Community Projects

The TinyML community isn’t limited to just professionals – hobbyists worldwide, even those without prior experience, are exploring the fascinating possibilities of TinyML by creating innovative and fun projects. The following are just a few examples to give you a taste of what’s possible. To discover more community projects, explore the diverse range of contributions on platforms like Hackster or Instructables. You can also find out about TinyML community projects by reading Seeed’s blogs.

Artificial Nose that Detects Scents

It’s fairly straightforward to detect specific gasses with the help of specialised sensors, but different combinations of gasses often indicate different conclusions in the real world. Since it’s too complicated to account for all the possibilities with hard-programming, Benjamin Cabe decided to create a TinyML powered artificial nose that can recognise different scents, including coffee, whisky and more!

Materials Needed:

Keen to explore further? Get tinkering with this project by having a look at Benjamin’s GitHub repo for the project here!

Build Handwriting Recognition with Wio Terminal & Edge Impulse

Do you think it’s possible to perform handwriting recognition with just a single distance sensor? The answer to that is, well, sort of! This project uses machine learning on time series data from just one ToF sensor to recognise handwriting gesture patterns! While it’s very much a proof of concept project and far from actual implementation, I hope this inspires you to think of crazy ideas for your own project!

Materials Needed:

If you’d like to try this for yourself, feel free to follow the full step-by-step tutorial here!

A device that can find the signs of fungal pneumonia in someone’s breath by detecting the Volatile Organic Compounds that are markers for the disease

Irrigation Level Assessment by Thermal Imaging w/ TensorFlow

Collect irrigation level data by thermal imaging, build and train a neural network model, and run the model directly on Wio Terminal.


Summary & More Resources

In this one-stop guide to TinyML, we’ve covered the basics of what TinyML is, its benefits, applications, and various resources that can help you achieve your next smart application! Be it hardware, software or learning resources, I hope that you’ve now gotten a clearer idea of where to start and are excited to enter the exciting world of TinyML! Got any more questions? Feel free to let me know down below!

To wrap up, I strongly encourage you to visit the following resources to learn more!

Learn TinyML with Wio Terminal Series

About Author

Calendar

June 2021
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
282930