1
00:00:00,450 --> 00:00:01,680
Hi and welcome back.

2
00:00:02,040 --> 00:00:08,250
In this section, we'll take a look at a very important topic, which is understanding how do we visualize

3
00:00:08,250 --> 00:00:10,710
water filters in our convolutional networks?

4
00:00:11,640 --> 00:00:17,670
So this will help you gain a better intuition and an understanding of how your CNN's actually learning

5
00:00:17,670 --> 00:00:18,630
what it's learning.

6
00:00:18,960 --> 00:00:23,400
And hopefully, this helps you overall in understanding the entire deep learning process.

7
00:00:24,270 --> 00:00:26,400
So let's take a look at what CNN's Lynn.

8
00:00:26,520 --> 00:00:31,500
Well, firstly, we know learning involves adjusting the weights and parameters that lead to the lowest

9
00:00:31,500 --> 00:00:31,920
loss.

10
00:00:32,310 --> 00:00:34,530
That's that much we know we've covered that before.

11
00:00:35,250 --> 00:00:39,450
So let's take a look at this CNN here and look at the parameters.

12
00:00:39,660 --> 00:00:41,280
These are the parameters we're learning.

13
00:00:41,850 --> 00:00:43,740
So what does that mean?

14
00:00:44,040 --> 00:00:44,630
What do you mean?

15
00:00:44,640 --> 00:00:46,680
What do we mean by learning these these parameters?

16
00:00:46,680 --> 00:00:48,300
And what do we actually learn here?

17
00:00:48,900 --> 00:00:52,410
Well, let's take a look at an untrained filter.

18
00:00:52,710 --> 00:00:58,200
So let's take a look at a model like this, and let's look at a little convolutional little one right

19
00:00:58,200 --> 00:00:58,530
here.

20
00:00:59,100 --> 00:01:05,640
Here we have 22 filters, each of which each has a size of tree by tree by one, and would have been

21
00:01:05,640 --> 00:01:07,350
created by tree if it was a color.

22
00:01:07,350 --> 00:01:09,300
RGV image will always remember that.

23
00:01:09,930 --> 00:01:12,060
And this produces these feature maps here.

24
00:01:12,330 --> 00:01:13,710
So we use these filters here.

25
00:01:14,190 --> 00:01:17,410
So what are these filters look like after?

26
00:01:17,460 --> 00:01:23,700
Because remember, remember, we initialize these tree budget by one filters with random values.

27
00:01:24,090 --> 00:01:30,210
But after the training process is finished, can we visualize and look at these filters and see what

28
00:01:30,210 --> 00:01:30,540
they learn?

29
00:01:30,660 --> 00:01:32,130
And actually, yes, we can.

30
00:01:33,060 --> 00:01:36,510
This is what a tributary filters what your budget filters look like.

31
00:01:36,510 --> 00:01:39,300
You know when a CNN upgrade before.

32
00:01:40,080 --> 00:01:43,230
So you can see these are basically what this one looks like a plus sign.

33
00:01:43,230 --> 00:01:44,670
This one looks like a diagonal.

34
00:01:45,030 --> 00:01:48,360
They all look like some sort of diagonal straight line like these here.

35
00:01:48,930 --> 00:01:55,440
So you can immediately see some patterns and we can use a ModCloth lib to visualize these filters and

36
00:01:55,440 --> 00:02:01,200
what the darker areas correspond to here that correspond to low values of zero and the lighter areas

37
00:02:01,200 --> 00:02:03,750
correspond to the high values of of white.

38
00:02:04,050 --> 00:02:05,130
So that's 255.

39
00:02:06,180 --> 00:02:12,210
So this means here that a white or lighter areas in the filter correspond to the areas that have a higher

40
00:02:12,210 --> 00:02:12,660
widths.

41
00:02:13,020 --> 00:02:19,590
So these are the areas here that you can see them right here that have had got some larger widths,

42
00:02:19,590 --> 00:02:25,170
which means that they will be activated when this filter aligns with something on the image and we'll

43
00:02:25,170 --> 00:02:27,300
talk about that in the next section.

44
00:02:27,510 --> 00:02:29,580
Let's take a look at how these filters work.

45
00:02:30,270 --> 00:02:31,980
So remember what this filter does?

46
00:02:31,980 --> 00:02:39,030
Remember this for this slightly slid across the image at a stride of one usually, and it produces this

