How Machines Learn to See: From Pixel Differences to Convolutions, ResNets and Scene Segmentation

Lex Fridman's MIT 6.S094 lecture walks from the basics of image classification through landmark network architectures to pixel-level segmentation, optical flow and the SegFuse competition.

LFLex FridmanHost · Lex Fridman Podcast
Channel
Lex Fridman Podcast
Video
53:13
Read
6 min
Original
English
Open on YouTube
Scroll to read and the video shrinks to the bottom-right corner. Captions follow your reading language.
Reading languageAvailable in 1 languages
You're reading the original English.
SUMMARY

In 30 seconds

Lex Fridman explains why computer vision is hard (a machine only sees numbers), then builds up from nearest-neighbor classifiers to convolutional networks and the ImageNet architectures AlexNet, VGGNet, GoogLeNet, ResNet and SENet. He then covers fully convolutional segmentation and optical flow, and introduces SegFuse, a competition that asks participants to use temporal information to improve driving-scene segmentation.

  1. 1To a machine an image is just numbersFridman keeps returning to the point that humans take vision for granted, so you should always ask whether the data the model is given is even sufficient for the task.
  2. 2Convolution works by reusing the same weights everywhereIf a feature that defines a cat is useful in the top-left corner, it is useful in every corner, and sharing those parameters across the image is what makes convolutional networks efficient.
  3. 3ResNet's residual blocks let networks become much deeperby passing the input along untransformed while still letting each layer learn something new, which makes training easier.
  4. 4The squeeze-and-excitation network won in 2017 with one small idea:let the network learn a weight for each channel of a feature map instead of leaving it fixed. Fridman reads it as a prompt to ask what else could be parameterized and learned.
  5. 5Every architectural trick throws something awayConvolution discards the spatial relationships between parts, such as eyes, nose and mouth, which is the problem Geoff Hinton's capsule networks aim to address.
  6. 6Labeling a single driving image at pixel level takes about 90 minutes,so no dataset yet has long videos with every frame fully segmented. SegFuse asks participants to close the gap by using optical flow to exploit temporal information.
FULL TEXT

Read the edited text by chapter

Transcript only
01

Vision is hard because machines see only numbers, lighting, pose and occlusion

Fridman opens by framing the lecture around SegFuse, a dynamic driving-scene segmentation competition that he says sits at the cutting edge of perception. Unlike the earlier DeepTraffic competition, which was designed to teach deep reinforcement learning, SegFuse could lead to publications. He notes that today's computer vision is largely deep learning, which here means supervised learning with human-annotated ground truth.

He insists on one idea: the machine receives raw numbers, whether a single channel or three RGB values per pixel, and must classify or regress from them. Humans take interpreting sensory input for granted, so we have to keep asking whether the data given to the machine is sufficient for the task. He draws a loose analogy to the layered visual cortex, where early layers pick up edges and later layers build higher-order meaning.

He lists the main difficulties. Illumination variability is among the biggest challenges for visible-light cameras in driving, followed by pose variability, since neural networks represent rotated or deformed objects poorly. Intra-class variation is large while differences between classes can be small, and occlusion forces a model to identify an object from just an ear or a leg. A cat dressed as a monkey eating a banana shows what is missing: context, humor and the temporal dynamics of the scene.

02

A pixel-difference classifier gets you started, but convolutional networks go much further

Fridman explains image classification as sorting new images into labeled bins, and lists datasets such as MNIST, CIFAR, ImageNet and Places. CIFAR-10 is the toy example, with tiny icons in ten categories including airplane, cat, dog and truck. All of these rely on ground-truth labels made by people.

His trivial classifier subtracts two images pixel by pixel and sums the differences. Finding the closest image in the dataset and copying its label, which is nearest neighbor, gives 35-38% accuracy on CIFAR-10, compared with 10% for coin flipping. Using the k closest images and voting does not rescue it much, while humans reach about 95% and convolutional networks come very close to 100%.

He then reviews the basic neural unit: weighted inputs, a bias and a nonlinear activation, stacked into hidden layers and trained by rewarding weights that led to correct decisions. For ten classes there are ten output neurons, and each one should get "excited" when its number is called. Convolutional networks, he says, are the trick that makes this work efficiently on big, complex image problems.

03

Convolution shares weights across space, and pooling condenses what the filters find

Convolutional networks exploit spatial invariance: a cat in the top-left corner is the same as one in the bottom-right. Instead of fully connected edges, a window slides across the image applying the same weights, and the blocks take 3D volumes as input and output. Depth is the number of filters, stride is the step size, and padding is zeros added around the input.

He steps through a worked example with a three-channel input, two 3x3 filters per channel plus a bias, and a stride of two, producing a two-channel output. The learned filter values are the parameters, and reusing them across the image greatly reduces how many are needed. Examples of filters include the identity filter and several edge detectors, with each filter producing a map showing where its pattern was found.

Pooling, traditionally max pooling, reduces resolution by keeping the strongest activations. That helps combine features into higher-order entities but hurts when precise spatial detail is needed, as in segmentation. Stacked convolutional layers followed by fully connected layers or other task-specific parts make a convolutional network.

04

ImageNet architectures advanced through simple, general ideas

ImageNet, with 14 million images and 21,000 categories, is the benchmark where architecture progress is measured, using top-five error. Fridman traces AlexNet, VGGNet, GoogLeNet, ResNet, CUImage and SENet, and notes that human error is 5.1% on the classification task. ResNet beat that in 2015 with about 4% error.

