Your Breast Ultrasound Model's Accuracy Problem Might Be a Labeling Problem
When a medical imaging model underperforms, the first instinct is to change the architecture or tune hyperparameters. But in breast ultrasound, the real culprit is often upstream: the labels. Ultrasound is noisy, operat
When a medical imaging model underperforms, the first instinct is to change the architecture or tune hyperparameters. But in breast ultrasound, the real culprit is often upstream: the labels.
Ultrasound is noisy, operator-dependent, and full of subtle lesion features like irregular margins and posterior shadowing. That makes breast ultrasound annotation harder than most computer vision labeling, and mistakes get baked straight into your model.
Here are three quick audits you can run on a dataset before you train.
1. Check inter-rater agreement
If two annotators label the same images and often disagree, your ground truth is noisy. For categorical labels (for example benign vs. malignant), Cohen's kappa is a quick check:
from sklearn.metrics import cohen_kappa_score
# labels from two annotators on the same 10 images
rater_a = ["benign", "malignant", "benign", "benign", "malignant",
"benign", "malignant", "benign", "benign", "malignant"]
rater_b = ["benign", "malignant", "benign", "malignant", "malignant",
"benign", "benign", "benign", "benign", "malignant"]
kappa = cohen_kappa_score(rater_a, rater_b)
print(f"Cohen's kappa: {kappa:.2f}")
Low agreement usually means your guidelines are unclear, not that annotators are careless. Fix the guidelines first.
2. Check segmentation overlap
If annotators draw lesion boundaries, compare their masks with the Dice coefficient:
import numpy as np
def dice(a: np.ndarray, b: np.ndarray) -> float:
a, b = a.astype(bool), b.astype(bool)
total = a.sum() + b.sum()
if total == 0:
return 1.0
return 2.0 * np.logical_and(a, b).sum() / total
Large gaps between two experts' masks on the same image are a warning sign that boundary rules aren't consistent.
3. Check class balance
Malignant cases are usually much rarer than benign ones. Look at the distribution before training:
import pandas as pd
df = pd.read_csv("annotations.csv") # columns: image_id, label, scanner, birads
print(df["label"].value_counts(normalize=True))
print(df.groupby(["scanner", "label"]).size().unstack(fill_value=0))
The second table also shows whether one scanner type dominates a class. If it does, your model may learn the scanner, not the lesion.
What the numbers can't tell you
These checks catch inconsistency, but not clinical correctness. Two annotators can agree and both be wrong. That's why a training-ready dataset also needs:
- Annotation by radiologists or trained medical annotators who understand BI-RADS
- Written protocols for boundaries, ambiguous cases, and disagreements
- Multi-layer review: annotation, peer review, and clinical validation
- Diverse patients, breast densities, and equipment
- De-identified data with structured metadata
Problems here usually show up only after deployment, when retraining on corrected data is far more expensive than doing it right the first time.
Further reading
- A full breakdown of what makes a breast ultrasound dataset training-ready
- Teams that want radiologist-led labeling can look at Pareidolia Systems' medical image annotation services
Disclosure: I'm connected to Pareidolia Systems. <!-- delete or edit this line to match your situation -->
What data-quality issues have you run into on medical imaging projects? Let me know in the comments.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.