1  Introduction to Embedded Machine Learning

This chapter introduces the essential concepts of embedded machine learning and highlights the growing significance of TinyML in modern embedded system designs. It emphasizes the role of microcontrollers, particularly the Silicon Labs EFR32MG24, in enabling efficient, low-power machine learning inferencing for IoT applications. Whether you are a student starting your embedded ML journey or an engineer aiming to enhance your system design skills, this textbook will serve as a valuable resource to build innovative and efficient TinyML-enabled embedded solutions.

1.1 Overview

Embedded machine learning, often referred to as TinyML, represents a paradigm shift in computational intelligence by bringing sophisticated inferencing capabilities directly to resource-constrained embedded systems. Unlike traditional machine learning systems that rely on cloud computing or powerful edge devices, TinyML optimizes models to operate within the strict memory, processing, and power constraints of microcontrollers. This evolution enables a new class of intelligent devices that can make real-time decisions locally without requiring constant connectivity to external servers.

At the core of TinyML systems lies the microcontroller, a compact integrated circuit that combines a processor, memory, and input/output peripherals on a single chip. Modern microcontrollers like the Silicon Labs EFR32MG24 are increasingly designed with ML workloads in mind, featuring specialized hardware accelerators and optimized instruction sets that enhance neural network performance while maintaining energy efficiency.

In recent years, the demand for local intelligence in IoT devices has surged, driven by concerns about latency, privacy, bandwidth limitations, and power consumption. TinyML addresses these challenges by enabling machine learning models to run directly on microcontrollers, processing sensor data locally and making intelligent decisions without transmitting raw data to the cloud. This approach is particularly valuable for applications such as keyword spotting, gesture recognition, anomaly detection, and predictive maintenance in industrial settings.

The Silicon Labs EFR32MG24 series is one of the most advanced microcontrollers available for TinyML applications in 2024. Built on the ARM Cortex-M33 core operating at 78 MHz, it offers a powerful blend of performance and energy efficiency, with a memory footprint of 1536KB flash and 256KB RAM. The platform includes an AI/ML hardware accelerator that enhances neural network execution, making it ideal for deploying sophisticated TinyML models while maintaining battery life in portable devices.

This textbook, Embedded Machine Learning Design with Silicon Labs EFR32MG24, provides a comprehensive guide for students and engineers to understand and implement TinyML solutions. The book covers both theoretical foundations and practical implementations, ensuring readers gain a deep understanding of machine learning optimization for resource-constrained systems.

Throughout this book, readers will learn:

  • The fundamentals of TinyML and the computational constraints paradigm
  • Model compression and quantization techniques for microcontroller deployment
  • Practical implementation using Google Colab for model training and Simplicity Studio for deployment
  • Hands-on experience building the canonical “Hello World” of TinyML: a sine wave predictor
  • Advanced techniques for power optimization, performance profiling, and model efficiency
  • Real-world case studies demonstrating TinyML applications across various domains

1.2 Real-World Applications of Embedded Machine Learning

Embedded machine learning is transforming countless devices and technologies by enabling local intelligence in resource-constrained environments. TinyML systems execute sophisticated inferencing tasks efficiently while operating under strict constraints of power consumption, memory limitations, and processing capabilities. Examples of TinyML applications can be observed across diverse industries, showcasing the versatility and transformative potential of this technology.

In healthcare and wearables, TinyML enables continuous health monitoring without draining battery life. Smart watches and fitness trackers use embedded ML algorithms to detect irregular heartbeats, analyze sleep patterns, and recognize specific activities based on motion sensor data. These devices perform complex pattern recognition locally, only transmitting alerts or summarized insights rather than constant streams of raw data, preserving both battery life and user privacy.

Industrial IoT applications leverage TinyML for predictive maintenance and anomaly detection at the sensor level. Embedded microcontrollers equipped with ML capabilities can analyze vibration patterns from motors or machinery, detecting subtle changes that might indicate impending failure before catastrophic breakdowns occur. By processing this data directly on the device, these systems can operate in environments with limited connectivity while providing real-time insights.

