Week # must be added in the tags option of the post.
Link to the classroom item you are referring to:
Description (include relevant info but please do not post solution code or your entire notebook)
Hello, I have a general question about Neural network frameworks, and it’s more about actually understanding and visualizing what happens when the algorithm breaks down and learns using the data.
I was watching the video “What are deep ConvNets learning?” It got me thinking: If we were to create a brand new algorithm from scratch, would we need to create the filters for what the NN is looking for in the dataset?
For example:
Andrew mentions in the video that in layer 1 in the shown NN, the layer looks for units similar to lines vertical, horizontal, at different angles, and similar colours.
Layer 2, looks for circles, stripes, patterns, similar shapes, and so on.
As the layers go on, they would look for more noticeable objects like tires, patterns, positioning, etc.
Here is my question; would we have to manually create filters for what we are looking for specifically?
I’m sure we went over this but this is more to confirm in my head that I understand what is going on. My hypothesis Is that no, you do not with a large enough dataset. Using the dev set, it should be enough to look for similar patterns that are shown in the images of, for example, similar faces if doing face recognition software. But I can’t help but think if ever there are future projects I’d like to start where if I want to use something with a brand new CNN, I would have to go in and manually input filters for the NN.
Thanks for your help!
@Viny Every Different people may have varying perspectives on your question.
From my understanding, modern CNNs automatically update their filters through learning, utilizing backpropagation and gradient descent to identify meaningful patterns. Therefore, there is generally no need to manually define filters.
When should you consider creating manual filters?
If you are employing a hybrid approach or developing an application that specifically requires designing custom filters.
In research or unique projects (e.g., PhD work), manually designing filters might be necessary. However, there is no guarantee that a manually crafted filter will always perform as expected.
@Prashant_Upadhyaya That’s actually what I was wondering! Thank you so much Dr. Upadhyaya!
Previously, the course mentioned the filters making the manual filter of a horizontal line and vertical using matrices. From this answer, in more modern hybrid approaches and in research in computer vision, would you hand-pick certain cropped pictures and input them as actual filters or would you have to unpack the cropped images to find the best matrix to find the filter that would best output the NN.
I imagine this is a bit of both of what I am thinking, but I wanted to know if there were techniques that could find the similarities in the filters to find the matrices to filters. That would make it very easy to find the best outputs. But wouldn’t that also cause overfitting?
When it comes to hand-crafted feature maps, techniques like HOG and SIFT are sometimes used in research to enhance model performance. However, in standard deep learning pipelines, these are not commonly employed. The choice ultimately depends on the specific task and dataset being used.
To analyze learned filters, you can leverage visualization techniques that help interpret what each filter is detecting within the model.
Regarding the risk of overfitting—yes, manually crafting filters based on a particular dataset can lead to poor generalization on unseen data. However, strategies such as data augmentation, dropout, and batch normalization, are reported in the literature, can help reduce this risk.
The other point worth making here is that Prof Ng just shows us this example of manual filters for vertical or horizontal boundaries to give us intuition about how convolutions work. At that point, he’s just introducing us to convolutions. It’s been a while since I actually watched those lectures, but I’m pretty sure he comments someplace that we don’t normally create manual filters like that. In most cases as @prashant_upadhyaya has said, it suffices just to let the training of the network learn what is needed for the data and the goals we have.