Brain Tumour MRI Classification
Why it is hard
Radiologists read MRI under time pressure, and at low contrast a glioma, a meningioma and a pituitary tumour can look alike. Public datasets are small, labelled inconsistently and collected on different scanners, so a model that scores well in a notebook often collapses on new images. The target was a four-class classifier that generalised.
How it works
Three public MRI sources were audited and merged first. Label noise in any one source caps accuracy no matter what the architecture does. A cleaning pass removed duplicates, near-duplicates and mislabelled slices, leaving 4,735 images across four classes: glioma, meningioma, pituitary, no tumour.
Class imbalance went through weighted sampling instead of naive oversampling, which earlier experiments had turned into brittle models. A CLAHE ablation over clip limits and tile sizes came next, because contrast normalisation moved the numbers more than CNN depth did.
Training ran in three stages:
- Stage 1 trains the autoencoder alone on reconstruction, so the encoder learns texture instead of labels.
- Stage 2 freezes the encoder and trains only the classification head.
- Stage 3 unfreezes everything and fine-tunes at a low learning rate with cosine decay.
The autoencoder compresses each slice into a denoised latent vector and the CNN classifies from there. Reconstruction forces the encoder to drop scanner noise and keep anatomy, which the classifier then never has to unlearn. CLAHE runs per channel before encoding, dropout sits at 0.4 before the dense head, label smoothing at 0.1. Test-time augmentation over five flips adds roughly one point of macro F1.
Results, including the weak one
Internal test accuracy is 89.31 percent with a macro F1 of 0.8859. Macro F1 matters more here because the four classes are not balanced.
The number worth reading is the external one: 71.25 percent on BraTS 2020, data the model never saw. The gap is expected. BraTS uses different scanners, different preprocessing and different tumour sub-region conventions. A model that only reports the internal figure says nothing about whether it learned anatomy or memorised a dataset.
Notes
Preprocessing discipline beat architecture search. The CLAHE ablation moved accuracy more than swapping CNN depths, and dataset cleaning moved it more than both. An audited 4,735-image set outperformed a noisy 9,000-image set on every metric measured.
One reporting habit came out of this: lead with the external number when the audience is technical. The internal number is what you want to be true. The external one is what is true.