The History of AI, Part 14: AlexNet and the 2012 Turning Point
DEV Community

The History of AI, Part 14: AlexNet and the 2012 Turning Point

The Moment They Combine

The History of AI, Part 14 of 24. Over thirteen chapters we've followed the dream of thinking machines through myths, logic, winters, booms, and the quiet rise of statistics. Part 12 assembled the ingredients. Now comes the moment they combine.

In the autumn of 2012, one neural network, trained on two gaming graphics cards, upended a field overnight.

On 30 September 2012, the organizers of the ImageNet Large Scale Visual Recognition Challenge posted the results of that year's competition. For anyone who followed computer vision closely, the leaderboard looked like a typo.

For two years, the best systems in the world had been inching forward. The 2010 winner had made mistakes on about 28 percent of test images; the 2011 winner, about 26 percent. The runner-up in 2012 would score 26.2 percent, right on trend. Everything about the field said that the next improvement would be a point or two.

But at the top of the table, in a different league, was an entry from the University of Toronto with an error rate of around 15 to 16 percent. It wasn't a point or two better. It was ten points better, a reduction in errors of more than a third, achieved in a single leap.

The entry was called SuperVision. History remembers it as AlexNet. This chapter is the story of that network, the people behind it, and the avalanche that followed.

The Team

AlexNet was built by three people.

Alex Krizhevsky was a graduate student at the University of Toronto, a Ukrainian-born programmer of unusual talent. Krizhevsky had a knack for squeezing performance out of GPUs. In 2009 and 2010, while working on a smaller image dataset called CIFAR-10, he had written a highly optimized GPU implementation of convolutional neural network training, a piece of code later known as cuda-convnet. This hard engineering work was the secret ingredient: it made it practical to train a big network on a lot of images.

Ilya Sutskever (right) at Stanford in 2014. Image: Steve Jurvetson from Los Altos, USA, CC BY 2.0, via Wikimedia Commons.

Ilya Sutskever, born in Russia and raised in Israel and Canada, was a fellow PhD student of Hinton's with a reputation for conviction bordering on the fanatical. He is said to have been the one who pushed his colleagues to try ImageNet, arguing that if you made a neural network large enough and trained it with enough data, it would simply work. Others in the lab were less sure. (Sutskever would go on to co-found OpenAI in 2015, a story we'll pick up in Parts 19 and 21.)

Geoffrey Hinton, their supervisor, was 64 at the time, a Cambridge-educated British-Canadian scientist who had been championing neural networks since the 1970s, including through the long periods when almost nobody else did. We met him in Part 9: co-author of the 1986 backpropagation paper, great-great-grandson of George Boole.

The setup was modest by today's standards. Krizhevsky trained the network on two Nvidia GTX 580 graphics cards, each with only 3 gigabytes of memory, in his bedroom at his parents' house, according to a story widely told about the project. The network was too big to fit on one card, so he split it across two. Training took five to six days. Those gaming GPUs, which cost about $500 each, did the job that would have required a supercomputer a decade earlier.

What AlexNet Actually Was

AlexNet wasn't a bolt from the blue conceptually. It was a convolutional neural network, the kind Yann LeCun had pioneered at Bell Labs in the late 1980s (Part 9), and its structure would have been familiar to him. What was new was the scale and a handful of crucial practical refinements.

The Architecture

The network had eight learned layers: five convolutional layers followed by three fully connected layers, ending in a 1,000-way output, one for each ImageNet category, whose values were converted into probabilities. In total, it had about 60 million parameters and 650,000 neurons. That was more than a hundred times larger than LeNet-5 of 1998.

The typical structure of a convolutional neural network. Image: Aphex34, CC BY-SA 4.0, via Wikimedia Commons.

The convolutional layers did the seeing. The first layer slid 96 small filters (11 by 11 pixels) across the input image, detecting basic patterns: oriented edges, color blobs, textures. The second layer combined those into more complex patterns, such as corners and curves. By the fifth layer, units responded to object parts: a wheel, an eye, a patch of fur. Then the fully connected layers combined these parts into a decision about which object was in the image.

