CS231N: Computer Vision with Deep Learning
Comprehensive Study Notes: CS231N - Computer Vision and Deep Learning
Introduction to Computer Vision and AI
Computer vision is a core, integral part of artificial intelligence. Vision is not merely a component of intelligence — it is considered a cornerstone to intelligence. Unlocking the mystery of visual intelligence is fundamentally tied to unlocking the mystery of intelligence itself. The primary mathematical tool used to approach AI problems is machine learning (or statistical machine learning), and within that, a major revolution over the past decade+ is deep learning.
Deep learning is built around a family of algorithms called neural networks.
The scope of this course is the core intersection of computer vision, machine learning, and deep learning — not the entirety of any single field.
AI and computer vision are increasingly interdisciplinary, intersecting with natural language processing, speech recognition, robotics, mathematics, neuroscience, computer science, psychology, physics, biology, and application areas from medicine to law to education.
The Evolution of Vision
The Cambrian Explosion and the Origin of Vision
The history of vision did not begin with humans. It began 540 million years ago during the Cambrian explosion — a short period (about 10 million years) when animal species rapidly diversified. Before this, life was passive, based purely on metabolism.
The most compelling theory for this explosion is the onset of vision: the first trilobites developed photosensitive cells — a simple pinhole that collected light.
With senses, organisms became active participants in their environment. Vision (along with tactile sensing) drove the evolution of the nervous system and intelligence. Over 540 million years, the evolution of vision is the evolution of intelligence. Today, almost all animals use vision as a primary sense. Humans are especially visual: more than half of our cortical cells are involved in visual processing.
Humans Building Seeing Machines
Humans have long sought to build machines that see. Historical examples include:
Leonardo da Vinci studied camera obscura for seeing machines.
Ancient Greek and Chinese thinkers explored projecting objects through pinholes.
Modern cameras are widespread, but cameras alone are not enough — understanding visual intelligence is the crux.
Early History of Computer Vision
Neuroscience Foundations (1959)
The seminal work of Hubel and Wiesel in the 1950s studied the visual pathways of mammals (anesthetized cats) using electrodes. Two critical discoveries:
Receptive fields: Neurons in the primary visual cortex each have their own confined patch of visual space and respond to specialized patterns — especially oriented edges (e.g., different neurons respond to edges at different angles).
Hierarchical processing: As signals move deeper along the visual pathway, neurons feed into others, creating more complex receptive fields (from edges to corners to objects). This hierarchical structure profoundly influenced neural network modeling.
Hubel and Wiesel later won the Nobel Prize in Medicine for this work.
The First PhD Thesis in Computer Vision (1963)
Larry Roberts wrote the first PhD thesis in computer vision, focusing on understanding shapes and surfaces from 2D images — an intuitive task for humans but challenging for machines.
The 1966 MIT Summer Project
An MIT professor hired undergraduates to "solve computer vision" in one summer — an overly optimistic goal. Vision was not solved; it blossomed into a major computer science field. Annual computer vision conferences now attract over 10,000 attendees.
David Marr's Framework (1970s)
David Marr's book systematically analyzed visual processing, inspired by neuroscience and cognitive science. He proposed stages:
Primal sketch: edges and basic features (similar to early visual cortex).
2½D sketch: separates depth and foreground/background.
Full 3D representation: the ultimate goal — recovering the complete 3D world.
This framework remains influential.
Challenges in Vision
The Ill-Posed Problem
Visual perception is fundamentally an ill-posed problem: the world is 3D, but light projects onto a 2D surface (retina or camera sensor). Recovering 3D information from 2D images is the core challenge nature and computer vision must solve.
Nature's solution: two eyes (or more) provide binocular disparity, but correspondences must still be solved.
Human 3D perception is not geometrically precise — we have rough but effective understanding.
Vision vs. Language
Language does not exist in nature; it is generated by the brain, sequential, 1D. This makes language modeling (e.g., LLMs) tractable. Vision, by contrast, reflects a physical world obeying the laws of physics. The two domains have fundamentally different structures.
AI Winter and Continued Progress
The 1970s and 1980s: Early Algorithms
Early computer vision pioneers worked without powerful computers, large datasets, or modern math:
Generalized cylinders (Rodney Brooks and Tom Binford at Stanford) for object recognition.
Compositional models of human body and objects.
Edge detection algorithms improved.
Despite progress, the field entered an AI winter — enthusiasm and funding dwindled as many promises went unfulfilled. However, research continued beneath the surface.
Cognitive and Neuroscience Insights
Cognitive and neuroscience provided the "north star" for vision tasks:
Biederman's experiment: Detection of bicycles in an image differs depending on whether the surrounding image is scrambled or natural — showing that seeing the whole scene impacts object perception.
Visual processing is fast: In a 10 Hz video (100ms per frame), humans effortlessly detect a human they've never seen before.
Simon Thorpe's EEG study: Brain signals differentiate "animal vs. no animal" categories within 150 milliseconds — only a few neural processing hops. Human "wetware" is remarkably efficient.
Specialized Brain Areas (1990s-2000s)
MIT neurophysiologists discovered specialized brain regions for:
Face recognition (fusiform face area)
Place recognition (parahippocampal place area)
Body part recognition
This emphasized that object recognition in natural settings was a fundamental problem to pursue.
The Role of Data and the Deep Learning Revolution
The Data Problem
In the pre-deep learning era, datasets were small (thousands of images). Neural networks are high-capacity algorithms that require large amounts of data to generalize; without sufficient data, they overfit. The importance of data as a first-class citizen in machine learning was underappreciated.
ImageNet (2009)
Fei-Fei Li's lab recognized the critical need for large-scale data. They created ImageNet, a dataset of:
15 million images (after cleaning a billion)
Sorted into 22,000 categories (similar to the number of categories humans learn in early life)
A subset of 1 million+ images across 1,000 object classes was used for the ImageNet Large Scale Visual Recognition Challenge (ILSVRC)
The challenge ran annually, testing algorithms on object recognition. Initial years had best error rates near 30% (vs. human performance ~3%).
The 2012 Breakthrough: AlexNet
In 2012, Geoffrey Hinton and his students entered using a convolutional neural network (CNN) called AlexNet. They reduced the error rate by almost half, demonstrating the power of deep learning.
Two key advances enabled this:
Backpropagation (1986): A mathematically rigorous learning rule that automatically adjusts parameters — no hand-tuning needed.
Data: Large datasets like ImageNet provided the scale needed for high-capacity models.
Many consider 2012 and AlexNet the birth (or rebirth) of modern AI and the start of the deep learning revolution.
Post-2012 Explosion
Since 2012, computer vision conferences like CVPR have seen explosive growth in papers and attendance. New architectures built on AlexNet have pushed performance further. The convergence of three forces — computation, algorithms, and data — has driven sustained progress. Hardware (e.g., NVIDIA GPUs) has also played a major role, with computing power (GFLOPS per dollar) accelerating dramatically.
Modern Computer Vision Tasks
Vision extends far beyond classifying cats and dogs. Key tasks include:
Image Classification
Assign a single label to the entire image (e.g., "cat").
Semantic Segmentation
Label every pixel in the image with a category (e.g., grass, cat, tree, sky) but do not distinguish between individual object instances.
Object Detection
Identify objects and their locations using bounding boxes with associated labels.
Instance Segmentation
Combine detection and segmentation: every object instance gets its own mask — the most granular understanding.
Video Understanding
Video classification: identify actions (running, jumping, dancing).
Multimodal understanding: combine vision and sound (e.g., someone playing a vibraphone).
Beyond Static Images
3D vision: reconstruct and generate 3D representations from images (voxels, shape completion, 3D object detection).
Visualization and interpretability: attention maps showing what the model focuses on.
Generative and Interactive Vision
Style transfer: reimagine images in the style of famous artworks.
Text-to-image generation (e.g., DALL·E, diffusion models).
Vision-language models: connect text and images in a shared space (retrieval, visual question answering).
Embodied agents: robots that perceive, plan, and act in the physical world.
Deep Learning Foundations
Linear Classification
A simple approach: each image is a point in a high-dimensional feature space; a linear classifier finds a hyperplane to separate classes (e.g., cats vs. dogs). However, linear models struggle when data is not linearly separable.
Neural Networks
Neural networks stack multiple layers of nonlinear operations, enabling modeling of complex functions. They power most modern vision systems.
Training Challenges
Overfitting vs. underfitting: Models must generalize to unseen data.
Regularization: Controls model complexity (e.g., weight decay, dropout).
Optimization: Finding best-fit parameters (e.g., stochastic gradient descent).
Key Architectures
Convolutional Neural Networks (CNNs): Use convolution, pooling, and fully connected layers. Designed for spatial data.
Recurrent Neural Networks (RNNs): For sequential data.
Transformers and attention mechanisms: Now dominant in vision and language.
Large-Scale Training
Data parallelism: Split data across multiple workers.
Model parallelism: Split model across devices.
Challenges: Synchronization, communication overhead.
Self-Supervised Learning
A branch where models learn representations from the data itself using pretext tasks (e.g., predicting rotation, contrastive learning) without labels. This has enabled training on vast unlabeled datasets.
Generative Models
Diffusion models: Learn to reverse a gradual noising process to generate new images (e.g., from text prompts).
These blend understanding, creativity, and control.
Human-Centered Applications and Implications
Bias and Ethics
Every large AI algorithm is driven by data, and data carries human biases. For example, face recognition algorithms exhibit the same biases as humans. AI can impact lives in areas like hiring, financial loans, and criminal justice. These are not purely engineering problems — they involve human factors and societal issues.
Positive Applications
Medical imaging: Radiology, pathology, and other visual diagnostics.
Scientific discovery: First image of a black hole used computer vision.
Sustainability and environmental monitoring.
AI for aging population and patient care — a focus area of the course's instructors.
Respecting Human Vision
Despite advances, human vision remains far richer in nuance, subtlety, complexity, and emotion. Computer vision still cannot match human capabilities in many real-world contexts.
Key takeaway: With great tools come great consequences. Understanding both the capabilities and limitations of computer vision is essential.
Course Structure and Learning Objectives
The course is organized into four major topic areas:
Deep Learning Basics (first few weeks)
Image classification and linear classifiers
Regularization, optimization
Neural network fundamentals
Perceiving and Understanding the Visual World
Tasks: object detection, scene understanding, motion, etc.
Models: CNNs, RNNs, transformers
Generative and Interactive Visual Intelligence
Self-supervised learning
Generative models (diffusion, style transfer)
Vision-language models
3D vision and embodied agents
Human-Centered Applications and Implications
Ethics, bias, societal impact
Positive use cases (medicine, aging)
Learning Objectives
Formalize computer vision applications into well-defined tasks.
Develop and train vision models operating on images, videos, and other visual data.
Gain understanding of where the field is and where it is headed.
Build models from scratch in assignments, including a generative emoji model.
Major Awards in Deep Learning
2018 Turing Award: Geoffrey Hinton, Yann LeCun, Yosha Bengio for deep neural networks.
2024 Nobel Prize in Physics: John Hopfield and Geoffrey Hinton for foundational neural network contributions.
The next session covers image classification and linear classifiers, building the foundation for the course.

Ask anything
We've read this whole study set, so questions about it get the best answers.