JEM ViT-B/16, trained from scratch on Pl@ntNet-300K-v2
These are self-supervised ViT-B/16 backbones trained for 100 epochs from scratch on Pl@ntNet-300K-v2 (243,866 training images, 1,000 plant species, long-tailed). They come from an independent reproduction of JEM (Scalable Patch-Level Self-Supervised Learning, arXiv 2610.10013). No labels were used during pre-training.
Training and loading code: https://github.com/saulane/jem-plantnet300k
| File | Version | Linear probe, test top-1 | Rare species (< 20 train imgs), macro top-1 |
|---|---|---|---|
jem_nols_vitb16_plantnet300kv2_ep100.safetensors | JEM without LayerScale (ablation; best) | 83.7% | 17.9% |
jem_vitb16_plantnet300kv2_ep100.safetensors | JEM as in the paper (LayerScale 1e-5) | 82.4% | 14.5% |
For comparison, under the same probe:
- tuned LeJEPA (100 epochs, same data): 81.3% / 12.8%;
- the released Pl@ntNet-300K-v2 ViT-B (DINOv3 pre-training on 1.7B images plus supervised fine-tuning): 84.4% / 23.7%.
All numbers come from one run per method, with one seed. The probe is a linear layer on the frozen mean patch token, with lr and weight decay chosen on val.
Usage
# pip install torch safetensors huggingface_hub; vit.py and load.py are in this repo
from huggingface_hub import hf_hub_download
from load import load_jem
path = hf_hub_download("saulane/jem-vitb16-plantnet300kv2", "jem_nols_vitb16_plantnet300kv2_ep100.safetensors")
model = load_jem(path) # detects the LayerScale / no-LayerScale version from the weights
out = model(images, layers=(4, 8)) # images: (B, 3, H, W), ImageNet mean/std, H and W divisible by 16
feats = out["final"].mean(1) # (B, 768): the linear-probe feature
# out["final"]: (B, N, 768) patch tokens after the final LayerNorm; out["registers"]: (B, 4, 768);
# out[4], out[8]: patch tokens after blocks 4 and 8 (before any norm)
Evaluation transform: square bicubic resize to 224 × 224, ImageNet mean/std (common.eval_transform in the GitHub repo).
Model
- ViT-B/16 (86M parameters): no CLS token, 4 register tokens, axial RoPE. The released weights are the EMA teacher backbone at epoch 100; the projection heads are not included.
- Training: 100 epochs, batch 128, on one H100 (≈ 22 h each). The patch-level KL to an EMA teacher uses 4,096 categories, with heads at blocks 4, 8 and 12, plus the R_global and R_struct regularisers.
- The supervised depths and R_struct targets are scaled to 12 blocks (the paper uses ViT-L, with 24), and the batch is 128 on one GPU instead of 2048.
License
Weights: CC-BY-4.0. Code: MIT. Pl@ntNet-300K is distributed under CC-BY-4.0 (Garcin et al., NeurIPS 2021 Datasets and Benchmarks).