You can see how the parameters are distributed with a few lines of arithmetic. The following code counts the parameters in each layer of the network (using the slightly slimmed single-tower variant found in popular software libraries, which has the same overall design):

def conv_params(k, c_in, c_out):
    return (k * k * c_in + 1) * c_out # weights + one bias per filter
def fc_params(n_in, n_out):
    return n_in * n_out + n_out
layers = {
    "conv1 (11x11, 3->64)": conv_params(11, 3, 64),
    "conv2 (5x5, 64->192)": conv_params(5, 64, 192),
    "conv3 (3x3, 192->384)": conv_params(3, 192, 384),
    "conv4 (3x3, 384->256)": conv_params(3, 384, 256),
    "conv5 (3x3, 256->256)": conv_params(3, 256, 256),
    "fc6 (9216->4096)": fc_params(256 * 6 * 6, 4096),
    "fc7 (4096->4096)": fc_params(4096, 4096),
    "fc8 (4096->1000 classes)": fc_params(4096, 1000),
}
total = sum(layers.values())
for name, n in layers.items():
    print(f"{name:28} {n:>12,} {100 * n / total:5.1f} %")
print(f"{'TOTAL':28} {total:>12,}")

Run it and you'll see roughly 61 million parameters, with the three fully connected layers holding over 90 percent of them, while the convolutional layers (with their few parameters reused at every position in the image) do most of the computational work. That asymmetry, few parameters but heavy compute in the convolutional layers, many parameters but light compute in the dense layers, is a recurring theme in network design.

The Ingredients That Made It Work

AlexNet combined most of the tricks we met in Part 12:

  • ReLU activations. Instead of sigmoids, AlexNet used the rectified linear unit, max(0, x). The paper reported that a network with ReLUs reached a given training error several times faster than the same network with tanh units. Fast training was the difference between an experiment that finishes in a week and one that never finishes.
  • GPU training. Two GPUs, with the network split across them, and a clever scheme in which the cards communicated only at certain layers.
  • Dropout. In the fully connected layers, half the units were randomly switched off during each training step, preventing the huge dense layers from simply memorizing the training set.
  • Data augmentation. The team artificially enlarged the training set, 1.2 million images, by randomly cropping, flipping horizontally, and slightly altering the colors of the training images, so the network never saw exactly the same image twice. This was a cheap and powerful defense against overfitting.
  • Overlapping pooling and local response normalization. Two other design choices that helped a little (the latter was later abandoned as unnecessary).
  • Big data. ImageNet's 1.2 million labeled images were exactly what such a large network needed.

None of these ideas was entirely new. The achievement was in assembling them all, getting them to work together, and scaling up. It's a pattern worth remembering: breakthroughs in AI are often less about a single brilliant idea than about the right combination at the right scale, executed with great engineering skill.

The Reaction

The results were presented at a workshop at the European Conference on Computer Vision in Florence in October 2012. The paper, "ImageNet Classification with Deep Convolutional Neural Networks," appeared at the NIPS (now NeurIPS) conference in December. In the years since, it has become one of the most cited papers in the history of computer science, with well over a hundred thousand citations.

The reaction within the computer vision community was a mix of astonishment, excitement, and denial. Researchers who had spent their careers designing clever hand-built feature extractors, such as SIFT, HOG, and Fisher vectors, suddenly saw a "generic" learning machine with no hand-designed features outperform all of their work by a huge margin. It was the vision-field equivalent of a rookie walking into a chess tournament and beating the grandmasters.

Yann LeCun, who had been working on convolutional networks for twenty-five years, was in the audience in Florence. People who were present have described the session as a turning point: some skeptics asked whether the network might be exploiting some quirk of the dataset. But within months, the dominant opinion had flipped. Research groups around the world dropped what they were doing and began training deep convolutional networks. By the 2013 ImageNet challenge, almost every top entry used deep learning. Within a few years, essentially all of computer vision did.

The speed of the shift is staggering in retrospect. The field's central approach, built up over some forty years, was effectively replaced within about eighteen months.

The Gold Rush

The AlexNet result triggered a scramble that reshaped the technology industry.

The Auction

Geoffrey Hinton at the 2024 Nobel Prize events. Image: Jennifer 8. Lee, CC BY-SA 4.0, via Wikimedia Commons.

