ECE 425/525 · Fall 2025 · University of Arizona · Team of 5

I-JEPA Analysis & Implementation

I-JEPA is a self-supervised vision model that learns by predicting hidden parts of an image as representations, not as pixels. My team implemented it on a small backbone, profiled where the training time went, and tested two changes to how it learns.

My role: Co-lead of the literature review; wrote all but one paragraph of it

  • Self-Supervised Learning
  • Vision Transformers
  • PyTorch
  • FlashAttention
  • Profiling

How I-JEPA learns, in 3D

One training step, taken apart: the model predicts hidden blocks of an image as representations, not pixels. Step through it, sample new blocks, or switch on the two changes my team tested.

ContextTarget
8 / 8

Update the encoders

Gradients train only the context encoder and the predictor. The target encoder follows as a moving average (EMA, momentum 0.996).

Context patches71 of 169
Target patches114, 4 blocks
Context scale0.85–1
Target scale0.15–0.2
EMA momentum0.996

An explanation, not the trained model

Hover over a part for what it is. Drag to turn, scroll to zoom.Tap a part for what it is. Drag to turn, pinch to zoom.

About this view: an explanation, not our trained model

The steps, block sizes and settings follow the I-JEPA paper and our report: a 224 × 224 image in 16 × 16 patches, one context block covering 85 to 100% of the grid, four target blocks of 15 to 20% each, a ViT-Small encoder, a six-layer predictor, and a target encoder updated as a moving average with momentum 0.996. The picture is drawn for the demo, the vectors are illustrations, and the report does not give the curriculum's starting target size, so the view picks one.

The idea

I-JEPA (Image-based Joint-Embedding Predictive Architecture) learns image representations without labels. A context encoder sees part of an image, and a predictor has to produce what a target encoder computes for the hidden blocks. Comparing representations rather than pixels means no pixel reconstruction and no hand-crafted augmentations.

At a glance

Course
ECE 425/525, Fall 2025
Team
Five people
My role
Co-lead of the literature review
Backbone
ViT-Small, six-layer predictor
Dataset
Imagenette, 10 classes

This was a five-person project in a combined undergraduate and graduate deep learning course. My team implemented I-JEPA in PyTorch with a ViT-Small backbone (16 × 16 patches) and a six-layer predictor, trained it on Imagenette, a 10-class subset of ImageNet, and measured the learned features with a linear classifier on top. My part was the literature review.

Flow diagram: ViT encoder and linear classifier, profiling-driven bottleneck analysis, system-level optimizations, then algorithmic refinements
The plan: fix system bottlenecks in a profiling loop first, then change the algorithm.

Three ways to learn without labels

I co-led the literature review officially and wrote all of it but one paragraph. It became the report's related-work section: the building blocks (vision transformers, autoencoders, masking, teacher-student training and joint embeddings) and the three families of methods I-JEPA sits among.

invariance masked image modeling latent prediction EMA targets Unlabeled image Two views crop · color · blur Shared encoder both views Two embeddings one per view Make them agree push other images away Hide patches random, most of them Encoder visible patches Decoder rebuilds the gaps Compare pixels or visual tokens Context block and 4 target blocks Context encoder visible context Target encoder whole image Predictor at target positions Compare representations not pixels

The three families my literature review compared: pick one to see what it shows the model and where its loss compares the answer.

What my team changed

Profiling showed the GPU waiting on CPU data loading. The team matched data-loader workers to logical cores, pinned memory, switched to mixed precision, compiled the model with torch.compile, and moved JPEG decoding to the GPU with NVIDIA DALI. Once the model itself was the bottleneck, they replaced standard attention with FlashAttention, a faster implementation of the same computation.

Then came two changes to how the model learns. Additive spatial conditioning passes each mask's normalized position and size through a small two-layer network (MLP) and adds the result to the patch embeddings; adding instead of appending tokens keeps the sequence length the same. Curriculum masking starts easy and moves on a linear per-epoch schedule to the standard setting: one context block at scale 0.85 to 1 and four target blocks at scale 0.15 to 0.2.

Diagram of mask coordinates passing through an MLP and being added to the context encoder's patch embeddings before the predictor
Spatial conditioning adds where the mask is to every patch, without lengthening the sequence.

What the team measured

The system-level changes cut total CPU time by about 4.3× for training and 6.7× for inference, and FlashAttention was about 1.2× faster than the baseline attention. The report puts the combined gain at roughly 8.5× for training and 2× for inference over the baseline implementation.

The numbers

CPU time cut, trainingabout 4.3×
CPU time cut, inferenceabout 6.7×
Loss after epoch 2, spatial conditioning0.064baseline 0.140
ViT-Small from scratch, Imagenetteabout 35%
Authors' pre-trained ViT-Huge97.7%

Spatial conditioning made the loss fall faster under the same hyperparameters: 0.183 against 0.254 after epoch 1 and 0.064 against 0.140 after epoch 2, with the two curves nearly meeting by epoch 5. Curriculum masking kept classifier accuracy close to standard masking throughout 35 epochs.

With ViT-Small and a 50-epoch cap, training from scratch reached about 35% on Imagenette. Swapping in the I-JEPA authors' pre-trained ViT-Huge backbone gave 97.7%, which confirmed the evaluation pipeline was correct.

Four bar charts of profiler CPU time by operation for training and inference
Profiler CPU time, training (top) and inference (bottom): data-loader waits dominate on the left, and the right is on a much smaller time scale.
Bar chart comparing baseline and optimized times after 1 and 5 epochs
Standard attention against FlashAttention, in ms as the chart labels it: 29.5 vs 24.62 at 1 epoch, 51.67 vs 43.52 at 5.
Line plot of average training loss per epoch for the baseline and optimized models over five epochs
Loss with spatial conditioning (solid blue) falls faster early; the two curves nearly meet by epoch 5.
Line plot of classifier training and validation accuracy over 35 epochs for multiblock and curriculum masking
Curriculum masking tracks standard multiblock masking over 35 epochs.

What I took from it

Writing the review taught me to sort a crowded field by one question: where does the loss compare the answer? In pixels, the model is pulled toward low-level detail; across augmented views, it inherits the augmentations you chose; in representation space, it avoids both.

My team's numbers added two practical lessons. Profile before reaching for the clever fix: the system-level changes cut training CPU time about 4.3×, FlashAttention gave 1.2×. And check the measurement against a known-good model, as the 97.7% with the authors' backbone did for the team's 35%.

Where it goes next

The open question is whether spatial conditioning gives better features or only a faster start, since its loss curve nearly met the baseline by epoch 5; longer training and a comparison of classifier accuracy would answer it. And because latent prediction needs no augmentations, the same approach could carry over to data where good augmentations are hard to choose.

Want the details behind this one, or to talk about similar work?