adejare adelugba
← all projects [ PROJECT 02 / 04 · MEDICAL IMAGING · BENCHMARK ]

Breast ultrasound classification.

Sorts breast-ultrasound images into benign, malignant or normal — and shows why a deep model was worth it over a classic pipeline.

// Comparative study on the public BUSI dataset (Breast Ultrasound Images).

[ AT A GLANCE ]

The figures.

// the short version
95.75%accuracy, EfficientNet-B0vs 58.2% Random Forest
0.99AUC-ROCvs 0.75 baseline
98%malignant cases caughtrecall · vs 55% baseline
12,000balanced images4,000 per class
// stack
tensorflowpytorchefficientnet-b0scikit-learnpcarandom forest
[ THE PROBLEM ]

Why I built it.

Reading ultrasound is hard and the public dataset is small and imbalanced. Before reaching for deep learning I wanted a fair answer to a simple question: does it actually beat a well-built classic pipeline, and by how much?

EfficientNet-B0 (deep model)95.75%
Random Forest + PCA (baseline)58.2%

How I built it

  1. Balance the data

    A TensorFlow augmentation pipeline — flips, 90/180/270° rotations, random crops — generated 4,000 images per class.

  2. Deep model

    EfficientNet-B0 pretrained on ImageNet, head replaced for 3 classes; 224×224 input, Adam (lr 1e-4), 25 epochs.

  3. Classic baseline

    Images at 64×64, flattened, reduced to 100 PCA components, then a 100-tree Random Forest with balanced class weights.

  4. Evaluate

    Accuracy, weighted F1, AUC-ROC and a per-class report for both models on the same held-out images.

// how the data moves
ultrasound_pipeline — live
How it works
  1. BUSI imagesbenign · malignant · normal
  2. Balance classesaugmented to 4,000 per class
  3. EfficientNet-B0pretrained, then fine-tuned
  4. Evaluateaccuracy, F1 and AUC-ROC on held-out scans
[ DECISION LOG ]

What went wrong, and what I decided.

// 3 decisions
D1

The dataset was small and imbalanced.

what happened
Training on it directly would favour the biggest class.
decision
Augmented every class to 4,000 images.
result
A balanced 12,000-image set for both models.
D2

Full-size pixels were too many features for classic ML.

what happened
A Random Forest on 224×224×3 raw values is slow and noisy.
decision
Resized to 64×64 and kept 100 PCA components for the baseline.
result
A fair, tractable baseline: 58.2% accuracy.
D3

The baseline missed too many cancers.

what happened
It caught only 55% of malignant cases — not acceptable for screening.
decision
Used EfficientNet-B0 transfer learning on the same balanced data.
result
98% malignant recall and 95.75% accuracy.
[ RESULTS ]

Where it ended up.

Accuracy
95.75% vs 58.20%
Weighted F1
0.96 vs 0.58
AUC-ROC
0.99 vs 0.75
Malignant recall
98% vs 55%

// research project, not a clinical tool.

Email me CV ↓