Run this model with HF Jobs
Run JWonderLand/StainNet-Base 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/JWonderLand/StainNet-Base. 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/JWonderLand/StainNet-Base 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.
Instructions to use JWonderLand/StainNet-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use JWonderLand/StainNet-Base with timm:
import timm model = timm.create_model("hf-hub:JWonderLand/StainNet-Base", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files12345678910---tags:- image-classification- timm- transformerspipeline_tag: image-classificationlibrary_name: timmlicense: apache-2.0---# Model card for StainNet-Base12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061---license: cc-by-nc-nd-4.0language:- enpipeline_tag: image-feature-extractionlibrary_name: timm---# Model Card for StainNet-Base<!-- Provide a quick summary of what the model is/does. -->`StainNet-Base` is a foundation model for histology images from **immunohistochemistry** and **special stains**. Arxiv preprint paper: [https://arxiv.org/abs/2512.10326]The model is a **Vision Transformer Base/16** with DINO [1] self-supervised pre-training on 1,418,938 patch images from 20,231 special staining whole slide images (WSIs) in HISTAI [2].## Using StainNet-Base to extract features from immunohistochemistry and special staining pathology images```pythonimport timmimport torchimport torchvision.transforms as transformsmodel = timm.create_model('hf_hub:JWonderLand/StainNet-Base', pretrained=True)preprocess = transforms.Compose([transforms.Resize(224, interpolation=transforms.InterpolationMode.BICUBIC),transforms.ToTensor(),transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5)),])model = model.to('cuda')model.eval()input = torch.randn([1, 3, 224, 224]).cuda()with torch.no_grad():output = model(input) # [1, 768]```## CitationIf `StainNet-Base` is helpful to you, please cite our work.```@misc{li2025stainnet,title={StainNet: A Special Staining Self-Supervised Vision Transformer for Computational Pathology},author={Jiawen Li and Jiali Hu and Xitong Ling and Yongqiang Lv and Yuxuan Chen and Yizhi Wang and Tian Guan and Yifei Liu and Yonghong He},year={2025},eprint={2512.10326},archivePrefix={arXiv},primaryClass={cs.CV},url={https://arxiv.org/abs/2512.10326},}```## References[1] Caron, M., Touvron, H., Misra, I., Jégou, H., Mairal, J., Bojanowski, P., & Joulin, A. (2021). Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision (pp. 9650-9660).[2] Nechaev, D., Pchelnikov, A., & Ivanova, E. (2025). HISTAI: An Open-Source, Large-Scale Whole Slide Image Dataset for Computational Pathology. arXiv preprint arXiv:2505.12120.
README.md+58-7