CytoSAE: Interpretable Cell Embeddings for Hematology
Paper • 2507.12464 • Published • 1
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:
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.
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.
How to use 1aurent/sae_dinov2_vitb14_resid_2.cytosae with timm:
import timm
model = timm.create_model("hf-hub:1aurent/sae_dinov2_vitb14_resid_2.cytosae", pretrained=True)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").
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()
@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},
}