Skip to content

Commit 534b7e6

Browse files
Update Edge Impulse documentation to reflect new title and enhance clarity in project setup instructions
1 parent 6356549 commit 534b7e6

1 file changed

Lines changed: 91 additions & 69 deletions

File tree

content/learning-paths/embedded-and-microcontrollers/edge/software-edge-impulse.md

Lines changed: 91 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
title: Set up your environment
2+
title: Train and deploy a TinyML audio classifier with Edge Impulse
33
weight: 3
44

5-
### FIXED, DO NOT MODIFY
5+
# FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
8+
89
# Using Edge Impulse to Train TinyML models
910

1011
Now that you've learned the foundational concepts of Edge AI and TinyML, it's time to move from theory to practice.
@@ -48,131 +49,152 @@ In the following sections, you'll walk through each key page on the Edge Impulse
4849
![Screenshot of the Edge Impulse home page showing the main navigation and project dashboard alt-text#center](images/1.png "Figure 1. Home page of Edge Impulse")
4950

5051

51-
### Step 1: Create a New Project
52+
### Create a new project
53+
54+
After you create your account and log in, the first step is to create a new project. Give your project a name that clearly reflects its purpose. This helps with easy identification, especially if you plan to build multiple models.
55+
56+
For example, if you're building a keyword spotting model, you might name it `Wake word detection`.
5257

53-
Once you’ve created your account and logged in, the first step is to **create a new project**. Give your project a name that clearly reflects its purpose—this helps with easy identification, especially if you plan to build multiple models later on. For example, if you're building a keyword spotting model, you might name it "Wake Word Detection". Youll also need to select the appropriate **project type** and **project setting**, as shown in the snapshot below.
58+
You'll also need to select the appropriate **project type** and **project settings**, as shown in the snapshot below.
5459

55-
![example image alt-text#center](images/3.png "Figure 2. New Project Setup")
60+
![Screenshot showing the new project creation page in Edge Impulse, with fields for project name, type, and target device alt-text#center](images/3.png "Figure 2. New project setup")
5661

57-
### Step 2: Configure the Target Device
62+
### Configure the target device
5863

59-
After creating your project, the next step is to **configure the target device**. Since you are using the **Arduino Nano RP2040 Connect**, click the highlighted button to begin device configuration, as shown in the snapshot below. This ensures that the data collection, model training, and deployment steps are optimized for your specific hardware.
64+
After creating your project, the next step is to configure the target device. Since you're using the **Arduino Nano RP2040 Connect**, click the highlighted button to begin the configuration process, as shown in the snapshot below. This ensures that data collection, model training, and deployment are optimized for your hardware.
6065

61-
The specifications of the Arduino Nano RP2040 Connect board can be found on [Arduino’s official page](https://store.arduino.cc/products/arduino-nano-rp2040-connect).
66+
You can find the full specifications for the Arduino Nano RP2040 Connect on [Arduino’s official product page](https://store.arduino.cc/products/arduino-nano-rp2040-connect).
6267

63-
Follow the exact settings in the attached snapshot to complete the configuration.
68+
Follow the settings shown in the screenshot to complete the configuration.
6469

65-
![example image alt-text#center](images/4.png "Figure 3. Configure Arduino Nano RP2040")
70+
![Screenshot showing the Edge Impulse device configuration page with Arduino Nano RP2040 Connect selected alt-text#center](images/4.png "Figure 3. Configure Arduino Nano RP2040")
6671

67-
### Step 3: Add the Dataset
6872

69-
With your device configured, the next step is to **add your dataset** to the project. Click on the **"Add existing data"** button and follow the configuration settings shown in the attached snapshot. This allows you to upload pre-recorded data instead of collecting it live, which can save time during the development phase.
73+
### Add the dataset
7074

71-
An **example repository** has been set up with some assets to be used throughout this Learning Path. You can clone it with the following command:
75+
With your device configured, the next step is to add your dataset to the project. Click **Add existing data** and follow the configuration settings shown in the screenshot. This lets you upload pre-recorded data instead of collecting it live, which can save time during development.
76+
77+
An example repository has been prepared with assets used throughout this Learning Path. You can clone it with the following command:
7278

7379
```bash
7480
git clone https://github.com/e-dudzi/Learning-Path.git
7581
```
7682

77-
The repository contains a `Dataset.zip` file containing the dataset used in the project. Extract it on your local machine. For convenience, the dataset has already been split into **training** and **testing**.
83+
The repository contains a `Dataset.zip` file with the dataset used in this project. Extract the contents to your local machine. For convenience, the dataset is already split into **training** and **testing** sets.
84+
85+
![Screenshot showing the Edge Impulse interface with the Add existing data panel open, used to upload pre-recorded datasets alt-text#center](images/6.png "Figure 4. Add existing data")
7886

79-
![example image alt-text#center](images/6.png "Figure 4. Add Existing Data")
8087

8188
{{% notice Note %}}
82-
Do **not** check the **Green** highlighted area during upload. The dataset already includes metadata. Enabling that option may result in **much slower upload times** and is unnecessary for this project.
89+
Do not check the green highlighted area during upload. The dataset already includes metadata. Enabling that option may result in much slower upload times and is unnecessary for this project.
8390
{{% /notice %}}
8491

85-
![example image alt-text#center](images/7.png "Figure 5. Dataset Overview")
92+
![Screenshot showing the Data acquisition tab in Edge Impulse with uploaded samples organized by label alt-text#center](images/7.png "Figure 5. Dataset overview")
93+
94+
### Dataset uploaded successfully
8695

87-
### Dataset Uploaded Successfully
96+
After the dataset is uploaded, you'll see the samples listed in the **Data acquisition** tab, organized by their labels. You can click each sample to inspect the raw signal, view metadata, and even listen to the audio recordings directly within the Edge Impulse interface. This helps confirm that the uploaded data is accurate and ready for training.
8897

89-
This is what you should see after the dataset has been successfully uploaded. The data samples will appear in the **Data acquisition** tab, categorized by their respective labels. You can click on each sample to inspect the raw signal, view metadata, and even **listen to the audio recordings** directly within the Edge Impulse interface. This helps verify that the uploaded data is accurate and usable for training.
9098

9199
{{% notice Note %}}
92-
This dataset is made up of **four labels**: `on`, `off`, `noise`, and `unknown`.
100+
This dataset is made up of four labels:
101+
- on
102+
- off
103+
- noise
104+
- unknown
93105
{{% /notice %}}
94106

95-
![example image alt-text#center](images/8.png "Figure 6. Dataset Overview")
107+
![Screenshot showing the Impulse design interface in Edge Impulse with input, processing, and learning blocks configured alt-text#center](images/8.png "Figure 6. Dataset overview")
96108

97-
### Step 4: Create the Impulse
109+
### Create the impulse
98110

99-
Now that your data is ready, it's time to create the **impulse**, which defines the flow of data from input to output through processing blocks. Click on the **"Create Impulse"** button in the menu and configure it exactly as shown in the snapshot below. This typically includes setting the input data type (e.g., audio), adding a **processing block** (such as MFCC for audio), and a **learning block** (such as a neural network classifier).
111+
Now that your data is ready, it's time to create the impulse. An impulse defines the flow of data from input to output using processing and learning blocks.
112+
113+
Click **Create impulse** in the menu and configure it as shown in the screenshot. Typically, this includes setting the input data type (such as audio), adding a **processing block** (like MFCC), and a **learning block** (such as a neural network classifier).
114+
115+
After configuring the impulse, make sure to **save your changes**.
100116

101-
After configuring everything, **don’t forget to save your impulse**.
102117

103118
![example image alt-text#center](images/9.png "Figure 7. Create Impulse")
104119

105-
### Step 5: Configure the MFCC Block
120+
### Configure the MFCC block
106121

107-
Next, you'll configure the **MFCC (Mel Frequency Cepstral Coefficients)** processing block, which transforms the raw audio data into features suitable for model training. Click on **"MFCC"** in the left-hand menu under the **"Impulse Design"** section.
122+
Next, you'll configure the **MFCC (Mel Frequency Cepstral Coefficients)** processing block. This block transforms raw audio into features suitable for training your model.
108123

109-
Set the parameters exactly as shown in the snapshot below. These settings determine how the audio input is broken down and analyzed. Once you're done, be sure to **save the parameters**. These parameters are chosen for this path. Modifications can be made once you are familiar with Edge Impulse.
124+
Click **MFCC** in the left-hand menu under the **Impulse design** section.
110125

111-
![example image alt-text#center](images/10.png "Figure 8. MFCC Block Configuration")
126+
Set the parameters exactly as shown in the screenshot. These settings determine how the audio input is segmented and analyzed. Once complete, make sure to **save the parameters**.
112127

113-
{{% notice Note %}}
114-
The **green highlighted section** on the MFCC configuration page gives an estimate of how the model will perform **on the target device**. This includes information like memory usage (RAM/Flash) and latency, helping you ensure the model fits within the constraints of your hardware.
115-
{{% /notice %}}
128+
These defaults are chosen for this Learning Path, but you can experiment with different values once you're more familiar with Edge Impulse.
116129

117-
### Step 6: Generate Features
130+
![Screenshot showing the MFCC configuration page in Edge Impulse with time and frequency parameters set for feature extraction alt-text#center](images/10.png "Figure 8. MFCC block configuration")
118131

119-
After saving the MFCC parameters, the next step is to generate features from your dataset. Click on the **"Generate features"** button highlighted. Edge Impulse will process all your data samples using the MFCC configuration and create a set of features suitable for training a machine learning model.
132+
{{< notice Note >}}
133+
The green-highlighted section on the MFCC configuration page provides an estimate of how the model will perform on the target device. This includes memory usage (RAM and flash) and latency, helping ensure the model fits within hardware constraints.
134+
{{< /notice >}}
120135

121-
Once the feature generation is complete, you'll see a **2D visualization plot** that shows how the dataset is distributed across the four labels: `on`, `off`, `noise`, and `unknown`. This helps to visually confirm whether the different classes are well-separated and learnable by the model.
136+
### Generate features
122137

123-
![example image alt-text#center](images/12.png "Figure 9. Feature Explorer")
138+
After saving the MFCC parameters, the next step is to generate features from your dataset. Click **Generate features** to begin. Edge Impulse will process your data using the MFCC configuration and create a feature set for training.
124139

125-
### Step 7: Setting Up the Classifier
140+
When complete, you'll see a **2D feature plot** that shows how the data is distributed across the four labels: `on`, `off`, `noise`, and `unknown`. This helps visually confirm whether the classes are distinct and learnable.
126141

127-
Now it's time to configure the **neural network classifier**, which will learn to recognize the different audio commands. Click on the **"Classifier"** button in the left-hand menu under **Impulse Design** and set the parameters exactly as shown in the snapshot below.
142+
![Screenshot showing the feature explorer in Edge Impulse with a 2D visualization of four labeled audio classes alt-text#center](images/12.png "Figure 9. Feature explorer")
128143

129-
{{% notice Note %}}
130-
For this learning path, a learning rate of `0.002` was chosen, although the snapshot shows a value of `0.005`. You are free to experiment with different values to improve model accuracy. However, using `0.002` is recommended as a good starting point.
131-
{{% /notice %}}
144+
### Set up the classifier
145+
146+
Now it's time to configure the **neural network classifier**, which learns to recognize different audio commands. Click **Classifier** under **Impulse design** and set the parameters as shown in the screenshot.
147+
148+
{{< notice Note >}}
149+
For this Learning Path, use a learning rate of `0.002` even though the screenshot shows `0.005`. You can experiment later, but `0.002` is a good starting point.
150+
{{< /notice >}}
151+
152+
Once all parameters are set, click **Save and train** to begin training your model.
153+
154+
![Screenshot showing the classifier configuration in Edge Impulse with neural network settings alt-text#center](images/13.png "Figure 10. Classifier settings")
155+
156+
### Review model performance
132157

133-
Once all the parameters are set, click on **"Save and train"** to start training your model.
158+
After training is complete, Edge Impulse will show the model’s performance metrics: **accuracy**, **loss**, and a **confusion matrix**.
134159

135-
![example image alt-text#center](images/13.png "Figure 10. Classifier Settings")
160+
![Screenshot showing the model performance results in Edge Impulse including accuracy, loss, and confusion matrix alt-text#center](images/14.png "Figure 11. Model performance")
136161

137-
### Step 8: Reviewing Model Performance
162+
- **Accuracy**: how often the model correctly predicts labels
163+
- **Loss**: how far off predictions are — lower values indicate better performance
164+
- **Confusion matrix**: shows how well the model classified each label and where errors occurred
138165

139-
After the training process is complete, Edge Impulse will display the **model's performance**, including its overall **accuracy**, **loss**, and a **confusion matrix**.
166+
Review these results to see how well the model learned. If needed, adjust settings or retrain.
140167

141-
![example image alt-text#center](images/14.png "Figure 11. Model Performance")
168+
**On-device performance (EON Compiler - RAM optimized):**
142169

143-
- **Accuracy** reflects how often the model predicts the correct label.
144-
- **Loss** indicates how far the model’s predictions are from the actual labels during training — a lower loss generally means better performance.
145-
- The **confusion matrix** shows how well the model predicted each of the four labels (`on`, `off`, `noise`, `unknown`), and can help identify patterns of misclassification.
170+
| Metric | Value |
171+
|------------------|---------|
172+
| Inference time | 6 ms |
173+
| Peak RAM usage | 12.5 KB |
174+
| Flash usage | 49.7 KB |
146175

147-
Review these metrics to determine if the model is learning effectively. If needed, adjust the model parameters or revisit earlier steps to improve performance.
176+
![Screenshot showing performance metrics for the trained model on the target device alt-text#center](images/15.png "Figure 12. Model performance")
148177

149-
**On-Device Performance (EON Compiler - RAM Optimized):**
178+
You can also use the pre-trained model found in `ei-edge-ai-tutorials-arduino-1.0.1.zip` from the example repository.
150179

151-
| Metric | Value |
152-
|--------------------|-----------|
153-
| Inference Time | 6 ms |
154-
| Peak RAM Usage | 12.5 KB |
155-
| Flash Usage | 49.7 KB |
180+
### Deploy the model
156181

157-
![example image alt-text#center](images/15.png "Figure 12. Model Performance")
182+
To run the trained model on your Arduino Nano RP2040 Connect, export it as an Arduino library:
158183

159-
You can also use the pre-trained model in the `ei-edge-ai-tutorials-arduino-1.0.1.zip` archive, from the example repository.
184+
1. Click **Deployment** in the left menu
185+
2. Search for **Arduino** and select **Arduino library**
186+
3. If the export doesn't start automatically, click **Build**
160187

161-
### Final Step: Deploying the Model
188+
The model will be downloaded as a `.zip` file you can import into the Arduino IDE.
162189

163-
To use the trained model on your Arduino Nano RP2040, follow the steps below to export it as an Arduino library.
190+
![Screenshot showing the deployment options in Edge Impulse with Arduino library export selected alt-text#center](images/16.png "Figure 13. Model deployment")
164191

165-
1. Click on the **Deployment** tab from the menu.
166-
2. In the **search bar**, type **"Arduino"** to filter the export options.
167-
3. Select **Arduino library** from the list.
168-
4. If the export process does not start automatically, click **Build**. The model will be downloaded as a `.zip` file.
192+
## Next steps
169193

170-
![example image alt-text#center](images/16.png "Figure 13. Model Deployment")
194+
In the next section, you'll move from model training to real-world deployment. Specifically, you will:
171195

172-
## Next Steps
196+
- Connect an **LED** to the **Arduino Nano RP2040** board
197+
- Set up the **Arduino IDE** for development
198+
- Deploy the trained model to recognize voice commands and control the LED
173199

174-
In the following steps, you will move from model training to real-world deployment. Specifically, you will:
175200

176-
- Connect an **LED** to the **Arduino Nano RP2040** board.
177-
- Set up the **Arduino IDE** for development.
178-
- Program the board and **deploy the trained model** to recognize voice commands which will be used to turn `ON` and `OFF` the LED

0 commit comments

Comments
 (0)