Official code for JEDI, a two-stage cross-architecture knowledge distillation framework that transfers an I-JEPA (ViT-H/16) representation into a compact SegFormer student for cropland segmentation from Sentinel-2 imagery.
Large self-supervised vision models provide strong representations for remote-sensing segmentation but are too expensive to deploy at the satellite or field edge. JEDI distills such a representation from a large isotropic I-JEPA ViT teacher into a compact hierarchical SegFormer student in two stages:
At inference, only the student encoder and decode head are deployed; the teacher, its decoder, and the alignment module are discarded.
This repository contains the training and evaluation code of JEDI.
JEDI/
├── train.py # two-stage training script (Stage 1 + Stage 2)
├── assets/
│ └── architecture.png
├── LICENSE
└── README.md
Figure-generation, checkpoint-inference, and benchmarking utilities used to produce the paper's figures and tables are not included in this repository.
No pretrained checkpoints or preprocessed data are distributed with this
repository. To reproduce results, you will need to (1) obtain the
CalCROP21 dataset and a fine-tuned I-JEPA teacher checkpoint yourself,
and (2) run training from scratch using train.py below.
This code depends on standard deep learning and remote-sensing libraries, including:
IJepaModel, SegformerForSemanticSegmentation)train.py expects the CalCROP21 directory layout:
<root_path>/
├── IMAGE_GRIDS/
│ └── <tile_name>_IMAGE.npy # (T, C, H, W) Sentinel-2 stack
├── STATT_GRIDS/
│ └── <tile_name>_STATT.npy # (H, W) CDL-derived crop labels
└── GRID_SPLITS/
├── TRAIN_SET.npy # array of tile-name strings
├── TEST_SET.npy
└── VALIDATION_SET.npy
Cropland labels are binarized as label < 22 (cultivated vs.
non-cultivated). Each multi-temporal tile is reduced to a single
three-channel composite by selecting the acquisition with maximal
mean NDVI before training and inference.
You will also need a fine-tuned I-JEPA teacher checkpoint
(--teacher_ckpt), containing a state_dict with model.-prefixed
keys, as produced by fine-tuning facebook/ijepa_vith16_1k with a
convolutional decoder head for binary segmentation.
Run the full two-stage pipeline (Stage 1 runs automatically if no Stage 1 checkpoint is found; otherwise it is skipped):
python3 train.py \
--root_path /path/to/ACCEPTABLE_GRIDS \
--splits_folder /path/to/ACCEPTABLE_GRIDS/GRID_SPLITS \
--teacher_ckpt /path/to/teacher_checkpoint.ckpt \
--segformer_variant b0 \
--save_dir models \
--device_id 0
This project is released under the MIT License.
Official code for JEDI, a two-stage cross-architecture knowledge distillation framework that transfers an I-JEPA (ViT-H/16) representation into a compact SegFormer student for cropland segmentation from Sentinel-2 imagery.
Large self-supervised vision models provide strong representations for remote-sensing segmentation but are too expensive to deploy at the satellite or field edge. JEDI distills such a representation from a large isotropic I-JEPA ViT teacher into a compact hierarchical SegFormer student in two stages:
At inference, only the student encoder and decode head are deployed; the teacher, its decoder, and the alignment module are discarded.
This repository contains the training and evaluation code of JEDI.
JEDI/
├── train.py # two-stage training script (Stage 1 + Stage 2)
├── assets/
│ └── architecture.png
├── LICENSE
└── README.md
Figure-generation, checkpoint-inference, and benchmarking utilities used to produce the paper's figures and tables are not included in this repository.
No pretrained checkpoints or preprocessed data are distributed with this
repository. To reproduce results, you will need to (1) obtain the
CalCROP21 dataset and a fine-tuned I-JEPA teacher checkpoint yourself,
and (2) run training from scratch using train.py below.
This code depends on standard deep learning and remote-sensing libraries, including:
IJepaModel, SegformerForSemanticSegmentation)train.py expects the CalCROP21 directory layout:
<root_path>/
├── IMAGE_GRIDS/
│ └── <tile_name>_IMAGE.npy # (T, C, H, W) Sentinel-2 stack
├── STATT_GRIDS/
│ └── <tile_name>_STATT.npy # (H, W) CDL-derived crop labels
└── GRID_SPLITS/
├── TRAIN_SET.npy # array of tile-name strings
├── TEST_SET.npy
└── VALIDATION_SET.npy
Cropland labels are binarized as label < 22 (cultivated vs.
non-cultivated). Each multi-temporal tile is reduced to a single
three-channel composite by selecting the acquisition with maximal
mean NDVI before training and inference.
You will also need a fine-tuned I-JEPA teacher checkpoint
(--teacher_ckpt), containing a state_dict with model.-prefixed
keys, as produced by fine-tuning facebook/ijepa_vith16_1k with a
convolutional decoder head for binary segmentation.
Run the full two-stage pipeline (Stage 1 runs automatically if no Stage 1 checkpoint is found; otherwise it is skipped):
python3 train.py \
--root_path /path/to/ACCEPTABLE_GRIDS \
--splits_folder /path/to/ACCEPTABLE_GRIDS/GRID_SPLITS \
--teacher_ckpt /path/to/teacher_checkpoint.ckpt \
--segformer_variant b0 \
--save_dir models \
--device_id 0
This project is released under the MIT License.