Welcome to IoTForums.com Community
Register now to participate in discussions, ask questions and share your knowledge on internet of things and automation! Feel free to sign up today.
Register Now

RTL8722DM is now supporting TensorFlow Lite “Micro Speech” Example

Dakamaster

Just Hatched
May 10, 2021
13
1
11
Singapore
Ameba is an easy-to-program platform for developing all kinds of IoT 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.

Materials
• Ameba D [RTL8722 CSM/DM] x 1
• Adafruit PDM MEMS microphone
• LED x 4

Example
- Procedure
Connect the microphone and LEDs to the RTL8722 board following the diagram.
1-1.jpg

Download the Ameba customized version of TensorFlow Lite for Microcontrollers library at:
Please, Log in or Register to view URLs content!
.

Follow the instructions at
Please, Log in or Register to view URLs content!
to install it.
Ensure that the patch files found at
Please, Log in or Register to view URLs content!
are also installed.

Open the example, “Files” -> “Examples” -> “TensorFlowLite_Ameba” -> “micro_speech”.

1-2.jpg

Upload the code and press the reset button on Ameba once the upload is finished.
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:
1-3.jpg
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
  1. More information on TensorFlow Lite for Microcontrollers can be found at:
    Please, Log in or Register to view URLs content!
  2. For more examples, please visit our official website:
    Please, Log in or Register to view URLs content!
  3. Please join our FB Forum (English version) to further discuss with us:
    Please, Log in or Register to view URLs content!
  4. Or join our forum to bring up any questions:
    Please, Log in or Register to view URLs content!
 

Log in

or Log in using