seegongsik
Saved words
AI

Eyes for images: the CNN

Earlier we saw a neural network stack neurons in layers to learn complex patterns. But a single photo has tens of thousands of dots. Flattening it into one row for a plain network is too much, and the same cat shifted a little becomes a totally different input. So a method appeared that scans small parts to find features, just like our eyes. That is the network that looks at images, the CNN.

01

A photo is really a grid of numbers

To our eyes it just looks like a picture.
But to hand a photo to a computer
we have to turn it into numbers.
Peer very closely at a photo
and you see tiny dots, pixels, packed in a grid.
Each dot holds its brightness as one number.
A bright dot is a big number, a dark dot a small one.
So a single photo
is really a grid with a brightness number in each cell.

To our eyes it is just a picture

Tap the picture to zoom in. Up close, each small dot holds a brightness number, so you can see the photo is really a grid of numbers.

Zoom in and the numbers showed up.
Bright cells are big numbers, dark cells small.
A person sees the shape at a glance,
but to a computer it is just a table full of numbers.
So among all these numbers,
how can it find a feature
like an edge or a curve?
Looking at everything at once is too much,
so it studies small parts one at a time.

02

Find a feature with a small filter

The tool that finds a feature is the filter.
A filter is a small pane, far smaller than the grid.
It is like setting a magnifier on one spot.
For example, a filter that finds a vertical edge
likes a pattern dark on the left, bright on the right.
Place the filter on one window of the image
and check how well it matches the numbers there.
If the pattern fits well, the score is high,
and if it does not fit, the score is low.

1
1
8
8
8
2
1
9
8
7
1
2
8
9
8
1
1
7
8
9
2
1
8
8
8
vertical-edge filter
darkbright
score: -
Tap a window in the grid to place the filter

Place the filter on different windows and watch the score. Where the patch resembles the filter (dark left, bright right), the score is high, meaning a vertical edge sits there.

Each spot you tried gave a different score.
Where the pattern fit, the score was high.
That means a vertical edge is right there.
One thing matters most.
Wherever you place the same filter,
it looks for the same feature.
So whether the edge is on the left of the picture
or on the right, it can catch it.
Then instead of one spot, let's scan them all.

03

Slide the filter to make a feature map

Now move the filter one step at a time.
Start at the top left,
one cell right, then one cell more.
Reach the end, drop down a row,
and scan again from the left.
Write the score at each spot,
and the scores gather into a new small grid.
This is the feature map.
It shows at a glance where the feature is strong.

brightness grid
1
1
8
8
8
2
1
9
8
7
1
2
8
9
8
1
1
7
8
9
2
1
8
8
8
feature map
0 / 16

Tap to slide the filter one step at a time. Each spot's score fills the feature map on the right. When the filter finishes, the map reveals where the feature is strong.

The filter swept across the whole grid.
The scores gathered into a feature map.
It is smaller than the original photo,
yet it shows clearly where the feature lies.
One filter finds only one kind of feature.
So in practice we use many filters together.
Vertical edges, horizontal edges, curves,
finding different features all at once.
But these are still only small features.

04

Higher layers, bigger features

Run a filter over the feature map once more
and small features gather into bigger ones.
The front layer sees small pieces like dots and edges,
the layer above gathers edges into an eye or a nose,
and a higher layer gathers eyes and nose into a whole face.
It is just like stacking layers in a neural network.
The difference is that here each layer scans with filters.
So the higher you climb,
the more abstract the features it catches.

layer 1: edges
layer 2: parts (eye, nose)
layer 3: whole face
Low layers catch small edge pieces.
1 / 3

Tap the button to climb one layer at a time. From edges to parts like an eye and a nose, then to a whole face, abstraction rises step by step.

Each layer up, what it sees grew bigger.
From edges to eyes and nose, then to a face.
Low layers see small, simple pieces,
and high layers gather them into meaningful shapes.
It is much like how a person recognizes things.
See lines, recognize parts, know the whole.
Scanning with small filters to find features
and stacking those layers to raise abstraction
is exactly the skill of a CNN that looks at images.

05

Let's wrap up

Gathered on one line, it is this.
A photo is really a grid filled with brightness numbers.
A CNN places a small filter, a magnifier, on one window
and scores whether that feature is there.
Sliding the same filter across the grid
makes a feature map that finds it wherever it sits.
Stacking many such layers,
from edges to eyes and nose, then to a face,
it catches ever more abstract features. That is a CNN.

Tap the key points in order to review

Tap the key points in order to review. (a photo is a number grid -> a small filter scores a feature -> scan to make a feature map -> higher layers, more abstract features)

Now you know how a computer sees a picture.
Turn the photo into a grid of numbers,
scan it with small filters to find features,
and stack layers to raise abstraction step by step.
A cat that shifted is still caught by the same filter.
This simple idea, scan with a magnifier and gather features,
is the foundation of clever machines that recognize images.
Next, let's keep exploring how this way of seeing
applies to text and sound as well.

In one lineA CNN is a neural network that looks at images. First, a photo is really a grid packed with brightness numbers. Bright means a big number, dark a small one. A CNN places a small filter, a little pane like a magnifier, onto one window of the image and scores whether the feature it seeks is there. Sliding the same filter across the grid one step at a time builds a feature map that finds that feature wherever it sits in the picture. A shift in position does not bother it, since the same filter does the finding. And by stacking many such layers, the front layer catches small edges, the layer above gathers edges into an eye or a nose, and a higher layer gathers those into a whole face. The higher you climb, the more abstract the features it catches. In short, see a photo as a grid of numbers, scan it with small filters to find features, and stack those layers to raise abstraction. That is a CNN.
AI
Was this helpful? Support seegongsik