Run this model with HF Jobs

Run 1aurent/sae_dinov2_vitb14_resid_2.cytosae on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/1aurent/sae_dinov2_vitb14_resid_2.cytosae. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/1aurent/sae_dinov2_vitb14_resid_2.cytosae on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Model card for sae_dinov2_vitb14_resid_2.cytosae

CytoSAE: a sparse autoencoder (SAE) trained on the residual stream of block -2 ("blocks.10") of the DinoBloom-B vision transformer, for interpretable cell embeddings in hematology (arXiv:2507.12464). This repo contains the SAE weights as fp32 safetensors plus a standalone PyTorch implementation ("model.py").

Model Details

Model Usage

import torch
import timm
from model import CytoSAE  # model.py from this repo

# 1. load the DinoBloom backbone from the hub
backbone = timm.create_model(
    "hf-hub:1aurent/vit_base_patch14_224.dinobloom",
    pretrained=True,
    num_classes=0,
).eval()

# 2. load the SAE from this repo
sae = CytoSAE.from_pretrained("1aurent/sae_dinov2_vitb14_resid_2.cytosae").eval()

# 3. hook the block -2 (blocks.10) residual stream
captured = {}
handle = backbone.blocks[10].register_forward_hook(
    lambda module, inputs, output: captured.__setitem__("resid", output)
)

# 4. run an image and the SAE on the hooked activations
x = torch.randn(1, 3, 224, 224)  # preprocess per the backbone's default cfg
with torch.no_grad():
    _ = backbone(x)
    resid = captured["resid"]                       # (1, 257, 768)
    sae_out, feature_acts, hidden_pre = sae(resid)  # sae_out: (1, 257, 768), feature_acts: (1, 257, 49152)
handle.remove()

Citation

@misc{dasdelen2025cytosaeinterpretablecellembeddings,
      title={CytoSAE: Interpretable Cell Embeddings for Hematology},
      author={Muhammed Furkan Dasdelen and Hyesu Lim and Michele Buck and Katharina S. Gotze and Carsten Marr and Steffen Schneider},
      year={2025},
      eprint={2507.12464},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2507.12464},
}
Downloads last month
34
Safetensors
Model size
75.5M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Papers for 1aurent/sae_dinov2_vitb14_resid_2.cytosae