Overview#

 

Introduction#

The Silicon Labs AI/ML extension provides APIs for running TensorFlow Lite Micro models on Series 2 (EFR32) and SiWx917 devices, with optional hardware acceleration through the Matrix Vector Processor (MVP). This reference covers the public APIs for model lifecycle, feature generation, and the sensor drivers commonly used to feed inference.

Use this guide together with the Machine Learning developer documentation for getting started, sample applications, and migration notes.

Model inference#

At the center of the SDK is the model handle API in Machine Learning model APIs and structures. A single sl_ml_model_handle_t holds the flatbuffer, operator resolver, and tensor arena buffers for one deployed model.

Typical flow:

  1. Construct or populate an sl_ml_model_handle_t with the flatbuffer, resolver, and arena buffers (auto-generated by the ML compiler).

  2. Call sl_ml_model_init() to load the model and allocate tensors.

  3. Write input tensors, then call sl_ml_model_run() for each inference.

  4. Call sl_ml_model_deinit() when the model is no longer needed (or before reloading the same handle).

Include the model header from application code:

#include "sl_ml_tflite_micro_model.h"

Feature generation#

Before inference, raw sensor data is usually converted into the feature layout the model was trained with.

  • Audio Feature Generator — Mel-filterbank features from a microphone stream for audio classification. Split the signal into overlapping windows, apply an FFT, run mel-scaled filters, and take the log of the filterbank energy. Use sl_ml_audio_feature_generation_fill_tensor() to write features directly into a TFLM input tensor.

  • Image Feature Generator — Crop and normalize camera frames for image classification. Initialize with sl_ml_image_feature_generation_init(), then call sl_ml_image_feature_generation_fill_tensor() when a new frame is ready.

Match feature-generator configuration to the training pipeline (window size, FFT length, image crop, mean/std normalization, and so on). Sample apps under aiml_app/ show end-to-end setups for both audio and vision.

Sensor drivers#

These drivers acquire the streams that feature generators and models consume:

Choose the microphone API that matches the target SoC. The audio feature generator depends on the platform mic driver component selected in the SLC project.

Using the APIs in a project#

  1. Add the AI/ML extension and the relevant SLC components (machine_learning, fe_audio, image feature generation, mic, or IMU as needed).

  2. Generate and build the project for your board (for example brd2601b or brd2605a / brd2605b).

  3. Include the public headers for the modules you use and follow the init → run → deinit pattern for models and feature generators.

Browse the module pages in the navigation for full function lists, parameter contracts, and examples embedded in the headers.