This project was a wake word detection APP running on Sense Arduino Nano 33 BLE Sense according to Chapter 7-8 of TinYM - New Book from Google Researchers Peter Warden & Daniel Situnayake. There are two apps, the detection words are yes/no, on/off. When the board detects yes or ON, it will light up green; when it detects no or off, it will light up red; if it cannot be classified, it will light up blue.
Approach- .Configure training
project1: set WANTED_WORDS = "yes,no", set TRAINING_STEPS = "15000,3000"
LEARNING_RATE = "0.001,0.0001"
project2: set WANTED_WORDS ="on,off", set TRAINING_STEPS = "15000,3000"
LEARNING_RATE = "0.001,0.0001"
- start training
follow Colab to Training cell and wait for one or two hour for finish training
result:
- Convert to TensorFlow Lite, then Convert to a C Array
follow Colab:
result:
- Replacing the Model
find micro_features_model.cpp, replace the DATA_ALIGN_ATTRIBUTE to the C array I have generated and change the g_model_len to the length of thenew C array.
- Updating the Labels
find micro_features_micro_model_settings.cpp, change to
const char* kCategoryLabels[kCategoryCount] = {
"silence",
"unknown",
"on",
"off",
};
- Updating command_responder.cc
- find arduino_command_responder.cpp, change to
if (found_command[0] == 'o' && found_command[1] == 'n') {
last_command_time = current_time;
digitalWrite(LEDG, LOW); // Green for yes
}
if (found_command[1] == 'f') {
last_command_time = current_time;
digitalWrite(LEDR, LOW); // Red for no
}
- run and test
The APP that detects yes and no has a better effect, while The effect of detecting on and off is not very good.
Comments