If you have worked machine learning to classify sounds or images, you know selecting right neural network architecture can often be very daunting. You need to follow a trial and error method in order to find the most optimal architecture for your use case.
In one of my recent projects, I was classifying birds by analyzing bird chirps. I had collected around 12 minutes of audio data of three different birds and different background noises.
I used Mel Frequency Cepstral Coefficients (MFCC) as my signal processing block and Keras as my learning block. MFCC is great for extracting features from human voices, though may not be great for other sounds such as bird chirps.
So, using MFCC and above NN architecture, I trained my model for 100 epochs with a learning rate of 0.005 and a confidence rating of 0.7, achieving a model accuracy of around 93%. This is a good start but not a performance you would like to deploy on your embedded device.
It’s time to try out other signal processing blocks like MFE and a different NN architecture such as a 2D CNN, adding few more layers. As you realize, it’s pure experimentation and you need to perform to achieve most optimal NN architecture to classify bird chirps.
How about you offload this experiment to someone else while you focus on your application? Edge Impulse has introduced the EON Tuner, which does exactly that. With the EON Tuner, you can effortlessly find the most optimal architecture for your embedded machine learning application!
Edge Impulse enables EON Tuner by default for you. You will notice “EON Tuner” in the menu.
Click on the menu item, head over to the page, and configure your EON tuner.
Dataset category = Audible events
Target device = Cortex-M7 (I am deploying to Raspberry Pi 4, so Cortex-M7 is the closest.)
Time per inference = DSP + NN time on the target device
After you configure your EON tuner, click on the “Start EON Tuner” button. Edge Impulse will create different model with different NN architecture and provide the result to you. This process may take several hours, so keep patience.
Once the process is finished, I was presented with 30 different NN architectures with accuracy scores.
Let’s look at two NN architectures based on the spectrogram processing block. You can see the details of the architecture and layers. The first is almost similar to one I started with two 1D conv layers and single dropout layer of 25%. The other with four 1D conv layers and single dropout layer of 50%. I decided to pick the first one with highest accuracy. Simply click on “Select” button and confirm your selection when prompted.
You will immediately notice that the impulse design is updated based on your selection. Head over to the NN tab to view the details.
Architecture will be read only. If you wish to change, click the link to clone the block and edit.
Once you are done training your model and satisfied with accuracy, head back to your phone (assuming you are deploying to your phone first) and switch to classification mode.
Once model is deployed on your mobile phone, you can see live classification right on your phone!





Comments