
Problem
Early in the pandemic, PCR tests were slow and scarce. Could a chest X-ray help triage patients? This project tests that at small scale: can a pretrained image model tell COVID-19 apart from pneumonia and normal lungs?
Approach
- Public chest X-rays (COVID-19 cases from the open COVID-19 image data collection, plus pneumonia and normal images).
- Keras
ImageDataGeneratoraugmentation: rescaling, rotation, zoom and flips. - VGG16 with ImageNet weights as a frozen base and a new three-class head, trained with checkpointing, early stopping and learning-rate reduction, then fine-tuned with the top layers unfrozen.
Result

- Best validation accuracy about 0.74; test accuracy 0.40, rising to 0.50 after fine-tuning (219 test images).
- With three classes, guessing scores about 0.33, so the model does not generalise. Likely causes: too few COVID-19 images and classes drawn from different sources, which lets a model learn the hospital rather than the disease.
What this shows
Transfer learning and a modern training set-up, and the judgement to report a weak result plainly and explain it: shortcut learning from mixed data sources is a real risk in medical AI. Not for clinical use.