Internet of Things (Part 3)

Edge Impulse


iot microchip
 by Philipp Petzka is licensed under CC

Edge Impulse

Edge Impulse is a development platform for creating machine learning (ML) models optimized for edge devices. It allows developers to collect data, train ML models, and deploy them on low-power hardware such as microcontrollers, IoT devices, and embedded systems. The platform is particularly useful for applications in industrial automation, healthcare, predictive maintenance, and smart devices.

Arduino Nano 33 BLE Sense

The Arduino Nano 33 BLE Sense is a compact, microcontroller board designed for Artificial Intelligence (AI) and Internet of Things (IoT) applications, featuring built-in sensors and Bluetooth Low Energy (BLE) connectivity.

The Arduino Nano 33 BLE Sense can be used in edge computing, AI/ML applications, and sensor-based projects.

Edge Impulse firmware

I installed the Edge Impulse firmware on the Arduino Nano 33 BLE Sense to improve the way that it connected to the with the Edge Impulse Studio for data collection.

Sampling Frequency

The Edge Impulse firmware for the Arduino Nano 33 BLE Sense supports a sampling frequency of 16,000 Hz.

Audio files recorded with this firmware can be previewed and edited in Edge Impulse Studio.

I noticed that the play, pause, and volume media controls in Edge Impulse Studio only appeared when the selected audio file had been recorded using an Arduino Nano 33 BLE Sense with the Edge Impulse firmware installed.

The Edge Impulse firmware for the Arduino Nano 33 BLE Sense supports a sampling frequency of 16,000 Hz.

When the dog was barking I clicked the Start sampling button

The button text updated to Waiting to start...

The button text updated to Sampling... (Xs left)

The button text updated to Reading data from device (XX%)...

The button text updated to Uploading...

I selected a 10 second sample and selected the Split sample menu option

Edge Impulse highlighted 6 interesting segments. I clicked the Split button

I reviewed each of the newly created 1 second segment keeping every sample that was useful.

Training and Testing groups

Data is split into Training and Testing groups to ensure that a machine learning model generalizes well to new, unseen data. This separation helps prevent overfitting, where a model performs well on the training data but poorly on new inputs.

I clicked the Perform train / test split button

I clicked the Yes, perform the train / test split button

I typed perform split and clicked the Perform train / test split button

I clicked the OK button

The samples were divided into a training set and a test set

EON Tuner

The Edge Impulse EON Tuner is a machine learning optimization tool that helps developers find the best ML model configuration for edge devices. It evaluates different model architectures, balancing accuracy, latency, and memory usage, to ensure the best possible performance on resource-constrained hardware.

https://www.youtube.com/watch?v=c3R9w7R_tRw

EON Tuner

I selected Audible events

Audible events. Listen for short one-time occurrences of non-voice audio

EON Tuner is running...

EON Tuner results

I clicked the + Add button on the best looking model configuration

mfcc-conv1d-8f2 was added as an Impulse

Deployment

After training the model I was able to deploy it to the Arduino Nano 33 BLE Sense.

I clicked the Deployment menu item. I clicked the Build button

An Arduino library .zip file was generated

I copied the .zip file from the Downloads folder

I copied the .zip file to the Arduino libraries folder

I unzipped the library

I ran the Arduino Integrated Development Environment (IDE)

I selected the nano_ble33_sense_microphone example

I clicked the Upload button

I waited for the sketch to compile

I waited for the sketch to be uploaded to the Arduino Nano 33 BLE Sense

I started the Serial Monitor

With no barking the model correctly predicted: Background

With barking the model correctly predicted: Bark