From CNN to Transformer: How AI Learns to See and Reason

MilestoneBig idea
AlexNet (2012)Learn from labeled examples (supervised learning).
ResNet (2015)Train very deep networks effectively.
AlphaGo Zero (2017)Learn through self-play with reinforcement learning.
Transformer (2017)Replace recurrence with attention.
Vision Transformer (2020)Apply Transformers directly to images.

The evolution of modern AI can be understood as a series of breakthroughs in how machines represent information, learn patterns, and make decisions.

1. LeNet: The Beginning of CNN

Before deep learning became popular, image recognition relied heavily on handcrafted features. LeNet introduced the key idea of Convolutional Neural Networks (CNNs):

Instead of looking at an entire image at once, learn small pattern detectors and scan them across the image. These small detectors are called filters. A filter can learn to detect:

  • edges
  • corners
  • textures

The important idea is locality and weight sharing:

  • nearby pixels are related
  • the same filter can be reused everywhere in the image

A vertical edge is still a vertical edge whether it appears on the left or right side of an image.


2. AlexNet: CNN + GPU Changed Computer Vision

CNN existed before AlexNet, but AlexNet showed that a deep CNN could dominate large-scale image recognition. The breakthrough was not inventing filters, but making CNNs powerful enough:

  • deeper network
  • huge ImageNet dataset
  • GPU acceleration using CUDA
  • ReLU activation
  • dropout

The idea is that A neural network can automatically learn useful filters instead of humans manually designing features. Early layers learn simple patterns:

pixels
edges
textures

Later layers combine them:

textures
shapes
object parts
objects

3. ResNet: Making Very Deep Networks Possible

After AlexNet, researchers wanted deeper networks. However, adding more layers did not always improve performance. Very deep networks became difficult to train. ResNet introduced the idea of residual learning:

Instead of learning a completely new representation:

Input → Layer → Output

learn only the change:

Output = Input + Residual

The shortcut connection allows information and gradients to flow easily through many layers. This made networks with 50, 100, or even more layers practical. The idea became fundamental. Modern Transformers also use residual connections.


4. Transformer: From Seeing Patterns to Learning Relationships

The Transformer changed the way models process information. The key paper is Attention Is All You Need (2017)

Instead of processing data sequentially, Transformer uses attention: Each piece of information can directly look at and interact with other pieces.

For language:

Sentence
Tokens
Attention
Prediction

The model learns: Given the previous tokens, what is the most likely next token? This simple idea powered modern large language models.


5. Vision Transformer: Treat Images Like Language

The Vision Transformer (ViT) asked:

Can an image also be represented as tokens?

Instead of CNN filters scanning pixels, ViT divides an image into patches.

Example:

Image
16×16 pixel patches
Patch tokens
Transformer

This is similar to text tokenization.

Text:

"The cat sits"
"The"
"cat"
"sits"

Image:

Picture
Patch 1
Patch 2
Patch 3
...

Each image patch becomes a visual token.

The Transformer then learns relationships between patches using attention.

CNN says:

Look for local patterns everywhere.

Vision Transformer says:

Let every patch communicate and learn the relationships.


6. AlphaGo Zero: From Prediction to Decision Making

CNN and Transformer models mainly learn patterns from data.

AlphaGo Zero introduced another idea:

Learning through interaction and feedback.

Instead of learning from human Go games:

Human games
Learning

AlphaGo Zero started from random play:

Random model
Self-play
Reward (win/loss)
Improve model
Stronger self-play

The system learned:

  • Policy: which moves to try
  • Value: how good a position is
  • Reward: whether the final result was successful

The neural network provides intuition:

“These moves look promising.”

Monte Carlo Tree Search provides deeper thinking:

“Let’s explore these moves carefully.”

Together:

Neural network
+
Search
+
Reinforcement learning
Superhuman Go player

The Big Picture

The evolution of AI can be summarized as:

LeNet
CNN learns local visual patterns
AlexNet
Deep CNN + GPU proves scale matters
ResNet
Very deep networks become trainable
Transformer
Attention learns relationships between tokens
Vision Transformer
Images become patch tokens
AlphaGo Zero
AI learns decisions through self-improvement

The overall trend is:

From human-designed features → learned representations → learned reasoning and decision making.

CNN taught machines how to see.

Transformer taught machines how to connect information.

Reinforcement learning taught machines how to improve through experience.

Leave a Reply