How machines learn to see — locally vs globally.

If you’ve ever wondered why Vision Transformers (ViTs) replaced Convolutional Neural Networks (CNNs) so quickly in computer vision, you’re not alone.

Both models “see” — but they see differently.

Let’s visualize how these architectures process the same image step-by-step, and why attention has changed the way machines perceive the world.


🧩 1. How CNNs See: The Local Lens

A CNN processes an image piece by piece — a mosaic of local patterns.

  • Each convolution filter slides over pixels (a receptive field)
  • Early layers learn edges, textures, shapes
  • Deeper layers combine them into higher-level features (eyes, wheels, leaves)
import torch
import torch.nn as nn

cnn = nn.Sequential(
nn....

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help