- Convolutional Neural Network (CNN)
-
A CNN is a neural network architecture designed for processing grid-structured data
like images. It uses convolutional layers that apply learnable filters to detect
local patterns, enabling parameter sharing and translation invariance. CNNs typically
stack convolutional and pooling layers to learn hierarchical features, from edges
in early layers to complex objects in deeper layers. They dramatically outperform
fully connected networks on image tasks.
- Convolution (in Neural Networks)
-
Convolution is an operation where a small filter (kernel) slides across the input,
computing the dot product at each position to produce a feature map. This operation
detects local patterns regardless of their position in the input. Unlike fully
connected layers, convolutions share the same filter weights across all positions,
dramatically reducing parameters. Multiple filters can be learned to detect different
patterns simultaneously.
- Filter (Kernel)
-
A filter or kernel is a small matrix of learnable weights (typically 3×3, 5×5, or 7×7)
that defines a pattern to detect in the input. During convolution, the filter slides
across the input computing element-wise products and sums. Classical filters include
edge detectors and blur kernels; in deep learning, filters are learned from data
to detect whatever patterns help the task.
- Feature Map
-
A feature map is the output of applying a filter to an input through convolution.
Each position in the feature map indicates how strongly the corresponding filter
pattern is present at that location. A convolutional layer with 64 filters produces
64 feature maps. Early layers produce feature maps for simple patterns; deeper
layers produce feature maps for complex, abstract features.
- Stride
-
Stride is the number of pixels the filter moves at each step during convolution.
Stride 1 moves one pixel at a time, producing output nearly the same size as input.
Stride 2 moves two pixels, halving the output dimensions and reducing computation.
Larger strides provide more aggressive downsampling but may miss fine details.
Stride is also used in pooling layers.
- Padding
-
Padding adds extra pixels (usually zeros) around the input border before convolution.
"Valid" padding means no padding, causing output to shrink. "Same" padding adds enough
zeros to keep output size equal to input (with stride 1). Padding helps preserve
spatial dimensions and ensures border pixels contribute to as many output positions
as center pixels.
- Pooling Layer
-
A pooling layer reduces the spatial dimensions of feature maps by summarizing
regions with a single value. Max pooling takes the maximum value in each region;
average pooling takes the mean. Typical pooling uses 2×2 regions with stride 2,
halving each dimension. Pooling provides translation invariance (small shifts
don't change output) and reduces computation in subsequent layers.
- Receptive Field
-
The receptive field of a neuron is the region of the original input that affects
its output. In the first convolutional layer with a 3×3 filter, each neuron's
receptive field is 3×3 pixels. Deeper layers have larger effective receptive fields
because they see the outputs of previous layers. This allows deep CNNs to detect
patterns spanning the entire image while keeping individual filters small.
- Transfer Learning
-
Transfer learning reuses a model trained on one task (typically ImageNet classification
with millions of images) for a different but related task. The pre-trained model's
learned features—edges, textures, shapes—transfer well to new image domains. Common
approaches include feature extraction (freeze base model, train new head) and
fine-tuning (update top layers with low learning rate). Transfer learning enables
good results with limited task-specific data.
- Data Augmentation
-
Data augmentation creates synthetic training examples by applying transformations
to existing images—rotations, flips, zooms, color adjustments, and more. This
effectively increases training data size and teaches the model invariance to
transformations that don't change the label. Augmentation is applied randomly
during training; the original image is used during evaluation. It significantly
reduces overfitting, especially with limited data.
- Global Average Pooling
-
Global average pooling computes the average of each feature map across all spatial
positions, producing one value per channel. For a 7×7×512 feature volume, global
average pooling outputs a 512-dimensional vector. This replaces flattening and
dense layers at the end of CNNs, dramatically reducing parameters and providing
regularization. It also enables input images of varying sizes.
- Skip Connection (Residual Connection)
-
A skip connection adds the input of a layer block directly to its output, allowing
gradients to flow through the shortcut during backpropagation. Introduced in ResNet,
skip connections enable training very deep networks (100+ layers) by mitigating
vanishing gradients. The network learns residual functions (what to add to the input)
rather than full transformations, making optimization easier.