# Enhancing basal cell carcinoma classification in preoperative biopsies via transfer learning with weakly supervised graph transformers

**Authors:** Johan Björkman, Sigrid Lagerroth, Jan Siarov, Filmon Yacob, Noora Neittaanmäki

PMC · DOI: 10.1186/s12880-025-01710-4 · BMC Medical Imaging · 2025-05-16

## TL;DR

This study improves automated diagnosis of basal cell carcinoma in skin biopsies using transfer learning with graph transformers, achieving high accuracy even with limited data.

## Contribution

A novel weakly supervised graph transformer model is proposed for BCC classification in preoperative biopsies using transfer learning.

## Key findings

- The fine-tuned model achieved 91.7% accuracy for two-class classification on the BCCC dataset.
- On external validation, the model showed 84.9% accuracy for two-class classification on the COBRA dataset.
- Transfer learning improved mean accuracy by up to 29.6% compared to models trained from scratch.

## Abstract

Basal cell carcinoma (BCC) is the most common skin cancer, placing a significant burden on healthcare systems globally. Developing high-precision automated diagnostics requires large annotated datasets, which are costly and difficult to obtain. This study aimed to fine-tune a weakly supervised machine learning model to classify BCC in preoperative punch biopsies using transfer learning. By addressing challenges of scalability and variability, this approach seeks to enhance generalizability and diagnostic accuracy.

The Basal Cell Classification (BCCC) dataset included 514 WSIs of punch biopsies (261 with BCC and 253 tumor-free slides), divided into training (70%), validation (15%), and test sets (15%). WSIs were split into patches, and features were extracted using a pretrained simCLR model trained on 1,435 WSIs from BCC excisions. Features were formed into graphs for spatial information and the processed by a Vision Transformer. Testing included finetuned and non-finetuned pre-trained models as well as a model trained from the scratch, evaluated on 78 WSIs from the BCCC dataset. The COBRA dataset of 3,588 WSIs (1,794 with BCC and 1,794 without) was used for external validation. Models classified no-tumor vs. tumor (two classes), no-tumor vs. low-risk vs. high-risk tumors (three classes), and no-tumor vs. four BCC subtypes (five classes).

The fine-tuned model significantly outperformed the non-fine-tuned pretrained model and the model trained from the scratch with accuracies of 91.7%, 82.1%, and 75.3% and with AUCs of 0.98, 0.95–0.98, and 0.91–0.97 for two, three, and five-class classification. On the external validation, accuracies were 84.9% and 70.5%, with AUCs of 0.92 and 0.89–0.91 for two and three-class classification, respectively. The ablation study revealed that the fine-tuned model outperformed the model trained from scratch, improving mean accuracy by 10.6%, 11.7%, and 13.1% on the BCCC dataset, as well as by 29.6% and 19.2% on the COBRA dataset.

The results suggest that transfer learning not only enhances model performance on small datasets but also supports robust feature extraction in complex histopathology tasks. These findings reinforce the utility of pre-trained models in computational pathology, where access to large, labeled datasets is often limited, and task-specific challenges require nuanced understanding of the visual data.

The online version contains supplementary material available at 10.1186/s12880-025-01710-4.

## Linked entities

- **Diseases:** basal cell carcinoma (MONDO:0005341), BCC (MONDO:0005341)

## Full-text entities

- **Diseases:** tumor (MESH:D009369), skin cancer (MESH:D012878), BCC (MESH:D002280)

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12084905/full.md

## Figures

6 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12084905/full.md

## References

2 references — full list in the complete paper: https://tomesphere.com/paper/PMC12084905/full.md

---
Source: https://tomesphere.com/paper/PMC12084905