Image Classification
Transformers
Safetensors
swin
medical-imaging
ultrasound
maternal-health
obstetric-ultrasound
Generated from Trainer
Instructions to use Beijuka/ultrasound_plane_classification-microsoft-swin-base-patch4-window7-224-undersampling-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Beijuka/ultrasound_plane_classification-microsoft-swin-base-patch4-window7-224-undersampling-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="Beijuka/ultrasound_plane_classification-microsoft-swin-base-patch4-window7-224-undersampling-v1") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("Beijuka/ultrasound_plane_classification-microsoft-swin-base-patch4-window7-224-undersampling-v1") model = AutoModelForImageClassification.from_pretrained("Beijuka/ultrasound_plane_classification-microsoft-swin-base-patch4-window7-224-undersampling-v1") - Notebooks
- Google Colab
- Kaggle
ultrasound_plane_classification-microsoft-swin-base-patch4-window7-224-undersampling-v1
This model is a fine-tuned version of microsoft/swin-base-patch4-window7-224 on the marconilabmak/hash-ultrasound-image-classification dataset. It achieves the following results on the evaluation set:
- Loss: 0.3529
- Accuracy: 0.9604
- Precision Macro: 0.9544
- Recall Macro: 0.9558
- F1 Macro: 0.9549
- Sensitivity Fetal Brain: 1.0
- Sensitivity Fetal Abdomen: 0.9286
- Sensitivity Fetal Femur: 1.0
- Sensitivity Fetal Thorax: 0.8947
- Specificity Fetal Brain: 1.0
- Specificity Fetal Abdomen: 0.9863
- Specificity Fetal Femur: 0.9870
- Specificity Fetal Thorax: 0.9756
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 4
- eval_batch_size: 16
- seed: 42
- gradient_accumulation_steps: 4
- total_train_batch_size: 16
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 0.1
- num_epochs: 50
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy | Precision Macro | Recall Macro | F1 Macro | Sensitivity Fetal Brain | Sensitivity Fetal Abdomen | Sensitivity Fetal Femur | Sensitivity Fetal Thorax | Specificity Fetal Brain | Specificity Fetal Abdomen | Specificity Fetal Femur | Specificity Fetal Thorax |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.2540 | 1.0 | 45 | 1.1472 | 0.5862 | 0.5969 | 0.5231 | 0.4872 | 0.8667 | 0.8966 | 0.2766 | 0.0526 | 0.9371 | 0.5379 | 0.9808 | 0.9697 |
| 1.5447 | 2.0 | 90 | 0.3789 | 0.8522 | 0.8447 | 0.8327 | 0.8342 | 0.9667 | 0.8276 | 0.9574 | 0.5789 | 0.9580 | 0.9103 | 0.9679 | 0.9636 |
| 0.6833 | 3.0 | 135 | 0.5568 | 0.8522 | 0.9011 | 0.8087 | 0.7992 | 0.9667 | 1.0 | 0.9787 | 0.2895 | 0.9860 | 0.8276 | 0.9808 | 1.0 |
| 0.7808 | 4.0 | 180 | 0.2893 | 0.9212 | 0.9459 | 0.9033 | 0.9149 | 0.9667 | 1.0 | 0.9362 | 0.7105 | 1.0 | 0.8897 | 1.0 | 1.0 |
| 0.6671 | 5.0 | 225 | 0.3016 | 0.9458 | 0.9525 | 0.9300 | 0.9351 | 0.9833 | 1.0 | 1.0 | 0.7368 | 1.0 | 0.9586 | 0.9679 | 1.0 |
| 0.8642 | 6.0 | 270 | 0.3313 | 0.9507 | 0.9586 | 0.9415 | 0.9479 | 1.0 | 0.9828 | 0.9149 | 0.8684 | 1.0 | 0.9379 | 1.0 | 0.9939 |
| 0.0799 | 7.0 | 315 | 0.3368 | 0.9655 | 0.9686 | 0.9576 | 0.9620 | 0.9833 | 1.0 | 0.9787 | 0.8684 | 0.9930 | 0.9655 | 1.0 | 0.9939 |
| 0.2535 | 8.0 | 360 | 0.4027 | 0.9557 | 0.9664 | 0.9408 | 0.9484 | 1.0 | 1.0 | 1.0 | 0.7632 | 1.0 | 0.9379 | 1.0 | 1.0 |
| 0.1939 | 9.0 | 405 | 0.2511 | 0.9557 | 0.9507 | 0.9489 | 0.9497 | 1.0 | 0.9483 | 0.9787 | 0.8684 | 1.0 | 0.9724 | 0.9936 | 0.9758 |
| 0.0000 | 10.0 | 450 | 0.3636 | 0.9606 | 0.9627 | 0.9559 | 0.9583 | 0.95 | 1.0 | 0.9787 | 0.8947 | 1.0 | 0.9586 | 1.0 | 0.9879 |
| 0.0078 | 11.0 | 495 | 0.2500 | 0.9655 | 0.9623 | 0.9646 | 0.9632 | 0.9667 | 0.9655 | 0.9787 | 0.9474 | 1.0 | 0.9793 | 1.0 | 0.9758 |
| 0.0996 | 12.0 | 540 | 0.2804 | 0.9803 | 0.9825 | 0.9737 | 0.9772 | 1.0 | 1.0 | 1.0 | 0.8947 | 1.0 | 0.9793 | 0.9936 | 1.0 |
| 0.0000 | 13.0 | 585 | 0.2539 | 0.9754 | 0.9727 | 0.9706 | 0.9716 | 1.0 | 0.9828 | 0.9787 | 0.9211 | 1.0 | 0.9862 | 0.9936 | 0.9879 |
| 0.0007 | 14.0 | 630 | 0.3613 | 0.9704 | 0.9732 | 0.9666 | 0.9692 | 0.9667 | 1.0 | 0.9787 | 0.9211 | 1.0 | 0.9655 | 1.0 | 0.9939 |
| 0.1308 | 15.0 | 675 | 0.3994 | 0.9655 | 0.9673 | 0.9586 | 0.9619 | 0.9833 | 0.9828 | 1.0 | 0.8684 | 1.0 | 0.9655 | 0.9936 | 0.9939 |
| 0.4742 | 16.0 | 720 | 0.3312 | 0.9704 | 0.9743 | 0.9628 | 0.9672 | 1.0 | 0.9828 | 1.0 | 0.8684 | 0.9930 | 0.9724 | 0.9936 | 1.0 |
| 0.0000 | 17.0 | 765 | 0.5241 | 0.9606 | 0.9697 | 0.9536 | 0.9596 | 0.9833 | 1.0 | 0.9362 | 0.8947 | 1.0 | 0.9448 | 1.0 | 1.0 |
Framework versions
- Transformers 5.0.0
- Pytorch 2.10.0+cu128
- Datasets 4.0.0
- Tokenizers 0.22.2
- Downloads last month
- -
Model tree for Beijuka/ultrasound_plane_classification-microsoft-swin-base-patch4-window7-224-undersampling-v1
Base model
microsoft/swin-base-patch4-window7-224