Back to Study Material Deep Learning

Image classification

Image classification is the task of mapping an input image to one of a fixed set of category labels. A trained classifier receives pixels as input and retu...

Image classification

Defining the Classification Problem

Image classification is the task of mapping an input image to one of a fixed set of category labels. A trained classifier receives pixels as input and returns a probability distribution over possible classes, with the predicted class being the one assigned the highest probability. This is the foundational computer vision task on which convolutional neural networks demonstrated their first decisive advantages over hand-crafted feature methods.

The ImageNet Large Scale Visual Recognition Challenge, which contains over a million labeled photographs spanning a thousand categories, became the benchmark that drove a decade of architecture improvements. AlexNet won the 2012 challenge with a top-five error rate dramatically lower than the nearest non-deep-learning competitor, marking the beginning of the modern deep learning era in computer vision.

Exam tip: Top-five accuracy counts a prediction as correct if the ground-truth label appears anywhere in the model's five highest-probability predictions, rather than requiring the top-one prediction to be correct. Understanding this distinction helps interpret benchmark tables correctly and explains why top-five numbers are always higher than top-one numbers.

Architecture Evolution: AlexNet to EfficientNet

The sequence of architectures developed for ImageNet classification reveals systematic patterns in how the field improved accuracy. AlexNet used large convolutional filters and local response normalization. VGG showed that stacking many small 3-by-3 filters outperforms using larger filters, establishing the importance of depth. GoogLeNet introduced the inception module, which processes input at multiple scales simultaneously within a single layer. ResNet added skip connections that allow gradients to bypass layers, enabling successfully training networks of over a hundred layers.

Later work moved from manual architecture design toward principled scaling and neural architecture search. EfficientNet introduced a compound scaling rule that simultaneously increases width, depth, and resolution by a constant factor, producing a family of models with excellent accuracy-to-parameter trade-offs across different compute budgets.

Knowing this progression is useful for interview discussions because it demonstrates understanding not just of individual architectures but of the principles that motivated each step forward.

Softmax, Cross-Entropy Loss, and Regularization

The final layer of a classification network produces unnormalized scores called logits, one per class. The softmax function converts these into a valid probability distribution by exponentiating each logit and dividing by the sum of all exponentiated logits. This ensures the outputs are positive and sum to one.

During training, the cross-entropy loss measures the discrepancy between the predicted distribution and the one-hot ground-truth distribution. Minimizing this loss is equivalent to maximizing the log probability assigned to the correct class. The loss is differentiable with respect to the logits, allowing gradients to flow back through the entire network during backpropagation.

Regularization techniques prevent overfitting, which is particularly important when labeled training data is limited. Dropout randomly zeroes activations during training, forcing the network to develop redundant representations. Data augmentation artificially expands the training set by applying random crops, flips, color jitter, and other transformations that preserve the label. Label smoothing softens the one-hot targets slightly, improving calibration and generalization on held-out data.