Instructions to use 1aurent/vit_base_patch16_224.usfmae with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use 1aurent/vit_base_patch16_224.usfmae with timm:
import timm model = timm.create_model("hf-hub:1aurent/vit_base_patch16_224.usfmae", pretrained=True) - Notebooks
- Google Colab
- Kaggle
File size: 3,572 Bytes
6718ceb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | ---
tags:
- feature-extraction
- timm
- ultrasound
- self-supervised-learning
- masked-autoencoding
library_name: timm
license: mit
pipeline_tag: feature-extraction
---
# Model card for vit_base_patch16_224.usfmae
The ViT-Base encoder of **USF-MAE** (Ultrasound Self-Supervised Foundation Model with Masked Autoencoding), ported to timm as an encoder-only feature extractor (num_classes=0). USF-MAE is a masked autoencoder (MAE) pretrained self-supervised on ~370,000 ultrasound images from 46 open-source datasets (OpenUS-46); only the encoder is kept here, the MAE decoder was used during pretraining only.

## Model Details
- **Model Type:** Feature backbone (encoder of a masked autoencoder)
- **Developed by**: Youssef Megahed, Robin Ducharme, Aylin Erman, Mark Walker, Steven Hawken, Adrian D.C. Chan
- **Model Stats:**
- Params: 85.8M (ViT-Base encoder)
- Image size: 224 x 224 x 3
- Patch size: 16 x 16 x 3
- **Pre-training:**
- Dataset: [OpenUS-46](https://github.com/Yusufii9/USF-MAE) (~370K unlabeled 2D/3D ultrasound images from 46 datasets)
- Framework: [MAE](https://github.com/facebookresearch/mae) self-supervised masked patch reconstruction (25% masking ratio), initialized from ImageNet-21k MAE weights, 100 epochs (recommended checkpoint)
- **Papers:**
- [USF-MAE: Ultrasound Self-Supervised Foundation Model with Masked Autoencoding](https://arxiv.org/abs/2510.22990) (Biomedical Signal Processing and Control, 2026, doi:10.1016/j.bspc.2026.110313)
- **Original:** https://github.com/Yusufii9/USF-MAE
- **License:** [MIT](https://github.com/Yusufii9/USF-MAE/blob/main/LICENSE)
- **Preprocessing (as in the original eval code):** resize to 224x224 with NEAREST interpolation (squash), scale to [0,1], normalize with ImageNet mean/std (0.485/0.456/0.406, 0.229/0.224/0.225)
## Model Usage
### Image Embeddings
```python
from urllib.request import urlopen
from PIL import Image
import timm
# get example image (any RGB ultrasound image works)
img = Image.open(
urlopen(
"https://github.com/Yusufii9/USF-MAE/raw/main/figures/USF-MAE.jpeg"
)
).convert("RGB")
# load model from the hub
model = timm.create_model(
model_name="hf-hub:1aurent/vit_base_patch16_224.usfmae",
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=768) shaped tensor (cls-token embedding)
```
## Citation
```bibtex
@article{MEGAHED2026110313,
author = {Youssef Megahed and Robin Ducharme and Aylin Erman and Mark C. Walker and Steven Hawken and Adrian D.C. Chan},
title = {USF-MAE: Ultrasound self-supervised foundation model with masked autoencoding},
journal = {Biomedical Signal Processing and Control},
volume = {122},
pages = {110313},
year = {2026},
issn = {1746-8094},
doi = {https://doi.org/10.1016/j.bspc.2026.110313},
url = {https://www.sciencedirect.com/science/article/pii/S1746809426008670}
}
@misc{megahed2025usfmae,
author = {Youssef Megahed and Robin Ducharme and Aylin Erman and Mark Walker and Steven Hawken and Adrian D. C. Chan},
title = {{USF-MAE}: Ultrasound Self-Supervised Foundation Model with Masked Autoencoding},
year = {2025},
eprint = {2510.22990},
archivePrefix = {arXiv},
doi = {10.48550/arXiv.2510.22990}
}
```
|