Hi and welcome back.
In this section, we'll take a look at a very important topic, which is understanding how do we visualize
water filters in our convolutional networks?
So this will help you gain a better intuition and an understanding of how your CNN's actually learning
what it's learning.
And hopefully, this helps you overall in understanding the entire deep learning process.
So let's take a look at what CNN's Lynn.
Well, firstly, we know learning involves adjusting the weights and parameters that lead to the lowest
loss.
That's that much we know we've covered that before.
So let's take a look at this CNN here and look at the parameters.
These are the parameters we're learning.
So what does that mean?
What do you mean?
What do we mean by learning these these parameters?
And what do we actually learn here?
Well, let's take a look at an untrained filter.
So let's take a look at a model like this, and let's look at a little convolutional little one right
here.
Here we have 22 filters, each of which each has a size of tree by tree by one, and would have been
created by tree if it was a color.
RGV image will always remember that.
And this produces these feature maps here.
So we use these filters here.
So what are these filters look like after?
Because remember, remember, we initialize these tree budget by one filters with random values.
But after the training process is finished, can we visualize and look at these filters and see what
they learn?
And actually, yes, we can.
This is what a tributary filters what your budget filters look like.
You know when a CNN upgrade before.
So you can see these are basically what this one looks like a plus sign.
This one looks like a diagonal.
They all look like some sort of diagonal straight line like these here.
So you can immediately see some patterns and we can use a ModCloth lib to visualize these filters and
what the darker areas correspond to here that correspond to low values of zero and the lighter areas
correspond to the high values of of white.
So that's 255.
So this means here that a white or lighter areas in the filter correspond to the areas that have a higher
widths.
So these are the areas here that you can see them right here that have had got some larger widths,
which means that they will be activated when this filter aligns with something on the image and we'll
talk about that in the next section.
Let's take a look at how these filters work.
So remember what this filter does?
Remember this for this slightly slid across the image at a stride of one usually, and it produces this
this feature map right here.
Well, let's take a look at the convolution operation.
No, the convolution operation is the dot product of the input vector.
That's what we're multiplying here by the width vector.
That's what the filter is.
Now, the dot product between two vectors is proportional to the angle between two vectors between those
vectors.
So what does that mean?
Well, that means that the output that's the feature map is high when the angle between these vectors
are zero.
That means that vectors on the same direction.
This also means you can consider it as they're basically along the lines of the same portion of the
image.
That means they line up.
That means if we're looking for an edge to edge with an edge detect filter, when the edge covers the
edge in the image here it activates that filter.
That's exactly what it means.
That means when the output is high.
So these are some examples of filters that look for features in images.
This is this was a trained CNN.
And these are the filters that learn here.
So you can see it learns quite distinct patterns, and you can tell immediately that these patterns
would correspond to maybe some sort of texture or maybe some sort of like exact pattern in the image.
So you can immediately see that these filters have learned to extract features from that image.
Here's a look at some of the filters here.
These are also you can tell these look more like diagonals and stripes and stuff like that.
So.
And here are some more filters.
These look like little blobs.
These are low level filters, by the way.
You can tell because the dimensions are usually quite small, like in this case, it looks quite small.
So how do we actually visualize visualize these photos now?
It's actually quite simple.
We can obtain the width and bias of a filter.
You can increase.
It's quite easy to do.
So we'll start off with examples with cameras in this case.
So you can use get with some cameras to extract the width and bias of a trained filter.
Then we just normalized weights between zero and one.
And we use Matloff Lib to plot the weight values in 2-D, which we'll do in the next lesson.
However, actually, before we move on to the code, I'll just talk about this present.
The slides on filter activations just because the code deals with.
Them together, so instead of jumping around, it will do the two terrorist lights first.
That's the section and the section here.
Then we'll dive into the coda where we actually see the implementations of these.
So I'll see you in the next section.
Thank you.