Upon building the original Wake-Word ML application from Chapter 7, then following the instruction from Chapter 8 to modify the app to recognize more words than only "yes" and "no".
Now, the program is trained to detect words "yes" "go" and "stop", use R G B to represent each of them, and use all lights to represent "unknown"
PreparationThe training process is heavy-GPU task, so we use Google Colab to do it. For my model, I used approximately one and half hour to train. Open the training script https://colab.research.google.com/github/tensorflow/tflite-micro/blob/main/tensorflow/lite/micro/examples/micro_speech/train/train_micro_speech_model.ipynb
with Google Colab.
change
WANTED_WORDS = "yes, no" to WANTED_WORDS = "yes, stop, go"
TRAINING_STEPS = "12000, 3000" to TRAINING_STEPS = "15000, 3000"
so the total training iteration is 18000 to obtain about 90% accuracy
Run the python script, the whole process took between one and two hours depends on the machine.
the program visualize the training accuracy and loss during the training as below:
and the spectrogram of input
and finally the C array which used to replace the original code
CompileandRun
Open Arduino and connect the board to computer with USB cable. Choose the correct port and board. Modify the code according to the context from Chapter 8.
below are demo of a few code changes:
After all done, we can move forward to test the program.
Comments
Please log in or sign up to comment.