Skip to content
mayankt411Public

About

Systematic Cognitive Observation And Recognition Engine:- An intuitive Mini Mental State Examination for Patients with cognitive disorders

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

21 Commits

Folders and files

Repository files navigation

S.C.O.R.E (Systematic Cognitive Observation and Recognition Engine)

An intuitive, multi-modal Mini Mental State Examination (MMSE) platform for neurocognitive screening powered by semantic analysis and behavioral biometrics.


πŸ”¬ Research Publication

This repository implements the assessment platform and machine learning framework introduced in the following peer-reviewed research paper:


🌐 Live Demo

The application is deployed and publicly accessible on Hugging Face Spaces: πŸ‘‰ Launch S.C.O.R.E Live Demo


πŸ“– Overview

The Mini-Mental State Examination (MMSE) is a 30-point clinical questionnaire widely utilized to measure cognitive impairment and track changes across time in conditions such as Alzheimer’s disease and dementia. Early and accessible cognitive screening is vital for timely clinical intervention, yet traditional paper-based administrations can be labor-intensive and susceptible to subjective evaluation.

S.C.O.R.E digitizes and elevates the standard MMSE into an automated multi-modal assessment engine. By coupling semantic embedding comparison (Sentence-Transformers SBERT) with fine-grained keystroke dynamics (typing speed, error types, and temporal pause analysis) and ensemble machine learning (XGBoost + Random Forest), the platform provides automated 30-point scoring, cognitive domain breakdown, and AI-driven risk stratification with downloadable clinical PDF reports.


✨ Key Features

  • Standardized Multi-Domain MMSE Assessment: Dynamic assessment battery spanning core cognitive domains β€” Orientation, Visual & Language Analysis, Focus & Discrimination, Linguistic Complexity, Memory Encoding, Attention & Calculation, Recall, and Executive Function.
  • Semantic & Fuzzy Scoring Engine: Evaluates free-text answers using cosine similarity over Sentence-BERT (all-MiniLM-L6-v2) embeddings with sequence-matching fallbacks (SequenceMatcher) for typo tolerance, multi-word corrections, and recall sets.
  • Behavioral Keystroke Biometrics: Real-time extraction of typing dynamics, including Words Per Minute (WPM), character count, error categorization (substitutions, omissions, additions, transpositions), consistency, and temporal hesitation stability.
  • 52-Feature Cognitive Profiling: Aggregates response accuracy, domain performance, and typing telemetry into a comprehensive 52-dimensional feature vector.
  • Ensemble Impairment Prediction & Interpretability: Dual-model ensemble combining XGBoost and Random Forest with heuristic baseline weighting to predict cognitive health stages (Normal Cognition, Mild Cognitive Impairment [MCI], Moderate, Severe) alongside SHAP tree-explainer attribution.
  • Interactive Clinical Dashboard: Dark/light-responsive diagnostic dashboard featuring scaled 30-point MMSE scores, interactive cognitive radar performance maps, typing biometrics charts, and granular response logs.
  • Automated Clinical PDF Generation: One-click generation and streaming of structured neurocognitive assessment reports via ReportLab.
  • Text-to-Speech & Voice Accessibility: Built-in voice reading (pyttsx3 / Web Speech) and audio prompts to assist patients with reading difficulties.

πŸ› οΈ Tech Stack

Backend & Machine Learning

  • Framework: FastAPI (Asynchronous REST API & Web Server)
  • ASGI Server: Uvicorn / Gunicorn
  • NLP / Semantic Embeddings: Sentence-Transformers (all-MiniLM-L6-v2), PyTorch (CPU-optimized)
  • Machine Learning: XGBoost, scikit-learn (Random Forest), SHAP
  • Data & Text Processing: pandas, numpy, python-Levenshtein
  • Data Validation & Schemas: Pydantic v2
  • PDF Generation: ReportLab
  • Audio & Accessibility: pyttsx3, SpeechRecognition

Frontend

  • Templates & Views: Jinja2 (HTML5)
  • Styling: Custom CSS (Modern clinical theme with responsive cards and typography)
  • Interactivity & Charts: Vanilla JavaScript (ES6+), Plotly.js / Chart.js for radar and biometrics plots, Web Speech API

πŸ“Έ Screenshots

1. System Interface (Landing Page)

System Interface

2. Assessment Interface

Assessment Interface

3. Results & Scoring Dashboard β€” Clinical Summary & Radar Map

Clinical Dashboard - Scoring & AI Analysis

4. Results & Scoring Dashboard β€” Biometrics & Response Log

Clinical Dashboard - Biometrics & Response Log

5. Sample Clinical Report Output (PDF)

Sample Clinical Report Output


πŸš€ Setup & Installation

Prerequisites

  • Python 3.10+ (Python 3.11 / 3.12 supported)
  • Git

1. Clone the Repository

git clone https://github.com/mayankt411/S.C.O.R.E.git
cd S.C.O.R.E

2. Create and Activate Virtual Environment

python -m venv .venv

# Windows (PowerShell):
.venv\Scripts\Activate.ps1

# Linux / macOS:
# source .venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Run the Application

python main.py

Or with Uvicorn directly:

uvicorn main:app --host 0.0.0.0 --port 8000 --reload

Open your browser and navigate to http://localhost:8000 to launch the assessment.


πŸ“ Project Structure

S.C.O.R.E/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ ml_models/
β”‚   β”‚   β”œβ”€β”€ disease_predictor.py   # Ensemble ML predictor (XGBoost + Random Forest + SHAP)
β”‚   β”‚   β”œβ”€β”€ feature_extractor.py   # 52-dimensional cognitive feature extraction
β”‚   β”‚   └── synthesizer.py         # Synthetic cognitive feature generation
β”‚   β”œβ”€β”€ config.py                  # Domain thresholds, MMSE cutoffs, and constants
β”‚   β”œβ”€β”€ data_manager.py            # ReportLab clinical PDF export and data persistence
β”‚   β”œβ”€β”€ questions.py               # Dynamic MMSE cognitive assessment battery
β”‚   β”œβ”€β”€ scoring_engine.py          # SBERT semantic cosine similarity & fuzzy matcher
β”‚   β”œβ”€β”€ typing_analyzer.py         # Keystroke dynamics, WPM, and error opcode analysis
β”‚   └── voice_engine.py            # Text-to-speech and audio feedback helper
β”œβ”€β”€ images/                        # UI screenshots and sample assessment outputs
β”‚   β”œβ”€β”€ system_interface.png
β”‚   β”œβ”€β”€ assessment_interface.png
β”‚   β”œβ”€β”€ clinical_dashboard_top.png
β”‚   β”œβ”€β”€ clinical_dashboard_bottom.png
β”‚   └── sample_report_output.png
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ css/style.css              # Custom styling for assessment and dashboard
β”‚   └── js/app.js                  # Dynamic client-side assessment flow and charting
β”œβ”€β”€ templates/
β”‚   └── index.html                 # Single-page assessment and clinical dashboard view
β”œβ”€β”€ Dockerfile                     # Containerization for Hugging Face / Cloud deploy
β”œβ”€β”€ main.py                        # FastAPI application entry point and REST endpoints
β”œβ”€β”€ schemas.py                     # Pydantic data schemas and validation models
β”œβ”€β”€ requirements.txt               # Project dependencies
β”œβ”€β”€ LICENSE                        # MIT License
└── README.md                      # Project documentation

πŸ“„ License

This project is licensed under the MIT License.

About

Systematic Cognitive Observation And Recognition Engine:- An intuitive Mini Mental State Examination for Patients with cognitive disorders

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages