
CNN is not a single architecture. In fact, what we saw in last blog is "A Basic CNN without many layers". There are numerous architecture in CNN history.
Starting with Image Classification
Broadly the history of CNN architectures was truly based on model improvements in image classification.
- 1989–1998: LeNet – Pioneered CNN-based handwritten digit recognition using convolution and subsampling.
- 2012: AlexNet – Popularized deep CNNs with ReLU, GPU training, and dropout for large-scale image classification.
- 2014: VGGNet – Improved feature extraction by stacking small 3×3 convolution filters to build deeper networks.
- 2014: GoogLeNet / Inception – Introduced parallel filters of different sizes to capture features at multiple scales efficiently.
- 2015: ResNet – Introduced skip connections, enabling effective training of very deep networks (50, 101, and 152 layers).
- 2017: MobileNet – Used depthwise separable convolutions to build lightweight CNNs for mobile and resource-constrained devices.
- 2019: EfficientNet – Introduced compound scaling to balance network depth, width, and input resolution for better accuracy and efficiency.
AlexNet, VGGNet and ResNet showed drastic from earlier versions both in extending training layers depth and accuracy. 1
We'll see the evolutions of these three in detail. Before diving, we can revisit the common arch and components though we discussed them in last blog-cnn.
Convolution layer
Small kernel matrices multiplied with input extracting features. Have a look on this blog for detailed convolution explanation if needed.
Activation layer
Stacking two linear operations without a nonlinearity in between collapses to a single linear operation. To build depth that matters, we insert a rectified linear unit (ReLU) after both every convolution and between fully-connected layers as well. Its simplest in terms of computation solving vanishing gradient problem much than sigmoid or tanh.
$$\text{Output = max(0, input)}$$
Pooling
Once the feature is extracted, the resulted feature map need less space than to retain the features. It servers two purposes.
- Less computations in later layers
- Translation invariance - Not much change in output with input. 2
Fully connected layer
Its nothing but the single vertical layers of weights and biases. For the first FC-layer, we flatten the multiple (of \(\text{size C}\)) feature maps (of \(\text{size H x W}\)) into single layer of \(\text{size C x H x W}\).
$$(B, C, H, W) \rightarrow (B, C* H* W)$$
Dropout - Generalization
Dropout is a phenomenal regularization method to make the learning more divergent (general) rather on strict inputs. In terms of techniques, its just dropping or masking a percentage of weights (i.e.,) setting it to zero during training time.
Enough on the components. Lets dive into CNets or CNNs.
AlexNet
AlexNet achieved a major breakthrough in the ImageNet image classification challenge, demonstrating the potential of deep CNNs. It was introduced in 2012 by Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton.
What made AlexNet different?
- Deeper architecture: Five convolutional layers followed by three fully connected layers.
- ReLU activation: Accelerated training compared with sigmoid and tanh activations.
- Overlapping max pooling: Reduced spatial dimensions while retaining useful features.
- Dropout: Reduced overfitting in fully connected layers.
- Data augmentation: Used random crops and horizontal flips to increase training data diversity.
AlexNet demonstrated how deeper networks, nonlinear activations, GPU acceleration, and regularization could significantly improve image classification.
VGGNet
VGGNet was introduced in 2014 by the Visual Geometry Group at the University of Oxford. Its central idea was to replace larger convolution filters with multiple smaller 3×3 filters stacked together.
Why 3×3 filters?
Consider two consecutive 3×3 convolution layers:
- The first layer observes a 3×3 region.
- The second combines these outputs, effectively capturing a 5×5 region of the original input.
Similarly, three consecutive 3×3 layers provide an effective receptive field of 7×7.
Thus, 3 stacked filters of 3x3 achieved what a 7x7 filter can do. This achieves a larger receptive field using smaller filters while introducing additional nonlinear activation functions.
What made VGGNet different?
- Consistent architecture: Repeated 3×3 convolution filters throughout the network.
- Increased depth: VGG-16 and VGG-19 contain 16 and 19 learnable layers respectively.
- Progressive feature extraction: Stacked convolution layers followed by max pooling.
- Large parameter count: Particularly in its fully connected layers.
Alex vs VGG
| spect | AlexNet | VGGNet |
|---|---|---|
| Year | 2012 | 2014 |
| Convolution filters | Multiple sizes | Primarily 3×3 |
| Convolution layers | 8 | 16 (VGG-16) |
| Activation | ReLU | ReLU |
| Parameters | ~60 million | ~138 million (VGG-16) |
VGG showed that increasing depth using smaller filters could improve feature extraction. However, simply stacking more layers introduced another challenge: training very deep networks effectively.
This is where ResNet introduced a fundamentally different approach.
ResNet
As networks became deeper, simply adding more layers did not always improve performance. In some cases, even training accuracy became worse. Below 56 layer network has high training error than 20 layer.
ResNet (Residual Network) was introduced by Kaiming He and his colleagues in 2015. It addressed a major challenge the above problem of degradation.
The idea behind residual learning
Consider a regular neural network where several layers learn a transformation of the input:
$$[ y = F(x) ]$$
ResNet introduced a shortcut connection that allows the original input to bypass these layers and be added directly to their output.
$$[ \boxed{y = F(x) + x} ]$$
This structure is called a residual block. Instead of learning the complete transformation, the layers learn the residual difference. The shortcut provides an alternative path for information and gradients to flow through the network.
ResNet architecture variations
- ResNet-18 and ResNet-34: Use basic residual blocks with two 3×3 convolution layers.
- ResNet-50: Introduced bottleneck blocks with three convolution layers (1×1, 3×3, 1×1).
- ResNet-101 and ResNet-152: Extend the bottleneck architecture with more residual blocks to build deeper networks.
ResNet demonstrated that much deeper networks could be trained effectively using shortcut connections. This became one of the most influential architectural ideas in modern deep learning.
While the above CNets are discovered and improved on image classification, there fundamental feature extraction components are same for other use cases like object detection, semantic segmentation etc.
Object Detection
When Image classification was going well, Object detection came into picture. The region guess and object detection on the region as two stages in one approach.
Two stage (Region proposal Network) CNets:
- R-CNN
- Fast R-CNN
- Mask R-CNN
Whereas, another approach trend started and still in top tier is only one forward pass as Single stage:
- Started as YOLO (You Only Look Once) started in 2015 for object detection.
- Into multiple evolutions.
Note: YOLO26 introduces native end-to-end inference, a lighter detection head, an updated training recipe, and task-specific heads for detection, segmentation, classification, pose estimation, and oriented detection. 3
We can continue the CNN architecture of object detection and its evolutions from here in detail as part-2.
Thanks for reading.
Just kidding with YOLOv26
You can live stream and do object detection in seconds. I've shared the steps I used to try out YOLO26 locally.
import torch
import argparse
from ultralytics import YOLO
import time
import cv2
def pick_device() -> str:
# MPS = Apple GPU via Metal Performance Shaders
return "mps" if torch.backends.mps.is_available() else "cpu"
def run_live(model, source, imgsz, conf, device):
"""Stream frames one at a time (stream=True keeps memory flat) and show them.
Stop with q or Esc in the video window, or Ctrl+C in the terminal."""
print("Live mode: press 'q' or Esc in the window (or Ctrl+C) to stop.")
frames, t0 = 0, time.perf_counter()
try:
for r in model.predict(source=source, stream=True, imgsz=imgsz,
conf=conf, device=device, verbose=False):
frame = r.plot() # frame with boxes drawn
frames += 1
fps = frames / (time.perf_counter() - t0)
cv2.putText(frame, f"{fps:.1f} FPS | {len(r.boxes)} objects", (10, 30),
cv2.FONT_HERSHEY_SIMPLEX, 0.9, (0, 255, 0), 2)
cv2.imshow("YOLO26 live", frame)
if cv2.waitKey(1) & 0xFF in (ord("q"), 27):
break
except KeyboardInterrupt:
pass
finally:
cv2.destroyAllWindows()
print(f"Stopped after {frames} frames "
f"(avg {frames / max(time.perf_counter() - t0, 1e-9):.1f} FPS).")
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--imgsz", type=int, default=640)
ap.add_argument("--conf", type=float, default=0.25)
args = ap.parse_args()
device = pick_device()
print(f"torch {torch.__version__} | device: {device}")
model = YOLO("yolo26s.pt")
run_live(model, 0, args.imgsz, args.conf, device)
if __name__ == "__main__":
main()
# Approach 1: - pip
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip
pip install "ultralytics>=8.4.0" torch torchvision opencv-python
python live.py
# Appraoch 2: uv
uv venv --python 3
source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install "ultralytics>=8.4.0" torch torchvision opencv-python
python live.py
References
Footnotes
About the author
Software Engineer working on scalability of systems
Comments
Join the discussionNo comments yet. Be the first to comment.




