Research question
Most multimodal fusion papers test their method on an artificially rebalanced version of the data, which hides how the model actually behaves on rare classes. The question here: on HAM10000's natural, untouched distribution — where melanocytic nevi make up 66.9% of images and dermatofibroma just 1.1% — which fusion strategy for combining an image encoder with a metadata encoder actually wins, and does the answer change once you look past aggregate accuracy at per-class recall?
What I built
A two-branch pipeline: a CNN image encoder (ResNet-50 or EfficientNet-B4) and a small MLP metadata encoder that takes a 19-dimensional vector built from age, sex, and anatomical site. Images go through DullRazor-style hair removal and lesion-guided cropping using HAM10000's segmentation masks before being resized and augmented.
I trained with weighted focal loss to handle the imbalance without touching the data distribution itself, used MixUp/CutMix during training, and applied an 8-transform test-time augmentation scheme at inference. I compared three ways of combining the two modalities — concatenation, a Hadamard (element-wise) product, and self/cross-attention — across four configurations in total.
Findings
| Model and fusion | Accuracy | Balanced accuracy |
|---|---|---|
| ResNet-50 · Hadamard | 87.57% | 59.98% |
| ResNet-50 · Attention | 84.92% | 56.38% |
| ResNet-50 · Concatenation | 82.78% | 55.26% |
| EfficientNet-B4 · Attention | 84.22% | 54.09% |
Hadamard fusion won on both accuracy and balanced accuracy, ahead of attention and concatenation across nearly every class. But AUC told a different story — EfficientNet-B4 + Attention had the highest AUC despite the lowest balanced accuracy, an early sign that AUC alone can mask how a model performs class-by-class.
Every tested configuration missed this class on the validation split, regardless of backbone or fusion strategy — the rarest class had only 115 images total, ~92 after the split.
This wasn't a fusion-strategy problem — every configuration failed identically, pointing to raw class scarcity rather than architecture as the cause. Akiec (actinic keratoses) was the second-weakest class, with recall ranging from 0.123 to 0.431 depending on configuration — wide enough that backbone and fusion choice clearly shift where errors land, even when they don't fix the underlying imbalance problem.
This result pushed back on prior work: papers like Das et al. found attention and Hadamard fusion nearly identical, but only after replicating the rarest class up to 52× to rebalance the training set. Under HAM10000's real distribution, that gap reopens, suggesting fusion rankings reported on artificially balanced data don't necessarily hold once imbalance is put back in.
Limitations
The single 80/20 split was stratified by class at the image level, not grouped by lesion. HAM10000 contains multiple images of the same lesion from different angles, so the same lesion could appear in both training and validation, likely inflating the reported numbers to an unknown degree. TTA's individual contribution wasn't isolated, no calibration metric was computed, and the study used HAM10000 alone, with a single split and no cross-validation or repeated seeds. The related case study below was built specifically to close these gaps.