BioStack / README.md
AE-Shree
Deploy BioStack RLHF Medical Demo
bda3c09
---
title: BioStack - RLHF Medical Report Generation
emoji: 🩻
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 7860
---
# BioStack - RLHF Medical Report Generation
AI-powered medical report generation using Reinforcement Learning from Human Feedback (RLHF).
## Features
- **SFT Model**: Supervised Fine-Tuning for initial report generation
- **Reward Model**: Quality assessment of generated reports
- **PPO Model**: Policy optimization for improved outputs
- **Modern UI**: Clean React interface with drag-and-drop upload
## Models Used
- **SFT Model**: `best_model.pt` - Initial report generation
- **Reward Model**: `reward_model.pt` - Quality scoring
- **PPO Model**: `rlhf_model.pt` - Optimized generation
All models are automatically downloaded from Hugging Face Hub on first startup.
## Usage
1. Upload a medical X-ray image
2. Optionally provide ground truth text for comparison
3. Click "Run Inference" to generate reports
4. View results from all three models with quality scores
## Technology Stack
- **Frontend**: React.js
- **Backend**: FastAPI (Python)
- **ML Framework**: PyTorch, Transformers
- **Models**: T5, CoAtNet, Custom Reward Model
## Local Development
### Prerequisites
- Python 3.11+
- Node.js 16+
- Hugging Face account with access tokens
### Installation
```bash
# Install Python dependencies
pip install -r requirements.txt
# Install Node dependencies
npm install
# Build React app
npm run build
# Run server
python server.py
```
The app will be available at `http://localhost:7860`
## Deployment
This app is configured for deployment on Hugging Face Spaces using Docker.