Applications of TinyML:Keyword Spotting 3

191 阅读2分钟

Keyword Spotting

colab.research.google.com/github/tiny…
If you want to take a look at the source code it can be found here: github.com/tensorflow/…. You’ll notice that there are even more flags than we set in the colab. If you’d like to customize the training process even more you can!

A coding assignment

Now that you know how to train a new Keyword Spotting model it's time for your assignment -- pick your own keywords from the Speech Commands dataset and train your own model! You’ll get to test it with your own audio input when you’re done! We hope you have a lot of fun with this one! As a quick warning, with the default values this should take ~2 hours to train on a GPU runtime once you launch the training cell -- so feel free to keep working through the rest of this section while it trains! Coding assignment

Assignment Solution

For this assignment you needed to input a few hyper-parameters for the model training. A possible solution is below but any combination of 2-4 words from the list provided in the comment should have done reasonably well (and more words might have worked too although after a point the small model may have started to struggle). For training steps, the longer you trained, the better the accuracy should have gotten, up to a point, and then you may have found that the model started to overfit. As for the learning rate, if it was too high the training most likely failed due to divergence, and if it was too low the training likely failed because it didn’t make much progress. However, values somewhat close to the default settings should have worked reasonably well.

WANTED_WORDS = "yes,no"
TRAINING_STEPS = "12000,3000"
LEARNING_RATE = "0.001,0.0001"

This assignment was mostly designed to give you experience with the full training pipeline and flow to prepare you for Course 3 where we will be training on your own custom data and deploying the model to your own hardware. Now is the time to make sure you understand the full flow well so you are in a better position to debug later when things get more complicated.

We hope you had some fun picking some words and getting to see the model learn based on your choices! We hope you also had fun trying to trick it with custom input! As always you’ll find the link to the assignment again below in case you want to explore it a bit more!

Keyword Spotting in the Big Picture

image.png

In this section, we have focused on the task of keyword spotting for tiny machine learning systems. We have seen how to develop algorithms for performing keyword spotting on a small set of keywords, and the challenges associated with developing these algorithms. We have also seen how audio can be streamed from a microphone to allow for low-power and yet online monitoring of keywords, and how this can be linked in a cascade architecture as a gateway to more complex and power-hungry operations such as natural language processing.

Keyword spotting has become increasingly popular in recent years, such as the introduction of software-based personal assistants like Siri (Apple), Cortana (Microsoft), Alexa (Amazon), and Google Assistant (Google). Similarly, smartphones utilize keyword spotting even while the CPU is not running through the use of an onboard digital signal processor, which is able to ‘wake up’ the CPU when a keyword is detected. These devices also utilize a cascade architecture, allowing the user to wake the device and subsequently ask questions which can be parsed and analyzed using natural language processing methods via an interface to the Cloud.

The prevalence of keyword spotting in industry will likely continue to increase as voice-recognition and natural language processing algorithms become increasingly accurate and powerful.

We are already beginning to see voice-enabled TV’s, alarm clocks (e.g., Hatch), lighting systems (e.g., Philips Hue), thermostats (e.g., Honeywell), and even smart vacuum cleaners (e.g., LG SmartThinQ).