Doubt in filter recognition

There was a question in quiz1. A filter matrix was given and it was asked to figure out what features (eg. vertical edges, horizontal edges, 45 degree edges, etc) can this filter detect. So, how should we approach this question? By looking at the numbers in the filter matrix, how can figure out its purpose?

Which week of Course 4 are you referring to?

I am referring to quiz of week1.

Either in your head, on paper, or in Python, execute a convolution of the given filter (aka kernel) with a few simple inputs with different characteristics. Examine the output. How could you generalize the transformation? That is, did it magnify differences in neighboring pixels? Reduce them?

Vary the inputs characteristics. Eg some are uniform, some have a vertical ‘edge’, some have horizontal ‘edge’ etc. Let us know what you discover?

This is a decent introductory read on applying small 2D kernels to images… Feature Detectors - Sobel Edge Detector

Prof Ng walks through an example like this in great detail in the lecture entitled (… wait for it …) “Edge Detection Example”. If you follow that, it will give you the understanding necessary to apply that same logic to the quiz question. This probably means that you need to watch it again. Or just watch it as the case may be :nerd_face:

The other point worth making here is that this type of “hand-coded” filter is pretty “old school”. That’s not really the way things work these days, but he’s just using this example to give you intuition about how convolutions work and why they are useful. Once we get past this, we just randomly initialize the filters and let back propagation learn the types of detection that it needs to satisfy whatever the problem is at hand.

Thanks for the help!