Hi and welcome back.
So now let's take a look at the grad cam algorithm, which allows us to give a visual explanation of
what a convolutional neural network is learning.
So let's take a look at what grad camera looks like.
So the output of grad cam looks like this, which is pretty cool.
So what is it telling us?
Well, good outcome is a very useful technique that basically tells us, well, model looking.
So it uses a localized based algorithm with gradient ascent to basically highlight the portions of the
image here that basically triggered that CNN to output that specific class.
So let's take a look at some more breadcrumb.
This is from a grad can paper, which you can access here to to SeaWorld.
These are some of the basically how how the algorithm, some demonstrations of the algorithm from the
paper.
So you can see when Grad Cam was predicting that this is the areas of the image where cut was triggered,
which makes sense because these are where the features are, the eyes and the ears, especially similarly
for dogs, it was in this dog's face as well.
So you can see the density, the heat map density basically overlaid onto the image.
That's where grad cam, that's where the CNN model was focused on.
So a grad covers a very, very useful as it provides a better understanding of what our model is basically
showing areas of the image it use to make its decision.
So how exactly does Grad Cam work?
Well, basically Grad Cam exploits the spatial information that is preserved in the convolutional is
that we have a known network here.
Now what it does is it uses the feature maps produced by the last kind of conflict here.
That's the one that we highlight in this pink box.
And at this point, we can insert some differentiate double layers after that last conflict output.
So this is so we can get the gradients out afterwards.
So Ingrid, can we wait?
The feature maps using alpha values that are calculated based on the gradient.
This is used to make the heat map.
That's how we get this nice heat map image.
Here we can create one and we can create one for each class, which is quite cool.
Cool.
And then we can overlay those hip apps onto the image to get those those visualizations that we've seen
in the previous slide.
So we'll take a look at performing grad cam, as well as some various variations of grad can increase
in the could soon in the lab notebook.
Afterwards, we'll take a look at some basic CNN design principles just to kind of keep you up to date
and also solidify some of the knowledge we learned before because it could be quite overwhelming sometimes.
So this is a nice summary to basically kind of show you how how we design to see and what type of CNN,
how many layers, that sort of thing.
So I'll see you in the code lesson now and then we'll go back to the slides where we talk about CNN
design principles.
So stay tuned.
Thank you.