Inspiration
We’ve all been there: It’s 2 AM, you’re staring at a blank IDE, and you’re telling yourself, "I’m fine. I just need to push through."
In university, this is often called "The Duck Syndrome"—looking calm and gliding smoothly on the surface, but paddling furiously and panic-stricken underneath. We realized that traditional wellness apps have a major flaw: they rely on you admitting you are stressed. But when we are closest to burnout, we are often the least likely to open an app and journal about it.
We wanted to build something that doesn't just ask how you are, but actually notices how you are. We wanted to build a "Digital Check-in" that sees the shaking hands, the erratic typing, and the tired eyes—even when we try to hide them.
What it does
The Invisible Monitor is a wellness companion that bridges the gap between your physical behavior and your mental state. It works by comparing what you say with how you act.
- The Invisible Sensors (Backend): A background program silently analyzes your "digital body language." It looks for jittery mouse movements, erratic typing rhythms, and "heavy fingers" (fatigue) without ever recording what you actually type.
- The Visible State (Frontend): When you journal, the camera briefly scans your facial expressions to see if you are smiling, frowning, or just exhausted.
- The Reality Check (AI): It combines your diary entry, your face, and your biological stress data into a single prompt for Google Gemini. The AI then acts as an empathetic friend, spotting contradictions (e.g., "You wrote that you're 'doing great', but your typing is frantic and your face looks sad"), and offers a gentle, reality-grounded intervention.
How we built it
We built the project using a "Nervous System" architecture, separating the raw hardware data from the user interface.
1. The Nervous System (Java)
We used Java and JNativeHook to listen to the operating system's input events. We didn't want to use generic "activity tracking," so we implemented specific research on psychomotor vigilance to model the human nervous system:
- Panic Typing (Arrhythmia): When we are anxious, we lose our rhythm. We calculate the Coefficient of Variation (CV) of the flight time between keystrokes:
Where is the consistency (standard deviation) and is the speed. If the variance spikes (), the system detects anxiety.
- Burnout (Motor Fatigue): When the central nervous system is tired, the signal to "lift" a finger is delayed. We track the specific "Dwell Time" (how long a key is held down). If the average dwell time exceeds , we flag it as physical sluggishness.
- Muscle Tension (Mouse Dynamics): Stress makes our muscles stiff. We model this by comparing the actual path of the mouse to the ideal straight line:
If the movement is inefficient or jittery, we interpret it as physiological stress.
2. The Bridge (Python & Flask)
Since our Java backend runs deep in the OS, and our frontend runs in a browser, they couldn't talk directly. We built a lightweight Python Flask server to act as the "Brain." It reads the live biometric data from a shared JSON stream and serves the web interface.
3. The Interface (HTML & Face-API)
For the frontend, we used face-api.js to detect emotions directly in the browser. We also built a multimedia diary that uses IndexedDB, allowing users to save video and audio logs locally on their machines so their personal vent sessions remain private.
Challenges we faced
- The "Mac OS Trap": Modern operating systems really don't like programs listening to keyboards (for good reason!). We spent hours debugging security permissions on macOS just to get our Java "sensors" to run without being blocked as malware.
- The "Flow State" vs. "Panic" Problem: Initially, our code couldn't tell the difference between someone typing fast because they were in the "zone" (Flow State) and someone typing fast because they were panicking. We had to fine-tune our math to punish instability rather than just speed.
- Connecting the Dots: Java and JavaScript don't play nice together. We had to engineer a robust file-locking system so our Python server could read the Java data in real-time without crashing when both programs tried to access the file at the exact same millisecond.
What we learned
We learned that human data is messy. A smile doesn't always mean happy, and a pause doesn't always mean rest. The true power of AI isn't just in analyzing text, but in context. By feeding Gemini the conflict between our face and our hands, we turned a simple chatbot into a genuinely insightful companion.
Built with
- Java (Backend Biometrics)
- JNativeHook (OS Event Listening)
- Python / Flask (Middleware & API Handling)
- HTML5 / W3.CSS (Frontend UI)
- face-api.js (Computer Vision)
- IndexedDB (Local Data Storage)
- Google Gemini API (AI Analysis)
Built With
- google-gemini-api
- html5
- java
- javascript
- python
Log in or sign up for Devpost to join the conversation.