DINO · computer vision

Also known as: self-distillation with no labels · DINOv2

On this page 8

DINO (self-distillation with no labels) is a self-supervised learning method in computer vision that trains an image encoder, usually a vision transformer, by making a student network match the outputs of a slowly updated teacher network on different views of the same image. No human annotations are used at any stage, yet the resulting features support classification, retrieval and segmentation with very little extra training.

Introduced in 2021 and extended by DINOv2 in 2023, the approach became a reference point for general-purpose visual features in artificial intelligence. Its best-known property is that the attention maps of a DINO-trained transformer segment objects without supervision, which showed that rich scene structure can emerge from images alone.

How DINO trains a student against a teacher

DINO trains two networks with the same architecture but different weights. The student is updated by gradient descent, while the teacher is an exponential moving average (EMA) of past student weights, so it changes slowly and acts as a stable target. Both networks end in a projection head that outputs a probability distribution over several thousand prototype dimensions, typically 65,536 outputs in the original configuration.

Each training image is turned into a set of augmented crops. Two global crops cover large parts of the image and several local crops cover small regions. The teacher sees only the global crops, while the student sees all of them. The loss is the cross-entropy between teacher and student distributions, which forces the student to infer from a small patch what the teacher concludes from a wide view. This local-to-global correspondence is the main source of the semantic quality of the features.

The table below summarizes the components that make the training loop work.

ComponentRoleTypical setting
Student networkLearns by gradient descentViT-S/16, ViT-B/16 or larger
Teacher networkProvides stable targetsEMA momentum rising from 0.996 to 1.0
Multi-crop augmentationCreates global and local views2 global crops at 224 px, 6-10 local crops at 96 px
CenteringPrevents one dimension from dominatingRunning mean subtracted from teacher outputs
SharpeningPrevents uniform outputsTeacher temperature 0.04-0.07
Core components of DINO training

Why DINO does not collapse

Any method in which a network predicts its own targets risks representation collapse, where every image maps to the same output and the loss becomes trivially low. DINO avoids collapse without negative pairs or large batches by combining two opposing operations on the teacher output. Centering subtracts a running mean, which discourages any single dimension from winning, and sharpening with a low temperature discourages a flat, uniform distribution.

Neither operation is sufficient alone: centering by itself drives outputs toward uniformity, and sharpening by itself drives them toward a single dimension. Their balance is a key hyperparameter, and practitioners who reproduce DINO usually find that an unsuitable teacher temperature causes unstable early training, especially with small batch sizes.

DINO compared with other self-supervised methods

DINO belongs to the family of joint-embedding self-supervised methods, but it differs from contrastive and masked approaches in what the model is asked to predict. The comparison below places it among the most common alternatives.

MethodLearning signalNeeds negative pairsTypical strength
DINOStudent matches EMA teacher distributionNoStrong frozen features and attention maps
SimCLRContrastive similarity between viewsYes, large batchesSimple design, well understood
BYOLPredictor regresses teacher embeddingNoRobust to batch size
MAEReconstruct masked pixel patchesNoExcellent after fine-tuning
iBOTSelf-distillation plus masked patch tokensNoBetter dense, patch-level features
DINOv2DINO and iBOT losses on curated dataNoBest frozen general-purpose features
DINO and related self-supervised approaches

A practical distinction is that masked image modeling methods such as MAE usually require fine-tuning to perform well, whereas DINO features work well frozen, with only a linear classifier or a k-nearest neighbors search on top. That property makes DINO attractive as a vision foundation model backbone.

From DINO to DINOv2

DINOv2 keeps the self-distillation principle but scales data, model size and training recipe. It adds a masked patch-level objective inspired by iBOT, uses a regularizer that spreads features evenly across the embedding space, and trains on roughly 142 million curated images selected by automatic retrieval from a larger uncurated pool.

The result is a family of ViT backbones from small to giant whose frozen features compete with weakly supervised image-text models on many benchmarks and clearly outperform them on dense tasks such as depth estimation and semantic segmentation. Later work added register tokens, extra learnable tokens that absorb high-norm artifacts and make attention maps cleaner.

AspectDINODINOv2
Training dataImageNet-1k without labels, about 1.3 million imagesAbout 142 million curated images
ObjectivesImage-level self-distillationImage-level plus masked patch-level loss
Largest backboneViT-BViT-g with about 1.1 billion parameters
Typical useResearch baseline, attention analysisFrozen backbone for production pipelines
Main differences between the two generations

Where DINO features are used

DINO features serve as a drop-in visual backbone wherever labeled data are scarce. Because the embeddings capture semantic similarity, they power content-based image retrieval, near-duplicate detection and clustering of large unlabeled collections. Patch-level features support unsupervised object discovery, segmentation and feature matching between images.

The following decision table shows how teams typically choose a usage mode.

SituationRecommended useReason
Few labeled imagesFrozen features with a linear headAvoids overfitting, trains in minutes
Image search or deduplicationk-NN on global embeddingsNo training required
Dense prediction tasksFrozen patch features with a light decoderPatch tokens carry spatial semantics
Large labeled domain datasetFine-tune the full backboneAdapts features to the domain
Choosing how to use a DINO backbone

Limitations and common misconceptions

  • Training from scratch is expensive: reproducing DINOv2 requires large GPU clusters, so most users start from released checkpoints.
  • Domain shift still matters: features learned on natural photographs transfer less well to medical scans, satellite imagery or documents without adaptation.
  • Self-supervised does not mean unbiased: the curated data reflect the distribution of the source pool, including its geographic and cultural gaps.
  • Attention maps are not segmentation masks: they highlight salient objects but need thresholding or post-processing for precise boundaries.
  • No language grounding: unlike image-text models, DINO cannot classify by text prompt without an additional aligned head.

Understanding it simply

DINO is a way to teach a computer to understand pictures without telling it what is in them. Two copies of the same network look at different cutouts of one photo. One copy sees the whole scene. The other sees only small pieces.

The learner must guess what the steadier copy concluded from the full view. To do that well, it has to learn what objects and parts look like. The key point is simple: the model learns useful vision from images alone, and people can then reuse it for many tasks with very few labels.

Applied in practice

A quality engineer at an electronics plant has about 200,000 unlabeled photos of circuit boards and only a few hundred labeled defects. Labeling more would take weeks, so the team extracts frozen DINOv2 ViT-B embeddings for every image on a single GPU in a few hours.

They train a linear classifier on 600 labeled examples and use k-nearest neighbors search to find boards similar to each known defect. Reviewers confirm the retrieved candidates, which grows the labeled set quickly. Within two weeks the inspection model reaches defect recall above 90 percent on held-out boards, and the same embeddings are reused to flag near-duplicate images that had inflated the training set.