AlexNet and VGGNet are uniform, stacked convolution and pooling layers ending in fully connected ones. The 16- or 19-layer VGGNet has 138 million parameters. GoogLeNet's inception module runs 1x1, 3x3 and 5x5 convolutions together, because small ones capture local texture and larger ones capture abstract features, which needs fewer parameters if the modules are placed well.

ResNet's residual block passes the input along untransformed while letting the layer learn something new, which makes training much easier and allows much deeper networks. Fridman notes the original belief that depth itself explains the gains does not necessarily hold. In 2017 the squeeze-and-excitation network cut error from about 4% to 3% by adding a learnable weight per channel, and he says it can be added to any architecture and invites asking what else could be made learnable.

He closes by mentioning capsule networks from Geoff Hinton, which he says will get an online-only lecture. The point for now is to ask what assumptions a successful network makes and what it throws away. Convolution discards the relationships between simple and complex parts, so a face with scrambled features can still fire as "a face".

05

Fully convolutional networks classify every pixel, which matters when boundaries matter

To segment an image, you take a classification network, chop off the final layer and add decoder parts that upsample the encoded features into a heat map. Semantic segmentation then colors every pixel with the object it belongs to. Fridman calls it incredibly difficult despite three years of progress, because millions of pixels each need a label.

Precise boundaries matter in medical imaging, such as detecting tumors, and in driving and robotics, where vehicles, pedestrians and cyclists need exact outlines. Fusing such semantic labels with lidar's 3D map could give both what an object is and exactly where it is. The 2014 FCN paper repurposed ImageNet-trained networks this way, and skip connections improved its very coarse output.

He lists later components that define the state of the art: SegNet's encoder-decoder framework applied to driving data, dilated convolutions that keep local high-resolution texture, and DeepLab's use of conditional random fields to smooth results based on image intensities. Better backbones from AlexNet to VGGNet to ResNet drove improvements. The setup used for the competition data adds dense upsampling convolution, which learns the upscaling filters rather than using bilinear upsampling, and hybrid dilated convolution that varies dilation rates for smoother output.

06

Optical flow lets segmentation use time, and SegFuse asks you to exploit it

Everything so far discards temporal dynamics, yet for driving and robotics, understanding how pixels move through time is essential. Dense optical flow estimates, for each pixel, the direction and distance it moved between two frames about 33.3 milliseconds apart at 30 frames per second. That lets information detected in one frame be propagated forward.

Fridman says manual annotation is the bottleneck: coloring every pixel of one image in the state-of-the-art Cityscapes driving dataset takes about 90 minutes. That is why no dataset exists with long videos where every frame is fully segmented, and the class hopes to create one. He describes FlowNet from 2015, in which FlowNetS stacks two RGB frames into a six-channel input and FlowNetC uses a correlation layer, and FlowNet 2.0 from December 2016 combines them for smoother flow and runs at roughly eight to 140 frames per second depending on the variant.

The SegFuse data includes original 1080p driving video around Cambridge, an 8K 360-degree video, ground-truth segmentation of the training set labeled on Mechanical Turk, the output of a state-of-the-art frame-by-frame segmentation network, and optical flow from FlowNet 2.0. The task is to use temporal information to improve the network's per-frame segmentation toward the ground truth. There are 10,000 images, starter code in Python on GitHub, and a submission of code.

More from this channel

3:36:56EN
Lex Fridman· Sep 16, 2026PodcastPsychiatry Has Never Found Its PenicillinHost Lex FridmanHistorian Andrew Scull tells Lex Fridman why the field can ease symptoms, has never cured a major mental illness, and keeps paying for overconfidence with patients' lives.Mental HealthPublic HealthNeuroscience
5:15:51EN
Lex Fridman· Aug 26, 2026Podcast · 2 speakersDHH Did Not Write a Line of Omarchy QuattroGuest DHH · Host Lex FridmanThirteen months after a skeptical conversation with Lex Fridman, the Rails creator describes how Opus 4.5, a swarm of coding agents, and a one-minute Linux installer ended his era of hand-chiseled Ruby.Coding agentsVibe CodingAgent engineering+3
3:12:58EN
Lex Fridman· Aug 12, 2026Podcast · 2 speakersOne Cold Shower, Twenty Champions: How Khabib Nurmagomedov Was ForgedGuest Khabib Nurmagomedov · Host Lex FridmanIn a Makhachkala school gym, seventy men shared one shower, and the water was only cold.Martial ArtsCombat SportsCoaching+3
3:46:18EN
Lex Fridman· Jul 28, 2026Podcast · 2 speakersIf You Take Slavery Out of the Picture, There Is No Civil WarGuest Gary Gallagher · Host Lex FridmanIn 1860, enslaved people were worth more than every railroad and factory in the United States combined.Political PhilosophyLeadershipHistory
3:51:47EN
Lex Fridman· Jun 30, 2026Podcast · 2 speakersForty-Six Percent of Emperors Were Overthrown. The Empire Lasted AnywayGuest Anthony Kaldellis · Host Lex FridmanHistorian Anthony Kaldellis walks Lex Fridman through 2,200 years of Roman history and argues that what we call Byzantium was Rome itself.Political PhilosophyGeopoliticsLeadership
2:53:42EN
Lex Fridman· May 29, 2026Podcast · 2 speakersThe Moon Is Falling. It Just Keeps Missing.Guest Biggest Mysteries in Physics · Host Lex FridmanFermilab physicist Don Lincoln tells Lex Fridman that the history of physics is a history of unification, and that antimatter, dark energy, and a theory of everything still sit far beyond the experiments we can run.Quantum MechanicsScience CommunicationPhilosophy of Science