Heart Health Prediction API via Wearables & Lab Data
Corix is an ML-based API service built with FastAPI that predicts heart health risks using both wearable device metrics and lab test results. It leverages advanced machine learning models and pipelines integrated with MongoDB, DVC, and MLflow for MLOps workflows, containerized and hosted on AWS.
- API Key Authentication with user registration and token quota
- Dual-Model Prediction:
- RFC model for wearable data
- LSTM model for lab results
- ML Model Management using DVC & MLflow on Dagshub
- Dockerized for easy deployment
- Hosted on AWS
- Model retraining and version control
| Data Type | Model Used | Purpose |
|---|---|---|
| Wearable Data | RandomForestClassifier (Sklearn) | Feature-driven risk prediction |
| Lab Data | LSTM (TensorFlow/Keras) | Time-series based prediction |
Model lifecycle is tracked using:
- DVC for dataset and model versioning
- MLflow for experiment tracking and deployment
- Backend: FastAPI
- Database: MongoDB
- Cache: Redis
- ML Models: Scikit-learn, LSTM (TensorFlow/Keras)
- Tracking: MLflow + DVC on Dagshub
- Deployment: Docker, AWS
Corix/
├── assets/
│ └── file.svg # README image asset
├── LICENSE
├── README.md
├── service/
│ ├── basic.py # Basic service utilities
│ ├── docker-compose.yaml # Multi-container orchestration
│ ├── Dockerfile # Container setup
│ ├── model/ # Model artifacts
│ ├── model_retriever.py # Model fetch
│ ├── mongo.py # DB connection
│ ├── redis_client.py # Redis connection/caching
│ ├── requirements.txt
│ └── service.py # FastAPI main application
└── training/
├── model_retraining.py # Model training pipeline
├── requirements.txt
├── training_datasets/ # Sample data for retraining
└── upload_model.py # Upload models to MLflow with parameters and metrics
- API Key system: Each user receives a unique API key upon registration.
- Daily token limit: Usage restricted by a configurable daily request limit.
git clone https://github.com/RijoSLal/Corix.git
cd Corixcd service
docker compose up --buildthis will start the API service along with its Redis dependency.
http://localhost:8000/
Corix uses DVC and MLflow, tracked via Dagshub:
- Track experiments with MLflow
- Push/pull models via DVC
To pull the latest model/data versions:
dvc pull| Endpoint | Method | Description |
|---|---|---|
/register |
POST | Register a new user |
/user_info |
POST | Retrieve user account information |
/predict/from-lab |
POST | Predict health risk using lab parameters |
/predict/from-wearables |
POST | Predict health risk using wearable sensor data |
Full request/response schemas and interactive testing for all endpoints are available at the root / endpoint once the service is running.
Fork the repo, create a branch, commit your changes, push, and open a Pull Request.
MIT License © LICENSE