Instructions to use 1aurent/vit_tiny_patch16_224.tinyusfm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- timm
How to use 1aurent/vit_tiny_patch16_224.tinyusfm with timm:
import timm model = timm.create_model("hf-hub:1aurent/vit_tiny_patch16_224.tinyusfm", pretrained=True) - Notebooks
- Google Colab
- Kaggle
Add vit_tiny_patch16_224.tinyusfm (timm re-upload of official TinyUSFM checkpoint; bit-identical 150/150, parity PASS)
Browse files- README.md +77 -0
- config.json +50 -0
- model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- feature-extraction
|
| 4 |
+
- timm
|
| 5 |
+
- ultrasound
|
| 6 |
+
- medical-imaging
|
| 7 |
+
library_name: timm
|
| 8 |
+
license: apache-2.0
|
| 9 |
+
pipeline_tag: feature-extraction
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Model card for vit_tiny_patch16_224.tinyusfm
|
| 13 |
+
|
| 14 |
+
TinyUSFM is a compact Vision Transformer (ViT) ultrasound foundation model, distilled from the large-scale USFM. \
|
| 15 |
+
It keeps foundation-level representation ability with only 5.5M parameters and 2.16 GFLOPs, and was the official lightweight continuation of [USFM](https://github.com/openmedlab/USFM).
|
| 16 |
+
|
| 17 |
+
This is a timm port of the official pretrained TinyUSFM encoder checkpoint released by the authors (Google Drive, see [original repo](https://github.com/MacDunno/TinyUSFM)).
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
|
| 21 |
+
## Model Details
|
| 22 |
+
|
| 23 |
+
- **Model Type:** Feature backbone (encoder-only Vision Transformer, no classifier head)
|
| 24 |
+
- **Developed by**: Chen Ma, Jing Jiao, Shuyu Liang, Junhu Fu, Qin Wang, Zeju Li, Yuanyuan Wang, Yi Guo (Fudan University)
|
| 25 |
+
- **Model Stats:**
|
| 26 |
+
- Params: 5.52M
|
| 27 |
+
- Image size: 224 x 224 x 3
|
| 28 |
+
- Patch size: 16 x 16 x 3
|
| 29 |
+
- Embed dim: 192, depth: 12, heads: 12 (head dim 16), MLP ratio: 4, qkv bias: yes, LayerNorm eps 1e-6
|
| 30 |
+
- **Pre-training:**
|
| 31 |
+
- Distilled from USFM (teacher) on ~200K curated ultrasound images (feature-gradient driven coreset selection) with domain-separated masked image modeling + consistency-driven dynamic distillation
|
| 32 |
+
- Evaluated on UniUS-Bench (8 classification + 10 segmentation datasets, 15 organs)
|
| 33 |
+
- **Papers:**
|
| 34 |
+
- [TinyUSFM: Towards Compact and Efficient Ultrasound Foundation Models](https://arxiv.org/abs/2510.19239) (IEEE JBHI 2026, DOI: 10.1109/JBHI.2026.3678309)
|
| 35 |
+
- **Original:** https://github.com/MacDunno/TinyUSFM
|
| 36 |
+
- **License:** Apache-2.0 (declared in the upstream README badge and License section; note: the LICENSE file itself is missing from the upstream repository)
|
| 37 |
+
|
| 38 |
+
## Model Usage
|
| 39 |
+
|
| 40 |
+
### Image Embeddings
|
| 41 |
+
```python
|
| 42 |
+
from urllib.request import urlopen
|
| 43 |
+
from PIL import Image
|
| 44 |
+
import timm
|
| 45 |
+
|
| 46 |
+
# get example image
|
| 47 |
+
img = Image.open(
|
| 48 |
+
urlopen(
|
| 49 |
+
"https://github.com/MacDunno/TinyUSFM/raw/main/img/overview.png"
|
| 50 |
+
)
|
| 51 |
+
).convert("RGB")
|
| 52 |
+
|
| 53 |
+
# load model from the hub
|
| 54 |
+
model = timm.create_model(
|
| 55 |
+
model_name="hf-hub:1aurent/vit_tiny_patch16_224.tinyusfm",
|
| 56 |
+
pretrained=True,
|
| 57 |
+
).eval()
|
| 58 |
+
|
| 59 |
+
# get model specific transforms (normalization, resize)
|
| 60 |
+
data_config = timm.data.resolve_model_data_config(model)
|
| 61 |
+
transforms = timm.data.create_transform(**data_config, is_training=False)
|
| 62 |
+
|
| 63 |
+
data = transforms(img).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
|
| 64 |
+
output = model(data) # output is a (batch_size, num_features) shaped tensor
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
## Citation
|
| 68 |
+
```bibtex
|
| 69 |
+
@article{tinyusfm,
|
| 70 |
+
author={Ma, Chen and Jiao, Jing and Liang, Shuyu and Fu, Junhu and Wang, Qin and Li, Zeju and Wang, Yuanyuan and Guo, Yi},
|
| 71 |
+
journal={IEEE Journal of Biomedical and Health Informatics},
|
| 72 |
+
title={TinyUSFM: Towards Compact and Efficient Ultrasound Foundation Models},
|
| 73 |
+
year={2026},
|
| 74 |
+
pages={1-14},
|
| 75 |
+
doi={10.1109/JBHI.2026.3678309}
|
| 76 |
+
}
|
| 77 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architecture": "vit_tiny_patch16_224",
|
| 3 |
+
"num_classes": 0,
|
| 4 |
+
"num_features": 192,
|
| 5 |
+
"global_pool": "token",
|
| 6 |
+
"model_args": {
|
| 7 |
+
"img_size": 224,
|
| 8 |
+
"patch_size": 16,
|
| 9 |
+
"in_chans": 3,
|
| 10 |
+
"embed_dim": 192,
|
| 11 |
+
"depth": 12,
|
| 12 |
+
"num_heads": 12,
|
| 13 |
+
"mlp_ratio": 4.0,
|
| 14 |
+
"qkv_bias": true,
|
| 15 |
+
"global_pool": "token",
|
| 16 |
+
"num_classes": 0
|
| 17 |
+
},
|
| 18 |
+
"pretrained_cfg": {
|
| 19 |
+
"tag": "tinyusfm",
|
| 20 |
+
"custom_load": false,
|
| 21 |
+
"input_size": [
|
| 22 |
+
3,
|
| 23 |
+
224,
|
| 24 |
+
224
|
| 25 |
+
],
|
| 26 |
+
"fixed_input_size": true,
|
| 27 |
+
"interpolation": "bilinear",
|
| 28 |
+
"crop_pct": 1.0,
|
| 29 |
+
"crop_mode": "center",
|
| 30 |
+
"mean": [
|
| 31 |
+
0.485,
|
| 32 |
+
0.456,
|
| 33 |
+
0.406
|
| 34 |
+
],
|
| 35 |
+
"std": [
|
| 36 |
+
0.229,
|
| 37 |
+
0.224,
|
| 38 |
+
0.225
|
| 39 |
+
],
|
| 40 |
+
"num_classes": 0,
|
| 41 |
+
"pool_size": null,
|
| 42 |
+
"first_conv": "patch_embed.proj",
|
| 43 |
+
"classifier": "head",
|
| 44 |
+
"license": "apache-2.0",
|
| 45 |
+
"hf_hub_id": "1aurent/vit_tiny_patch16_224.tinyusfm",
|
| 46 |
+
"notes": [
|
| 47 |
+
"Apache-2.0 is declared in the upstream README (badge + License section); the LICENSE file itself is MISSING from github.com/MacDunno/TinyUSFM (404 on main; GitHub API license=null)"
|
| 48 |
+
]
|
| 49 |
+
}
|
| 50 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc68b9934070ab0be3fc400963555862680de35d10fe555804efb26ab7835efe
|
| 3 |
+
size 22111216
|