Consumer electronics increasingly incorporate TinyML to enhance user experience through always-on, low-power intelligence. Voice assistants use keyword spotting models running on microcontrollers to detect wake words without sending all audio to the cloud. Smart home sensors employ ML algorithms to differentiate between routine movements and security concerns, reducing false alarms while improving response times to genuine threats.

Agricultural and environmental monitoring systems utilize TinyML to enable intelligent, autonomous operation in remote locations. Soil moisture sensors can incorporate local ML models to optimize irrigation schedules based on weather patterns, soil conditions, and crop-specific needs. Wildlife tracking devices use embedded ML to classify animal behaviors directly on the device, extending battery life from days to months by eliminating continuous data transmission.

The EFR32MG24 microcontroller is particularly well-suited for these applications due to its balance of processing power, memory resources, and energy efficiency. Its ARM Cortex-M33 core provides sufficient computational capabilities for running inference on neural networks, while its power management features enable long-term operation on battery power. The integrated ML accelerator further enhances performance for specific machine learning workloads, enabling more complex models to run efficiently.

1.3 The EFR32MG24 for Machine Learning Applications

The EFR32MG24 microcontroller, part of Silicon Labs’ Wireless Gecko series, is specifically designed to address the growing demand for local machine learning capabilities in resource-constrained embedded systems. Built on the ARM Cortex-M33 core, it operates at a maximum frequency of 78 MHz, delivering sufficient computational power for real-time ML inferencing while maintaining energy efficiency. With 1536KB of flash memory and 256KB of RAM, it provides adequate storage for both program code and machine learning models after quantization and optimization.

A key feature that distinguishes the EFR32MG24 for ML applications is its dedicated AI/ML hardware accelerator, which enhances the execution of specific neural network operations. This accelerator enables more efficient matrix multiplications and other common ML computations, allowing for faster inference times and lower power consumption compared to software-only implementations. Combined with the DSP extensions in the Cortex-M33 architecture, this hardware support makes the EFR32MG24 an excellent platform for deploying sophisticated TinyML models.

The EFR32MG24 excels in power management, offering multiple low-power modes that are essential for battery-operated ML devices. Its Energy Management Unit (EMU) allows fine-grained control over active, sleep, and deep sleep states, enabling systems to run inferencing only when needed and remain in ultra-low-power states otherwise. This capability is critical for applications like smart sensors that may need to periodically analyze data but remain dormant most of the time.

For data acquisition and sensor integration, the EFR32MG24 provides comprehensive peripheral support, including high-precision ADCs, DACs, and various communication interfaces (UART, SPI, I2C). These peripherals enable the connection of diverse sensors for gathering the input data required by ML models. The microcontroller’s wireless capabilities, particularly Bluetooth Low Energy (BLE), allow for convenient model updates, configuration changes, and the transmission of inference results when necessary.

Security features are increasingly important in ML-enabled devices, and the EFR32MG24 addresses this through hardware-based security elements including a cryptographic accelerator and secure boot mechanisms. These features help protect both the intellectual property embedded in the ML models and any sensitive data processed by the device.

The development environment for the EFR32MG24, centered around Simplicity Studio and the Gecko SDK, provides integrated support for TinyML workflows. The SDK includes optimized libraries for TensorFlow Lite Micro, enabling straightforward deployment of models trained using popular frameworks like TensorFlow. This integration streamlines the development process from model training to on-device deployment, making the platform accessible even to developers new to machine learning.

Available in the xG24-DK2601B Development Kit, the EFR32MG24 provides an ideal platform for learning and experimenting with embedded machine learning concepts, from simple inferencing tasks like our sine wave predictor to more complex applications such as sensor fusion, anomaly detection, and pattern recognition. Throughout this book, we will use this powerful yet resource-constrained platform to demonstrate the principles and practices of efficient TinyML implementation.