The problem
Reading chest X-rays takes specialist time, and an AI model that only outputs a label is hard to trust. People need to see why it flagged something, and get the result in plain words.
What I built
- A deep learning model (DenseNet-121) gives a probability for each of 14 findings on an uploaded chest X-ray. It was trained on about 86,000 de-identified X-rays from the public Grand X-Ray Slam dataset on Kaggle, labelled with the standard CheXpert list of 14 findings.
- A heatmap (Grad-CAM) highlights the parts of the image that drove the top prediction, so a person can check what the model based its result on. It switches on and off with one click.
- An AI language model (GPT-4.1-mini) writes a short report from the scores and the optional clinical context, drawing on a local library of medical reference documents (retrieval-augmented generation), and answers follow-up questions in a chat.
- It runs as a web app and as a documented API, so other software can send an X-ray and get the results back. Docker packaging means it installs the same way on any server.

The result
Tested on 10,779 X-rays held back from training, the model reaches a mean AUROC of 0.92 across the 14 findings (0.83 to 0.97 per finding). AUROC measures how well a model ranks X-rays that have a finding above X-rays that do not: 0.5 is a coin toss, 1.0 is perfect.
Caveat: the split was by image, not by patient, so the same patient can appear in both training and test data, which likely makes the score optimistic. It has no clinical validation and is not a diagnostic tool.
How a business would use it
The same approach works wherever people look at images to make a decision. A model takes the first pass in a fraction of a second, a heatmap shows what each result was based on so your staff can check it instead of trusting a black box, and it runs as a service your existing software can call, not as a one-off experiment.
- Spotting defects on a production line
- Checking site, shelf or vehicle photos
- Reading and sorting scanned documents
- Any model that has to explain itself to be trusted



