Feature Extraction
timm
Safetensors
self-supervised
histology
computational-pathology
foundation-model
Instructions to use 1aurent/vit_base_patch8_224.lemon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use 1aurent/vit_base_patch8_224.lemon with timm:
import timm model = timm.create_model("hf-hub:1aurent/vit_base_patch8_224.lemon", pretrained=True) - Notebooks
- Google Colab
- Kaggle
|
Download README.md from 1aurent/vit_base_patch8_224.lemon: direct link, hf CLI and curl.
- Browser
- Download file 2.03 kB
-
https://huggingface.co/1aurent/vit_base_patch8_224.lemon/resolve/main/README.md
- Command line
-
hf download hf://1aurent/vit_base_patch8_224.lemon/README.md
-
curl -L -o README.md https://huggingface.co/1aurent/vit_base_patch8_224.lemon/resolve/main/README.md
2.03 kB
| tags: | |
| - timm | |
| - feature-extraction | |
| - self-supervised | |
| - histology | |
| - computational-pathology | |
| - foundation-model | |
| - arxiv:2603.25802 | |
| library_name: timm | |
| license: mit | |
| pipeline_tag: feature-extraction | |
| # Model card for vit_base_patch8_224.lemon | |
| A Vision Transformer (ViT) single-cell nuclear morphology model. \ | |
| Trained with MoCo v3 on ~10M 40x40 px single-cell images from ~10k TCGA slides (LEMON). | |
| ## Model Details | |
| - **Model Type:** Feature backbone | |
| - **Model Stats:** | |
| - - Params: 85.8M (base) | |
| - - Image size: 40 x 40 x 3 | |
| - - Patch size: 8 x 8 x 3 | |
| - **Papers:** | |
| - - [LEMON: a foundation model for nuclear morphology in Computational Pathology](https://arxiv.org/abs/2603.25802) | |
| - **Original:** https://huggingface.co/aliceblondel/LEMON (lemon_vitb8.pth.tar) | |
| - **License:** [MIT](https://huggingface.co/aliceblondel/LEMON) | |
| ## Model Usage | |
| ### Image Embeddings | |
| ```python | |
| from urllib.request import urlopen | |
| from PIL import Image | |
| import timm | |
| # get example image | |
| img = Image.open( | |
| urlopen("https://github.com/owkin/HistoSSLscaling/raw/main/assets/example.tif") | |
| ).convert('RGB') | |
| # load model from the hub | |
| model = timm.create_model( | |
| model_name="hf-hub:1aurent/vit_base_patch8_224.lemon", | |
| pretrained=True, | |
| ).eval() | |
| # get model specific transforms (normalization, resize) | |
| data_config = timm.data.resolve_model_data_config(model) | |
| transforms = timm.data.create_transform(**data_config, is_training=False) | |
| data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor | |
| output = model(data) # output is a (batch_size, num_features) shaped tensor | |
| ``` | |
| ## Citation | |
| ```bibtex | |
| @misc{chadoutaud2026lemon, | |
| title = {LEMON: a foundation model for nuclear morphology in Computational Pathology}, | |
| author = {Chadoutaud, Loïc and Blondel, Alice and Feki, Hana and Fontugne, Jacqueline and Barillot, Emmanuel and Walter, Thomas}, | |
| year = {2026}, | |
| eprint = {2603.25802}, | |
| archivePrefix = {arXiv}, | |
| primaryClass = {cs.CV}, | |
| url = {https://arxiv.org/abs/2603.25802} | |
| } | |
| ``` | |