Views
No views yet
main branch of this repository exposes the model trained for 300 epochs. please refer to other revisions for other models.| Setting | Value |
|---|---|
| Dataset | ImageNet-1K (1.45M images) |
| Architecture | ViT-S/16 (ViT-v2, no registers) |
| Epochs | 100,300 |
| Views | 8 total — 2 global (224×224) + 6 local (96×96) |
| Precision | BF16 mixed (bf16-mixed) |
| GPUs | 8× (4 devices × 2 nodes, DDP via PyTorch Lightning) |
| Global batch size | 1024 (128 per GPU) |
| Optimizer | AdamW, layerwise LR decay 0.9, patch embed LR mult 0.2 (from DiNOv2) |
| Learning rate | Base 5e-4 → effective 2e-3 (scaled by batch / 256); linear warmup 10 epochs → cosine decay to 1e-6 |
| Weight decay | Cosine anneal 0.04 → 0.4 (for DiNO and iBOT), Constant 5e-2 for LeJEPA |
| Gradient clipping | Norm, max 3.0 |
configs/{dino,ibot,lejepa}/vit_{s,b}16_ep{100,300}.json in the code repository.| Model | IN-1K online probe (acc@1) | IN-1K linear probe (acc@1) | IN-1K k-NN (acc@1) | NYU Depth (δ1) | Pascal VOC (mAP) |
|---|---|---|---|---|---|
| DINO ViT-S/16 ep100 | 69.32 | - | - | - | - |
| DINO ViT-S/16 ep300 | 73.88 | - | - | - | - |
| DINO ViT-B/16 ep100 | 73.49 | - | - | - | - |
| DINO ViT-B/16 ep300 | Soon | - | - | - | - |
| iBOT ViT-S/16 ep100 | 69.70 | - | - | - | - |
| iBOT ViT-S/16 ep300 | 74.32 | - | - | - | - |
| iBOT ViT-B/16 ep100 | 76.50 | - | - | - | - |
| iBOT ViT-B/16 ep300 | 78.74 | - | - | - | - |
| LeJEPA ViT-S/16 ep100 | 61.85 | - | - | - | - |
| LeJEPA ViT-S/16 ep300 | 65.99 | - | - | - | - |
| LeJEPA ViT-B/16 ep100 | 69.28 | - | - | - | - |
| LeJEPA ViT-B/16 ep300 | 72.04 | - | - | - | - |
Online probe results are logged during pre-training. Linear probe, k-NN, and downstream evaluations are coming soon.
1from transformers import AutoModel
2
3# default checkpoint (teacher checkpoint after 300 epochs)
4objective = "dino" # lejepa, ibot
5model_size = "s" # b
6pretrain_dataset = "in1k" # currently only in1k is planned unless compute can be expanded.
7
8hf_model_string = f"OK-AI/{objective}-vit{model_size}16-pretrain-{pretrain_dataset}"
9model = AutoModel.from_pretrained(hf_model_string)
10
11# alternate training checkpoints
12epoch_variant = 100 # 300
13state_dict_of = "student" # `teacher` is default for dino and ibot, lejepa only has student.
14model = AutoModel.from_pretrained(
15 hf_model_string,
16 revision=f"ep{epoch_variant}/{state_dict_of}",
17)1import requests
2
3import torch
4
5from PIL import Image
6from transformers import AutoModel, AutoImageProcessor
7
8model_id = "OK-AI/dino-vits16-pretrain-in1k"
9
10processor = AutoImageProcessor.from_pretrained(model_id)
11model = AutoModel.from_pretrained(model_id, torch_dtype=torch.bfloat16)
12model.eval()
13
14url = "http://images.cocodataset.org/val2017/000000039769.jpg"
15image = Image.open(requests.get(url, stream=True).raw)
16
17inputs = processor(images=image, return_tensors="pt")
18with torch.no_grad():
19 outputs = model(**inputs)
20
21# {
22# "latent": cls_tokens[:, 0],
23# "patch_latent": patch_tokens,
24# "raw_latent": x[:, 0],
25# "last_self_attention": attn,
26# "logits": self.head(cls_tokens[:, 0]), # only exists for comptability, head is always identity in this case.
27# }
28
29# CLS token — use for classification, retrieval, k-NN
30cls = outputs["latent"] # (1, 384)
31
32# Patch tokens — use for dense tasks (depth, segmentation)
33patches = outputs["patch_latent"] # (1, 196, 384)1@article{Sablayrolles2018Jun,
2 author = {Sablayrolles, Alexandre and Douze, Matthijs and Schmid, Cordelia and J{\ifmmode\acute{e}\else\'{e}\fi}gou, Herv{\ifmmode\acute{e}\else\'{e}\fi}},
3 title = {{Spreading vectors for similarity search}},
4 year = {2018},
5 month = jun,
6 doi = {10.48550/arXiv.1806.03198}
7}
8
9@article{Caron2021Apr,
10 author = {Caron, Mathilde and Touvron, Hugo and Misra, Ishan and J{\ifmmode\acute{e}\else\'{e}\fi}gou, Herv{\ifmmode\acute{e}\else\'{e}\fi} and Mairal, Julien and Bojanowski, Piotr and Joulin, Armand},
11 title = {{Emerging Properties in Self-Supervised Vision Transformers}},
12 year = {2021},
13 month = apr,
14 doi = {10.48550/arXiv.2104.14294}
15}
16
17@article{Zhou2021Nov,
18 author = {Zhou, Jinghao and Wei, Chen and Wang, Huiyu and Shen, Wei and Xie, Cihang and Yuille, Alan and Kong, Tao},
19 title = {{iBOT: Image BERT Pre-Training with Online Tokenizer}},
20 year = {2021},
21 month = nov,
22 doi = {10.48550/arXiv.2111.07832}
23}
24
25@article{Dong2022Dec,
26 author = {Dong, Xiaoyi and Bao, Jianmin and Zhang, Ting and Chen, Dongdong and Gu, Shuyang and Zhang, Weiming and Yuan, Lu and Chen, Dong and Wen, Fang and Yu, Nenghai},
27 title = {{CLIP Itself is a Strong Fine-tuner: Achieving 85.7{\%} and 88.0{\%} Top-1 Accuracy with ViT-B and ViT-L on ImageNet}},
28 year = {2022},
29 month = dec,
30 doi = {10.48550/arXiv.2212.06138}
31}
32
33@article{Oquab2023Apr,
34 author = {Oquab, Maxime and Darcet, Timoth{\ifmmode\acute{e}\else\'{e}\fi}e and Moutakanni, Th{\ifmmode\acute{e}\else\'{e}\fi}o and Vo, Huy and Szafraniec, Marc and Khalidov, Vasil and Fernandez, Pierre and Haziza, Daniel and Massa, Francisco and El-Nouby, Alaaeldin and Assran, Mahmoud and Ballas, Nicolas and Galuba, Wojciech and Howes, Russell and Huang, Po-Yao and Li, Shang-Wen and Misra, Ishan and Rabbat, Michael and Sharma, Vasu and Synnaeve, Gabriel and Xu, Hu and Jegou, Herv{\ifmmode\acute{e}\else\'{e}\fi} and Mairal, Julien and Labatut, Patrick and Joulin, Armand and Bojanowski, Piotr},
35 title = {{DINOv2: Learning Robust Visual Features without Supervision}},
36 year = {2023},
37 month = apr,
38 doi = {10.48550/arXiv.2304.07193}
39}
40
41@article{Balestriero2025Nov,
42 author = {Balestriero, Randall and LeCun, Yann},
43 title = {{LeJEPA: Provable and Scalable Self-Supervised Learning Without the Heuristics}},
44 year = {2025},
45 month = nov,
46 doi = {10.48550/arXiv.2511.08544}
47}