Search

Search papers and lessons

I-JEPA: Self-Supervised Learning with a Joint-Embedding Predictive Architecture

Mahmoud Assran, Quentin Duval, Ishan Misra et al. · 2023

I-JEPA learns image features by predicting the embeddings of hidden image blocks from one visible block, with no hand-crafted augmentations and no pixel reconstruction.

On this page

  • Colour = topic mix
  • Probability
  • Calculus
  • Neural network basics
  • Representation learning
  • Linear algebra
  • Architectures
  • Sign in to see your progress

TL;DR

Most self-supervised image methods either compare two hand-augmented views of an image, or reconstruct masked pixels. I-JEPA does neither: from one large context block it predicts the encoder embeddings of several small target blocks in the same image. Predicting in embedding space keeps the targets semantic, and the paper reports strong linear-probe results on ImageNet with less pretraining compute than the reconstruction baseline it compares to.

Where you'll see it: in self-supervised pretraining of Vision Transformers on unlabelled images, and in the wider family of joint-embedding predictive models that the paper's architecture belongs to.

The problem

Invariance methods such as SimCLR-style contrastive learning and DINO-style self-distillation learn semantic features, but they depend on hand-crafted augmentations such as cropping, scaling and colour jitter. The paper argues these carry strong biases that may not suit every downstream task, and that the augmentations do not transfer easily to other modalities such as audio.

Masked generative methods, such as MAE, need no hand-crafted views. They reconstruct masked patches in pixel or token space. The paper's concern is that these representations are typically of a lower semantic level and do worse on off-the-shelf linear probes and on semantic transfer with few labels, so they need expensive end-to-end fine-tuning to be useful.

The paper's question is how to get semantic features without either the augmentation bias or the pixel-level target.

Key idea

Keep the masked prediction task, but move it into representation space. A context encoder sees one block of the image. A predictor, conditioned on where the missing blocks are, must output the embeddings that a separate target encoder assigns to those blocks. Because the target is an embedding rather than pixels, the encoder need not spend capacity on fine texture and noise.

Two design choices push the model toward semantic content, according to the paper's abstract and ablations. The target blocks must be large enough to cover object parts, and the context block must be spread across the image so that it carries enough information to predict them. The paper describes the resulting context as informative yet sparse, which also keeps it cheap to process, since the encoder only sees the visible patches.

flowchart LR
  I["Image"] --> T["Target encoder (EMA copy)"]
  I --> C["Context block, other regions removed"]
  C --> E["Context encoder"]
  E --> P["Predictor, with position tokens"]
  T --> Y["Target block embeddings"]
  P --> L["L2 loss in embedding space"]
  Y --> L

The method

Architecture

The context encoder, target encoder and predictor are all Vision Transformers. The context encoder processes only the visible patches, which is what makes the method cheap. The predictor is a narrower ViT. The paper says its encoder and predictor design is reminiscent of MAE, but the predictions are made in representation space and the method is non-generative.

Targets

Pass the full image through the target encoder to get one embedding per patch. Sample MM blocks from these patch embeddings. The paper uses M=4M = 4, with each block having a random aspect ratio in (0.75,1.5)(0.75, 1.5) and a random scale in (0.15,0.2)(0.15, 0.2) of the image. Targets come from masking the output of the target encoder, not the input. The paper says this distinction is crucial for keeping the targets at a high semantic level.

Context

Sample one context block with scale in (0.85,1.0)(0.85, 1.0) and unit aspect ratio. Remove any patches that overlap the target blocks, so the prediction task is not trivial. Pass the remaining patches through the context encoder to get the context representation sxs_x.

Prediction and loss

For each target block BiB_i, the predictor receives sxs_x and one mask token per target patch. The mask token is a shared learnable vector plus a positional embedding, so the predictor knows where each missing patch sits. The predictor runs once per target block, giving MM predictions s^y(i)\hat{s}_y(i). The loss is

1M∑i=1M∑j∈Bi∥s^yj−syj∥22,\frac{1}{M}\sum_{i=1}^{M}\sum_{j \in B_i}\left\lVert \hat{s}_{y_j} - s_{y_j} \right\rVert_2^2,

the squared L2L_2 distance between each predicted patch embedding and the matching target patch embedding, averaged over blocks. Here syjs_{y_j} is the target embedding of patch jj, and s^yj\hat{s}_{y_j} is the prediction for that patch.

The target encoder is an EMA copy

Context encoder and predictor are trained by gradient descent. The target encoder θˉ\bar\theta is not trained by gradients. After each step it is updated from the context encoder parameters θ\theta by an exponential moving average,

θˉ←m θˉ+(1−m) θ.\bar\theta \leftarrow m\,\bar\theta + (1 - m)\,\theta.

The paper uses a momentum mm of 0.996, increased linearly to 1.0 over pretraining, and says this is essential for training joint-embedding architectures with Vision Transformers. The moving average is what keeps the targets from simply following the encoder into a constant output. This asymmetry between the trained context encoder and the slowly moving target encoder is the standard guard against Representation Collapse in joint-embedding methods. The concept is covered in Representation Collapse and Exponential Moving Average.

