BeCuriouzBeCuriouz

Learn something new every day

🧠 Artificial Intelligence
🖼️

How a computer 'sees' a cat: the sliding window trick

💡 A CNN recognizes objects by sliding the same small pattern-detecting filter across an entire image, so a learned feature is caught no matter where it appears.

When a neural network looks at a photo, it doesn't see a cat — it sees a grid of numbers (pixel brightness values). A convolutional neural network (CNN) is the architecture that turned those numbers into reliable image recognition, and its core trick is surprisingly simple: a small filter (also called a kernel) — say a 3×3 grid of weights — slides across the whole image, one patch at a time, multiplying and summing as it goes. Each filter learns to fire on one kind of pattern: an edge, a color blob, a corner.

The genius is weight sharing: the same filter is reused at every position, so if it learns to spot a whiskery edge, it spots that edge anywhere in the frame — top-left corner or dead center. This gives CNNs a rough translation invariance and slashes the number of parameters compared to connecting every pixel to every neuron. Stack these layers, and early filters detecting edges feed later ones that assemble edges into eyes, ears, and eventually whole faces.

This hierarchy — simple patterns composing into complex ones — is why CNNs dominated computer vision for a decade and still power everything from medical imaging to the camera in your phone.

🖼️ How a computer 'sees' a cat: the sliding window trick — BeCuriouz