← AI Terminology
CNN - Convolutional Neural Network
A CNN (Convolutional Neural Network) is a neural network architecture that uses convolutional layers to automatically learn spatial features from grid-structured data — most commonly images — by applying learned filters that detect edges, textures, shapes, and objects.
CNNs dominated computer vision from ~2012 (AlexNet) through ~2021, when Vision Transformers began competing at the frontier.
CNNs dominated computer vision from ~2012 (AlexNet) through ~2021, when Vision Transformers began competing at the frontier.
Why It Matters in AI
CNNs made image recognition practical at scale by exploiting two key inductive biases: local connectivity (nearby pixels are more related than distant ones) and translation invariance (a cat is a cat regardless of where it appears in the frame). AlexNet's 2012 ImageNet win launched the deep learning era; ResNet, EfficientNet, and MobileNet followed, now embedded in billions of devices.
Key Points
| Aspect | Description |
|---|---|
| Depth | Early layers detect edges/textures; deeper layers detect objects/parts |
| Pooling | Max/average pooling reduces spatial dimensions — builds translation invariance |
| Convolution | Slides a small filter (e.g. 3×3) across the input — each position produces one output value |
| Current status | Still dominant for edge/mobile; Vision Transformers (ViT) lead on high-compute benchmarks |
| Key architectures | AlexNet, VGG, ResNet, EfficientNet, MobileNet, DenseNet, ConvNeXt |
| Parameter sharing | Same filter applied everywhere — far fewer parameters than fully connected for images |
Simple Analogy
Imagine scanning a photo for a cat by sliding a magnifying glass across it in a grid pattern. At each position, the glass checks for cat-like features — whiskers, ears, round eyes. CNN filters work the same way, learned automatically from training data rather than hand-designed.
Common Usage Examples
nn.Conv2d(in_channels=3, out_channels=64, kernel_size=3, padding=1)in PyTorch- ResNet50 pre-trained on ImageNet:
torchvision.models.resnet50(pretrained=True) - MobileNetV3 for on-device inference:
torchvision.models.mobilenet_v3_small() - Transfer learning: load ResNet50, freeze all but final layer, fine-tune on custom dataset
- EfficientNet-B7 achieves 84.4% top-1 on ImageNet with 8× fewer parameters than comparable models
Summary
In short: CNNs learn spatial features from images using sliding filters — the architecture that powered a decade of computer vision breakthroughs and is still the default for edge deployment.