Cleaning the SpeechCommand dataset
The Tensorflow Simple Audio Recognition tutorial is a great way to get started with machine learning. It uses the Speech Command Dataset to detect spoken occurrences of different keywords. With an accuracy of 85 to 90%, it’s pretty good but I want to take it a step further. The first step was to use a different model. The Honk project already tested some and the Res8 model was both small and performant. The second step was to use the updated version of the Speech Command Dataset. This boosted the recognition rate to 93%. After utilizing these low hanging fruits I ran across a wall. The model just wouldn’t improve.
Time to take a closer look at the dataset. With over 100k files I could just pick some samples to manually review. At first glance, it looked good. But then I ran the model to spit out the audio files which were miss-classified. This time the result was different. The yield was just a couple hundred files. This time more of half of the files were silence or wrong words and cutoff samples. I removed them and rerun the model. I inserted the manually review correct files with a prefix back to the dataset. The prefix was used so that I wouldn’t have to review them again.
The new model still spits out new false classifications. Upon reviewing them the silent files and wrong files were mostly but not completely gone. What was left were more cutoff files. I guess these were classified correctly by chance. Like files “on” and “off” where just the “o” was audible have roughly a 50% chance to get classified correctly. The other reason could be that the old model learned to recognize word parts as correct labels. For the keyword, “Sheila” “She” was also classified as a valid sample. This is very bad because it doesn’t show up in the dev error and leads to unexpected detections in production.
After a few iterations, the errors got less and less so I could be confident most of the errors are gone. This procedure took significantly less time than manually reviewing all the data. It’s also a starting point for a method which makes eliminates manually reviewing files at all.
Here is the clean dataset with a folder which contains the bad files. Of the 110k files, 3500 were removed which represent about 3% of the files. The new dataset gave me a recognition rate of 95.5% and with some tuning of the learning rate I was able to finally get 97.3%. One last trick was to increase the background noise during training, which got me to 97.6%.
At this point, the misclassified keywords are hard to interpret even for a human closely listening with headphones.