Skip to content

PatiPiasecka/DiaScore

Repository files navigation

DiaScore

Python Version Backend API ML Preprocessing Frontend Database

DiaScore is a full-stack application for diabetes risk estimation. It combines:

  • FastAPI API layer
  • PyTorch model inference
  • scikit-learn preprocessing (KNN imputer and feature scaling)
  • SQLite persistence
  • React + Vite frontend

Demo and Screenshots

demo.mp4

A full demo walkthrough showing the main flow: medical questionnaire, family interview, prediction result, and history management.

DiaScore prediction home screen with medical questionnaire and family interview panel
The main landing page shows the medical questionnaire on the left and the family interview card on the right. This is the entry point for entering clinical values before sending a prediction.

Family interview step for adding a relative and tagging relevant conditions
The family interview screen lets the user add relatives, specify early onset diabetes, and mark associated conditions such as obesity, hypertension, or heart disease.

Prediction result gauge showing a low-risk score and next-step recommendations
The prediction result view displays the final risk percentage, risk category, and follow-up recommendations in a dedicated summary panel.

History view with saved predictions, export action, and record deletion controls
The history screen lists previous predictions, highlights the stored clinical values, and provides export and deletion actions for managing saved records.

Delete confirmation modal used before removing a saved prediction
The confirmation modal appears before deleting a single record or clearing history. It prevents accidental removal of stored predictions.

Project Scope

DiaScore is not only a web API. The core backend logic includes the ML model and preprocessing pipeline. The project is built as an end-to-end system: data preparation, model training, inference, API integration, and UI for patient-facing prediction history.

Main Features

  • Predict diabetes risk from medical questionnaire values.
  • Impute missing values before inference.
  • Store prediction history in SQLite.
  • Display history in the frontend and export results to CSV.
  • Support single-record deletion and full history cleanup.

Run with Docker

The project should be run through Docker Compose (not by starting frontend and backend separately).

Requirements

  • Docker
  • Docker Compose plugin

Build images

docker compose build

Start the full stack

docker compose up

Or build and start in one command:

docker compose up --build

Access services

Stop services

docker compose down

Our Model

DiaScore uses a binary classification neural network implemented in PyTorch and trained on the Pima Indians Diabetes dataset. Before inference, missing clinical values are imputed (KNN imputer), then scaled with StandardScaler.

Model details, intended use, metrics and trade-offs are documented in:

Related ML notebooks:

Project Structure

  • api/ - FastAPI app and endpoint schemas
  • database/ - SQLAlchemy models, CRUD, preprocessing, database scripts
  • frontend/ - React and Vite user interface
  • ml/ - model training, evaluation and inference code
  • data/ - dataset and split utilities
  • docs/ - project documentation, including model card

Authors

About

DiaScore is a full-stack application for diabetes risk estimation. The core backend logic includes the ML model and preprocessing pipeline. The project is built as an end-to-end system: data preparation, model training, inference, API integration, and UI for patient-facing prediction history.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors