SandHouse
Pages and contents

I-JEPA

Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecture, http://arxiv.org/abs/2301.08243

Goal: learning semantics of an image

I-JEPA can be seen as a foundational model that creates an embedding of an image, and your later use those embeddings to train a smaller model (linear usually) on downstream tasks (e.g classification, object recognition, depth estimation).

The key thing is that JEPA is:

1. Self-supervised learning: the images do not need labels
2. No hand crafted data augmentation: The data augmentation is done automatically and does not depend on the type of image you are working on

JEPA stands for Joint-Embedding Predictive Architecture and is different from other approaches:

1. Joint-Embedding Architectures: JEA
2. Generative architectures

[image: image.png]

Caveats of other approaches

1. JEA are prone to representation collapse, meaning that the encoder will always output a constant embedding because it is a trivial solution at minimizing the MSE loss
2. Generative Architectures are not computationally efficient because the embeddings need to encode non-semantic data that is useful only for the image reconstruction

So the key difference of JEPA is that:

1. The loss is calculated on the latent space (not on the pixel space like generative architectures ⇒ maximizes semantic efficiency)
2. A predictor is used to “teach” the model the useful semantic data in an image

Inputs & Outputs

[image: image.png]

The context is x in Fig 1.(c) and the target is y in Fig 1.(c)

We start with the target image, and we split it into N patches. We then sample randomly M blocks (block = a selection of adjacent patches). Those M blocks become the targets that that the predictor has to retrieve. The context image is the image where the M blocks have been masked.

So the process is:

1. Split image into N patches
2. encode image into s={s1,…,sN} (one embedding per patch), with a ViT (vision transformer)
3. choose M blocks to form your masked set B, and s′={(si)i∉B}
4. input your predictor with s′ and a positional embeddings (so the predictor knows where the masked blocks are)
5. Compare your predicted embedding with the embedding of the full image (the target)

How to avoid representation collapse?

When training the predictor and context encoder weights are updated through backpropagation but the target encoder output is detached from the gradient graph (so it doesn’t get backpropagated). Instead the weights are updated through an exponential moving average (EMA):

θ′←λ×θ′+(1−λ)θ

Where θ are the weights of the context encoder, and θ′ the weights of the target encoder