Deep Computer Vision (CNN)

Lesson 2

Deep learning's role in computer vision

From hand-crafted features to representations learned from data

Deep learning's role in computer vision

Over the last decade, deep learning turned computer vision from hand-tuned features and brittle rules into models that learn straight from pixels. That change is not a small tweak; it is a different way to think about perception.

Classical ML + Handcrafted FeaturesDeep Neural Networks (Dense / MLPs)
Manual feature engineering requiredLearns features directly from pixels
Raw pixels were weak inputs for traditional ML algorithmsPixels can be fed directly into neural networks
Required image processing expertiseReduced dependence on handcrafted features
Features: , , , , Representation learning emerges during training
Separate feature extraction + classifier pipelineEnd-to-end learning becomes possible
Traditional ML: SVMs, Random ForestsDeep fully connected neural networks
Limited performance on complex visual tasksBetter learning capacity with large datasets
Math: y = ML(f(x)) where f(x) is handcrafted featuresMath: y = NN(x) where the network learns features automatically
Code intuition: features = hog(image)Code intuition: prediction = model(image_tensor)

Two pipelines, same goal

Classical ML — features hand-engineered

imagehand-crafted features (HOG / SIFT)classifier (SVM)prediction

Deep learning — features learned from pixels

imageneural network — learns features and classifiesprediction

Classical vision needs a separate feature step you design by hand; deep learning folds feature extraction into the trained network.

Neural networks are now the default engine for serious vision work, from datacenter training down to phones and wearables.


Real-world computer vision: cloud to edge

Vision models run across very different compute environments, from datacenter GPUs to low-power edge devices.

EnvironmentTypical constraintsCommon vision tasks
Mobile / edge devicesLow latency, low power, small memoryFace unlock, portrait enhancement, AR depth
Robots / drones / wearablesReal-time inference, constrained hardwareNavigation, tracking, obstacle perception
Cloud / datacenterLarge-scale training and servingFoundation models, large-scale inference

Edge models are often:

  • quantized, lower-precision weights and activations
  • pruned, redundant connections removed
  • distilled, a small student trained to mimic a large teacher
  • hardware-optimized, kernels tuned for specific accelerators

Vision in healthcare

Medical imaging already contains high-signal visual patterns, making it a strong domain for deep learning.

DomainTypical vision tasks
Radiology (CT / MRI / X-ray)Detection, localization, triaging
PathologyTissue and cell-level analysis
Retina imagingDisease screening (e.g. diabetic retinopathy)

Models help surface subtle and repeatable patterns across large datasets, usually as decision-support systems alongside clinicians, not a replacement for clinical judgment.


Autonomous driving

Self-driving systems combine:

  • perception, what's in the scene
  • prediction, what will it do next
  • planning, what should we do
  • control, how do we execute it

One important research direction explored a much simpler framing:

InputOutput
Camera frames / videoSteering and driving commands

This introduced the idea of:

pixels → actions (end-to-end learning)

The challenge:

  • safety-critical edge cases
  • rare events ("long tail")
  • interpretability
  • real-world robustness

Modern autonomy stacks therefore combine learned vision systems, rules, mapping, planning, and systems engineering, rather than betting everything on a single end-to-end network.


Facial recognition and understanding

Computer vision evolved from simple face detection to rich facial understanding.

Earlier systemsModern deep learning systems
Detect whether a face existsDetect, align, and embed faces
Limited geometric featuresIdentity, landmarks, gaze, pose, expressions
Simple classifiersDeep metric-learning pipelines

Modern systems must additionally handle:

  • occlusion (masks, hands, hair)
  • lighting variation
  • pose changes
  • privacy and bias concerns

Try it: zero-shot vision with CLIP

The "one flexible toolkit" claim above is easy to wave away in prose. Here it is concretely. CLIP is a vision-language model trained on image-caption pairs scraped from the web. It learned a shared embedding space: an image and a sentence describing that image end up close together; an unrelated sentence ends up far away.

Once you have that, classification stops being a fixed list of categories. You feed the model an image and whatever candidate captions you want, "a photo of a cat", "an indoor scene", "the year 1985", and it scores how well each one matches. No retraining, no fine-tuning, no labeled dataset. The same model handles "is this a cat?" and "is this happy?" because it lives in language-space.

Pick a preset image (or upload your own), tweak the candidate labels, and watch the scores shift:

CLIP Zero-Shot Classificationclip-vit-base-patch32 · ~150 MB
CLIP similarity
Press Score labels to compute cosine similarities.
First run downloads the model — happens once, then cached in your browser.

The model running here is clip-vit-base-patch32, the same architecture used in production by Stable Diffusion, DALL·E text encoders, and countless retrieval systems. ~150 MB; cached in your browser after the first run.


Check your understanding

1 / 6

What is the key shift deep learning brought to computer vision?


Practice it yourself

From edge-shrinking tricks to CLIP's zero-shot magic — implement the ideas, real Python, hidden tests, no setup.

Test your understanding

Prof is ready

Prof will ask you questions about Deep learning's role in computer vision — not explain it. You'll be surprised what you don't know until you have to say it.

Finished this lesson?

Read through the lesson first (0/20s).