Home Lex Fridman Episode
Lex Fridman · 2016-09-27

Deep Learning for Computer Vision (Andrej Karpathy, OpenAI)

Andrej Karpathy delivers a deep-dive lecture on how convolutional neural networks revolutionized computer vision.

Deep Learning for Computer Vision (Andrej Karpathy, OpenAI)
The guest

Andrej Karpathy: Deep learning researcher at OpenAI, creator of Stanford's CS231N convolutional networks course, ConvNetJS, and arxiv-sanity.com

What this episode covers

This is a technical lecture by Andrej Karpathy covering deep learning for computer vision, focused on convolutional neural networks (CNNs). He traces the field's history from Hubel and Wiesel's 1960s cat experiments through Fukushima's neurocognitron, Yann LeCun's 1990s LeNet, and the 2012 AlexNet breakthrough that transformed the field. He explains the mechanics of convolutional, pooling, and fully connected layers, then walks through the evolution of winning ImageNet architectures (AlexNet, ZFNet, VGGNet, GoogLeNet, ResNet). The talk closes with practical guidance on hardware, software frameworks, architecture selection, hyperparameters, and distributed training, followed by an extended audience Q&A.

Recommended on this episode

ProductRecommended

Keras

Keras

“my go-to number one thing to look at”
“90% of the use cases are probably addressable with things like KAS. So KAS would be my go-to number one uh thing to look at.”— Andrej Karpathy
ProductRecommended

Torch

“I still really like Torch”
“I've used Torch for a long time. I still really like Torch. It's very lightweight, interpretable. It works just just fine.”— Andrej Karpathy

The guest's own work

ProductBy the guest

ConvNetJS

Andrej Karpathy

“this is comjs. uh this is um a deep learning library for training convolutional neural networks that I've that is implemented in JavaScript. I wrote this”— Andrej Karpathy
ProductBy the guest

arxiv-sanity.com

Andrej Karpathy

“I think this is a natural point to plug very briefly my archivesity.com. So this is the best website ever and what it does is it crawls archive”— Andrej Karpathy

Also referenced (named, not recommended)

ProductReferenced

TensorFlow

Google

“Keras is a layer over TensorFlow or Theano. Uh and basically it's just a higher level API over either of those.”— Andrej Karpathy
ProductReferenced

Theano

“Keras is a layer over TensorFlow or Theano. Uh and basically it's just a higher level API over either of those.”— Andrej Karpathy
ProductReferenced

NVIDIA DIGITS DevBox

NVIDIA

“Nvidia uh has these digits dev boxes that you can buy. They have Titan X GPUs which are strong GPUs.”— Andrej Karpathy
ProductReferenced

NVIDIA DGX-1

NVIDIA

“you can buy DGX1, which has the newest Pascal P100 GPUs. Unfortunately, the DGX1 is about $130,000. So, this is kind of an expensive supercomputer.”— Andrej Karpathy
ProductReferenced

NVIDIA Titan X

NVIDIA

“They have Titan X GPUs which are strong GPUs.”— Andrej Karpathy
ProductReferenced

NVIDIA Tesla K80

NVIDIA

“those are powerful GPUs K80s that would be available to you”— Andrej Karpathy
ProductReferenced

Microsoft Azure

Microsoft

“Microsoft Azure is coming up, Azure is coming up with its own offering soon. Uh, so I think uh they've announced it and it's in some kind of a beta stage”— Andrej Karpathy
ProductReferenced

Cirrascale

Cirrascale

“At OpenAI for example, you use Cirrus Scale. So Serale is much more a slightly different model. You can't spin up GPUs on demand, but they allow you to rent a box in the cloud.”— Andrej Karpathy
ProductReferenced

NVIDIA CUDA

NVIDIA

“we're talking about uh Nvidia releasing the CUDA library that allows you to efficiently create all these matrix vector operations and apply them on arrays of numbers.”— Andrej Karpathy
ProductReferenced

Caffe

“neural network called Alexet running in cafe. By interacting with the network, we can see what some of the neurons are doing.”— Andrej Karpathy

Big reveals from this episode

  • By 2016 ImageNet top-5 error dropped to about 3.57%, roughly matching or beating estimated human accuracy of 2-5%.
  • CNNs replaced multi-page hand-engineered feature extraction pipelines with end-to-end trained networks, drastically cutting code complexity.
  • Features learned by pre-training on ImageNet transfer remarkably well to entirely different datasets and tasks.
  • In ~20 years the two main algorithmic advances over LeNet were dropout and ReLU, both essentially one-line changes that set values to zero.
  • Residual networks (ResNet) won ImageNet 2015 and many other challenges, enabling far deeper networks via skip connections acting as a gradient superhighway.
  • ResNets can be made much shallower and wider and still work as well or better, suggesting depth alone is not the key.
  • Karpathy's practical advice: 'don't be a hero' - use pre-trained ImageNet models and fine-tune rather than designing custom architectures.

Worth remembering

  • Spectrograms are 2D arrays, images 3D, videos 4D, and text can be treated as a 1D array of numbers.
  • Karpathy built a web interface to measure his own ImageNet accuracy by competing against a CNN, losing points mostly on dog-breed identification.
  • Some ImageNet test images are actually mislabeled, and ImageNet contains 50 different types of terriers.
  • CNN neurons learned to detect faces, wrinkles, and printed text on their own, despite labels only being provided at the final layer.
  • GoogLeNet has only 5 million parameters versus VGGNet's 140 million, mainly by discarding fully connected layers.
  • A 56-layer plain network performs worse than a 20-layer one even on training data, an optimization problem ResNet's skip connections solve.
  • NVIDIA's DGX-1 supercomputer cost about $130,000 at the time of the talk.
  • State-of-the-art networks were typically trained for a few weeks across four or eight GPUs costing about $1,000 each.