CoolFace
Modelpublic

ERO26/fetal-planes-classification-custom-cnn-V2

sourceHugging Faceupdated 13d agoView on Hugging Face
0likes
Model Card

fetal-planes-classification-custom-cnn-V2

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

  • —Loss: 0.3325
  • —Accuracy: 0.8925
  • —Precision Macro: 0.8655
  • —Recall Macro: 0.8859
  • —F1 Macro: 0.8750

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 LossEpochStepValidation LossAccuracyPrecision MacroRecall MacroF1 Macro
1.34561.04831.03160.61540.54000.59020.5513
1.13722.09660.85180.70830.59910.62070.6050
1.11053.014490.81400.68530.68850.65110.6033
0.97684.019320.76250.74180.69740.67900.6538
0.97415.024150.69640.77090.73950.74280.7405
0.95896.028980.65190.77740.73460.80250.7556
0.95607.033810.62110.79230.76920.80180.7771
1.09998.038640.64590.78020.76820.77450.7642
0.79499.043470.60830.77740.75060.80300.7639
0.995910.048300.59280.79070.76910.81600.7817
0.971211.053130.62260.81210.79070.77570.7824
0.814712.057960.60950.77980.75390.79630.7599
1.025713.062790.52740.81450.77400.84280.7949
0.730514.067620.53660.82100.78590.84580.8046
0.841115.072450.52890.84730.81160.83830.8230
0.842916.077280.51530.83560.79680.84890.8152
0.714217.082110.50050.82460.78450.84630.8057
0.808218.086940.48560.83840.79540.86290.8153
0.828819.091770.45980.84400.80600.86190.8260
0.692520.096600.46330.84480.81680.84770.8261
0.655921.0101430.41060.85740.82190.86940.8405
0.950122.0106260.43580.84970.82240.85200.8321
0.752123.0111090.43340.85900.82480.86370.8407
0.646524.0115920.42820.86220.83400.86210.8454
0.759625.0120750.41360.86550.83490.87270.8507
0.706726.0125580.38870.85410.81750.88420.8404
0.680927.0130410.39100.86870.83600.87580.8524
0.751228.0135240.41330.84690.81270.86110.8280
0.619229.0140070.37340.87110.84610.87030.8533
0.791330.0144900.35470.87720.84990.87320.8593
0.564331.0149730.35680.88320.85910.87800.8648
0.589932.0154560.34850.88280.85790.88340.8684
0.522233.0159390.33390.88770.85640.88980.8705
0.491834.0164220.33250.89250.86550.88590.8750
0.475835.0169050.33890.88770.86080.88850.8731
0.625936.0173880.33960.88850.86420.88170.8720
0.567237.0178710.33310.88930.86660.88420.8743
0.545838.0183540.33630.88610.86210.88810.8728
0.454939.0188370.32260.88650.86010.88650.8717

Framework versions

  • —Transformers 5.17.0
  • —Pytorch 2.11.0+cu128
  • —Datasets 5.0.1
  • —Tokenizers 0.23.1