47
00:02:39,120 --> 00:02:40,380
this feature map right here.

48
00:02:41,340 --> 00:02:44,130
Well, let's take a look at the convolution operation.

49
00:02:44,160 --> 00:02:48,450
No, the convolution operation is the dot product of the input vector.

50
00:02:48,750 --> 00:02:51,960
That's what we're multiplying here by the width vector.

51
00:02:51,990 --> 00:02:53,370
That's what the filter is.

52
00:02:54,270 --> 00:03:00,450
Now, the dot product between two vectors is proportional to the angle between two vectors between those

53
00:03:00,450 --> 00:03:00,930
vectors.

54
00:03:01,260 --> 00:03:02,280
So what does that mean?

55
00:03:02,340 --> 00:03:08,160
Well, that means that the output that's the feature map is high when the angle between these vectors

56
00:03:08,160 --> 00:03:08,640
are zero.

57
00:03:09,180 --> 00:03:11,220
That means that vectors on the same direction.

58
00:03:11,580 --> 00:03:18,060
This also means you can consider it as they're basically along the lines of the same portion of the

59
00:03:18,060 --> 00:03:18,340
image.

60
00:03:18,360 --> 00:03:19,350
That means they line up.

61
00:03:19,770 --> 00:03:25,980
That means if we're looking for an edge to edge with an edge detect filter, when the edge covers the

62
00:03:25,980 --> 00:03:28,890
edge in the image here it activates that filter.

63
00:03:28,950 --> 00:03:30,250
That's exactly what it means.

64
00:03:30,270 --> 00:03:31,620
That means when the output is high.

65
00:03:32,370 --> 00:03:36,720
So these are some examples of filters that look for features in images.

66
00:03:37,290 --> 00:03:39,180
This is this was a trained CNN.

67
00:03:39,630 --> 00:03:41,280
And these are the filters that learn here.

68
00:03:41,490 --> 00:03:46,770
So you can see it learns quite distinct patterns, and you can tell immediately that these patterns

69
00:03:46,770 --> 00:03:53,820
would correspond to maybe some sort of texture or maybe some sort of like exact pattern in the image.

70
00:03:54,240 --> 00:04:00,120
So you can immediately see that these filters have learned to extract features from that image.

71
00:04:00,360 --> 00:04:02,220
Here's a look at some of the filters here.

72
00:04:02,820 --> 00:04:07,650
These are also you can tell these look more like diagonals and stripes and stuff like that.

73
00:04:07,680 --> 00:04:08,130
So.

74
00:04:08,640 --> 00:04:10,040
And here are some more filters.

75
00:04:10,050 --> 00:04:11,430
These look like little blobs.

76
00:04:12,390 --> 00:04:14,220
These are low level filters, by the way.

77
00:04:14,220 --> 00:04:19,230
You can tell because the dimensions are usually quite small, like in this case, it looks quite small.

78
00:04:19,920 --> 00:04:24,240
So how do we actually visualize visualize these photos now?

79
00:04:24,780 --> 00:04:25,830
It's actually quite simple.

80
00:04:26,250 --> 00:04:29,010
We can obtain the width and bias of a filter.

81
00:04:29,400 --> 00:04:30,270
You can increase.

82
00:04:30,270 --> 00:04:31,650
It's quite easy to do.

83
00:04:32,040 --> 00:04:35,290
So we'll start off with examples with cameras in this case.

84
00:04:35,610 --> 00:04:40,350
So you can use get with some cameras to extract the width and bias of a trained filter.

85
00:04:40,950 --> 00:04:43,410
Then we just normalized weights between zero and one.

86
00:04:43,980 --> 00:04:49,680
And we use Matloff Lib to plot the weight values in 2-D, which we'll do in the next lesson.

87
00:04:50,460 --> 00:04:54,990
However, actually, before we move on to the code, I'll just talk about this present.

88
00:04:55,320 --> 00:04:59,220
The slides on filter activations just because the code deals with.

89
00:04:59,840 --> 00:05:04,880
Them together, so instead of jumping around, it will do the two terrorist lights first.

90
00:05:05,030 --> 00:05:07,610
That's the section and the section here.

91
00:05:07,970 --> 00:05:11,930
Then we'll dive into the coda where we actually see the implementations of these.

92
00:05:12,560 --> 00:05:14,190
So I'll see you in the next section.

93
00:05:14,300 --> 00:05:14,750
Thank you.
