ChestXpert is an advanced, AI-powered web application designed to assist medical professionals in analyzing chest X-rays. It leverages state-of-the-art vision models to detect pneumonia and provide interpretability through Grad-CAM heatmaps, offering a robust second opinion tool for clinical workflows.
- Automated Pneumonia Detection: Utilizes pre-trained DenseNet121 and RAD-DINO models for high-accuracy binary classification (Pneumonia vs. Normal).
- Explainable AI (XAI): Generates Grad-CAM (Gradient-weighted Class Activation Mapping) heatmaps to visually highlight the regions of the X-ray that contributed most to the model's prediction.
- DICOM & Image Support: Accepts standard image formats (JPEG, PNG) as well as medical DICOM files.
- Comparative Analysis: Allows side-by-side comparison of two X-rays (e.g., pre- and post-treatment) with differential predictions.
- Clinical Reports: Generates downloadable, professional PDF reports containing the analysis results, patient metadata (if applicable), and heatmaps.
- Patient History Logs: Tracks past analyses for quick review and auditing.
- Frontend: HTML5, CSS3 (Modular via static/css/), Vanilla JavaScript, Tailwind CSS (for layout utilities).
- Backend: Python, Flask.
- Deep Learning: PyTorch, Torchvision, Transformers (Hugging Face).
- Image Processing: OpenCV (Headless), Pillow, Albumentations, pydicom.
Follow these steps to run ChestXpert on your local machine.
Ensure you have the following installed:
- Python 3.10+
- Git
- Git LFS (Large File Storage) - Required for downloading the model weights.
- Clone the Repository
git clone https://github.com/YOUR_USERNAME/ChestXpert.git
cd ChestXpert
git lfs install
git lfs pull
- Create a Virtual Environment (Recommended) Windows:
python -m venv venv
.\venv\Scripts\activate
Linux/macOS:
python3 -m venv venv
source venv/bin/activate
3.Install Dependencies
pip install -r requirements.txt
- Run the Application
python app.py