‫In this lecture, we will understand the concept of a filter.
‫We have been saying till now that a cell in the Convolutional layer gets information from a set of pictures
‫cells or a set of cells in the previous layer, for example, that red cell in the Convolutional layer
‫is getting information from these nine cells and this red rectangle.
‫But what does this mean?
‫How is it getting the information from all these pixels?
‫We have 25 pixels here.
‫And our cell here can have only one value, which should be the representative value for these 25 pixels.
‫So we need to find a way to convert these 25 values of pixels into one value.
‫This is done by using a filter. Filter is a matrix of same dimensions as our window of receptive field.
‫So if the window is five cross five.
‫Filter is also of dimension five
‫Cross five.
‫If it is of three cross three, filter will also be of three cross three dimensions.
‫No, we have a window of five into five pixels containing pixel value and we have a five in two five
‫matrix containing some values.
‫We multiply each pixel value with the corresponding filter value.
‫And add all of these products up.
‫So the pixel value here.
‫Will be multiplied with zero point four the next pixel value will be multiplied with zero point three.
‫And so on.
‫And all these products will be added up
‫This will give us one number.
‫And this number will represent information in these 25 pixels.
‫Now the question comes, how do we decide the values in this filter ?
‫The answer to this is very pleasing.
‫We do not have to decide these values.
‫Our network will learn these values also.
‫So when we are training our model, these values will be self learnt.
‫Now to demonstrate how filters work and how they are able to extract certain features out.
‫I have taken a five into five input image.
‫With zero one type pixel values and a three by three filter.
‫Look at this filter.
‫This filter looks like a cross.
‫That is the diagonal values are one and the other are 0.
‫If we use this filter with a stride of one, we get this output.
‫The gif below shows you how we get this output.
‫How the filter values are multiplied and their product values are added up to get the first value.
‫Then the next value and then the next and so on.
‫This final output, which we get after applying the filter is called a feature map.
‫A feature map, because each filter highlights some feature of the input image, the images on the
‫right are demonstrating how particular features are highlighted by filters.
‫For example, if we use a vertical filter, that is the middle column of this matrix is one one one,
‫and these side columns are zero zero zero.
‫This type of filter transforms the image to this image.
‫Notice that vertical white lines are enhanced and the rest of the image is blurred.
‫Similarly, if we use the horizontal filter.
‫That is this middle row will be one one, one.
‫And top and bottom row will consist of zeros.
‫If we use such horizontal filter.
‫We set this image.
‫You can notice that horizontal white lines are highlighted and rest is blurred.
‫This is what a filter does.
‫A filter is a set of values which transforms the window by doing sum of products.
‫What we get after applying a filter is called a feature map, each feature map has some particular
‫feature highlighted.
‫So what we will do is we will use many types of filter.
‫So that each filter creates different feature maps containing different features.
‫This means our convolutional live is going to be a bundle of feature maps.
‫And each feature map has some particular highlighted feature.
‫Important thing to notice here is what happens in the next layer.
‫So this cell.
‫In the first feature map of Convolutional layer 2.
‫What does this see.
‫Is it only this rectangle on the first feature map of previous layer
‫Or this rectangle on all feature maps in the previous layer
‫The answer is that each cell on Convolutional layer two will be getting information of all the feature
‫maps in the previous layer.
‫Because only then can these cells combine the different features to find more high level features.
‫I'll summarize again for clarity.
‫We apply a filter on the previous layer of data to extract features.
‫The output after applying filter is called a feature map.
‫We apply many different types of filters to extract many different types of features.
‫This gives us a bundle of feature maps.
‫The first bundle of feature maps is called Convolutional layer One.
‫Convolutional layer 2 works on these extracted features.
‫To extract even higher level of features.
‫Next, we are going to discuss about the input layer.
‫Input layer also has multiple layers of information.
‫These layers are called channels.
‫We talk about channels in the next video.