📝 Chapter 11: Computer Vision — Quick-Revision Notes
A compact cheatsheet covering every major topic in the Computer Vision chapter. Use this for last-minute revision before GATE DA.
1. Image Fundamentals
| Concept | Detail |
| Grayscale image | H × W matrix, values 0–255 |
| RGB image | H × W × 3 tensor (Red, Green, Blue) |
| RGBA | H × W × 4 (+ Alpha transparency channel) |
| RGB → Gray | Y = 0.299R + 0.587G + 0.114B |
| HSV | Hue, Saturation, Value — colour-based segmentation |
| YCbCr | Luminance + chrominance — JPEG compression |
| Batch tensor (PyTorch) | (N, C, H, W) |
3. CNN Architecture Quick Reference
| Model | Year | Params | Key Innovation |
| LeNet-5 | 1998 | ~60K | First practical CNN (MNIST) |
| AlexNet | 2012 | ~60M | ReLU, Dropout, GPU, data augmentation |
| VGG-16 | 2014 | 138M | Uniform 3×3 filters, deep |
| GoogLeNet | 2014 | 5M | Inception module, 1×1 bottleneck, GAP |
| ResNet-50 | 2015 | 25.6M | Residual connections (y = F(x) + x) |
| DenseNet | 2017 | 8M | Dense connectivity, growth rate k |
| MobileNet | 2017 | 4.2M | Depthwise separable conv (~8× saving) |
| EfficientNet | 2019 | 5.3M | Compound scaling (α · β² · γ² ≈ 2) |
VGG insight: Three 3×3 convs have same RF as one 7×7 but only 27C² vs 49C² params + 3 non-linearities.
ResNet insight: Skip connections create gradient highways; learning F(x) = 0 is easier than H(x) = x.
4. Object Detection
| Concept | Formula / Detail |
| IoU | |A ∩ B| / |A ∪ B|; TP if IoU ≥ 0.5 |
| NMS | Sort by confidence; keep top; remove IoU > thresh; repeat |
| mAP | Mean of per-class AP (area under P-R curve) |
| Precision | TP / (TP + FP) |
| Recall | TP / (TP + FN) |
Detector Evolution
| Model | Type | Key Feature |
| R-CNN | Two-stage | Selective Search + CNN per region |
| Fast R-CNN | Two-stage | Shared features + RoI Pooling |
| Faster R-CNN | Two-stage | RPN replaces Selective Search |
| YOLO | One-stage | S×S grid; output = S×S×(B×5+C) |
| SSD | One-stage | Multi-scale feature maps, default boxes |
Two-stage: More accurate, slower. One-stage: Faster, real-time capable.
5. Image Segmentation
| Type | Output | Example Model |
| Semantic | Per-pixel class label | FCN, DeepLab |
| Instance | Per-object mask + class | Mask R-CNN |
| Panoptic | Semantic + instance IDs for things | Panoptic FPN |
Key Models
- FCN: 1×1 conv replaces FC layers; variants FCN-32s, -16s, -8s
- U-Net: Encoder-decoder + skip concatenation; dominant in medical imaging
- DeepLab: Atrous/dilated conv + ASPP; v3+ adds decoder for sharp boundaries
- Mask R-CNN: Faster R-CNN + mask head + RoI Align (bilinear, no quantisation)
Metrics
| Metric | Formula |
| Pixel Accuracy | ∑ pii / ∑∑ pij |
| mIoU | (1/C) ∑ TPc/(TPc+FPc+FNc) |
| Dice coefficient | 2TP / (2TP + FP + FN) |
6. Generative Models
| Model | Key Idea | Loss / Objective |
| Autoencoder | Compress → reconstruct | MSE or BCE |
| VAE | Probabilistic latent; reparameterisation trick | Recon + KL divergence |
| GAN | Generator vs Discriminator | minG maxD V(D,G) |
| WGAN | Wasserstein distance | E[D(x)] − E[D(G(z))], 1-Lipschitz |
| Diffusion | Forward noise → reverse denoise | E[‖ε − εθ(xt,t)‖²] |
Key Formulas
- VAE KL: −½ ∑(1 + log σ² − μ² − σ²)
- GAN V: E[log D(x)] + E[log(1−D(G(z)))]
- Diffusion forward: xt = √ᾱt x0 + √(1−ᾱt) ε
| Property | VAE | GAN | Diffusion |
| Training | Stable | Unstable | Stable |
| Quality | Blurry | Sharp | Best |
| Speed | Fast | Fast | Slow (T steps) |
| Mode collapse | No | Yes | No |
8. GATE DA Quick Tips
- ⚡ Output size formula is the most testable — practise with varying padding, stride, and kernel sizes.
- ⚡ Parameter counting: Remember Cout × (Cin × k² + 1). FC layers dominate total params in VGG/AlexNet.
- ⚡ Receptive field: For all-stride-1, RF = 1 + ∑(kl − 1). Three 3×3 = RF of 7.
- ⚡ ResNet skip connection: y = F(x) + x. Solves degradation in deep networks.
- ⚡ IoU calculation: Draw the boxes, compute intersection dims carefully, then union = A + B − intersection.
- ⚡ 1×1 convolutions are used for channel reduction (bottleneck), not spatial change.
- ⚡ Depthwise separable conv saves ~k²× parameters compared to standard conv.
- ⚡ Transposed conv output formula is the “reverse” of regular conv: (n−1)s − 2p + k.
- ⚡ Semantic vs Instance: Semantic = per-pixel class only. Instance = per-object mask + class.
- ⚡ mIoU > Pixel Accuracy for evaluation when classes are imbalanced.