Ir para o conteúdo
ModelListadosExterno
Baixar

Aloe v2 Dinov3 Base

ALOEv2 is a B-cos-interpretable DINOv3 model obtained by fine-tuning the original ALOE backbones for a further 30k steps. It keeps the original three-layer distillation scheme but adds per-step multi-resolution...

TipoOtherVersãoRevision 0197fd4Bnota

Fonte do modelo

Tipo
Other
Tamanho do arquivo
334 MB
Versão
vRevision 0197fd4
Atualizado
10 de out. de 2026
Downloads
32
Fonte
Hugging Face

Descrição da fonte

ALOEv2 (multi-resolution DINOv3)

ALOEv2 is a B-cos-interpretable DINOv3 model obtained by fine-tuning the original ALOE backbones for a further 30k steps. It keeps the original three-layer distillation scheme but adds per-step multi-resolution sampling (224/384/480) and fixes a target-layer bug so the even-thirds distillation layers include the final transformer block.

The original ALOE distilled at a single resolution (224 px), which left features poorly calibrated for the high-resolution inputs that dense-prediction probes — correspondence, depth, surface normals — actually run on, so feature quality degraded at those resolutions. Training on multiple resolutions removes that train/eval mismatch and restores dense-prediction accuracy close to the DINOv3 teacher, while retaining the inherent B-cos explanations and holding ImageNet-1k recognition roughly unchanged.

This card is shared by the ALOEv2 DINOv3 backbones and their ImageNet-1k linear-probe (LP) classifier heads:

KindRepos
Backbonermaser/aloe-v2-dinov3-{small,base,large}
ImageNet-1k LPrmaser/aloe-v2-dinov3-{small,base,large}-in1k-lp

Why ALOEv2 (qualitative difference vs. previous models)

Fig 2a — dense correspondence & surface normals across model sizes. ALOEv2 (orange) tracks the DINOv3 teacher closely on NAVI / ScanNet / SPair / surface-normals, while the original ALOE (grey, dotted) lags far behind.

Fig 2a — size grid

NYUv2 depth probe. δ<1.25 (higher better) and RMSE (lower better) by size:

NYUv2 depth probe

Fig 3 — discriminative quality (ImageNet-1k kNN@20 + Linear Probe).

Fig 3 — kNN and LP

GridPG localization. ALOEv2 inherent B-cos localization (higher is better):

SizeALOEv2 B-cosOriginal ALOE B-cosDINOv3 AttnLRP
Small75.8079.5553.46
Base87.7782.6965.11
Large84.3880.6965.33

GridPG localization

ImageNet-1k (base): kNN@20 81.43, Linear Probe 83.92.

Usage — backbone (feature extraction)

from transformers import AutoImageProcessor, AutoModel

repo_id = "rmaser/aloe-v2-dinov3-base"
processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True)
model.eval()

Hidden states are pre-norm

With 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.

Use 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).

Usage — ImageNet-1k classification and explanations (-in1k-lp only)

from PIL import Image
from transformers import AutoImageProcessor, AutoModelForImageClassification

repo_id = "rmaser/aloe-v2-dinov3-base-in1k-lp"
processor = AutoImageProcessor.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForImageClassification.from_pretrained(repo_id, trust_remote_code=True)
model.eval()

image = Image.open("image.jpg").convert("RGB")
pixel_values = processor(images=image, return_tensors="pt").pixel_values

result = model.explain(pixel_values, idx=None)
class_idx = int(result["explained_class_idx"][0])
print(f"Predicted ImageNet-1k class index: {class_idx}")

rgba = (result["explanation"][0] * 255).astype("uint8")
Image.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.

Notes

ALOE models use custom B-cos-aware Transformers code, so loading requires trust_remote_code=True. Runtime code: rmaser/aloe-arch.

Links

Citation

@inproceedings{maser2026align,
  title = {Align Once to Explain: Feature Alignment for Scalable B-cosification of Foundational Vision Transformers},
  author = {Maser, Raphael and Gairola, Siddhartha and Rao, Sukrut and Schiele, Bernt},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year = {2026},
  note = {Poster}
}

License

This model is released under the Creative Commons Attribution-NonCommercial ShareAlike 4.0 International License. The methods described in this work are patent pending.

Fontes

1 fonte
Hugging FacePrimárioVersão 0197fd45b7453446f5b443bea2ea353aa27536e0
huggingface.co/rmaser/aloe-v2-dinov3-base/tree/0197fd45b7453446f5b443bea2ea353aa27536e0

Verificado 10 de out.

Artefatos de modelo

1 artefato

model.safetensors

safetensors · 334 MB · SHA-256 3ddef2e5200a…4a5b · Hugging Face

Baixar

Trechos de fonte

3 trechos

--- library_name: transformers license: cc-by-nc-sa-4.0 pipeline_tag: image-feature-extraction tags: - aloe - b-cos - interpretability - vision --- # ALOEv2 (multi-resolution DINOv3) ALOEv2 is a B-cos-interpretable DINOv3 model obtained by fine-tuning the original ALOE backbones for a further 30k steps. It keeps the original three-layer distillation scheme but adds **per-step multi-resolution sampling** (224/384/480) and fixes a target-layer bug so the even-thirds distillation layers include the final transformer block. The original ALOE distilled at a single resolution (224 px), which left features poorly calibrated for the high-resolution inputs that dense-prediction probes — correspondence, depth, surface normals — actually run on, so feature quality degraded at those resolutions. Training on multiple resolutions removes that train/eval mismatch and **restores dense-prediction accuracy close to the DINOv3 teacher**, while retaining the inherent B-cos explanations and holding ImageNet-1k recognition roughly unchanged. This card is shared by the ALOEv2 DINOv3 backbones and their ImageNet-1k linear-probe (LP) classifier heads: | Kind | Repos | |---|---| | Backbone | `rmaser/aloe-v2-dinov3-{small,base,large}` | | ImageNet-1k LP | `rmaser/aloe-v2-dinov3-{small,base,large}-in1k-lp` | ## Why ALOEv2 (qualitative difference vs. previous models) **Fig 2a — dense correspondence & surface normals across model sizes.** ALOEv2 (orange) tracks the DINOv3 teacher closely on NAVI / ScanNet / SPair / surface-normals, while the original ALOE (grey, dotted) lags far behind. ![Fig 2a — size grid](figures/pub_size_grid.png) **NYUv2 depth probe.** δ<1.25 (higher better) and RMSE (lower better) by size: ![NYUv2 depth probe](figures/pub_depth.png) **Fig 3 — discriminative quality (ImageNet-1k kNN@20 + Linear Probe).** ![Fig 3 — kNN and LP](figures/pub_knn_lp.png) **GridPG localization.** ALOEv2 inherent B-cos localization (higher is better): | 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 | ![GridPG localization](figures/pub_gridpg.png) ImageNet-1k (base): kNN@20 **81.43**, Linear Probe **83.92**. ## Usage — backbone (feature extraction) ```python from transformers import AutoImageProcessor, AutoModel repo_id = "r...

Source context: 32 downloads · 0 likes · Pipeline image-feature-extraction · Library transformers · Repo rmaser/aloe-v2-dinov3-base

Source context: 10657 downloads · 0 likes · Pipeline image-feature-extraction · Library transformers · Repo rmaser/aloe-v2-dinov3-base