ML Notes
Comprehensive introduction to computer vision covering image representation, feature extraction, classical vs deep learning approaches, and real-world applications.
Computer vision is the field of artificial intelligence that teaches machines to interpret and understand visual information from the world — images, videos, and real-time camera feeds. When your phone unlocks with your face, when a self-driving car detects pedestrians, or when Instagram applies filters that track your facial features, computer vision is at work. This field has experienced a revolution in the past decade thanks to deep learning, transforming from a niche research area into one of the most commercially impactful branches of AI.
What Is Computer Vision?
At its core, computer vision aims to replicate the human visual system's capabilities in software. Humans effortlessly recognize faces, read text, judge distances, and identify objects in milliseconds. Replicating even a fraction of this ability in machines requires solving incredibly complex mathematical and computational problems.
The fundamental challenge is this: a computer sees an image as nothing more than a grid of numbers (pixel values). A 1080p color image is simply a matrix of 1920×1080×3 numbers between 0 and 255. From this raw numerical grid, the computer must somehow extract meaning — "this is a cat," "this person is smiling," "that car is 50 meters away and approaching."
| Human sees | A photo of a cat sitting on a sofa |
| Computer sees | A 224×224×3 matrix of numbers |
| [[128, 134, 142, ...], ← Row 1 | pixel values (R,G,B) |
| Challenge | Extract semantic meaning from raw numbers |
Image Representation in Computers
Understanding how images are stored is the first step in computer vision:
Grayscale images: A 2D matrix where each cell holds a value from 0 (black) to 255 (white). An image of size H×W has H×W total pixel values.
Color images (RGB): Three 2D matrices stacked together — one for Red, one for Green, one for Blue. Each pixel has three values, so an H×W color image has H×W×3 total values.
Video: A sequence of images (frames) played rapidly. A 30fps video is simply 30 images per second, each processed individually or in sequence.
Classical vs Deep Learning Approaches
Computer vision has evolved through two major paradigms:
Classical Computer Vision (Pre-2012)
Before deep learning, computer vision relied on hand-crafted features designed by domain experts. Engineers would manually define what patterns to look for (edges, corners, textures) and build detectors for each. Common techniques included SIFT (Scale-Invariant Feature Transform), HOG (Histogram of Oriented Gradients), and Haar cascades.
The workflow was: Image → Hand-crafted feature extraction → Traditional ML classifier (SVM, Random Forest). The bottleneck was always feature engineering — experts spent years designing features for each specific task.
Deep Learning Revolution (2012-Present)
In 2012, AlexNet won the ImageNet competition by a massive margin using a Convolutional Neural Network (CNN). The key insight was that CNNs learn their own features directly from raw pixels — no manual feature engineering needed. The network automatically discovers edges in early layers, textures in middle layers, and object parts in deeper layers.
The modern workflow is: Image → CNN (learns features automatically) → Classification/Detection/Segmentation. This end-to-end learning approach has surpassed human-level performance on many benchmark tasks.
Core Tasks in Computer Vision
Computer vision encompasses several distinct tasks, each with different outputs:
Image Classification: Given an image, assign it to one category (e.g., "cat," "dog," "car"). The simplest CV task and the foundation for others.
Object Detection: Find all objects in an image AND draw bounding boxes around each one with class labels. Used in autonomous driving, surveillance, and retail analytics.
Image Segmentation: Classify every single pixel in an image as belonging to a specific category. Creates precise masks rather than bounding boxes. Used in medical imaging and autonomous driving.
Face Recognition: Identify or verify a person's identity from their face. Powers phone unlocking, surveillance systems, and photo organization.
Pose Estimation: Detect the position of human body joints (shoulders, elbows, knees) to understand body posture and movement.
Image Generation: Create new images from scratch or modify existing ones. Includes style transfer, super-resolution, and generative AI art.
The CNN Architecture: Why It Works for Images
Convolutional Neural Networks exploit the spatial structure of images through three key operations. Convolution slides small filters across the image to detect local patterns like edges and textures. Pooling reduces spatial dimensions while preserving important features, providing translation invariance. Stacking these operations creates a hierarchy where early layers detect simple features and deeper layers combine them into complex concepts.
Real-World Applications
Computer vision powers an enormous range of applications across industries: medical imaging (detecting tumors in X-rays and MRIs with radiologist-level accuracy), autonomous vehicles (perceiving the road environment through multiple cameras and LIDAR), manufacturing quality control (inspecting products at superhuman speed), agriculture (monitoring crop health from drone imagery), retail (cashier-less stores, inventory tracking), security (facial recognition, anomaly detection), and augmented reality (overlaying digital content on the real world in real time).
Getting Started: Your Learning Path
To build practical computer vision skills, start with OpenCV for basic image processing operations, then learn CNNs with TensorFlow or PyTorch for classification tasks, explore transfer learning (using pre-trained models like ResNet and EfficientNet), and finally tackle specialized tasks like object detection (YOLO, Faster R-CNN) and segmentation (U-Net, Mask R-CNN). Each subsequent lesson in this module will dive deep into one of these areas.
Hardware and Computational Requirements
Computer vision models, especially deep CNNs, are computationally intensive. Training a state-of-the-art image classifier requires GPUs with significant memory. However, inference (making predictions on new images) is increasingly efficient — modern mobile devices can run optimized CV models in real time. Libraries like TensorFlow Lite and ONNX Runtime enable deployment on edge devices, bringing computer vision capabilities to smartphones, drones, and IoT sensors without cloud connectivity. Understanding the computational landscape helps you choose appropriate model architectures for your deployment constraints.
Key Takeaways
Computer vision transforms raw pixel grids into semantic understanding. The deep learning revolution replaced manual feature engineering with learned representations, achieving superhuman performance on many benchmarks. Start with image classification using pre-trained CNNs, then progressively tackle detection and segmentation. Understanding both classical techniques and modern deep learning gives you the complete toolkit for any visual AI challenge.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Introduction to Computer Vision.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Machine Learning topic.
Search Terms
machine-learning, machine learning, machine, learning, computer, vision, introduction, introduction to computer vision
Related Machine Learning Topics