Honestly, I never planned to build something like SleepMetrics. Not at first.
I developed CardioMetrics-Core what is an AI-powered desktop application that analyzes clinical data to evaluate cardiovascular risk levels and provide real-time health insights using machine learning models.
And I enjoyed developing the CardioMetrics project. And I thought, could I create a similar application related to health? And thatβs how Sleepmetrics was created.
β¨ My Approach
I wanted SleepMetrics to be more than just a spreadsheet of numbers. The tool needed to be simple, functional, and professional.
CustomTkinter ended up being a surprisingly good fit once again. I maintained the light/dark modes to ensure the interface felt comfortable to use especially important for an app you might check at night.
Real-time Visualization: I integrated live gauges that react to your data. When you adjust stress levels or physical activity, the app provides immediate visual feedback.
Personalized Sleep Insights: The app doesn't just show numbers; it provides specific guidance based on sleep duration, activity levels, and stress to help you optimize your rest.
π©Ί Smart Health Recommendations
Based on the lifestyle and clinical data entered, SleepMetrics generates a dynamic dashboard of personalized suggestions. These aren't generic tips; they are reactive nudges triggered by your specific metrics:
π§ Disorder & Quality Alerts
SleepMetrics transforms your data into three different health statuses based on the machine learning modelβs findings:
Sleep Apnea Risk Detected π¨: If the model identifies patterns consistent with Apnea, the app triggers a high-priority alert (Red) recommending a consultation with an ENT specialist.
Insomnia Symptoms Detected β οΈ: When insomnia markers appear, the app provides practical tips, such as cutting out blue light sources 2 hours before bed to help your brain naturally produce melatonin.
Healthy / Asymptomatic β : If no risks are detected, the app encourages you to keep up the good work, confirming your data aligns with a healthy sleep profile.
π Parameter Specific Health Recommendations
Stress Management π§: If stress levels exceed 7/10, the app suggests pre-sleep breathing exercises to lower cortisol levels.
Sleep Duration β°: Logging less than 6 hours triggers a warning about the lack of physical repair and encourages a 7+ hour target.
Activity & Movement π£: Low step counts (< 5,000) or low activity trigger a reminder that reaching 7,500 steps can shorten the time it takes to fall asleep by 15%.
Heart Rate & BP β€οΈ: High readings prompt advice to reduce caffeine intake and monitor vitals more closely.
Note: Theyβre not the a substitute for professional medical advice, diagnosis, or treatment. It just a simple advices and friendly nudges to support your heart health.
π The Tech Stack & Model
For the backend, I used these datasets Sleep Health and Lifestyle and Sleep Cycle and Productivity from Kaggle.
I built a dual-engine system:
Quality Prediction: A
RandomForestRegressor(150 estimators) handles the sleep quality score with a 99.08% $R^2$ accuracy.Diagnosis: A GradientBoostingClassifier predicts potential sleep disorders with 88% accuracy.
The model provides a signal: "maybe check this out."
π Why Two Languages? (EN/TR)
As Iβm Turkish, I developed the app in Turkish first. But health is universal. I restructured the project to have clean v_EN and v_TR folders so language would never be a barrier to access.
π₯οΈ Choose Your Experience: (Web, Desktop, or Code)
People have different preferences. Some want instant access, some prefer a standalone desktop app, some just want the code.
So I made three options:
- Streamlit Web App: quick access β SleepMetrics Streamlit App
-
Desktop App: A pre-built
.exefile (no Python environment required). Just download and run. -
Source Code: Cleanly structured folders with clear
EN/TRseparation for the curious.
π Explore the Project
lemancaliskan
/
SleepMetrics
Sleep Health & Lifestyle Analysis Tool: An AI-powered desktop application that analyzes biometric data to predict sleep quality and detect potential sleep disorders using machine learning models.
π SleepMetrics - Sleep Health & Lifestyle Analysis Tool
SleepMetrics is a modern desktop application designed to analyze sleep quality and predict potential sleep disorders using advanced machine learning algorithms. By processing lifestyle and clinical data through a sleek, high-DPI interface, it provides users with data-driven insights into their sleep health.
πΊ Demo
π¨ Visual Experience
The application features a dedicated toggle for seamless switching between light and dark modes.
Features integrated real-time gauges for the live visualization of sleep quality scores.
π Desktop Application (EN/TR)
Optimized for a 980x666 centered window layout, this standalone application delivers a precision-focused, localized experience through a theme-aware CustomTkinter UI designed for both global and local users.
π Web Application (Streamlit):
A responsive and lightweight web version for instant access from any device.

β¨ Features
-
Dual Language Support: Optimized interfaces for both English (EN) and Turkish (TR).
-
Modern GUI: Aβ¦
- Streamlit Web App: Try it here
-
Desktop App: Pre-built
.exeavailable in GitHub Releases.
π€ Contributing
If you have ideas on how to improve the ML model or want to suggest new features for the UI, feel free to open an issue or a Pull Request on GitHub. Letβs build better health tools together!
Medical Disclaimer: This software is for informational purposes only. The results provided do not constitute a formal medical diagnosis. Always consult with a professional healthcare provider before making any medical decisions.






Top comments (0)