Downloads · 30 days
0
bhargavvz/MedGPT
MedGPT is a machine learning model from bhargavvz. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
<p align="center" <strongAI-powered medical image analysis with visual explanations</strong </p
Downloads · 30 days
0
Access
Public
Updated Mar 23, 2026
Repo size
8.5 GB
Likes
1
Public
Click a slice to open those files.
.pt5 GB · 59%
From the Hugging Face model README
MedGPT/
├── frontend/ # React + Vite frontend
│ ├── src/
│ │ ├── pages/ # Home, Analyze, Dashboard, About
│ │ ├── components/ # Navbar, Footer
│ │ └── styles/ # Global CSS design system
│ └── dist/ # Production build
├── backend/ # FastAPI server
│ └── server.py # API endpoints + React SPA serving
├── models/ # Model definitions
│ ├── medgpt.py # MedGPT model class
│ └── explainability.py # Grad-CAM implementation
├── training/ # Training pipeline
│ ├── train.py # Pre-training + fine-tuning script
│ ├── evaluate.py # Evaluation metrics
│ └── visualize.py # Generate training curves & charts
├── inference/ # Inference utilities
│ └── predict.py # CLI prediction tool
├── data/ # Datasets
│ ├── prepare_data.py # Download & preprocess datasets
│ ├── dataset.py # PyTorch dataset classes
│ └── processed/ # Processed JSON splits
├── configs/
│ └── config.yaml # All configuration settings
├── checkpoints/ # Trained model checkpoints
│ └── finetune/
│ └── best_model/ # Best LoRA adapter
└── results/ # Evaluation results & visualizations
└── figures/ # Training curves, charts, heatmaps
| Metric | Score |
|---|---|
| Overall Accuracy | 78.5% |
| Yes/No Accuracy | 87.1% |
| Open-ended Accuracy | 73.9% |
| BLEU-1 | 82.8% |
| ROUGE-L | 80.6% |
| Token F1 | 81.2% |
| Parameter | Value |
|---|---|
| Base Model | Qwen3-VL-8B-Instruct |
| Fine-tuning Method | LoRA (rank=64, alpha=128) |
| Trainable Parameters | 210M / 9B (2.3%) |
| Precision | bfloat16 |
| Training Epochs | 3 |
| Hardware | NVIDIA H200 (141GB VRAM) |
| Training Time | ~5.6 hours |
| Dataset | Samples | Stage |
|---|---|---|
| PMC-VQA | ~140K | Pre-training |
| VQA-RAD | ~3.5K | Fine-tuning |
| SLAKE | ~14K | Fine-tuning |
| PathVQA | ~32K | Fine-tuning |
# Clone from HuggingFace
git lfs install
git clone https://huggingface.co/bhargavvz/MedGPT
cd MedGPT
# Install Python dependencies
pip install -r requirements.txt
# Download datasets
python data/prepare_data.py --datasets all --output_dir data/processed --validate
# Build frontend
cd frontend && npm install && npm run build && cd ..
# Start the server (API + React frontend on port 8000)
python backend/server.py
# Open: http://localhost:8000
python inference/predict.py \
--image path/to/xray.jpg \
--question "What abnormality is visible?" \
--adapter_path checkpoints/finetune/best_model
# Full pipeline (pre-training + fine-tuning)
python training/train.py --stage all
# Fine-tuning only
python training/train.py --stage finetune
python training/evaluate.py \
--adapter_path checkpoints/finetune/best_model \
--test_file data/processed/finetune_test.json \
--output_file results/eval_results.json
python training/visualize.py --output_dir results/figures
docker compose up -d
# Access at http://localhost:8000
| Method | Endpoint | Description |
|---|---|---|
GET | /api/health | Health check & model status |
POST | /api/predict | Image + question → answer + heatmap |
POST | /api/load | Load/reload model |
GET | /api/metrics | Evaluation results |
GET | /api/training-history | Training loss curves |
MedGPT is a research and educational tool. It is NOT intended for clinical diagnosis or medical decision-making. Always consult qualified healthcare professionals for medical advice.
This project is for educational and research purposes only.