Computer Vision Interview 40 Q&A Chapter 14

CNN Basics for Vision — Interview Q&A

Convolutional neural networks for images and the AlexNet breakthrough on ImageNet.

40 questions Chapter 14

CNNs for Vision: 20 Essential Q&A

1 Why CNNs for vision? ⚡ easy
Answer: Images have spatial structure; conv layers exploit local correlations and share weights—far fewer parameters and better generalization than huge FC layers on pixels.
# PyTorch: nn.Conv2d(in_c, out_c, k, padding=1)  # standard conv layer
2 What does a conv layer do? 📊 medium
Answer: Slides learnable filters over the input; each output location is dot product of filter with local patch—detects patterns like edges/textures at many positions.
3 What is parameter sharing? 📊 medium
Answer: Same filter weights used at every spatial location—if a feature is useful in one place, it can appear anywhere; drastically cuts parameters vs FC.
4 Local receptive field? ⚡ easy
Answer: Each neuron sees only a small neighborhood—deeper layers indirectly see larger context via stacked convs.
5 Stride and padding? 📊 medium
Answer: Stride subsamples spatial size; same padding keeps H×W with zero border; valid shrinks without padding.
6 Purpose of pooling? 📊 medium
Answer: Reduces spatial resolution, adds slight translation tolerance, and lowers compute—max pool keeps strongest activations in each window.
7 Output depth? ⚡ easy
Answer: Number of filters = number of output channels—each filter produces one feature map.
8 Receptive field size? 🔥 hard
Answer: Grows with kernel sizes, strides, and stacking—after L layers network “sees” a region of that size in the input image.
9 Why 1×1 conv? 📊 medium
Answer: Mixes channels at each spatial location—cheap way to change depth (bottleneck), add nonlinearity, or implement MLP per pixel.
10 CNN vs fully connected? 📊 medium
Answer: FC connects all inputs to each output—no locality; used at end (or as 1×1 conv) after spatial reduction for classification.
11 Translation equivariance? 🔥 hard
Answer: Shift input → shifted feature maps (before pooling)—CNN respects spatial structure; pooling adds limited invariance.
12 RGB input? ⚡ easy
Answer: First conv has 3 input channels per filter—depth matches image channels (or more for hyperspectral).
13 Role of batch norm? 📊 medium
Answer: Normalize activations per channel for stable training and higher learning rates—slight regularization effect.
14 Dropout in CNNs? 📊 medium
Answer: More common in FC heads; sometimes spatial dropout drops whole feature maps—less standard than in MLPs.
15 Global average pooling? 📊 medium
Answer: Average each channel to one value—reduces params vs large FC layers before softmax (Network in Network / ResNet style).
16 Classification loss? ⚡ easy
Answer: Cross-entropy with softmax over classes—multi-label uses sigmoid + BCE per class.
17 Typical augmentation? 📊 medium
Answer: Random crop/flip, color jitter, mixup/cutmix—improves generalization and simulates viewpoint/light changes.
18 Transfer learning? 📊 medium
Answer: Initialize backbone from ImageNet pretrain, replace head, fine-tune—standard when labeled data is limited.
19 Estimate complexity? 🔥 hard
Answer: Conv: roughly O(H_out×W_out×C_in×C_out×k²)—depthwise separable reduces this (MobileNet).
20 CNN vs Vision Transformer? 🔥 hard
Answer: CNN: local inductive bias and efficiency. ViT: global attention, needs more data—hybrids (ConvNeXt, Swin) blend ideas.

AlexNet: 20 Essential Q&A

21 Why is AlexNet important? ⚡ easy
Answer: Won ImageNet 2012 by a large margin—showed deep CNNs + GPU + data could beat hand-crafted features, sparking the deep learning boom in vision.
22 What was ImageNet 2012? 📊 medium
Answer: 1.2M images, 1000 classes—AlexNet ~16% top-5 error vs previous ~26% with shallow methods—breakthrough result.
23 Rough architecture? 📊 medium
Answer: Five conv layers (some grouped across 2 GPUs) + max pooling + three large FC layers + softmax—deeper than prior CNNs for this task.
24 Why ReLU? 📊 medium
Answer: Faster training than saturating tanh/sigmoid; mitigates vanishing gradient in deep stacks; sparse activations.
25 Use of dropout? 📊 medium
Answer: Regularize huge FC layers by randomly zeroing neurons—reduces co-adaptation on training set.
26 What was LRN? 🔥 hard
Answer: Local response normalization—side inhibition across channels; later often replaced by batch norm; minor effect in hindsight.
27 Overlapping pooling? 📊 medium
Answer: Stride smaller than pool window—slightly richer downsampling vs non-overlapping; less common in newer nets.
28 Two GPUs? ⚡ easy
Answer: Model split across GPUs due to memory limits—cross-GPU connections only on certain layers (engineering constraint of the time).
29 Augmentation? 📊 medium
Answer: Random crops/flips from 256×256, PCA color jitter—reduces overfitting and increases effective data.
30 Parameters? ⚡ easy
Answer: On order of 60M—mostly FC layers; later architectures reduce FC params with GAP.
31 Training details? 📊 medium
Answer: SGD + momentum, weight decay, learning rate schedule dropping on plateaus—long schedule on two GPUs.
32 Overfitting risk? 📊 medium
Answer: Large capacity vs data—addressed by dropout, aug, and weight decay; still a concern for smaller datasets when fine-tuning.
33 vs VGG? 📊 medium
Answer: VGG uses uniform 3×3 stacks, deeper, more systematic—higher accuracy, more compute; AlexNet shallower irregular design.
34 vs ResNet? 📊 medium
Answer: ResNet adds residuals enabling much deeper nets—AlexNet depth modest by today’s standards.
35 Use AlexNet now? ⚡ easy
Answer: Mostly for teaching/history; ResNet/EfficientNet backbones dominate transfer learning—AlexNet too weak/slow vs modern alternatives.
36 Typical input? 📊 medium
Answer: 224×224 crops from 256×256 resized image—standard pipeline referenced in many papers.
37 Output layer? ⚡ easy
Answer: 1000-way softmax for ImageNet classes—cross-entropy loss during training.
38 Obsolete? ⚡ easy
Answer: For production accuracy, yes; for pedagogy and history, still the canonical “first big win” story.
39 Impact beyond vision? ⚡ easy
Answer: Validated deep learning at scale—influenced speech, NLP later wave; proved GPUs + data + depth recipe.
40 Modern small nets? 📊 medium
Answer: MobileNet, EfficientNet achieve better accuracy/FLOPs—mobile edge rarely uses AlexNet-sized FC heads.
Full tutorial chapter

Pair these interview notes with the matching CV tutorial chapter.

align-items-center flex-wrap gap-2"> Previous Next