X-Raydar CV β Chest X-Ray Image Classifier
Pre-trained model weights for the computer vision component of X-Raydar, from "Development and validation of open-source deep neural networks for comprehensive chest x-ray reading" (Cid, Macpherson et al., The Lancet Digital Health, 2024).
Trained on over 2.5 million chest X-ray studies from six NHS hospitals across the UK.
Website: x-raydar.info Code: github.com/gmontana/xraydar-cv NLP model: dnamodel/xraydar-nlp
Model Description
XNet38MS is a multi-scale Inception v3 ensemble that takes a chest X-ray image and predicts probabilities for 37 radiological findings. Three models trained at different resolutions (299, 512, 1024 pixels) are averaged at inference time.
Architecture
- Backbone: Modified Inception v3 (single-channel input) with 38-class output
- Multi-scale: Three models at 299px, 512px, and 1024px, ensembled by averaging sigmoid probabilities
- Input: Grayscale chest X-ray image (any resolution, resized and padded internally)
Files
| File | Description |
|---|---|
cv/is299/model_best.pth.tar |
Inception v3 trained at 299px (187 MB) |
cv/is299/model_TranslatorCVLogitsToUrgency_fcs.pth.tar |
Urgency head (299px) |
cv/is512/model_best.pth.tar |
Inception v3 trained at 512px (187 MB) |
cv/is512/model_TranslatorCVLogitsToUrgency_fcs.pth.tar |
Urgency head (512px) |
cv/is1024/model_best.pth.tar |
Inception v3 trained at 1024px (187 MB) |
cv/is1024/model_TranslatorCVLogitsToUrgency_fcs.pth.tar |
Urgency head (1024px) |
Usage
Download weights
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="dnamodel/xraydar-cv",
local_dir="./xraydar-cv-weights"
)
Place weights for the code repository
from huggingface_hub import hf_hub_download
import shutil, os
for size in [299, 512, 1024]:
dest = f"src/model_20210820_XNet38MS/model_weights/direct_multi93_is{size}_Rv10_pre00_imagenet"
os.makedirs(dest, exist_ok=True)
for f in ["model_best.pth.tar", "model_TranslatorCVLogitsToUrgency_fcs.pth.tar"]:
path = hf_hub_download("dnamodel/xraydar-cv", f"cv/is{size}/{f}")
shutil.copy(path, os.path.join(dest, f))
See the code repository for full inference instructions.
Radiological Findings (37 classes + 1 meta-class)
| # | Finding | # | Finding |
|---|---|---|---|
| 0 | Abnormal (non-clinically important) | 19 | Interstitial shadowing |
| 1 | Aortic calcification | 20 | Mediastinum displaced |
| 2 | Apical changes | 21 | Mediastinum widened |
| 3 | Atelectasis | 22 | Object |
| 4 | Axillary abnormality | 23 | Paraspinal mass |
| 5 | Bronchial changes | 24 | Paratracheal/hilar enlargement |
| 6 | Bulla | 25 | Parenchymal lesion |
| 7 | Cardiomegaly | 26 | Pleural abnormality |
| 8 | Cavity | 27 | Pleural effusion |
| 9 | Clavicle fracture | 28 | Pneumomediastinum |
| 10 | Consolidation | 29 | Pneumoperitoneum |
| 11 | Cardiac calcification | 30 | Pneumothorax |
| 12 | Dextrocardia | 31 | Rib fracture |
| 13 | Dilated bowel | 32 | Rib lesion |
| 14 | Emphysema | 33 | Scoliosis |
| 15 | Ground-glass opacification | 34 | Subcutaneous emphysema |
| 16 | Hemidiaphragm elevated | 35 | Tortuosity of aorta |
| 17 | Hernia | 36 | Pulmonary blood flow redistribution |
| 18 | Hyperexpanded lungs | 37 | Volume loss |
Citation
@article{cid2024development,
title={Development and validation of open-source deep neural networks for comprehensive chest x-ray reading: a retrospective, multicentre study},
author={Cid, Yan Digilov and Macpherson, Matt and others},
journal={The Lancet Digital Health},
volume={6},
number={1},
pages={e44--e57},
year={2024},
publisher={Elsevier},
doi={10.1016/S2589-7500(23)00218-2}
}
License
For academic research and non-commercial evaluation only. See x-raydar.info for terms and conditions.
Contact
- Questions or collaborations: Giovanni Montana β g.montana@warwick.ac.uk
- Commercial licensing: Warwick Ventures β ventures@warwick.ac.uk