Microbiome-Immunotherapy-CDS / PROJECT_README.md
fierce74's picture
Rename README.md to PROJECT_README.md
1314222 verified

A newer version of the Gradio SDK is available: 6.13.0

Upgrade

Microbiome-Immunotherapy Clinical Decision Support System

An Evidence-Based Clinical Decision Support Tool

This project provides a sophisticated clinical decision support system that optimizes immunotherapy (ICI/ACT) treatments based on a patient's gut microbiome profile. It leverages MedGemma 1.5 4B and a specialized RAG pipeline to generate evidence-based clinical reports.

Architecture Overview

The system processes patient data and clinical evidence through a modular pipeline to produce a 6-section clinical report:

  1. Microbiome Composition: Profile of diversity and key taxa.
  2. Metabolite Landscape: Analysis of SCFAs, bile acids, and tryptophan.
  3. Drug-Microbiome Interaction: Core interpretation of microbiome impact on drug efficacy.
  4. Confounding Factors: Impact of antibiotics, PPIs, and prior treatments.
  5. Intervention Considerations: Evidence-based dietary or probiotic suggestions.
  6. Data Quality & Limitations: Assessment of report confidence.

Each section is generated using targeted RAG retrieval from a database of peer-reviewed medical literature.

Key Features

  • EHR Extraction: Automatically parses raw Electronic Health Records (EHR) text into structured patient data using MedGemma.
  • Medical RAG: Domain-specific retrieval system using PubMedBERT embeddings and table-aware chunking.
  • Multi-Model Support: Designed for MedGemma 1.5 but extensible to other LLMs.

Project Structure

β”œβ”€β”€ rag/               # RAG pipeline for indexing medical papers
β”œβ”€β”€ src/               # Core application logic (models, prompts, generators)
β”œβ”€β”€ data/              # Patient data and clinical inputs
β”œβ”€β”€ outputs/           # Generated clinical reports (Markdown)
β”œβ”€β”€ generate_report.py # Main CLI entry point
└── requirements.txt   # Project dependencies

Getting Started

Prerequisites

  • First get the RAG ready. See rag/README.mds
  • Python 3.10+
  • CUDA-compatible GPU (recommended for MedGemma and PubMedBERT)
  • HuggingFace access for google/medgemma-1.5-4b-it

Installation

  1. Clone the repository.
  2. Install dependencies:
    pip install -r requirements.txt
    pip install -r rag/requirements.txt
    

Usage

Generate a report from structured patient JSON (see data/template/patient_schema_template.json):

python generate_report.py data/patient_example.json

Generate a report from raw EHR text:

python generate_report.py data/patient_ehr.txt --save-ehr-json outputs/patient_profile.json

Examples

See data/sample_input for EHR examples and output for the corresponding output

Configuration

Settings for model IDs, device selection (CPU/GPU), and RAG parameters can be found in src/config.py.