Clinical Decision Support System for ICU Glucose Monitoring and Insulin Dose Recommendation
IntelliGlu is a research project that explores the use of Offline Reinforcement Learning (Conservative Q-Learning) to assist insulin dosing in Intensive Care Units (ICUs).
The application combines a FastAPI backend, a Next.js + Electron frontend, and a trained CQL model to generate insulin dose recommendations from patient glucose measurements. Clinicians can review every recommendation before accepting it or overriding it manually.
The objective of the project is to study how reinforcement learning can support clinical decision-making while keeping the clinician in control.
- Offline Reinforcement Learning (Conservative Q-Learning) recommendation engine
- FastAPI REST API
- Interactive patient dashboard
- Patient management (CRUD)
- Glucose monitoring
- Real-time glucose simulator
- Recommendation review and manual override
- Safety rules for insulin dosing
- Analytics and reporting
- Desktop application with Electron
- Docker support
Next.js + Electron
│
▼
FastAPI REST API
│
┌──────────────┼──────────────┐
▼ ▼ ▼
Patient Data RL Inference Analytics
│
▼
Conservative Q-Learning Model
│
▼
Safety Validation
│
▼
Recommended Insulin Dose
Version 2 introduces a complete backend architecture and several improvements to the recommendation workflow.
- Fixed the high-glucose recommendation logic.
- Frontend and backend now use the same inference rules.
- Improved consistency for glucose values above 400 mg/dL.
- The backend automatically detects the state dimension stored in the trained model.
- Removed the dependency on hardcoded feature sizes.
The FastAPI backend now provides endpoints for:
- Patient management
- Recommendations
- Simulation
- Reports
- Analytics
- Monitoring
- Settings
- Redesigned dashboard
- New patient management workflow
- Recommendation page connected to the backend
- Simulator integrated with recommendations
- Improved navigation and UI consistency
- Python
- FastAPI
- Pydantic
- Uvicorn
- Docker
- Conservative Q-Learning (CQL)
- PyTorch
- Offline Reinforcement Learning
- Next.js
- React
- TypeScript
- Tailwind CSS
- Electron
backend/
├── app/
│ ├── api/
│ ├── core/
│ ├── db/
│ ├── ml_models/
│ ├── rl/
│ │ ├── cql/
│ │ ├── ope/
│ │ └── safety/
│ ├── schemas/
│ ├── services/
│ └── main.py
└── docker-compose.yml
frontend/
├── app/
├── components/
├── hooks/
├── lib/
├── services/
└── electron/
cd backend/app
pip install -r requirements.txt
uvicorn main:app --reload --port 8000Backend:
http://localhost:8000
cd frontend
npm install
npm run devFrontend:
http://localhost:3000
Internally, the recommendation model operates in mg/dL.
For usability, the interface displays glucose values in both:
- mg/dL
- g/L
| Glucose | Typical Recommendation |
|---|---|
| 300 mg/dL (3 g/L) | 4–6 U |
| 400 mg/dL (4 g/L) | ≥ 6 U |
This project was developed to investigate how Offline Reinforcement Learning can be applied to insulin dosing using retrospective ICU data.
Rather than replacing clinical judgment, IntelliGlu provides recommendations that clinicians can inspect, accept, or modify before administration.
The project combines machine learning with rule-based safety checks to encourage safe and explainable recommendations.
- Integration with hospital databases
- Authentication and user roles
- Additional reinforcement learning algorithms
- Explainable AI visualizations
- Model retraining pipeline
- Deployment to cloud infrastructure
This repository was developed for research and educational purposes.