In late 2012, Hinton, Krizhevsky, and Sutskever formed a tiny company called DNNresearch, with no products and essentially no assets beyond themselves and their papers. Several tech giants wanted them. Hinton, who was working on a deadline, was reportedly flying to a conference at Lake Tahoe in December 2012 when the story of what happened next, as told in Cade Metz's book Genius Makers, became legend: he decided to run an auction for the company among Google, Microsoft, Baidu, and DeepMind.

The bidding rose in a hotel room at Harrah's casino, in million-dollar increments, until Hinton called a halt at $44 million, selling to Google. The price, for a three-person company with no product, announced that AI talent had become one of the most valuable commodities on earth.

Hinton joined Google and divided his time between Toronto and Mountain View, until he resigned in 2023 to speak more freely about the risks of the technology he helped create (see Part 24).

The Talent War

What followed was a frenzy: Google bought the London start-up DeepMind in January 2014 for a reported $500 million or more, for a team that had barely any product. (DeepMind's story is central to Parts 17 and 21.) It also created the Google Brain group, which Andrew Ng, Jeff Dean, and Greg Corrado had started in 2011. Facebook created Facebook AI Research (FAIR) in December 2013 and hired Yann LeCun to lead it. Baidu hired Andrew Ng to lead a lab in Silicon Valley in 2014. Microsoft, Amazon, Apple, IBM, and Nvidia all expanded their research.

Nvidia pivoted decisively, tuning its chips and software libraries (such as cuDNN, released in 2014) specifically for neural network training. Its stock price would eventually climb into the trillions. Universities found their top machine learning professors recruited by industry with salaries and compute budgets they couldn't match, a dynamic that continues to this day. Academic conferences, which had been small, collegial gatherings (NIPS had only a few hundred attendees in the 2000s), ballooned. By the late 2010s they had tens of thousands of attendees and sold out within minutes.

The Tools

A wave of open-source software lowered the barrier to entry:

  • Theano (Universitรฉ de Montrรฉal), Torch, and Caffe (Berkeley, 2013 to 2014) offered early frameworks.
  • Keras (2015, by Franรงois Chollet) made building networks accessible to ordinary programmers.
  • TensorFlow, released by Google in November 2015, and PyTorch, released by Facebook in 2016 to 2017, became the standard tools. PyTorch's flexible style won over researchers; today it is the dominant research framework.

Google announced a custom chip, the Tensor Processing Unit (TPU), in 2016, designed specifically for neural network math.

Equally important was the culture of openness: researchers posted their papers on arXiv immediately, released code, and shared pretrained models. The pace of progress accelerated because everyone could build on everyone else's work within days.

The Cascade of Improvements

Once the world noticed that deep convolutional networks worked, they got better and better, at an astonishing pace. The ImageNet challenge itself became a scoreboard for the progress.

Year Winning system Top-5 error 2010 Traditional features + SVM (NEC-UIUC) ~28% 2011 Traditional features (Xerox) ~26% 2012 AlexNet (8 layers) ~16% 2013 ZFNet / Clarifai (tweaked AlexNet) ~11.7% 2014 GoogLeNet (22 layers) and VGG (19 layers) ~6.7% / ~7.3% 2015 ResNet (152 layers) ~3.6% 2017 SENet (final competition) ~2.3%

For comparison, the researcher Andrej Karpathy, then a Stanford PhD student, took on the task of classifying ImageNet images himself in 2014, spending days training himself on the categories, and reached a top-5 error of about 5.1 percent. In 2015, Microsoft's ResNet beat that human benchmark. Machines were now better than a dedicated person at this particular image classification task, a fact that made headlines worldwide. (There are many caveats, including that the labels themselves contain errors, and that a human can do things the network can't. But the milestone was real.)

Deeper and Deeper: ResNet

The trend of 2012 to 2015 was toward depth: more layers meant better results, as long as you could train them. The vanishing gradient problem had not gone away. When researchers tried simply stacking more layers, accuracy at some point got worse, even on the training data, a puzzling "degradation" phenomenon.

The solution, from Kaiming He

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.