Skip to content

shamuddin/ClinSight

Repository files navigation

ClinSight β€” Hierarchical Multimodal Clinical Intelligence

ClinSight

Hierarchical Multimodal Clinical Intelligence for Emergency Decision Support

License Live Demo HF Space
AMD MI300X ROCm 7.0 vLLM ROCm Qwen LangGraph FastAPI React



🌐 Live Demo β€’ πŸ€— Hugging Face β€’ πŸ“– Technical Walkthrough β€’ πŸŽ₯ Demo Video

πŸŽ₯ Judge Note: The live demo below shows pre-computed results from our 50-case benchmark run (AMD MI300X credit exhausted). The submitted video demonstrates live inference with zero caching on AMD MI300X β€” see Technical Walkthrough for full evidence.


🚨 The Problem

Every year, 795,000 Americans are harmed by delayed diagnosis in emergency departments.

Metric Current Reality
Preliminary X-ray review 30–60 minutes
Official radiology report 1–3 hours
Rural teleradiology 4–24 hours

For a patient with a collapsed lung, that's a lifetime.

Existing solutions (Aidoc, Qure.ai, BraveCX) are proprietary, NVIDIA-locked, and image-only. None fuse imaging + lab values + patient history in a single open-source inference pipeline. None run on AMD hardware. None use a hierarchical agentic safety layer.


🧠 What We Built

ClinSight is an open-source, multi-agent clinical decision support system that reads chest X-rays, lab values, vitals, and triage notes simultaneously β€” then reasons across all modalities through a compiled LangGraph pipeline running entirely on AMD Instinct MI300X.

Architecture: 5 Parent Agents β†’ 7 Subagents β†’ 12 Reasoning Nodes

Agent Role Subagents
πŸ”΅ Coordinator Input validation, quality gates, pediatric safety Image Quality Gate, Pediatric Gate
🩺 Radiologist Image analysis, pathology detection, attention regions Image Prep, Pathology Analyzer
πŸ§ͺ Lab Analyst Critical value detection, pattern correlation Critical Value Detector, Pattern Correlator
πŸ›‘οΈ Safety Contradiction checking, hallucination guard, bias audit Contradiction Checker, Hallucination Guard, Bias Auditor, Safety Merge
πŸ“ Documenter ESI scoring, differential diagnosis, report generation ESI Scorer, Differential Builder

Pipeline: Coordinator β†’ [pass] β†’ Radiologist β†’ Lab Analyst β†’ Safety β†’ Documenter β†’ END


⚑ Why AMD MI300X?

Healthcare AI has three non-negotiable requirements:

  1. On-premise deployment β€” patient data cannot leave the hospital (HIPAA)
  2. Large model capacity β€” medical reasoning requires 35B+ parameters
  3. No quantization β€” clinical accuracy degrades with INT8/INT4
Requirement AMD MI300X NVIDIA H100 80GB
On-premise βœ… βœ…
HBM capacity 192 GB 80 GB
Dual-model FP16 βœ… Fits ❌ Does not fit
Headroom 93 GB None

The decisive advantage: Our dual-model stack (99GB total) fits at full FP16 on MI300X. An H100 80GB would require quantization, degrading clinical accuracy.


πŸ—οΈ Dual-Model Stack

Model Role VRAM License
Qwen2.5-VL-7B-Instruct Vision (chest X-ray analysis) ~14 GB Apache 2.0
Qwen3.5-35B-A3B Text reasoning (256-expert MoE, 3B active) ~70 GB Apache 2.0
Total ~99 GB
Qwen2.5-VL-7B  FP16 weights:  ~14 GB
Qwen3.5-35B    FP16 weights:  ~70 GB
KV cache (both, 32K context): ~15 GB
─────────────────────────────────────
Total:                         ~99 GB
MI300X HBM3:                  192 GB
Headroom:                     ~93 GB
Utilization:                   52%

πŸ“Š 50-Case Live Benchmark (AMD MI300X)

Every case ran real inference with cached: false. Zero mock data.

Metric Value
Cases tested 50
Successful 50 (100%)
Mean latency 23.02s
Min latency 19.80s
Max latency 27.91s
Mode Real AMD MI300X inference

GPU Evidence (from rocm-smi)

State VRAM GPU Use Power Temp
Baseline (models loaded) 94.4% (181GB/192GB) 10% 231W 38Β°C junction
Post-inference 88.6% (170GB/192GB) 49% 263W 40Β°C junction

πŸ“ Raw evidence: benchmarks/gpu_results/droplet_complete/rocm_smi_*.txt


πŸ›‘οΈ Safety Layer: 3 Parallel Checks

The crown jewel of ClinSight is the Safety Agent with three parallel subagents:

Check What It Does Example
Contradiction Checker Cross-modality mismatch detection Image shows pneumonia, but WBC is normal β†’ downgrade confidence
Hallucination Guard Visual grounding verification Finding without attention region β†’ flag as ungrounded
Bias Auditor Demographic disparity detection Elderly patient with edema β†’ flag undertriage risk

All three run simultaneously and merge into confidence downgrades before any output reaches a physician.


🎯 The "What If?" Demo

Same chest X-ray. Same patient. Different labs β†’ Different triage.

Scenario Labs Result
Critical labs Lactate 3.2, pO2 58 ESI 1 β€” Immediate
Normal labs Lactate 1.1, pO2 98 ESI 3 β€” Urgent

This is multimodal reasoning, not just multimodal input.


πŸš€ Quick Start

# Clone
git clone https://github.com/shamuddin/ClinSight.git
cd ClinSight

# Backend
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
PYTHONPATH=.. uvicorn backend.api.main:app --host 0.0.0.0 --port 8000

# Frontend (new terminal)
cd frontend/react-app
npm install
npm run dev
# Open http://localhost:5173

AMD MI300X Production Setup

# Setup ROCm + vLLM (one-time, ~15-30 min)
chmod +x scripts/setup_amd_gpu.sh
./scripts/setup_amd_gpu.sh

# Start dual-model vLLM servers
./scripts/start_vllm_vision.sh &
./scripts/start_vllm_text.sh &

# Verify GPU health
python scripts/gpu_health_check.py

See docs/TECHNICAL_WALKTHROUGH.md for full architecture deep-dive.


πŸ”— Links

Resource URL
🌐 Live Demo clinsight-e7ai.onrender.com
πŸ€— Hugging Face Space huggingface.co/spaces/shamuddin/clinsight
πŸŽ₯ Demo Video YouTube (update with your URL)
πŸ“– Technical Walkthrough docs/TECHNICAL_WALKTHROUGH.md
πŸ† Hackathon AMD Developer Hackathon @ lablab.ai

πŸ§ͺ Tests

PYTHONPATH=. python -m pytest tests/ -v --cov=backend --cov-report=html

πŸ“œ License

Apache-2.0 β€” See LICENSE

⚠️ Medical Disclaimer: This software is for research and educational purposes only. Not for clinical use without regulatory approval and physician oversight. Every output requires clinician review.


Built with ❀️ for the AMD Developer Hackathon @ lablab.ai β€” Track 3: Vision & Multimodal AI

About

Multi-agent clinical decision support system with vision-language models for chest X-ray analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors