ImageNet Classification with Deep Convolutional Neural Networks
2012 · NeurIPS · ~11 min read
Read the original paperTrains an eight-layer convolutional network on two GPUs and cuts the best ImageNet top-5 error by about 40 per cent. Read it to see how ReLU, dropout, augmentation and GPU code turned an old idea into one that worked.
In 2011, a program that had to tell a photograph of a dalmatian from one of a fire hydrant did not get to decide what to look at. It ran a feature extractor that a researcher had designed by hand, usually SIFT or HOG, which summarised small patches of the image as histograms of edge directions. Those descriptors were pooled into one long vector per image and a linear classifier was trained on the vectors. Years of doctoral work went into the extractors. The classifier was the only part that learned anything from the data.
On the ImageNet challenge (1.2 million training photographs, 1,000 categories) the 2011 winner still missed the correct label in its top five guesses on about a quarter of the test images. In 2012 a team of three from Toronto entered a network that learned everything from raw pixels. Its top-5 error was 15.3 per cent; the second-best entry was at 26.2. A gap that size had not been seen on the benchmark before.
This explainer walks through what that network computed, works one filter by hand, counts where its sixty million parameters sit, and shows why four specific decisions (ReLU, GPUs, data augmentation and dropout) separated a known idea from a working one. By the end you should be able to read the paper’s architecture section and say what problem each choice was solving, and what it cost.
Why the hand-built pipeline stopped improving
A hand-designed descriptor answers a fixed question: which edge orientations are present in this patch? That is a good first question. The trouble is the second and third questions. Is this arrangement of edges a dog’s ear, or a leaf? Are these two ears and a snout a face? The old pipelines never learned those intermediate concepts. They jumped from edge statistics straight to “dalmatian”, and a linear classifier on top can only weigh the evidence it is given.
Convolutional networks that learned all the stages already existed. LeCun’s networks read handwritten digits on cheques in the 1990s. The common view in 2011 was that they did not scale: they were slow to train, and with millions of free weights they memorised small datasets rather than generalising. Two things had changed by 2012. ImageNet supplied a labelled dataset a thousand times larger than the digit sets, and NVIDIA’s CUDA made graphics cards programmable for general arithmetic. The paper’s contribution is the set of choices that turned those two facts into a network that trained in a week and did not overfit.
One filter, worked by hand
A convolutional layer slides a small grid of weights across the image and, at each position, multiplies the weights by the pixels underneath and adds the products. Take a 3×3 filter that responds to a vertical edge where the image gets brighter towards the right:
filter patch A patch B patch C
-1 0 1 0 0 1 1 1 1 1 1 0
-2 0 2 0 0 1 1 1 1 1 1 0
-1 0 1 0 0 1 1 1 1 1 1 0On patch A, only the right-hand column is lit, so the sum is 1 + 2 + 1 = 4. Patch B is uniformly bright: the left column contributes −4, the right column +4, and the response is 0. Patch C has the edge the other way round, and the response is −4. A bias is added, and then the ReLU keeps the positive part: max(0, x). With a bias of zero, the outputs are 4, 0 and 0. The layer has said, at each location, “a dark-to-light vertical edge is here” or “it is not”.
Now change one thing. Shift the edge in patch A one pixel to the right in the original image. The same nine weights are applied at every position, so the strong response moves one position to the right in the output map. Nothing has to be relearned. That is weight sharing, and it is the assumption that makes convolution cheap: a feature that is useful in one part of the image is useful everywhere. A pooling layer that follows takes the maximum over small neighbourhoods, so a one-pixel shift often leaves the pooled output unchanged.
Click pixels to toggle them. The output is the filter's response at each position: a feature map. A deep network stacks dozens of these, each layer reading the maps of the one below.
Before 2012 the winners used features designed by hand (edges, corners, colour histograms) and the error fell a point or two a year. AlexNet learned its filters from the pixels and cut the error from 25.8% to 16.4% in one step. Every winner since has been a deeper network of the same kind, and the 2015 entry passed the estimated human error of about 5%.
AlexNet did not use hand-written filters like this one. Its first layer had 96 filters of 11×11 pixels over three colour channels, applied every fourth pixel, and all their weights were learned. When the authors plotted them (Figure 3 of the paper), most looked like oriented edge detectors and colour blobs. The network had rediscovered roughly what SIFT encoded, and then it went on to learn the layers that SIFT did not have.
AlexNet has about 60 million parameters across five convolutional layers and three fully connected layers. Before reading on, guess what share of the parameters are in the three fully connected layers.
Show the worked answer
About 96 per cent. The first fully connected layer takes the last convolutional output, 6×6×256 = 9,216 numbers, and connects every one to each of 4,096 units: 37.7 million weights in one layer. The second is 4,096 × 4,096 = 16.8 million, and the output layer is 4,096 × 1,000 = 4.1 million. That is 58.6 million. All five convolutional layers together hold about 2.3 million.
The arithmetic runs the other way. The convolutional layers apply their small filters at thousands of positions, so they perform roughly 90 per cent of the multiply-adds. The parameters, and so the risk of memorising, live in the fully connected layers; the time lives in the convolutions.
Where the sixty million parameters live
The split in that answer explains where the paper aimed its fixes. Here is the count, layer by layer, using the shapes in the paper. The second, fourth and fifth convolutional layers see only 48 or 192 input channels rather than 96 or 384 because the network was cut in half across two GPUs, and those layers only read the maps on their own card.
| layer | filters or units | weights (approx.) | multiply-adds per image (approx.) |
|---|---|---|---|
| conv1 | 96 × 11×11×3, stride 4 | 35 thousand | 105 million |
| conv2 | 256 × 5×5×48 | 307 thousand | 224 million |
| conv3 | 384 × 3×3×256 | 885 thousand | 150 million |
| conv4 | 384 × 3×3×192 | 664 thousand | 112 million |
| conv5 | 256 × 3×3×192 | 442 thousand | 75 million |
| fc6 | 9,216 → 4,096 | 37.7 million | 37.7 million |
| fc7 | 4,096 → 4,096 | 16.8 million | 16.8 million |
| fc8 | 4,096 → 1,000 | 4.1 million | 4.1 million |
Compare the first row with a fully connected alternative. A 224×224 colour image is 150,528 numbers. Connecting it to a modest 1,000 hidden units would take about 150 million weights, more than the whole of AlexNet, and those units would have to learn the same edge detector separately for every location. The convolution gets 96 learned detectors, usable anywhere, for 35 thousand weights.
Four decisions that made it trainable
ReLU. Networks of the time mostly used tanh or the logistic sigmoid as the non-linearity. Both flatten out for large inputs. The slope of tanh at an input of 3 is about 0.01, so a unit in that range passes back a hundredth of the error signal, and the weights feeding it barely move. ReLU’s slope is exactly 1 for any positive input. The paper’s Figure 1 shows a small four-layer network on CIFAR-10 reaching 25 per cent training error about six times faster with ReLUs than with tanh. At the scale of a week-long run, a six-fold difference decides whether the experiment can be done at all.
Two GPUs. The authors trained on two NVIDIA GTX 580 cards with 3 GB of memory each, using CUDA code Krizhevsky wrote himself. Ninety passes over the 1.2 million images took five to six days. The network did not fit on one card, so half the filters of each layer live on each GPU and the halves exchange activations only at the third convolutional layer and in the fully connected layers. The paper reports that this two-card network beat a one-card network with half as many filters per layer by 1.7 points of top-1 error. The split was a memory workaround that happened to cost little accuracy.
Data augmentation. Every training image was resized to 256×256, and on each pass the network saw a random 224×224 crop of it, possibly mirrored left to right. There are 32 × 32 crop positions and two orientations, so one photograph becomes 2,048 slightly different training examples. The variants are highly correlated, so this is not 2,048 times more information, but it stops the network from memorising exact pixel positions. A second trick perturbed the colours along the principal components of the dataset’s RGB values, which the paper says cut top-1 error by over a point. At test time the network averaged its predictions over ten crops (four corners and the centre, plus their mirrors), which multiplies inference cost by ten.
Dropout. During training, each unit in the first two fully connected layers is set to zero with probability 0.5 on every example. A unit cannot rely on any particular partner being present, so it has to learn features that are useful on their own. At test time all units are kept and their outputs are halved to keep the expected input the same. Dropout had been proposed by Hinton’s group earlier that year; this was its first big public result.
| decision | problem it addressed | what the paper reports | what it cost |
|---|---|---|---|
| ReLU instead of tanh | slow learning when units saturate | about 6× faster to a fixed training error on a small benchmark | unbounded outputs; the paper added a normalisation step to compensate |
| two GPUs, hand-written CUDA | a week of training instead of months; 3 GB memory ceiling | split network beat a half-width single-GPU network by 1.7 top-1 points | an architecture shaped by memory, with custom communication code |
| random crops, flips, colour shifts | memorising exact images | colour shifts alone: over 1 point of top-1 | ten forward passes per test image |
| dropout in fc6 and fc7 | overfitting in the 58 million fully connected weights | without it, “substantial overfitting” | roughly twice as many iterations to converge |
| local response normalisation | large ReLU outputs drowning neighbours | 1.4 points of top-1 | later found unnecessary and dropped |
Take dropout out and watch it fail
The paper gives a rough way to see why overfitting was the central risk. With 1,000 classes, each training label carries about 10 bits of information (210 ≈ 1,000). The 1.2 million labels supply around 12 million bits of constraint. The network has 60 million parameters, each a 32-bit float. Nothing in the labels forces those parameters to encode anything general; there is ample room to store a lookup table of the training set.
Run the experiment without dropout. Training error keeps falling, because the fully connected layers are large enough to fit the training images individually. Validation error falls for a while, then flattens and begins to rise as the network starts fitting the noise particular to each training photograph. The paper does not give the curve, only that overfitting without dropout was substantial. The usual response at the time would have been to make the network smaller, which also throws away the capacity that made it accurate.
Dropout was the alternative. Halving the active units on each example acts like training a large family of thinner networks that share weights and averaging them at test time. The price was time: the authors note that dropout roughly doubled the number of iterations needed to converge. Data augmentation worked alongside it from the input side. The combination let them keep a network big enough to win.
The authors also report one ablation that settled an argument about depth. Removing any one of the middle convolutional layers raised top-1 error by about two points, even though each of those layers held only about one per cent of the parameters. The depth of the network, not its width alone, was doing work.
What later work changed
Almost every specific choice in AlexNet was revised within three years, which is a fair measure of how much of the paper was engineering under constraint rather than principle. Zeiler and Fergus (2013) visualised what each layer responded to and found the 11×11, stride-4 first layer was too coarse; a 7×7 filter with stride 2 did better. The VGG networks (2014) used only 3×3 filters, stacked: two 3×3 layers cover the same 5×5 area as one 5×5 filter with 18 weights per channel pair instead of 25, plus an extra non-linearity. VGG also reported that local response normalisation did not help, and it disappeared.
Batch normalisation (2015) made deep networks far easier to train and reduced the need for dropout. GoogLeNet and later designs replaced the giant fully connected layers with global average pooling, which removed most of the parameters the table above counts. ResNet (2015) added skip connections that let networks reach 152 layers, and its ImageNet top-5 error was 3.6 per cent. The two-GPU split survived in an unexpected form: grouped convolutions, where each filter sees only a subset of input channels, became a deliberate design tool in ResNeXt and the mobile networks.
The idea that lasted longest came from the paper’s Figure 4. The authors took the 4,096 numbers in the last hidden layer as a description of an image and showed that images with nearby vectors looked semantically alike, even when their pixels did not. Within a year, other groups showed that those features, lifted out of a network trained on ImageNet, beat hand-designed features on unrelated vision tasks. Pretrain on a large labelled set, then reuse the representation elsewhere: that pattern carried into language as well.
When this design is the wrong starting point
Nobody should build an AlexNet in 2026 except to learn from it. For a new vision task with a few thousand labelled images, the sensible start is a pretrained network (a ResNet, EfficientNet or Vision Transformer) fine-tuned on your data; training from scratch repeats the overfitting problem above with far less data than ImageNet. On a phone or a microcontroller, its 60 million parameters and ten-crop testing are the wrong trade, and architectures built for efficiency do much better per operation. With very large datasets, Transformers applied to image patches now match or beat convolutional networks. What the paper still teaches is the reasoning: find where the parameters and the arithmetic sit, and aim each fix at the part that is failing.
How to read the original
The paper is nine pages and readable in an evening. Start with Section 3, the architecture, which is ordered by the authors’ own estimate of importance: ReLU first, then the multi-GPU split, then normalisation and pooling. Section 3.5 and Figure 2 give the overall layout; Figure 2 is famously cropped at the top, and the stated 224-pixel input does not quite produce the 55×55 first-layer output (227 does), so do not lose time reconciling it. Read Section 4 on overfitting in full; it is where the 10-bits argument and the augmentation details live.
Skim the local response normalisation formula in Section 3.3; it no longer matters. In Section 6, look for the difference between the single-network result and the ensemble: the 15.3 per cent winning figure averaged seven networks, two of them pretrained on a larger ImageNet release, while one network alone was around 18 per cent on validation. That is still far ahead of the runner-up, but it is worth knowing what was compared. Then spend time on Figures 3 and 4, the learned filters and the nearest-neighbour images, which make the case for learned features better than any table.
AlexNet showed that a network could learn what to look for in pixels, given enough examples and arithmetic. Words have no pixels. The next paper, word2vec, asks what the equivalent of a learned edge detector is for vocabulary, and answers it with a model that is deliberately much simpler than this one.
The original. Read it after this page; the explainer above is a map, not a substitute.
A visual tour of what AlexNet actually learned, layer by layer.
The course notes that taught a generation how convolutions, pooling and depth fit together.