Will now discuss on Lesson five, Project two, still on justifying hand gestures with accelerometer.
But for this lesson, we'll be specifying on model training and development in the last lesson.
We briefly used the spectral analysis of lock to process data for this time.
We will use it more.
Slice your data those smaller windows and apply Buttonwood filters first for your joints, forms and
other tools for spectral analysis of each one.
Now here, each window of each data access is transformed and Barbara edges are calculated on each one.
This gives the following features.
Now for values after Butterworth filter, normally depending on the filter type of light from low base
or high pass, it's more than the signal.
For big in frequency domain here, you can specify the number of peaks.
Here you can see on the illustration.
Now these are the most prominent frequencies in that window of data.
And then we have spectral power of peaks here.
This is the amplitude of frequency at the peaks.
Like how powerful is the signal?
The spectral analysis is actually best for data that has a lot of things that happen at the same time.
The accelerometer motion are, to some extent, the audio signal, vibration and so on.
It doesn't work well with data that doesn't have any repeating elements, which is why it didn't work
well for data in the previous project.
So in preparation, we need to make sure you're using our doing not I.D. that has greater done 1.9 version,
set up the training you need and then start to think about what you want to do next.
Take the raw data and slice it into smaller windows.
Use signal processing blocks to find features and then use a learning block to classify new data.
There are signal processing and learning blocks.
Signal processing blocks always return the same values for the same input, and somehow they are used
to make raw data easier to process.
Learning blocks learn from their past experiences, and then signal processing, called spectral analysis,
will be used in this lesson.
Now this block filters the signal before spectral analysis on it, and it also gets the frequency and
spectral power from data from it.
Then we'll use a neural network in learning block that takes the spectral features and learns to distinguish
between the three, the idle, the shake, the and with classes.
Now, to make an impulse, go to the studio and click on Create Impulse, then set the window size to
two thousand and window to eight and add the spectral analysis and kuras blocks to save the impulse.
Click the save impulse button.
On this slide, you would see the times to use data where you can adjust the window size and spectral
analysis, where you can input spectral features such as axis and the neural network areas where you
can input classifiers or more special features.
And then you would see the output features now to configure your signal processing block.
Click on these spectral features in the menu on the left side.
Now this will show you the raw data on top of the screen.
You can select other files via the dropdown menu and the results of the signal processing through drops
on the right now.
For the Spectral Features Block, you'll see the following groups after filter the signal after applying
a low pass filter.
This will remove noise frequency domain, the frequency at which signal is repeating.
Example making one wave movement per second will show one peak at one hertz.
Then also, we have spectral power, the amount of power that went into the signal at each frequency.
A good signal processing block will yield similar results for similar data.
If you move the sliding window on the raw data, drop around the drops should remain similar.
Also, when you switch to another file with the same label, you should see similar drops.
Even if the orientation of the device was different on this line, you would see these raw features.
This is actually you one window of data before processing.
And then after processing, you would see the process features.
Now here are the process features data you would see on this slide.
And then once you're happy with the result, you can now click See Parameters.
This will send you to the Future Generation scheme.
In here, you'll be able to split all the raw data up in windows based on the window size and the window
increase, and then you'll be able to apply the spectral features block on all of this windows.
So first, generate features to start the process.
Then right after that, the feature explorer will open up.
Now this is actually a drop of all the features that were found against all the windows that were made.
People who compare all of their data with this drop will see how well they did, for example, by blocking
the height of the first speak on the x axis against the spectral power between 0.5 hertz and one hertz
on the y axis.
So basically, as a general rule, if you can separate the data on the number of axis, then the machine
learning model will be able to do the same thing as well.
So with all the data process, it's time to start training.
A neural network in neural networks are a group of algorithms that aren't very different from the human
brain.
They are somehow designed to recognize patterns.
And in this case, we're going to train a network that will take the signal processing data as an input
and try to figure out which of these three classes it fits into.
So the question is, how does a neural network figure out what to do next?
A neural network is made up of layers of neurons that are all connected.
Each connection has a weak.
You need to know that one such neuron in the input layer would be the height of the first peak of the
x axis from the signal processing block.
And when you set up a neural network, all of these connections are set up at random.
This means that the neural network will make random predictions.
Take all the real data during training.
We ask the network to make a prediction, and if it doesn't work out, we make small changes to week.
Now, in this way, after a lot of trials, the neural network will learn and it will become a better
at predicting new data in the long run.
Now click on the end in Classifier in the middle to see how this works and then set the number of training
cycles to one.
This will only allow for one round of training, and as soon as you're done, click the Start training
button.
On this slide, you would see your last training performance, the level of your accuracy, your loss
and the classes.
Also, you would be able to see the on device performance, your inference time, your memory usage
and your model binary size.
No change in the number of training cycles to two, and you'll see performance will go up.
Then finally change the number of training cycles to 100 or more and let training finish be just doing
your first neural network.
Now, it's important to take note that you might end up with the 100 percent accuracy after training
for 100 training cycles.
This is not necessarily a good thing, as it might be a sign that the neural network is too tuned for
the specific test set and might performed poorly on new data, which is overfitting now.
The best way to reduce this is by adding more data now adding jump out block or reducing the learning
rate.
With the impulse design train and improving the work, you can put this model back on your device when
the model runs without an internet connection.
Latency is kept to a minimum in power.
Consumption is kept to a minimum, and this makes it run.
After you click on deployment, Bob, just the adrenal library and downloaded removed the archive and
put it in your adrenal library folder.
Open the Arduino IDE and choose examples, then choose the name of your project in surgery and she must
then choose Nanobody 33 cents accelerometer sketch, which is the one for your project.
Now, it looks like the adrenal nano DL 33 cents, but it has a different accelerometer, which is the
Alliés 3D HDR stand off Alice M9.
The S1 so will need to change the data acquisition section to make it work with our board because View
Terminal has an LCD screen with showed the name of a class that was found.
If this class confidence value is above a certain level, then change initialization instead of function
due the data collection and inference within loop function.
Here, you can see, is where we need to change data acquisition with A. m9 S1 data acquisition function
for Ellie S3, the HDR, and then to display that last name on the LCD screen after you need to do it
like this.
Now, add the following code block in which we check confidence values of every class, and if one of
them is higher than the threshold, change the color of the screen and display the classic theme, then
compile and upload, open the serial monitor and perform one of the gestures.
You will be able to see the inference results displayed on the serial monitor and also on the LCD screen.
Here you can see an actual photo or illustration on the code gestures that we have used earlier.
Another illustration on how we use the code.
So basically, we need to retrieve model for another gestures.