1
00:00:01,140 --> 00:00:01,460
Hello.

2
00:00:01,470 --> 00:00:02,270
Welcome back.

3
00:00:02,280 --> 00:00:09,540
In this lesson we shall talk about putting in why it is important when applying the convolution operation.

4
00:00:09,540 --> 00:00:17,130
There are two things we must keep in mind every time we apply convolution operation the size of the

5
00:00:17,130 --> 00:00:19,210
image shrinks.

6
00:00:19,210 --> 00:00:27,540
Also the pixels at the corner of the image are used only a few number of times during the convolution

7
00:00:27,950 --> 00:00:32,050
as compared to those in the central part of the image.

8
00:00:32,130 --> 00:00:36,270
And this effect may lead to loss of information.

9
00:00:36,270 --> 00:00:46,710
For instance when we convert of an input of six by six dimension with a three by three filter the result

10
00:00:46,830 --> 00:00:53,610
is a four by four outputs image and we use this equation up here to determine that this is the equation

11
00:00:53,610 --> 00:01:04,860
for determining the size of the output image given and as the as there with 0 height of the input image

12
00:01:04,890 --> 00:01:10,570
in F as the width or height of the filter right.

13
00:01:10,920 --> 00:01:18,090
So to overcome this sort of shrink in effect we can part of the image with additional border meaning

14
00:01:18,090 --> 00:01:27,390
we add one pixel all around the edges of the pattern 0 6 by six image with an additional border the

15
00:01:27,450 --> 00:01:29,970
input image becomes eight by eight.

16
00:01:30,210 --> 00:01:37,620
Applying convolution of three by three on it will result in a six by six matrix which is the original

17
00:01:37,620 --> 00:01:39,530
shape of the image.

18
00:01:39,690 --> 00:01:43,090
We often denote pardon we did let up P.

19
00:01:43,390 --> 00:01:46,760
There are two types of pattern often applied.

20
00:01:46,800 --> 00:01:54,600
We have what is called valid pattern and we also have what is called Same pattern valid pattern means

21
00:01:54,720 --> 00:01:56,280
no pattern.

22
00:01:56,280 --> 00:02:04,980
If we are using valid part in the size of the output will be and minus one plus one by N minus.

23
00:02:04,980 --> 00:02:12,360
If we are using valid pattern the size of the output will be and minus f plus one by and minus f plus

24
00:02:12,360 --> 00:02:12,600
1.

25
00:02:12,600 --> 00:02:19,680
And we know n is the image height or with because it's a square often the height and with the same N

26
00:02:19,980 --> 00:02:24,210
and F is equally the height and width of the filter.

27
00:02:24,540 --> 00:02:27,300
So when we use valid pardon this is what happens.

28
00:02:27,300 --> 00:02:34,740
Valid pattern means no pattern and same pattern means we should apply a pattern so that the output size

29
00:02:35,130 --> 00:02:37,740
is the same as the output size.

30
00:02:37,740 --> 00:02:46,720
When we apply same pattern the size of the output image becomes two plus P minus f plus one by one we'll

31
00:02:46,730 --> 00:02:53,430
use and I should repeat that one will use the same pattern the size of the output image becomes and

32
00:02:53,460 --> 00:03:04,560
plus two p minus f plus one by and plus two p minus f plus one where p is the pattern of course and

33
00:03:04,590 --> 00:03:08,380
F is the filter size and n is the inputs.

34
00:03:08,400 --> 00:03:09,240
Image size.

35
00:03:10,800 --> 00:03:18,480
This equation over here is used to derive the amount of padding required to keep the output image equal

36
00:03:18,480 --> 00:03:19,230
to the inputs.

37
00:03:19,230 --> 00:03:24,350
Image p equals F minus one divided by two.

38
00:03:24,360 --> 00:03:28,570
That's an example of I here given through by three filter over here.

39
00:03:28,650 --> 00:03:34,950
Find a pattern required to keep input image size and output image size the same.

40
00:03:34,950 --> 00:03:42,060
We simply take F which is three we do three minus one divided by two we need a pattern of one and when

41
00:03:42,060 --> 00:03:48,240
we apply a pattern of one with is three by three filter whatever the size of the input image the output

42
00:03:48,330 --> 00:03:51,300
image is going to have the same size.

43
00:03:51,360 --> 00:04:00,000
This animation over here shows a five by five by one input image padded with zeros which P equals one

44
00:04:00,420 --> 00:04:03,830
to create a six by six by one image.

45
00:04:03,840 --> 00:04:08,040
This is an example of same pattern in this arrangement.

46
00:04:08,040 --> 00:04:14,700
The blue square represents the input image the dash lines represent the pattern and the green square

47
00:04:14,700 --> 00:04:18,070
represents the output image.

48
00:04:18,120 --> 00:04:23,100
This is all the rest for this lesson and in the next less than we should talk about stride in.

49
00:04:23,160 --> 00:04:24,050
I'll see you later.
