Inspiration

Stress is often invisible until it starts affecting productivity, focus, or mental well-being. Many existing stress-monitoring solutions rely on wearables or self-reported surveys, which can be intrusive or inconsistent. I was inspired by the idea that everyday digital behavior—specifically typing patterns—can reflect cognitive and emotional states. This led me to explore whether stress could be detected passively through typing behaviour.

What it does

Stress Prediction Using Typing Behaviour is a web application that predicts a user’s stress level based on how they type. As users type text into the application, the system captures keystroke dynamics such as typing speed, pause duration, and error rate. These features are processed by a machine learning model to classify stress levels as Low, Medium, or High, providing instant, non-intrusive feedback.

How we built it

I built the application using a lightweight full-stack approach. The frontend was developed using HTML, CSS, and JavaScript to capture real-time typing behaviour. The backend was implemented using Python and Flask, which processes the typing features and feeds them into a machine learning model built with scikit-learn. A synthetic dataset was used to train the model, allowing us to simulate stress patterns and keep the system explainable and beginner-friendly.

Challenges we ran into

One major challenge was the lack of publicly available datasets linking typing behaviour directly to stress levels. To address this, I designed a synthetic dataset based on behavioral assumptions supported by research. Another challenge was accurately capturing and processing keystroke data in real time while keeping the application responsive and simple for users.

Accomplishments that we're proud of

I am proud of building a fully functional, end-to-end AI application within the hackathon timeframe. The project successfully demonstrates how behavioral data can be used for mental well-being analysis in a non-intrusive way. I also focused on making the solution easy to understand and explain, which is important for real-world adoption.

What we learned

Through this project, I learned how behavioral features can be engineered for machine learning models, even when real datasets are limited. We also gained experience in integrating frontend data collection with backend ML inference, and learned how to balance technical complexity with clarity and usability in a hackathon setting.

What's next for Stress Prediction Using Typing Behaviour

In the future, I plan to improve model accuracy by collecting real-world typing data with user consent. I also aim to add real-time dashboards, personalized stress insights, and wellness recommendations. With further development, this solution could be extended into workplace tools, educational platforms, or browser extensions for continuous stress monitoring.

Share this project:

Updates