Reputation: 287
I understand that an input (let's say an image) is forward passed through a CNN, convoluted, and down-sampled. Then, at a fully connected layer, assigned a label given the final weights it produces. In training, an Error variable is calculated so that we can utilize gradient descent (or some other optimization function) to adjust the weights, making E approach zero.
Where do filter's get learned in this process? I don't understand how filters go from gaussian noise to lines, corners, and colors. Then I suppose these filters are explicitly written out into a file for testing, correct?
Upvotes: 2
Views: 1144
Reputation: 813
Each of the kernels learned from the CNN are the filters that creates those features (lines,corners and so on).
Let's talk about Sobel just as example, Sobel use an specific kernel to convolute the image and with this kernel we can recover the gradients of the imagen in X and Y which is used as an edge detector. But what about if that features (lines) are not the only think that we would like to recover or it is not the ideal feature for our specific problem. Therefore, we can learn those kernels and create different images.
This images created from the kernels are called Features Maps and can be visualised with different techniques, I really recommend to watch that video since you can better understand what are the features that CNN is learning and take a look of this course.
Well one way to learn this filters is giving that you know what is the expected output. You can convolute the image with random values (the first values in the filters/weights) and then learn those values until get something that is better to predict your training set, therefore, instead of using the typical sobel you are learning what is the best kernel/filter to recover the features that better represent your image.
So, those filters are finally the weights of the network that you just learn.
Upvotes: 1