Skip to main navigation Skip to search Skip to main content

From Free Text to Upper Gastrointestinal Cancer Diagnosis: Fine-Tuning Language Models on Endoscopy and Histology Narratives

Research output: Chapter in Book/Report/Conference proceeding › Conference contribution

Abstract

Clinical free text reports from endoscopy and histology are a valuable yet underexploited source of information for supporting upper gastrointestinal (GI) cancer diagnosis. Our initial learning task was to classify procedures as cancer-positive or cancer-negative based on downstream registry-confirmed diagnoses. For this, we developed a patient-level dataset of 63,040 endoscopy reports linked with histology data and cancer registry outcomes, allowing supervised learning on real-world clinical data. We fine-tuned two transformer-based models:
general-purpose BERT and domain-specific BioClinicalBERT and evaluated methods to address severe class imbalance, including random minority upsampling and class weighting. BioClinicalBERT combined with up
sampling achieved the best recall (sensitivity) of 85% and reduced false negatives compared to BERT’s recall of 78%. Calibration analysis indicated that predicted probabilities were broadly reliable. We also applied
SHapley Additive exPlanations (SHAP) to interpret model decisions by highlighting influential clinical terms, fostering transparency and trust. Our findings demonstrate the potential of scalable, interpretable natural lan
guage processing models to extract clinically meaningful insights from unstructured narratives, providing a foundation for future retrospective review of cancer diagnosis and clinical decision support tools.
Original languageEnglish
Title of host publicationProceedings of the 17th International Conference on Knowledge Discovery and Information Retrieval (KDIR 2025)
EditorsFrans Coenen, Lars Nolle, David Aveiro, Jesualdo Fernandez-Breis, Elio Masciari, Le Gruenwald, Jorge Bernardino, Ricardo Torres
PublisherSciTePress – Science and Technology Publications
Pages501-508
Number of pages8
ISBN (Electronic)9789897587696
DOIs
Publication statusPublished - 2025

Publication series

NameInternational Joint Conference on Knowledge Discovery, Knowledge Engineering and Knowledge Management, IC3K - Proceedings
Volume1
ISSN (Electronic)2184-3228

UN SDGs

This output contributes to the following UN Sustainable Development Goals (SDGs)

  1. SDG 3 - Good Health and Well-being
    SDG 3 Good Health and Well-being

Keywords

  • Clinical Text Classification
  • Transformer Models
  • Upper GI Cancer

Cite this