CNN
26 bites tagged CNN — interview questions with model answers, and 60-second explainers.
Classic image captioning architecture
A CNN encoder extracts image features, a recurrent or transformer decoder generates the caption word by word, and attention lets the decoder focus on image regions per word. the encoder-decoder captioning pattern.
Adapting a 2D CNN for video action recognition
Run the 2D CNN per frame, pool features over time, optionally add two-stream or 3D conv. extending image models to temporal data. assuming a single frame suffices or ignoring temporal information entirely.
Designing a baseline Visual Question Answering model
Encode the image with a CNN, encode the question with an RNN or embedding, fuse the two vectors, and classify over a fixed answer vocabulary. multimodal baseline design.
Why ViTs need positional embeddings
Self-attention is permutation invariant so patch order is lost; positional embeddings restore spatial location. CNNs encode position implicitly via the fixed convolution grid. why order matters for attention but not convolution.
Inductive biases of ViT versus CNN
CNNs bake in locality and translation equivariance; a plain ViT has almost none beyond patch structure, so it must learn spatial relations from data, needing large datasets or strong pretraining. how built-in priors affect data needs.
How ViT and CNN process an image differently
A CNN slides local filters over the raw pixel grid; a ViT splits the image into patches, flattens and linearly embeds each into a token, adds positional embeddings, and feeds the sequence to… the input pipelines of two paradigms.
Translation equivariance versus invariance in CNNs
Convolution is equivariant, shifting input shifts feature maps; invariance comes only from pooling and global aggregation. Strict invariance is partial and broken by strided sampling. precise reasoning about CNN symmetries.
Uses of the 1x1 convolution
A 1x1 conv is a per-pixel linear combination across channels; it reshapes channel depth cheaply and adds nonlinearity. Uses: dimensionality reduction in bottlenecks and channel mixing. channel-wise operations and efficient design.
Receptive fields in convolutional networks
Receptive field is the input region affecting a neuron; it grows with depth, larger kernels, and stride. It matters for capturing context in detection and segmentation. how spatial context accumulates in CNNs.
Max pooling versus strided convolution
Pooling downsamples and adds small translation invariance with no parameters; strided conv learns its downsampling but adds parameters. downsampling tradeoffs in CNNs.
How a convolutional layer works
Learnable kernels slide over the input computing dot products, with stride controlling step size and padding controlling output size. the mechanics of convolution.
Walk me through a CNN's layers for image classification
Tests hierarchical feature extraction in CNNs. Answer: conv filters learn edges-to-objects with shared weights, pooling reduces dimensions and adds invariance, fully-connected layers classify.
Mask R-CNN: Region-Based Detection
Mask R-CNN belongs to the R-CNN family core: selective search over CNN feature maps yields bounding boxes with object categories. Reusing convolutional features for localization, not just classification, is the win.
U-Net: Segmentation with Less Data
U-Net retrofits fully convolutional networks to segment images precisely with fewer training examples. It runs a 512 by 512 frame in under a second on a 2015 GPU, fitting latency-sensitive pipelines.
Convolutional Neural Networks: Finding Patterns with Filters
A CNN learns to spot features by sliding optimized filters over data like images, audio, or text. It's the go-to for computer vision, but a common mistake is thinking it's the only modern tool, as transformers sometimes replace it.
Image Convolution: A Sliding Feature Detector
An image convolution is a sliding filter that scans an image to detect features like edges or textures. It's the core building block of modern computer vision, used in image classification and object detection.
Anchor Boxes: Pre-defined Guesses for Object Detection
Anchor boxes are predefined 'template' boxes of various sizes and shapes. Object detection models use them as a starting point, predicting how to shift and scale these templates to fit actual objects, making detection faster.
Two-Stream ConvNets: Seeing What vs. How It Moves
Two-Stream ConvNets split video analysis into two paths: a spatial stream sees *what* is in a frame, and a temporal stream sees *how* it moves via optical flow. This is used for action recognition, like telling 'typing' from 'waving'.
DeepLab: Pixel-Level Semantic Image Segmentation
DeepLab assigns a class label like 'road' or 'person' to every pixel in an image. This powers features like smartphone portrait mode by precisely outlining objects. The key challenge is achieving sharp object boundaries, not just coarse bounding boxes.
Dilated Convolution: A Wider View Without More Parameters
Dilated convolution gives a filter a wider view by skipping pixels, like reading every Nth word to get the gist. This helps models in semantic segmentation see broader context without the resolution loss of pooling.
Fully Convolutional Networks: From Image to Segmentation Map
An FCN turns a standard image classifier into a pixel-level labeler by replacing its final layers with convolutions to preserve spatial data. It's used for semantic segmentation, like identifying all cars and roads in a street scene.
GoogLeNet's Inception Module: Wider, Not Just Deeper
Instead of choosing one filter size, GoogLeNet's Inception module runs 1x1, 3x3, and 5x5 convolutions in parallel. This lets the network capture features at multiple scales at once. The footgun is forgetting the crucial 1x1 'bottleneck' convolutions.
AlexNet: The CNN That Sparked the Deep Learning Boom
AlexNet is the blueprint that proved deep CNNs could master image recognition, kicking off the modern AI boom. Its architecture is foundational for modern computer vision. The footgun is thinking it was just bigger; its novelty was combining new techniques.
Pooling Layers: Summarizing What Matters in an Image
A pooling layer is like squinting at an image; you lose fine detail but see the main shapes. It summarizes features in a region, reducing computation and making the model robust to small shifts.
Get CNN bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.