Chest X-ray analysis that shows its reasoning.

Iridescent screens frontal chest X-rays with DenseNet-121 models and shows where each result comes from, using Grad-CAM, LIME and SHAP, with plain-language reliability checks. Everything runs in your browser: the image never leaves your device.

Runs on your device. No upload, works offline.

The Iridescent app showing a pneumonia result: a probability scale with the decision threshold, the lung zones the model attended to, reliability checks, and a Grad-CAM heatmap over the radiograph.
A real result from the app on a test X-ray the model never saw in training.
0.997AUROC for paediatric pneumonia, mean of 3 training runs on 874 unseen X-rays
98.3% / 97.1%sensitivity / specificity at the decision threshold chosen on validation data
14chest conditions screened on adult X-rays, mean AUROC 0.81 on 25,596 official test images
4.5×more often than chance, Grad-CAM's peak falls inside a radiologist-drawn box (984 boxes)

How a result is produced

The app reads the image exactly as the models were trained to, runs the models on your device, and turns their output and explanation maps into a short, checkable summary.

  1. Prepare

    Grayscale, resized the same way as in training. PNG or JPEG, any size.

  2. Predict

    Two DenseNet-121 models: a 14-condition screen for adults, and paediatric pneumonia. The original and a mirrored copy are averaged.

  3. Explain

    Grad-CAM shows where the model looked; LIME and SHAP test which image regions change the result.

  4. Check

    Is the attention inside the chest? On film edges or text markers? Do the methods agree? How close is the result to the threshold?

Flowchart of the app: load and prepare the X-ray, check the GPU against reference outputs, run the selected DenseNet-121 model, compute Grad-CAM, LIME and KernelSHAP, and summarise the result, location and reliability checks on the device.
How the app analyses an X-ray on the device. How the models were trained: training pipeline.

Evaluation

All results are on data the models never saw during training, split by patient so that no person appears in both. Pneumonia metrics are the mean ± standard deviation of three independent training runs.

Paediatric pneumonia (874 test X-rays)
ModelAUROCSensitivitySpecificity
Initialised from our NIH ChestX-ray14 pretraining used in the app0.997 ± 0.00198.3%97.1%
Initialised from ImageNet0.996 ± 0.00197.4%98.0%
ImageNet, lung-cropped images0.988 ± 0.00196.4%94.1%

The two full-image models are statistically equivalent in accuracy; their difference shows in where they look (below).

14-condition screen

DenseNet-121 trained on 78,186 adult X-rays from NIH ChestX-ray14 and tested on the official patient-wise test list of 25,596 images. Mean AUROC 0.81, from 0.69 (infiltration) to 0.92 (emphysema). Scores are corrected for the weighted training loss.

Localisation

On 984 lesions outlined by radiologists, the hottest point of the Grad-CAM map fell inside the box 34% of the time: 4.5 times chance. It works well for large findings such as an enlarged heart (89%) and poorly for small nodules (1%).

What the explanations revealed

Accuracy alone would have hidden these. They come from measuring the explanation maps on 100 test images per model.

The baseline partly looked at the film corners

For pneumonia predictions, the ImageNet model put 8.0% of its Grad-CAM attention in the two top corners, where view markers such as "AP" are printed, against 4.9% for normal predictions. Cropping to the lungs removed this but lowered specificity from 98.0% to 94.1%.

Chest X-ray pretraining reduced it

Starting from our own NIH ChestX-ray14 model instead of ImageNet cut corner attention for pneumonia predictions to 4.8% while keeping accuracy. The benefit of domain pretraining here is in what the model attends to.

Not every explanation can be trusted

When the top of the network is re-initialised, Grad-CAM maps change completely, but SHAP maps stay about 60% the same: they partly reflect image structure rather than what the model learned. The three methods also often disagree, so the app never presents one map as "the" reason.

Limitations and intended use

Iridescent is a research prototype built as a final-year project. It is not a medical device and does not give a diagnosis.

Private by design

The models are downloaded once and run inside the browser with ONNX Runtime Web, on the GPU when it passes an accuracy check and otherwise on the CPU. The X-ray is never uploaded, results are stored only on the device, and the app works offline after the first use.

Open the app

The project

Explainable AI for Medical Image Diagnosis: a final-year B.E. project in Electronics and Telecommunication Engineering. Data: Kermany et al. (2018), Chest X-Ray Images (Pneumonia), CC BY 4.0; Wang et al. (2017), NIH ChestX-ray14. Lung segmentation in the evaluation: TorchXRayVision.