fetal-planes-classification-custom-cnn-V1

This model was trained from scratch on ERO26/fetal-planes-classification-zenodo. It achieves the following results on the evaluation set:

  • Loss: 0.3586
  • Accuracy: 0.9080
  • Precision Macro: 0.8620
  • Recall Macro: 0.9027
  • F1 Macro: 0.8790

Model description

  • Developed by: ERO26
  • Model Type: Custom Convolutional Neural Network (CNN) for Image Classification
  • Task: Multi-class classification of standard fetal ultrasound planes
  • Input: Grayscale ultrasound images resized to 128x128 pixels ((1, 128, 128) tensor format)
  • Output: Probability logits across the target fetal plane classes
  • Architecture Highlights:
    • Feature Extractor: 3 Conv2d blocks (32, 64, and 128 channels) with BatchNorm2d, ReLU, MaxPool2d, and Dropout2d.
    • Classifier Head: Flatten layer, linear projection to 256 hidden units with ReLU and 50% dropout, followed by a final linear layer matching num_classes.
  • Loss Function: Cross-Entropy Loss with integrated class weights to handle dataset imbalance.

Intended uses & limitations

Intended Uses

  • Clinical Quality Assurance: Assisting sonographers and medical researchers in automatically tagging or verifying standard fetal imaging planes during routine or archive scans.
  • Educational Tool: Supporting medical students and trainees in learning standard fetal biometric and anatomical plane identification.

Limitations & Out-of-Scope Use

  • Not a Diagnostic Device: This model is intended for research, educational, and assistive prototyping purposes only. It must not be deployed as a standalone diagnostic tool for clinical decision-making.
  • Domain Shift: Performance may degrade when evaluating ultrasound images captured using scanner hardware, acoustic settings, or transducers significantly different from the training distribution.

Training and evaluation data

  • Dataset: Trained on ERO26/fetal-planes-classification-zenodo.
  • Data Splits: The dataset is partitioned into training, validation, and test subsets to ensure robust generalization and unbiased final evaluation.
  • Preprocessing: Images are normalized, converted to single-channel grayscale, and uniformly resized to 128x128 pixels before being ingested into the network pipeline.

Training procedure

The model was trained from scratch using the Hugging Face Trainer framework with native Automatic Mixed Precision (AMP) enabled for accelerated convergence. Class frequency imbalances were addressed by incorporating dynamically calculated class weights into the loss function.

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.001
  • 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
  • lr_scheduler_type: cosine
  • num_epochs: 50
  • mixed_precision_training: Native AMP

Training results

Training Loss Epoch Step Validation Loss Accuracy Precision Macro Recall Macro F1 Macro
0.9073 1.0 317 0.9008 0.6512 0.6269 0.6025 0.5566
0.9162 2.0 634 0.7200 0.7058 0.6486 0.7089 0.6609
0.8177 3.0 951 0.6554 0.8049 0.7461 0.7387 0.7393
0.7520 4.0 1268 0.5613 0.7543 0.6862 0.7465 0.6999
0.6695 5.0 1585 0.5708 0.8038 0.7450 0.7892 0.7591
1.0570 6.0 1902 0.5302 0.7907 0.7236 0.7826 0.7435
0.8156 7.0 2219 0.5057 0.7968 0.7551 0.8177 0.7715
0.6888 8.0 2536 0.4715 0.8160 0.7591 0.8324 0.7835
0.6194 9.0 2853 0.4609 0.8220 0.7636 0.8441 0.7900
0.6261 10.0 3170 0.4942 0.7978 0.7498 0.8299 0.7630
0.5964 11.0 3487 0.4395 0.8413 0.7870 0.8435 0.8039
0.7691 12.0 3804 0.4477 0.8322 0.7760 0.8446 0.8005
0.5971 13.0 4121 0.4079 0.8413 0.7851 0.8580 0.8096
0.6364 14.0 4438 0.4061 0.8413 0.7832 0.8596 0.8076
0.6412 15.0 4755 0.4355 0.8544 0.8021 0.8623 0.8229
0.5242 16.0 5072 0.3783 0.8686 0.8178 0.8573 0.8334
0.6033 17.0 5389 0.3738 0.8625 0.8045 0.8701 0.8287
0.7080 18.0 5706 0.3965 0.8483 0.8013 0.8617 0.8166
0.5689 19.0 6023 0.4015 0.8524 0.8005 0.8724 0.8248
0.4923 20.0 6340 0.3855 0.8574 0.8025 0.8750 0.8244
0.4272 21.0 6657 0.3553 0.8766 0.8264 0.8738 0.8460
0.5221 22.0 6974 0.3597 0.8615 0.8095 0.8804 0.8298
0.4752 23.0 7291 0.3648 0.8857 0.8392 0.8759 0.8528
0.3906 24.0 7608 0.3677 0.8706 0.8189 0.8701 0.8387
0.4001 25.0 7925 0.3202 0.8706 0.8160 0.8867 0.8406
0.4809 26.0 8242 0.3232 0.8797 0.8326 0.8942 0.8549
0.4715 27.0 8559 0.3460 0.8787 0.8299 0.8916 0.8508
0.3758 28.0 8876 0.3383 0.8888 0.8378 0.8879 0.8574
0.3891 29.0 9193 0.3455 0.8857 0.8335 0.8966 0.8577
0.2582 30.0 9510 0.3347 0.8969 0.8455 0.8992 0.8673
0.3163 31.0 9827 0.3198 0.8938 0.8428 0.8891 0.8615
0.3230 32.0 10144 0.3234 0.8868 0.8305 0.8821 0.8511
0.3189 33.0 10461 0.3098 0.9019 0.8545 0.9001 0.8727
0.3142 34.0 10778 0.3434 0.8979 0.8472 0.8947 0.8666
0.3274 35.0 11095 0.3387 0.9070 0.8617 0.8952 0.8759
0.4326 36.0 11412 0.3423 0.9029 0.8576 0.8963 0.8732
0.4480 37.0 11729 0.3586 0.9080 0.8620 0.9027 0.8790
0.2945 38.0 12046 0.3761 0.8969 0.8444 0.8820 0.8608
0.2479 39.0 12363 0.3716 0.8827 0.8321 0.8721 0.8481
0.2763 40.0 12680 0.3532 0.8989 0.8475 0.8950 0.8669
0.3422 41.0 12997 0.3251 0.9039 0.8562 0.8936 0.8715
0.3239 42.0 13314 0.3264 0.8999 0.8475 0.8954 0.8671

Framework versions

  • Transformers 5.16.1
  • Pytorch 2.11.0+cu128
  • Datasets 5.0.1
  • Tokenizers 0.23.1
Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
8.48M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support