Skip to content

PowerForYou74/cellrepair-medgemma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧬 CellRepair Health Educator — MedGemma Impact Challenge

Patient-Friendly Cellular Health Education Powered by MedGemma 1.5 4B

Quality Score AgentBeats Edge AI

Kaggle Notebook MedGemma Demo Video Live Dashboard

Python License: MIT GitHub Pages Release


🎬 Demo Video


📊 Live Benchmark Dashboard

Explore all results interactively → CellRepair AI — Benchmark Dashboard

Chart.js visualizations · KPI cards · Hardware compatibility matrix · Filterable & sortable


🏆 Key Results at a Glance

Metric Value Details
MedGemma Quality Score 4.68 / 5.0 (93.6%) LLM-as-Judge across 6 clinical dimensions
Patient Accessibility 5.00 / 5.0 Perfect layperson readability
Analogy Quality 5.00 / 5.0 Complex biology → everyday metaphors
AgentBeats Validation 96.5% (201/208) Independently validated vs. GPT-4, Claude 3.5 Sonnet, Gemini Pro
Edge Deployment 8 GB VRAM Runs on RTX 3060, Jetson Orin, Apple M1
Avg. Response Time 32.2 s On Tesla T4 GPU
Peak GPU Memory 13.28 / 15.64 GB (84.9%) bfloat16 precision

🔬 Overview

CellRepair Health Educator transforms complex cellular biology into clear, actionable patient explanations using Google's MedGemma 1.5 4B model. Built for the MedGemma Impact Challenge on Kaggle.

Tracks: Main Track (Medical Education & Patient Empowerment) + Edge AI Prize


🔬 Independent LLM Validation — 96.5% Win Rate

CellRepair was independently benchmarked against GPT-4, Claude 3.5 Sonnet, and Gemini Pro using the RDI Foundation’s AgentBeats debate evaluation framework — 208 structured patient education debates:

Metric Result
Debates Won 201 / 208
Win Rate 96.5%
Opponents GPT-4 · Claude 3.5 Sonnet · Gemini Pro
Evaluation Criteria Medical accuracy, patient accessibility, actionable advice, analogy quality, safety disclaimers

A 4B-parameter edge model outperforming commercial LLMs with 100×+ more parameters — independently verified through automated debate evaluation.


✨ What Makes This Submission Special

  1. Prompt Ablation Study — 3-strategy comparison proving structured prompts improve quality by 40%+ over generic approaches
  2. LLM-as-Judge Evaluation — MedGemma evaluates its own responses across 6 clinical dimensions with per-criterion justifications
  3. Independent LLM Validation — Benchmarked against GPT-4, Claude 3.5 Sonnet, Gemini Pro via AgentBeats (96.5%, 201/208 debates)
  4. Multi-Turn Conversation — Full conversational context for follow-up patient questions
  5. Multimodal Vision — Cell biology image analysis for visual patient education
  6. Edge Deployment Ready — 4B params, 8 GB VRAM, fully local inference (HIPAA/GDPR compatible)

📁 Project Structure

cellrepair-medgemma/
├── README.md                          # This file
├── WRITEUP.md                         # Competition writeup
├── LICENSE                            # MIT License
├── requirements.txt                   # Python dependencies
├── notebooks/
│   └── cellrepair_health_educator_v3.ipynb  # Main Kaggle notebook (v3.0)
├── src/
│   ├── demo_cellrepair_health.py      # Standalone demo script
│   ├── scoring_framework.py           # Quality evaluation framework
│   ├── edge_deployment_analysis.py    # Edge hardware analysis
│   ├── model_comparison.py            # MedGemma vs LLM comparison
│   └── image_analysis_cell.py         # Multimodal image analysis
├── dashboard/
│   └── benchmark-dashboard.html       # Interactive results dashboard
├── assets/
│   ├── scoring_radar.png              # Quality radar chart
│   ├── edge_deployment_chart.png      # Edge deployment comparison
│   ├── model_comparison_chart.png     # Model comparison chart
│   ├── medical_advantages.png         # MedGemma advantages
│   ├── inference_timeline.png         # Inference timeline
│   └── thumbnail.png                  # Project thumbnail
└── docs/
    ├── VIDEO_SCRIPT.md                # 3-minute demo video script
    └── QUICK_START.md                 # Quick start guide

🚀 Quick Start

Run on Kaggle (Recommended)

  1. Open the Kaggle Notebook
  2. Enable GPU T4 x2 in Settings
  3. Add your HF_TOKEN via Add-ons → Secrets
  4. Click "Run All"

Run Locally

git clone https://github.com/powerforyou74/cellrepair-medgemma.git
cd cellrepair-medgemma
pip install -r requirements.txt
huggingface-cli login   # Requires access to MedGemma
python src/demo_cellrepair_health.py

🏗️ Architecture

Patient Question → Structured Education Prompt → MedGemma 1.5 4B → Patient-Friendly Response
                                                                          ↓
                                                              LLM-as-Judge Self-Evaluation

The system uses a structured prompt (CellRepair v2) with emoji-segmented sections:

  • 🔬 What's happening in your cells — Biology with analogies
  • 💡 Why this matters for you — Personal health relevance
  • What you can do — 3 actionable lifestyle tips
  • ⚕️ Disclaimer — Consult your healthcare provider

🧪 5 Patient Education Scenarios

# Topic Category Time Words
1 Autophagy — Cellular Self-Cleaning Education 32.0s 330
2 Free Radicals & Oxidative Stress Clinical Support 29.6s 304
3 Lifestyle & Cellular Health Prevention 36.4s 394
4 Chronic Inflammation Education 35.7s 372
5 Telomeres & Aging Education 27.3s 296

⚡ Edge Deployment

CellRepair runs on consumer-grade hardware — no cloud required:

Device VRAM Status
NVIDIA RTX 3060 12 GB ✅ Full speed
NVIDIA Jetson Orin 8 GB ✅ Optimized
Apple M1 (16 GB) Shared ✅ Compatible
Raspberry Pi 5 8 GB RAM ⚠️ CPU-only, slow

Privacy by design: All inference runs locally. No patient data leaves the device. HIPAA & GDPR compatible.


🔧 Technical Details

  • Model: google/medgemma-1.5-4b-it (4B parameters, multimodal)
  • Precision: bfloat16 for memory efficiency
  • Decoding: Greedy (do_sample=False) for reproducibility
  • APIs: AutoProcessor + AutoModelForImageTextToText
  • GPU: Tesla T4 (15.64 GB VRAM), peak usage 84.9%

👤 Author

Oliver Winkel — Founder & Developer, CellRepair AI

LinkedIn GitHub


📄 License

MIT License — see LICENSE for details.


Disclaimer: CellRepair Health Educator is a research prototype for educational purposes. Not a medical device. Always consult a qualified healthcare professional.

📊 Benchmark Dashboard · 📓 Kaggle Notebook · 🎬 YouTube Demo

About

Patient-Friendly Cellular Health Education Powered by MedGemma 1.5 4B — MedGemma Impact Challenge Submission

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors