Hello.
Welcome back.
In this lesson we shall talk about putting in why it is important when applying the convolution operation.
There are two things we must keep in mind every time we apply convolution operation the size of the
image shrinks.
Also the pixels at the corner of the image are used only a few number of times during the convolution
as compared to those in the central part of the image.
And this effect may lead to loss of information.
For instance when we convert of an input of six by six dimension with a three by three filter the result
is a four by four outputs image and we use this equation up here to determine that this is the equation
for determining the size of the output image given and as the as there with 0 height of the input image
in F as the width or height of the filter right.
So to overcome this sort of shrink in effect we can part of the image with additional border meaning
we add one pixel all around the edges of the pattern 0 6 by six image with an additional border the
input image becomes eight by eight.
Applying convolution of three by three on it will result in a six by six matrix which is the original
shape of the image.
We often denote pardon we did let up P.
There are two types of pattern often applied.
We have what is called valid pattern and we also have what is called Same pattern valid pattern means
no pattern.
If we are using valid part in the size of the output will be and minus one plus one by N minus.
If we are using valid pattern the size of the output will be and minus f plus one by and minus f plus
1.
And we know n is the image height or with because it's a square often the height and with the same N
and F is equally the height and width of the filter.
So when we use valid pardon this is what happens.
Valid pattern means no pattern and same pattern means we should apply a pattern so that the output size
is the same as the output size.
When we apply same pattern the size of the output image becomes two plus P minus f plus one by one we'll
use and I should repeat that one will use the same pattern the size of the output image becomes and
plus two p minus f plus one by and plus two p minus f plus one where p is the pattern of course and
F is the filter size and n is the inputs.
Image size.
This equation over here is used to derive the amount of padding required to keep the output image equal
to the inputs.
Image p equals F minus one divided by two.
That's an example of I here given through by three filter over here.
Find a pattern required to keep input image size and output image size the same.
We simply take F which is three we do three minus one divided by two we need a pattern of one and when
we apply a pattern of one with is three by three filter whatever the size of the input image the output
image is going to have the same size.
This animation over here shows a five by five by one input image padded with zeros which P equals one
to create a six by six by one image.
This is an example of same pattern in this arrangement.
The blue square represents the input image the dash lines represent the pattern and the green square
represents the output image.
This is all the rest for this lesson and in the next less than we should talk about stride in.
I'll see you later.