Results

Pretraining is on ImageNet-1K without labels. The main evaluation is a linear probe on frozen features, and a semi-supervised evaluation with 1% of the labels.

MethodArch.EpochsLinear probe, ImageNet-1K top-1
MAEViT-H/14160077.2
data2vecViT-L/16160077.3
I-JEPAViT-H/1430079.3
I-JEPAViT-H/16 at 448 px30081.1

On the 1% ImageNet benchmark, I-JEPA ViT-H/14 reaches 73.3 top-1 with 300 epochs, compared with 71.5 for MAE ViT-H/14 at 1600 epochs. The 448-pixel ViT-H/16 reaches 77.3. The paper reports that the 448-pixel ViT-H/16 matches iBOT on ImageNet linear probing (81.0 for iBOT) and surpasses MSN, DINO and iBOT on the 1% benchmark. Those comparison methods use hand-crafted augmentations.

On transfer with a linear probe, I-JEPA ViT-H/14 scores 87.5 on CIFAR100, 58.4 on Places205 and 47.6 on iNat18. DINO ViT-B/8 scores 84.9, 57.9 and 55.9 on the same datasets. So I-JEPA leads on CIFAR100 and Places205 and trails on iNat18.

On low-level tasks, I-JEPA ViT-H/14 scores 86.7 on Clevr object counting, above DINO's 86.6 and iBOT's 85.7, and ties MAE's 72.4 on Clevr depth. MAE is higher on counting, at 90.5.

Compute. The paper says that per iteration I-JEPA is about 7% slower than MAE, because it computes targets in representation space, but that it converges in roughly five times fewer iterations, so the net saving is still significant. It also says pretraining ViT-H/14 on ImageNet takes less than 1200 GPU hours, and that this is over 2.5 times faster than a ViT-S/16 pretrained with iBOT and over 10 times more efficient than a ViT-H/14 pretrained with MAE. The abstract adds that a ViT-H/14 can be trained on ImageNet in under 72 hours on 16 A100 GPUs.

Ablations. The multi-block masking strategy reaches 54.2 top-1 on 1% ImageNet, against 15.5 for rasterised quadrant masking, 20.2 for a single block and 17.6 for random masking, all at ViT-B/16 with 300 epochs. Computing the loss in pixel space instead of representation space drops the score from 66.9 to 40.7, although those runs use different epoch counts (500 and 800), so the gap is not a clean comparison.

Why it mattered

The paper shows that a non-generative, augmentation-free predictive objective can reach strong semantic features without the cost of multi-view pipelines. It also gives a concrete recipe: a masking scheme, an EMA target encoder and a narrow predictor, with a compute figure attached.

The paper's evaluations are on ImageNet and a set of transfer and local-prediction benchmarks, and its visualisations of what the predictor represents (Section 8) are qualitative.

Reading guide

Read the paper in this order. Each section needs the listed prerequisites.

Check yourself

QuestionWhat is predicted, and in what space is the loss computed?Show answer

I-JEPA predicts the embeddings of several target blocks from one visible context block. The loss is the squared L2L_2 distance between predicted and target patch embeddings, so it is computed in representation space rather than on pixels.

QuestionWith M=2M = 2 target blocks, one block has two patches with predictions (1,2)(1, 2) and (0,1)(0, 1) against targets (0,2)(0, 2) and (0,0)(0, 0). The second block has a single patch with squared error 0.50.5. What is the loss?Show answer

For the first block the squared errors are ∥(1,2)−(0,2)∥2=1\lVert(1,2)-(0,2)\rVert^2 = 1 and ∥(0,1)−(0,0)∥2=1\lVert(0,1)-(0,0)\rVert^2 = 1, which sum to 2. The second block contributes 0.50.5. The loss averages over blocks, so it is 12(2+0.5)=1.25\tfrac{1}{2}(2 + 0.5) = 1.25. These numbers are illustrative, not from the paper.

QuestionWhy is the target encoder updated by an exponential moving average instead of by gradients?Show answer

If the target encoder were trained by gradients toward its own predictions, the easiest solution is a constant output, which is representation collapse. The moving average makes the target change slowly and follow the context encoder, which keeps the targets informative and is the asymmetry the paper uses against collapse. The paper reports that this is essential with Vision Transformers.

QuestionGive two reasons the paper gives for predicting in representation space rather than pixel space.Show answer

First, the target encoder can drop pixel-level details that are irrelevant to the semantics, so the targets are more abstract. Second, the ablation shows linear-probe accuracy falls sharply when the loss is pixel-based, which the paper reads as evidence that representation-space targets matter. The paper's own ablation runs differ in epoch count, so the magnitude of the gap should be read with care.

Sources

Read the full paper

Mahmoud Assran, Quentin Duval, Ishan Misra et al., 2023. arXiv:2301.08243