Project Info
Inspiration
We are faced by a stark reality: 1 in 10 adults aged 45 and older experience worsening memory loss or confusion - early signs that often go unnoticed. What's most concerning is that these subtle changes can appear up to 10 years before becoming obvious symptoms. This gap between early signs and diagnosis is what inspired us to create CogniSync. Core Technology We developed a wearable device that serves as the foundation of our system. Using an integrated IMU sensor, it captures two critical types of data that provide early insights into cognitive health. Movement Analysis The device continuously tracks movement patterns through its integrated sensors. By processing acceleration, gyroscope, and magnetometer readings, we calculate stability indices from acceleration variance and measure movement efficiency through jerk analysis. These measurements allow us to identify early concerns in tremor patterns, gait stability, and fall risk assessment, providing early warnings of potential cognitive decline. Voice Analysis The same wearable device captures speech patterns, which research shows can be one of the earliest indicators of cognitive changes. Our analysis examines voice stability, where we look for readings above 65% for normal function. We also track attention patterns through speech rhythm, aiming for scores above 80%, and monitor memory indicators through processing speed, targeting above 90%. Key metrics like mean pause duration are measured against clinical thresholds, with 1.2 seconds being a crucial marker, while beta power measurements are compared to a 5.465 threshold for memory function assessment. Cognitive Assessment To complement the wearable, we developed engaging cognitive games that transform traditional assessments into interactive experiences. Our suite includes memory recall exercises that dynamically adjust memorization times, reaction-based challenges that introduce random variations, and pattern recognition tasks that scale in complexity. These games continuously adapt to player performance, ensuring both engagement and accurate assessment. By combining game performance with our wearable data, we aim to create a comprehensive picture of cognitive health that can detect subtle changes before they become apparent symptoms. The results from all three components - movement, voice, and cognitive games - are displayed through a dashboard that transforms these metrics into clear, actionable insights, enabling earlier intervention when it matters most. How we Built It We integrated our wearable device's data streaming through TCP/IP sockets with a Python backend. For data analysis, we used NumPy for statistical computations of movement metrics like stability indices and jerk calculations. The voice analysis pipeline utilized pre-trained transformer models from Hugging Face for pattern recognition and emotion classification. We built our interactive dashboard using Streamlit and Plotly, creating real-time visualizations of sensor data and health metrics. The system stores user interaction data and cognitive game results in JSON format for persistent tracking and analysis. Challenges We Ran Into Our biggest challenges came from processing multiple data streams simultaneously and extracting meaningful data from voice patterns. Managing continuous sensor input while running voice analysis models required significant performance optimization. We also dealt with calibrating accurate health metric thresholds, especially aligning our voice stability and movement analysis with clinical standards. In overcoming these challenges, we were able to transform raw sensor and voice data into meaningful health insights through our monitoring platform.
Accomplishments we're proud of
Our biggest achievement was successfully integrating complex health monitoring into a single, intuitive interface that makes data accessible and meaningful. We're also particularly proud of our selection of cognitive games, intended to balance assessment and engagement.
What we learned
The development process taught us crucial lessons about balancing real-time data processing with system performance, while maintaining accuracy. We discovered the importance of translating complex clinical metrics into user-friendly insights that anyone can understand. Most importantly, we learned how continuous sensor data, when properly analyzed, can reveal subtle patterns that indicate significant health trends.
What's next
We plan to expand our system by incorporating more sophisticated health metrics, developing additional cognitive games, and refining our threshold detection algorithms based on clinical research. We're also exploring ways to make our platform more accessible through mobile development and improved data visualization techniques.
Install Dependencies:
This repository contains a web application for analyzing cognitive health using multiple modalities including speech, movement (IMU sensor data), and interactive cognitive games. The app is built with Streamlit and includes data analysis using machine learning pipelines, sensor data visualization, and a performance tracker for cognitive games.
Repository Structure
├── static
│ ├── script.js
│ └── style.css
├── imu_client │
├── imu_client.h
│ └── imu_client.ino
├── imu_server
│ ├── imu_server.py
│ └── model_server.py
├── analyze_sensor_data.py
├── cognitive_files.html
├── demo.py
├── diagnostic_model.py
├── feature_extractor.py
├── index.html
├── sensor_metrics.json
└── README.md
Features
-
Voice Analysis:
Analyze speech features (e.g., voice stability, pause count, frequency, etc.) and generate advanced neural metrics and clinical insights. -
Movement Analysis:
Real-time IMU sensor data collection and visualization including movement stability and smoothness metrics. -
Sensor Data Analysis Report:
Process static sensor data from JSON, visualize technical summaries and structured sensor data, and highlight detected situations with visual components. -
Cognitive Games & Performance Tracker:
Play cognitive games and track user performance across multiple games.
Setup and Installation
-
Clone the Repository:
git clone https://github.com/your-username/your-repository.git cd your-repository -
Install Dependencies:
Ensure you have Python 3.7 or later installed. Install the required packages using pip:
pip install streamlit plotly transformers torch numpyOptionally, if you plan to expose the app publicly (e.g., running in Google Colab), install pyngrok:
pip install pyngrok -
(Optional) Set Up Ngrok:
If you wish to expose the app publicly, configure Ngrok by obtaining a token from ngrok.com and following their documentation.
Running the Application
Running the Streamlit App
To start the main application, run:
streamlit run demo.py
This command launches the Streamlit app locally (by default on port 8501). To expose it publicly using Ngrok, you can use the following snippet:
from pyngrok import ngrok
import os
# Run Streamlit in the background
os.system("streamlit run demo.py &")
# Connect Ngrok tunnel to the default Streamlit port (8501)
public_url = ngrok.connect(8501)
print("Streamlit Public URL:", public_url)
Running the Cognitive Games (Optional)
The cognitive games interface is integrated into the Streamlit app in the "Cognitive Games" tab. If you prefer to run a standalone version (e.g., using index.html), you can serve it using Python's HTTP server:
python -m http.server 8000
Then navigate to http://localhost:8000 in your browser.
File Descriptions
-
analyze_sensor_data.py:
Contains theSensorAnalyzerclass for processing raw sensor data, generating technical summaries, performing emotion analysis, detecting movement situations (e.g., tremors, falls), and visualizing sensor data. -
diagnostic_model.py:
Implements a diagnostic model that uses extracted speech features to generate clinical insights and risk assessments. -
feature_extractor.py:
Extracts various features from a provided audio file for voice analysis. -
demo.py:
The main Streamlit application that integrates voice analysis, movement analysis, sensor data reports, and cognitive games into a unified web interface. -
sensor_metrics.json:
A sample JSON file containing sensor metrics data used for sensor data analysis. -
static/
Contains static assets (CSS and JS) used by the cognitive games interface. -
cognitive_files.html:
HTML for the cognitive games interface that is inlined within the Streamlit app. -
index.html:
A standalone HTML page (if needed) for displaying the cognitive games interface.
Troubleshooting
-
Ngrok Issues:
If you experience issues with Ngrok (e.g.,ERR_NGROK_3200), ensure that your Ngrok token is properly configured and that no conflicting tunnels are active. -
Localhost Conflicts:
If you receive errors regarding ports already in use, ensure that no other applications are running on the specified ports (8501for Streamlit and8000for the HTTP server).
Contact
For any questions or feedback, please open an issue or contact ssingh7@mit.edu.
Analysis
View
Metric
- 15
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CIn code
- CSSIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- StreamlitClaimed
5 of 6 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
118 KB
Source files
13
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
Sanskriti-Slngh/CognitiveApp
15 files · 548 KB · @ a8ff0e5
Structure
Interface
2 files · 13%Screens, components and styles rendered to the user.
Application logic
10 files · 67%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python53%
- JavaScript24%
- HTML15%
- Markdown4%
- CSS3%
- C1%
Share of indexed source by file size. Binary and vendored files are excluded.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.