✳ BETWEEN QUESTIONS ML STUDY ATLAS

A QUESTION-LED LESSON

CNNs: How Can a Filter Recognize a Pattern Anywhere?

A small pattern can appear in many places. Can we look for it using the same detector at each location?

Share one filter

A convolutional layer applies the same filter at multiple positions. Its output is a feature map. Sharing weights makes the same local pattern detectable in different locations, though padding, stride and later layers affect the exact behavior.

Build a larger view

A network can combine feature maps across layers. Early filters may respond to simple local patterns; later layers can combine information from larger regions. These are useful intuitions, not a guarantee that every filter learns a named feature. Change the second input and follow the shared filter across adjacent windows. ReLU then replaces negative filter responses with zero.

INTERACTIVE EXPLORATION

Scan and activate

Change the second input in [1, x, 2, 4]. Apply [1, −1] to each valid window, followed by ReLU.

Try the detector

Our experiment slides a fixed [1, −1] filter over four numbers and then applies ReLU. The filter detects local differences; ReLU keeps positive responses. It is one tiny step, not a complete trained image classifier.

Check your understanding

What does ReLU do to a filter output of −2?

It returns 0, because ReLU(z) = max(0, z).

Keep exploring

How does a filter scan? ↗Why use an activation? ↗How is an image represented? ↗

Further reading

Source and further reading ↗