Views
No views yet
| Kind | Repos |
|---|---|
| Backbone | rmaser/aloe-v2-dinov3-{small,base,large} |
| ImageNet-1k LP | rmaser/aloe-v2-dinov3-{small,base,large}-in1k-lp |



| Size | ALOEv2 B-cos | Original ALOE B-cos | DINOv3 AttnLRP |
|---|---|---|---|
| Small | 75.80 | 79.55 | 53.46 |
| Base | 87.77 | 82.69 | 65.11 |
| Large | 84.38 | 80.69 | 65.33 |

1from transformers import AutoImageProcessor, AutoModel
2
3repo_id = "rmaser/aloe-v2-dinov3-base"
4processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)
5model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
6model.eval()output_hidden_states=True, hidden_states[i] is the raw output of block i — in
particular hidden_states[-1] is not last_hidden_state, which additionally passes through
post_layernorm. This is the convention the distillation loss was defined against, and recent
Transformers versions report the post-norm tensor in hidden_states[-1] on the official DINOv3
teacher, so the two APIs differ at that one index.hidden_states[i] for anything layer-wise — ALOEv2 supervises blocks n/3, 2n/3 and n,
where its cosine similarity to the DINOv3 teacher's corresponding pre-norm features is 0.98–0.99.
post_layernorm was not part of the loss, so last_hidden_state is noticeably less aligned
(0.78–0.86).-in1k-lp only)1from PIL import Image
2from transformers import AutoImageProcessor, AutoModelForImageClassification
3
4repo_id = "rmaser/aloe-v2-dinov3-base-in1k-lp"
5processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)
6model = AutoModelForImageClassification.from_pretrained(repo_id, trust_remote_code=True)
7model.eval()
8
9image = Image.open("image.jpg").convert("RGB")
10pixel_values = processor(images=image, return_tensors="pt").pixel_values
11
12result = model.explain(pixel_values, idx=None)
13class_idx = int(result["explained_class_idx"][0])
14print(f"Predicted ImageNet-1k class index: {class_idx}")
15
16rgba = (result["explanation"][0] * 255).astype("uint8")
17Image.fromarray(rgba).save("explanation.png")idx=None explains the predicted class. Pass an ImageNet-1k class index to idx to explain a specific class instead. Do not wrap model.explain(...) in torch.inference_mode(): generating the attribution requires input gradients.trust_remote_code=True. Runtime code: rmaser/aloe-arch.rmaser/aloe-arch1@inproceedings{maser2026align,
2 title = {Align Once to Explain: Feature Alignment for Scalable B-cosification of Foundational Vision Transformers},
3 author = {Maser, Raphael and Gairola, Siddhartha and Rao, Sukrut and Schiele, Bernt},
4 booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
5 year = {2026},
6 note = {Poster}
7}