← All publications

1 MIN READ

conference · 2024 · Published

Neighbourhood representation loss

Can 1,000 images be enough if the loss knows the feature space?

Paper
Enhancing downstream classification of breast abnormalities in contrast enhanced spectral mammography using a neighborhood representation loss
Authors
Adarsh Bhandary Panambur · Prathmesh Madhu · Siming Bayer · Andreas Maier
Venue
SPIE Medical Imaging 2024: Computer-Aided Diagnosis, vol. 12927, 129270F
FIG 1 / METHOD
Pretrain with SimCLR, bank the features and precompute each sample's nearest same-class (green) and farthest different-class (red) neighbours, then use both in the loss. The neighbour search happens once, offline. My figure — from the paper and my PhD thesis
1,003 CESM images 326 patients · Cairo University · public
116 Test ROIs Three-class: normal / benign / malignant
0.8413 Test F1 Cross-entropy: 0.8159
1st Reported ROI results On CDD-CESM subtracted images

IN ONE SENTENCE

Summary

Extract self-supervised features once, look at each sample's nearest and farthest neighbours, and let that geometry decide which samples are hard and what the triplets should be.

Self-supervision wants data this domain does not have.

Contrast-enhanced spectral mammography is used when a mammogram is not enough — dense tissue, suspicious lesion management. The public data amount to about a thousand images.

SimCLR pretraining helps, but not by much at that scale — which left the loss function as the remaining place to find leverage.

Ask the feature space which samples are hard.

After pretraining, every training feature is banked once. For each sample, its nearest same-class and farthest different-class neighbours are found by L2 distance. If a sample's neighbours mostly carry a different label, it is a hard sample and gets more weight in the cross-entropy.

The same neighbours serve as triplet positives and negatives directly, so there is no Siamese network and no online mining — the whole thing is precomputed.

  1. 01SimCLR pretraining
  2. 02Feature bank
  3. 03Nearest / farthest neighbours
  4. 04Difficulty weights
  5. 05DWCE + triplet
  6. 06ROI classifier

Two initializations, four losses, one small dataset.

CDD-CESM: 1,003 subtracted CESM images from 326 patients at Cairo University, with pixel-level lesion annotations. ROIs were extracted for benign and malignant lesions, with a fixed 512 × 512 centre crop for normals, split at patient level into 745 / 130 / 116.

Cross-entropy, focal loss and DWNR were compared under both from-scratch and ImageNet-initialized SimCLR pretraining, five runs each.

745 Training ROIs
2,919 SSL pretraining patches ≈4 per CESM image
116 Test ROIs
05× Runs per setting

Two and a half points of F1 from the loss alone.

In the ImageNet + SimCLR track, DWNR lifted F1 from 0.8159 to 0.8413 and AUC from 0.9278 to 0.9350 over cross-entropy, with focal loss landing below both. The gain concentrates on the benign class, where per-class F1 went from 0.6589 to 0.7058.

It also transferred: initializing a whole-image CESM classifier from the DWNR-trained ROI model beat ImageNet initialization by more than four points of F1 on both BI-RADS management and diagnosis.

CDD-CESM ROI classification, test set n = 116, ImageNet + SimCLR pretraining. Mean values over 5 runs.
LossAccuracyF1AUC
Cross-entropy (ImageNet only)0.83790.81300.9252
Cross-entropy + SSL0.84480.81590.9278
Focal loss + SSL0.83970.80830.9320
DWNR + SSL0.86550.84130.9350

Standard deviations and the from-scratch SimCLR track are in the paper. Unpaired t-test, p < 0.0001 against cross-entropy and focal loss.

FIG 2 / NEIGHBOUR ABLATION
Ablation on the number of neighbours used to compute the difficulty weight. The difficulty-weighted term stays above the cross-entropy reference and peaks at k = 3. My figure — from the paper and my PhD thesis

And why I rebuilt it two years later.

The result stands: geometry in a self-supervised feature space carries usable training signal in a small-data domain, and the improvement transfers to the whole-image task.

But three quantities here had to be swept per dataset — neighbour count, difficulty weights, triplet margin. That is exactly the limitation the later DITL framework removes by deriving all three from the data.

LIMITATION

What this does not show

A single public dataset with 116 test ROIs, and three hand-tuned hyperparameters that do not transfer between cohorts.

READ IT YOURSELF

Paper · DOI · Code · Citation

Paper ↗DOI ↗
View original abstract + citation

Abstract

Self-supervised learning improves representation quality but normally needs large amounts of data, which the contrast-enhanced spectral mammography (CESM) domain does not have. This paper proposes the Difficulty-Weighted Neighborhood Representation (DWNR) loss for downstream ROI classification in a small-data setting. After SimCLR pretraining, features for the whole training set are extracted once and used to find each sample's nearest same-class and farthest different-class neighbours. Those neighbours drive two terms: a difficulty-weighted cross-entropy, where difficulty comes from the class labels of the nearest neighbours, and a triplet loss that uses the precomputed representations directly instead of training a Siamese network. On the public CDD-CESM dataset the combined loss improves accuracy, F1 and AUC over cross-entropy and focal loss.

Citation

A. Bhandary Panambur, P. Madhu, S. Bayer, A. Maier. Enhancing downstream classification of breast abnormalities in contrast enhanced spectral mammography using a neighborhood representation loss. Proc. SPIE Medical Imaging 2024: Computer-Aided Diagnosis, vol. 12927, 129270F. doi:10.1117/12.3004102