Runs the voice recognition model of TFL for a microcontroller on Ameba D RTL8722DM/RTL8722DM-MINI
Ameba is an easy-to-program platform for developing all kinds of AIoT applications.
Introduction to Google TensorFlow
TensorFlow (TF) is an end-to-end open-source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries, and community resources that lets researchers push the state-of-the-art in ML, and developers easily build and deploy ML-powered applications.
TensorFlow Lite for Microcontrollers
While TensorFlow Lite (TFL) for Microcontrollers is designed to run machine learning models on microcontrollers and other devices with only a few kilobytes of memory. The core runtime just fits in 16 KB on an Arm Cortex M3 and can run many basic models. It doesn't require operating system support, any standard C or C++ libraries, or dynamic memory allocation.
Ameba and TFL for Microcontrollers
Ameba is an easy-to-program platform for developing all kinds of IoT applications. AmebaD is equipped with various peripheral interfaces, including WiFi, GPIO INT, I2C, UART, SPI, PWM, ADC. Through these interfaces, AmebaD can connect with electronic components such as LED, switches, manometer, hygrometer, PM2.5 dust sensors, …etc.
“Micro Speech” Example
- Ameba D [RTL8722 CSM/DM] x 1 or Ameba D- MINI
- Adafruit PDM MEMS microphone
- LED x 4
In this example, we will use Ameba D as an example, however, the microcontroller EVB using in the video link above is Ameba D-mini.
Connect the microphone and LEDs to the RTL8722 board following the diagram.
Once it is running, you should see one of the LEDs flashing, indicating that it is processing audio. Saying the word “yes” will cause the green LED to light up. Saying the word “no” will cause the red LED to light up. If the word is not recognized, the blue LED will to light up.
The inference results are also output to the Arduino serial monitor, which appear as follows:
If you are having trouble getting the words recognized, here are some tips:
- Ensure that your surroundings are quiet with minimal noise.
- Experiment with varying the distance of the microphone, starting with it at an arm’s length.
- Experiment with different tones and volumes when saying the words.
- Depending on how you pronounce the words, the characteristics of the microphone used, getting one keyword recognized may be easier than the other.
Reference and Q&A