This repository contains the implementation of DeepCXR, a ResNet-based model for chest X-ray analysis. The model is designed to assist in the diagnosis of various thoracic diseases by analyzing chest X-ray images.
Image-level AUROC: 0.95
F1-Score: 0.90
Backbone: ResNet-18
Sampling Ratio: 0.005 (Coreset)
-
The framework follows the PatchCore methodology, focusing on mid-level feature representations:
-
Feature Extraction: Uses ResNet-18 to extract high-dimensional patches from chest radiographs.
-
Memory Bank Construction: Stores historical feature representations of healthy (Normal) lungs.
-
Coreset Sampling: Implements a greedy sub-sampling ratio of 0.005 to keep only the most diverse 0.5% of normal features, ensuring rapid diagnostic comparisons.
-
Anomaly Scoring: New scans are compared against the memory bank via Nearest Neighbor Search; significant deviations flag potential abnormalities with heatmaps for localization.
This project uses uv for fast, reliable dependency management. The primary libraries required are:
- anomalib: Core framework for unsupervised anomaly detection.
- torch / torchvision: Deep learning engine and computer vision utilities.
- lightning: High-level interface for PyTorch used by the engine.
- pillow / matplotlib: Image processing and result visualization.
Ensure you have uv installed, then sync the environment:
uv syncPlace your X-ray images in a folder named dataset in the root directory following this structure:
dataset/train/NORMAL: Healthy images for memory bank construction.
dataset/test/: Folders containing DEFECT, TB, or NORMAL images for evaluation.
- After training, evaluate the model on the test set:
uv run python -m src.DeepCXRHussein Hodroj - Middle East University
Thabit Bustanji - Middle East University
Supervisor: Dr. Maria Yousef (Middle East University)
This research was presented at the ICETES 2026 conference. The work is indexed in IEEE Xplore and Scopus. Paper on IEEE Xplore
For further information or collaboration opportunities, please contact Hussein Hodroj at [husseinwork6@gmail.com], or Thabit Bustanji at [thabitbustanji@hotmail.com].
If you use this code in your research, please cite our paper:
@inproceedings{hodroj2026deepcxr,
title={DeepCXR: A Deep Learning Framework for Automated Chest X-Ray Analysis Using ResNet Architectures},
author={Hodroj, Hussein and Bustanji, Thabit and Yousef, Dr. Maria},
booktitle={2026 International Conference on Emerging Technologies in Engineering and Sciences (ICETES)},
year={2026},
publisher={IEEE},
note={Indexed in Scopus and IEEE Xplore}
}