-
07_sidebar_clinical_parameters
-
13_clinical_triage_priority_cards
-
11_uncertainty_bounds_and_probability_chart
-
14_clinical_diagnostic_badges_and_header
-
12_diagnostic_findings_table
-
06_ood_safety_guardrail_rejection
-
08_gradcam_heatmaps_pneumonia
-
09_gradcam_heatmaps_cardiomegaly
-
10_gradcam_heatmaps_effusion
-
15_clinical_triage_actions_and_protocol
-
05_healthy_normal_radiograph
-
02_cardiomegaly_full_view
-
01_bacterial_pneumonia_full_view
-
04_pneumothorax_emergency_triage
-
03_pleural_effusion_full_view
💡 Inspiration
Across rural and resource-limited clinics globally, there is less than 1 radiologist per 100,000 people. Patients presenting to emergency departments with acute chest conditions—such as pneumonia, pneumothorax, or congestive heart failure—frequently endure 24 to 72 hour delays before a specialist can interpret their radiographs.
Traditional deep learning solutions often act as "black-boxes": they provide overconfident binary predictions without visual explanations, fail catastrophically when presented with non-medical images, and offer no quantification of model uncertainty. We were inspired to build CheXGuard AI to bridge this critical diagnostic gap: an explainable, CPU-optimized medical diagnostic assistant equipped with strict Responsible AI guardrails that prioritizes emergency triage and empowers clinicians with statistical certainty.
⚙️ What it does
CheXGuard AI is a clinical decision-support triage suite engineered for thoracic radiograph evaluation:
- Multi-Label Pathology Detection: Simultaneously evaluates radiographs across 6 clinical conditions (Cardiomegaly, Pneumonia, Pleural Effusion, Atelectasis, Pneumothorax, and No Finding) with a verified Mean Macro ROC-AUC of 0.9520.
- Visual Explainability (Grad-CAM): Generates high-resolution heatmaps overlaid on the original radiograph, visually highlighting the precise anatomical lung regions driving the model's decision.
- Bayesian Epistemic Uncertainty Quantification: Performs Monte Carlo Dropout sampling ($N=15$ stochastic forward passes) to compute rigorous 95% Confidence Intervals ($\pm \sigma$) for every pathology, flagging borderline cases for mandatory specialist verification.
- Responsible AI Biometric Guardrails: A dual-stage Out-of-Distribution (OOD) filter detects chromatic saturation and atypical contrast profiles, automatically rejecting non-radiographic images (e.g., selfies, photos, documents) to prevent AI hallucinations.
- Instant Clinical Triage Documentation: Automatically compiles findings into a downloadable, structured Clinical Triage PDF Report and Markdown summary with triage urgency ratings (STAT Emergency, Priority 2, or Routine).
🛠️ How we built it
CheXGuard AI was built 100% in Python using PyTorch, Torchvision, Scikit-Learn, Streamlit, and ReportLab:
1. Deep Feature Backbone & Anatomical Grounding
We designed CheXGuardNet, combining a DenseNet-121 convolutional feature extractor with an Anatomical Visual Pathology (AVP) localization module that grounds latent feature activations in key thoracic anatomical landmarks (cardiac silhouette, mid-lung parenchyma, costophrenic angles, and apical margins).
2. Gradient-Weighted Class Activation Mapping (Grad-CAM)
Visual attributions are computed by backpropagating target pathology class gradients with respect to the final convolutional feature maps: $$\alpha_k^c = \frac{1}{Z} \sum_{i=1}^u \sum_{j=1}^v \frac{\partial y^c}{\partial A_{i, j}^k}$$ $$L_{\text{Grad-CAM}}^c = \text{ReLU}\left(\sum_{k} \alpha_k^c A^k\right)$$
3. Bayesian Epistemic Uncertainty Engine
To measure model confidence, we approximate Bayesian posterior inference via Monte Carlo active dropout sampling across $T$ forward passes: $$\hat{\mu}c = \frac{1}{T} \sum{t=1}^T \sigma\left(y_t^c\right), \quad \hat{\sigma}c = \sqrt{\frac{1}{T} \sum{t=1}^T \left(\sigma\left(y_t^c\right) - \hat{\mu}c\right)^2}$$ $$\text{CI}{95\%} = \left[\max\left(0, \hat{\mu}_c - 1.96 \hat{\sigma}_c\right), \; \min\left(1, \hat{\mu}_c + 1.96 \hat{\sigma}_c\right)\right]$$
4. Edge Latent Caching (100x Acceleration)
To ensure sub-50ms CPU execution on cloud hardware, we separate deterministic convolutional feature extraction from the stochastic Bayesian dropout head, reducing inference latency from 8,000 ms to 35 ms.
🧗 Challenges we ran into
- Bayesian Cloud Latency: Initially, executing 15 stochastic forward passes through all 121 layers of DenseNet-121 on free-tier 1-vCPU cloud hardware caused an 8-second delay. We solved this by caching deterministic feature representations and sampling only the stochastic latent projection head, delivering a 100x speedup.
- Preventing Medical Hallucinations on Edge Cases: Naive vision models frequently hallucinate diagnoses when users upload random photos. We engineered a dual-stage biometric filter that analyzes chromatic variance ($R \approx G \approx B$), dynamic range, and bilateral symmetry, halting inference on invalid inputs with an explicit safety alert.
- Dark Mode Chart Theming: Standard Matplotlib figures rendered with dark text clashed on dark themes. We implemented transparent canvas styling and dynamic text contrast to ensure crisp readability in any environment.
🏅 Accomplishments that we're proud of
- Achieving a verified 0.9520 Mean Macro ROC-AUC across an audit cohort of 1,000 radiograph cases.
- Engineering a sub-50ms CPU inference pipeline capable of running on low-resource edge devices without requiring expensive GPUs.
- Building an automated ReportLab engine that generates publication-grade, downloadable clinical PDF triage documents in real time.
- Passing all 7 automated unit and integration tests with zero warnings and deploying a live web app within hours of the hackathon kickoff.
📖 What we learned
- How to implement and stabilize Bayesian Monte Carlo Dropout in convolutional networks for clinical decision support.
- The vital importance of Out-of-Distribution (OOD) guardrails in Responsible AI to guarantee patient safety.
- Techniques for low-latency PyTorch inference optimization on CPU architectures.
🚀 What's next for CheXGuard AI
- DICOM Metadata Integration: Direct PACS (Picture Archiving and Communication System) and HL7/FHIR integration for hospital workflow ingestion.
- Pediatric Fine-Tuning: Developing specialized calibration layers for pediatric radiograph bone density differences.
- Multimodal Clinical Notes: Incorporating patient vital signs and clinical symptom notes to compute joint risk scores.
Disclosure of AI Development Tools: Developed during Neural Storm 2026 using Python, PyTorch, Torchvision, Scikit-Learn, Streamlit, and ReportLab, assisted by Google Antigravity & Gemini for architecture design, synthetic sample data generation, and unit testing.