โ† Back to Projects

MSc Dissertation ยท Medical AI ยท 2025

Uncertainty-Aware Ensemble Learning for Chest X-Ray Diagnosis

Investigating accurate, uncertainty-aware and interpretable deep learning systems for multi-label chest X-ray classification, including specialist ensembles, threshold optimisation and expert-reviewed visual explanations.

PythonPyTorchComputer VisionCNNsEnsemble LearningGrad-CAMSHAP

10

Architectures benchmarked

0.9238

Pleural Effusion AUROC

40,977

CheXpert subset images

28

Grad-CAM cases reviewed

The Problem

Deep learning models can achieve strong classification performance on medical images without necessarily learning clinically meaningful features.

This research investigated how architecture selection, uncertainty handling, class-specific thresholds and explainability techniques influence the reliability of multi-label chest X-ray classification.

Methodology

The project followed a multi-stage experimental workflow.

01

Data Preparation

Prepared frontal chest X-ray datasets from CheXpert and NIH ChestX-ray14, including preprocessing and handling uncertain labels.

02

Architecture Benchmarking

Evaluated ten CNN and transformer backbones, including DenseNet, EfficientNet, ConvNeXt, ResNet, Swin and ViT.

03

Ensemble Construction

Selected specialist models for individual pathology classes based on their evaluation performance.

04

Uncertainty-Aware Training

Developed a two-phase CheXpert training strategy using masked binary cross-entropy followed by a custom Uncertainty Target-Zone Loss.

05

Threshold Optimisation

Compared fixed thresholds with per-class F1 optimisation and Youden's J statistic.

06

Explainability and Evaluation

Generated Grad-CAM explanations, obtained expert radiologist feedback and examined hybrid models using SHAP.

Model Architecture & Training Pipeline

An overview of the experimental workflow, from architecture benchmarking to specialist ensemble construction and uncertainty-aware training.

01

Data Preparation

CheXpert and NIH ChestX-ray14 datasets. Images resized to 224ร—224, converted to tensors and normalised using ImageNet statistics.

02

Architecture Benchmarking

Ten pretrained CNN and Vision Transformer architectures evaluated for multi-label thoracic disease classification.

03

Specialist Model Selection

Best-performing models selected for individual pathology classes, with class-specific F1 or Youden's J threshold optimisation.

CheXpert Ensemble

Two-Phase Uncertainty-Aware Training

PHASE 1

Confident Labels

Train on definite negative (0) and positive (1) labels using masked binary cross-entropy.

Loss: Masked BCEWithLogits

Uncertain labels (-1): Ignored

Learning rate: 0.001

PHASE 2

Uncertainty-Aware Learning

Reintroduce uncertain labels and apply UTZL to discourage overconfident predictions for ambiguous cases.

Loss: BCE + UTZL penalty

Uncertain labels (-1): Included

Learning rate: 0.0001

Phase 2 fine-tunes the CheXpert ensemble using uncertainty-aware supervision.

04 โ€” EVALUATION

Predictions, Explainability & Validation

Evaluate pathology-specific AUROC, precision, recall and F1 scores. Analyse Grad-CAM explanations through expert radiologist review.

Separately investigate Random Forest and XGBoost meta-learners with SHAP feature-attribution analysis.

Simplified research workflow based on MSc dissertation (2025), Chapter 3. Two-phase UTZL training applies to the CheXpert ensemble, not the NIH ensemble.

Model Performance

Final CheXpert ensemble ยท AUROC by pathology

Pleural Effusion0.9238
Cardiomegaly0.8965
Pleural Other0.8936
Consolidation0.8898
Enlarged Cardiomediastinum0.8183
0.00.51.0

AUROC measures how well a model distinguishes positive from negative cases across decision thresholds. Results vary by pathology, and strong AUROC does not necessarily imply good calibration or clinical reliability.

Source: MSc Dissertation (2025), Table 14.

Explainability and Clinical Review

A radiologist reviewed 28 Grad-CAM heatmaps across seven pathologies, evaluating how closely the highlighted regions aligned with clinically relevant anatomy.

Clinically relevant focus

Pleural Effusion

4/5

In a true-positive example, Grad-CAM highlighted the lung bases, aligning with the radiologist's assessment of pleural effusion.

Misleading model focus

Atelectasis

1/5

Despite a correct high-confidence prediction, the heatmap focused on the cardiac silhouette rather than clinically relevant signs of lung collapse.

Grad-CAM Visual Analysis

To evaluate model interpretability, Grad-CAM heatmaps were reviewed by an expert radiologist. The examples below demonstrate both clinically meaningful explanations and cases where the model focused on irrelevant anatomy.

Original chest X-ray and Grad-CAM overlay for Pleural Effusion

Pleural Effusion

4/5

Clinically relevant

The model correctly focused on the lung bases, consistent with the radiologist's assessment of bilateral pleural effusions.

Original chest X-ray and Grad-CAM overlay for Cardiomegaly

Cardiomegaly

4/5

Clinically relevant

The Grad-CAM heatmap highlighted the enlarged cardiac silhouette, demonstrating anatomically appropriate attention.

Original chest X-ray and Grad-CAM overlay for Atelectasis

Atelectasis

1/5

Misleading explanation

Despite a correct prediction, the model focused on the cardiac silhouette rather than features indicating lung collapse.

Original chest X-ray and Grad-CAM overlay for Edema

Edema

1/5

Misleading explanation

The model's attention was diffuse and failed to localise specific clinically relevant signs of edema.

Source: MSc dissertation (2025), Figures 24โ€“26 and 28. Clinical relevance scores were assigned by one expert reviewer.

Limitations and Lessons Learned

The experiments used retrospective datasets and CPU-only training with images resized to 224ร—224 pixels. Expert review involved one radiologist and 28 selected cases. These constraints limit the conclusions that can be drawn about performance in real clinical environments.

A central finding was that strong classification metrics do not guarantee clinically meaningful explanations. More extensive external validation would be required before considering real-world clinical use.