Skip to main content
Back

University of Seville's Skin Cancer AI Shows Dermatologists Exactly Where It Looks

A MobileNet-V2 multitask model detects basal cell carcinoma with 90% accuracy while flagging the exact dermoscopic patterns that justify each call.

Pro

  • Multitask MobileNet-V2 hits 90% accuracy on BCC vs non-BCC from dermoscopic images across 60 Andalusian primary care centers.
  • Model detects seven clinical patterns and applies the dermatologist decision rule directly, not as post-hoc explanation.
  • At least one correct BCC pattern flagged in 99% of positive cases; pigment network exclusion holds in 95% of negatives.
  • Grad-CAM foreground activation averages 0.57 vs 0.16 background, validated against expert pixel-level segmentations.
  • Beats ConvNext Tiny and ViT-Base on pattern detection despite using 8x to 25x fewer parameters.
  • GitHub repo publishes splits and image IDs; clinical images restricted under EU GDPR.

A team from the University of Seville has built a skin cancer triage model that does something most medical AI still refuses to do: show its work in the same language dermatologists use. The system classifies dermoscopic images as basal cell carcinoma (BCC) or not, but it also tells the clinician which of the seven textbook BCC patterns it saw, and where in the image it saw them.

Code and dataset splits are published on GitHub, though the clinical images themselves are restricted under Spanish and EU data protection law.

Why teledermatology needed this

BCC accounts for approximately 75% of all skin cancers, making it the most frequent form. In Spain, every major public hospital now runs a teledermatology intake, which has flooded specialists with images to review. AI triage is the obvious answer, but to develop a tool that is useful from a medical perspective, it is crucial to provide not only classification metrics, but also a detailed diagnosis explaining the detected clinical features. A yes/no verdict from a black box is not something a dermatologist can defend to a patient.

The clinical rule for BCC is surprisingly clean. A lesion is not considered BCC if it exhibits pigment network pattern, and is considered BCC if it exhibits at least one of these BCC patterns: ulceration, ovoid nest, multi globules, maple-leaf, spoke wheel, arborizing telangiectasia. The model was designed to mirror that logic exactly.

Workflow comparison between current teledermatology and the proposed MTL system

Building a ground truth that does not exist

There is no biopsy-level ground truth for individual dermoscopic patterns, and dermatologists famously disagree on them. The authors handled this with an Expectation-Maximization consensus algorithm across four dermatologists' annotations. This algorithm consolidates multilabel annotations from different dermatologists and generates a single inferred Standard Reference that encapsulates the collective expertise of the raters.

The dataset itself came from real teledermatology traffic: 1559 dermoscopic images collected from 60 primary care centers in Andalusia, captured on a mix of smartphone-attached DermLite dermatoscopes and hospital-grade FotoFinder systems. That device heterogeneity is a feature, not a bug, since it reflects what the model will actually see in deployment.

The multitask architecture

The backbone is MobileNet-V2 with three classifier heads, trained in three stages:

  1. ImageNet transfer learning, classifier weights only, AdamW schedule-free optimizer at 1e-5 for 100 epochs.
  2. Fine-tuning the last three feature-extractor blocks on dermoscopic images to learn domain-specific features.
  3. Retraining the classifier at a very low learning rate for the seven-pattern detection task.

Focal loss handled the significant class imbalance, since patterns like spoke wheel and multiglobules are rare. The clinical decision rule is then hard-coded on top of the pattern outputs: if pigment network fires, predict non-BCC; if any of the six positive patterns fires, predict BCC.

The numbers

On binary BCC classification the model hits 90% accuracy (precision=0.90, recall=0.89). The more interesting result is on the explanation side. At least one clinically relevant BCC pattern was correctly identified in 99% of BCC-positive cases, and the pigment-network negative criterion was met in 95% of non-BCC cases.

For the Grad-CAM validation, a dermatologist hand-segmented each pattern on 334 held-out images. A comparison of the GRADCAM maps with the dermatologist's manual delineation demonstrated strong colocalization with dermatologist-segmented regions (mean foreground density 0.57 vs. background 0.16). Statistical testing on activation energy inside versus outside the expert masks was significant in 98.2% of images with a mean Cohen's d of 1.972, which is a very large effect size.

Why MobileNet-V2 beat the big models

The authors benchmarked against ConvNext Tiny and ViT-Base B/16 using the same protocol. The lightweight model won on the hardest task:

ModelParametersFLOPsBCC/Non-BCC Acc.Pattern Avg Acc.
MobileNet-V23.5M0.3G0.900.82
ConvNext Tiny28M4.5G0.900.77
ViT-Base (B/16)86M17.6G0.860.78

With roughly 1,500 training images and heavy class imbalance on the minority patterns, the larger models overfit before they can leverage their capacity. MobileNet-V2's compact size (14 MB) and minimal computational requirements enable rapid inference on standard clinical workstations without requiring specialized GPU hardware, which matters for primary care centers that do not run GPU servers.

Where it falls short

Per-pattern precision on the rare classes is not great. Multiglobules sits at 0.32 precision, maple leaf-like at 0.34, spoke wheel at 0.37. The authors are upfront that this is fine for clinical use because a dermatologist only needs one confirmed pattern to call BCC, but if you wanted a tool that generates a complete structured pattern report, it is not there yet. The 73% accuracy on truly featureless non-BCC lesions (no patterns at all) is another soft spot.

Two other caveats: the dataset is Andalusian and skews to lighter skin types, and demographic metadata was stripped for privacy, so fairness across skin tones cannot be audited from the paper. Generalization to other populations is an open question.

The real contribution

Most XAI work in dermatology bolts Grad-CAM onto a trained classifier and hopes the heatmaps look reasonable. This paper flips it: the classification decision is derived from pattern detection, so the explanation is not a post-hoc story but the actual reasoning path. And the heatmaps are validated against pixel-level expert segmentations rather than eyeballed. For anyone building clinical AI where regulators and doctors both need to trust the output, that combination of architectural interpretability plus quantitative XAI validation is a useful template to steal.