Lesson seven Project St. Augustine recognition with microphones specifically for model training and
development, convolutional layers are the main parts of convolutional neural networks.
They are used to build the networks.
A convolution is the simple act of applying a filter to an input that results in activation, which
is called convolutional repeated use of the same filter results in a map activation called a feature
map, which shows the location and strength of a detected feature in an input such as sequence of data
or the one d an image, the two D or Point Cloud the 3D.
This map is called a feature map.
Three.
The people who use convolutional neural networks see that they can automatically learn a lot of filters
in a short time that are specific to weight training data and a specific predictive model problem,
like predicting which image belong to which people.
The result is a set of very specific features that can be found anywhere in the input data.
Now, using a C and can help you find simple patterns in your data, which can then be used to make
more complex patterns in the higher layers of your data.
A one designed and is very useful when you want to find interesting features in these short term fixed
length.
Part of the overall dataset and the location of the feature in the segment isn't very important now
for preparation for expansion task.
Make sure that we are terminal facilities, wife aware and Wi-Fi libraries.
You can check it by uploading the following code and then open serial monitoring, and you should see
a female version displayed as output on the screen.
If there is no output installed, the latest Wi-Fi library.
Step one Open Arduino ID and then click Sketch Locate include library and then look at manage libraries.
Step two The name of the library that we need and select the latest version from the dropdown menu if
available.
Then lastly, you can now click Install.
Also, you need to make sure you have installed the following libraries.
You can search for these libraries by typing the library name in the search box of Arduino Library Manager.
We have seen Arduino RBC Wi-Fi.
We have seen Arduino, RBC Unified.
We have seen it.
Do we know anybody else?
We have seen Arduino FC.
We also have seen the Arduino SFE with the now among the processing blocks.
We see three familiar options, namely raw spectral analysis, which is essentially for your transfer
of the signal spectrogram and MFP, or known as the Mel Frequency Energy Backs, which correspond to
four stages of audio processing.
We described earlier for this part try all of them if you like trying new things.
The only one that might be too much for our small neural network is wrong, which has a lot of data
for us to handle.
For this lesson, we'll just use the NFC or the Mel Frequency Energy bands, which aren't the best choice
for this task.
It is time to go to the Classifier tab and choose a modal architecture that fits your needs.
We can use the one deep cons or the two con.
It doesn't matter which one you choose, because both will work if possible.
We should always go with the smaller model because we'll be using it on embedded device.
It took us a long time to write the materials for discourse, so we did four different experiments.
They were one second or the 2D gone with NFC or MST features, and the results are shown in this table.
And for us, the best model was one they called network with MFI processing block by tweaking MFP parameters,
namely the increasing straight to zero point zero two and decreasing low frequency to zero.
We have achieved accuracy of eighty nine point four percent on validation data set.
You can find a trained model in the course materials and try it out for yourself to see how well it
works.
It is good at separating crying sounds from the background, but its ability to detect totting sounds
isn't very good.
It might need to get more samples, actually, as soon as we've made a model that's accurate enough
to train on.
We can test it in a new data.
The labs classification and then send it to the real terminal now in the adrenal libraries will download
it as an adrenal library, put it into adrenal library folder and open examples.
The name of your project and then locate the Nano three dialysis microphone continuous to see how it
works.
Now, based on the adrenal Nano 33 B Elite and the EDM library for Real Terminal, we will use the DMA
or direct memory access to get samples from the ADC or the analog to digital converter and then send
them to the inference buffer with the help of the MCU.
In that way, we can get the sound samples and figure out what they mean at the same time when we want
to move sound data from the PD and library to DME.
We need to make a lot of changes.
If you get a little lost during the expedition, check out the full sample code, which you can find
in the course materials.
Don't delete the PDM library from sketch.
Add the main descriptor structure and other settings consent right after losing to the statement.
Then, right before a set of function, create variables for buffer arrays, volatile variables for
passing the values between ESR callback and the main code, and also high pass Butterworth's filter,
which we will apply to signal to eliminate most of the DC component in microphone signal.
Now, make sure to add three blocks of code after that first one is called callback function called
by ESR or the interrupt service routine.
Every time one of the two buffers field inside the function, we read the elements from recording buffer.
The one that was field just now processed them and put it into an inference buffer.
Next block contains the ESR itself.
It is executed by a timer at a certain period of time.
Inside of that function, we check if the DMA see Channel one has been suspended, if it has been suspended.
It means that one of the buffers for microphone data has failed, and we need to copy the data from
it.
Switch to another buffer and restart the DMA.
See ADC.
The next block contains configuration data for ADC, Demasi and timer controlling EOS R or interrupt
service routine.
So basically on this slide, you will see the data set for the ADC, the MACIE, as well as the timer
for the Izaak.
Now add the debug condition on top of the setup function, just like this now in the setup function.
After the run on the classifier underscore in it with open and closed parenthesis.
Add the following code that creates inference buffers, configures DMA and start the recording by setting
volatile global variable recording to one, then right after that, delete the PDMP dot and opening
close parenthesis and free sample buffer microphone underscore, inference, underscore and void opening
doors, parentheses function and also microphone inference start.
You are entitled to underscore D and underscore samples be the same underscore data underscore underscore
inference on this group called that void functions since we are not using them.
After compiling and uploading the code open to serial monitor and you will see probabilities for every
class is printed out.
Play some sounds or scoff at real terminal to check the accuracy.
If you're having difficulties on listening to my voice instructions.
You may refer the illustration on the side of this line.
So since we are terminal cannot connect to the internet, we can take these samples demo and make it
into a real iottie application with the Blink, Blink is a platform that lets you quickly build interfaces
for controlling and monitoring your hardware projects from your iOS and Android devices.
You can do this quickly with Blink.
In this case, we will use Blink to push notifications to our smartphone if we are terminal detects
any sounds we should worry about.
Now get the app set up an account and start a new project to get started with Blink.
When you're finished, click the play button.
Then that's your setup by compiling and uploading simple and push button.
For example, make sure you change Wi-Fi Assist, ID password and your Blink API token, which you can
get it in the app.
And if the code compiles the test is successful, pressing the left button on your terminal causes a
push notification to appear on your phone.
Then you can move to the next stage.
On this part, we are going to move all the neural network inference code in a separate function and
call it in the loop open and just parenthesis function right after doubling that run open and close
parenthesis.
Similar to what we did before, we checked the neural network prediction probabilities.
And if they are higher than the threshold for a certain class, we call link that notify open and close
parenthesis function, which, as you might have guessed, pushes the notification to your mobile device.