Phase 06: State-of-the-Art Vision Models
Weeks 13-14 | 4 Labs
The modern CV engineer must understand the architectural innovations that power GPT-4V, SAM, CLIP, and DINO. This phase builds ViT, CLIP, DINO, and a mini-SAM from scratch — then maps the 2024–2026 layer on top: promptable segmentation (SAM/SAM2), open-vocabulary detection (OWL-ViT, Grounding DINO), NMS-free set-prediction detectors (DETR/RT-DETR), frozen DINOv2/v3 backbones, and vision-language models.
Why SOTA Models?
- Vision Transformers (ViT): replaced CNNs as backbone in most SOTA systems
- CLIP: foundation for zero-shot recognition, image search, VLMs
- Self-supervised learning (DINO/DINOv2/v3): reduce label dependency by 10-100x; frozen features + light heads is the 2026 default
- SAM/SAM2 + open-vocabulary detection: promptable masks and text-defined classes — the standard auto-labeling stack (Grounded-SAM) and the data-engine mindset
- DETR/RT-DETR: detection as set prediction — no NMS, deterministic latency, real-time DETRs competing with YOLO
- VLMs (LLaVA-class, Qwen2.5-VL-class): when perception needs reasoning — plus the cost/verifiability framework for choosing them over pipelines
- Every top-tier role (Google DeepMind, Meta AI, OpenAI) expects fluency here
Lab Structure
| Lab | Topic | Key Concepts |
|---|---|---|
| lab-01-vision-transformer | ViT from scratch | Patch embedding, positional encoding, TransformerEncoder, attention maps |
| lab-02-clip-contrastive | CLIP-style contrastive learning | InfoNCE loss, image-text alignment, zero-shot classification |
| lab-03-dino-self-supervised | DINO-style self-supervised | Student-teacher with EMA, multi-crop, centering + sharpening |
| lab-04-promptable-segmentation | Mini-SAM from scratch | Point-prompt encoder, two-way-attention mask decoder, multi-mask output + IoU-prediction head |
Key Equations
Scaled Dot-Product Attention
$$\text{Attention}(Q,K,V) = \text{softmax}!\left(\frac{QK^\top}{\sqrt{d_k}}\right) V$$
InfoNCE Loss (CLIP)
$$\mathcal{L} = -\frac{1}{N}\sum_{i=1}^{N} \log \frac{\exp(\text{sim}(z_i^I, z_i^T)/\tau)}{\sum_{j=1}^{N}\exp(\text{sim}(z_i^I, z_j^T)/\tau)}$$
DINO EMA Update (teacher)
$$\theta_t \leftarrow \lambda,\theta_t + (1-\lambda),\theta_s$$
DETR Bipartite Matching Cost (per prediction–GT pair)
$$\mathcal{C}{ij} = -\hat{p}i(c_j) + \lambda{L1},\lVert \hat{b}i - b_j \rVert_1 + \lambda{giou},\mathcal{L}{giou}(\hat{b}_i, b_j)$$
Architectural Comparison
| Model | Backbone | Pre-training | Zero-shot? | Key Innovation |
|---|---|---|---|---|
| ResNet | CNN | Supervised | No | Residual connections |
| ViT-B/16 | Transformer | Supervised (JFT-300M) | No | Patches as tokens |
| CLIP | ViT + Text Enc. | Contrastive (400M pairs) | Yes | Image-text alignment |
| DINO | ViT | Self-supervised | No (but great features) | Student-teacher + EMA |
| DINOv2/v3 | ViT (+ registers) | Self-supervised (curated LVD) | No (frozen-feature default) | DINO + iBOT objectives, register tokens, Gram anchoring |
| SAM / SAM2 | ViT-H (+ memory) | SA-1B / SA-V data engine | Yes | Promptable segmentation; streaming memory for video |
| OWL-ViT / Grounding DINO | ViT / DETR-family + text | Image-text + detection | Yes (open-vocab) | Text as the detection label space |
| DETR / RT-DETR | CNN + Transformer | Supervised | No | Set prediction + Hungarian matching — no NMS; real-time hybrid encoder |
| LLaVA / Qwen2.5-VL-class | CLIP tower + LLM | Alignment + instruction tuning | Yes (open-ended) | Visual tokens in an LLM — perception with reasoning |