File size: 2,136 Bytes
e529357
 
 
 
 
 
cdac786
e529357
 
 
 
766411f
b89b0ca
cdac786
 
 
 
 
b89b0ca
ecdc7bc
 
cdac786
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ecdc7bc
766411f
ecdc7bc
cdac786
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ecdc7bc
c783aed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
title: AI Diagnostics Agent - Early Cancer Discovery
emoji: πŸ₯
colorFrom: purple
colorTo: pink
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
---

# πŸ₯ AI Diagnostics Agent: Early Cancer Discovery (Demo)

[![Made with Python](https://img.shields.io/badge/Made%20with-Python-3776AB?logo=python&logoColor=white)](https://www.python.org/)
[![Powered by Moonshot.ai](https://img.shields.io/badge/Powered%20by-Moonshot.ai-blue)](https://moonshot.ai)
[![Gradio App](https://img.shields.io/badge/Gradio-5.44.0-orange)](https://gradio.app/)

⚠️ **Research Demo Only β€” Not for Clinical Use**

---

## 🌍 Overview

**AI Diagnostics (POC)** is a research project designed to demonstrate early cancer risk screening using **AI-driven imaging + lab report synthesis**.

It integrates:
- πŸ–ΌοΈ **Imaging Agent** β€” Detects lung abnormalities (mass, opacity, nodules) from chest X-rays.  
- πŸ§ͺ **Lab Agent** β€” Parses tumor markers (PSA, CA-125, AFP) and highlights abnormal results.  
- 🧠 **AI Coordinator** β€” Generates diagnostic summaries powered by **Moonshot.ai** with a local **T5 fallback** for offline use.  
- πŸ”₯ **Heatmap Overlay** β€” Highlights model-identified lung regions for interpretability.  

---

## βš™οΈ Features

| Agent | Description |
|--------|--------------|
| **Imaging Agent** | TorchXRayVision + PyTorch for lung-related cancer indicators |
| **Lab Agent** | Extracts structured tumor marker insights |
| **Coordinator** | Combines both into concise AI summaries (Moonshot.ai LLM) |
| **Fallback AI** | Local text generation using T5-small if network/API fails |
| **Heatmap Overlay** | Visual interpretability of X-ray activations |
| **Gradio UI** | Easy drag-and-drop web interface for demos |

---

## 🧠 How It Works

1. Upload or select a sample chest X-ray.  
2. Paste lab or MRI/CT report text.  
3. The AI analyzes the image + text.  
4. Results are combined into a natural-language diagnostic summary.

---

## πŸš€ Run Locally

```bash
git clone https://github.com/<your-org>/ai_diagnostics.git
cd ai_diagnostics
pip install -r requirements.txt
python app.py