MEDA is a high-performance Hybrid System Architecture designed to bridge the gap between doctors and patients during physical therapy. By leveraging AI-driven exercise tracking, the project combines the flexibility of Python's AI ecosystem with the memory safety and blazing speed of Rust. π
The project is engineered as a multi-layered system, ensuring high stability and real-time performance:
- π§ Logic & AI Layer (Python): Utilizes
MediaPipeandOpenCVfor real-time biomechanical analysis. It tracks human landmarks to ensure exercises are performed with the correct form. - βοΈ System & UI Layer (Rust): Features an embedded Python interpreter via the
pyo3library. The frontend is built withSlint UI, providing a lightweight, native desktop experience with minimal resource overhead. - π Safety & Concurrency: Implements Rust's
Arc,Mutex, andAtomicBoolprimitives to manage the AI lifecycle and UI thread safely, preventing race conditions during high-frequency data streaming.
- ποΈ Real-Time AI Tracking: Automated detection and counting of exercises (e.g., squats) with goal-based feedback.
- π FFI Integration: Seamless Foreign Function Interface communication between Python's data processing and Rust's system management.
- β‘ High Performance: Processed at 30 FPS (approx. 33ms latency) for a lag-free user experience.
- π¨ββοΈ Doctor Control Panel: A dedicated management module for patient registration and graphical data analysis.
- Clone the repository:
git clone [https://github.com/yourusername/MEDA.git](https://github.com/CSDC-K/MEDA.git)
- Install Python dependencies:
pip install -r requirements.txt
- Build and run the Rust application:
cargo run --release
MEDA is currently in its MVP (Minimum Viable Product) phase. While the core AI detection is fully functional, the following architectural expansions are planned:
[DEVELOPER VISION]: π‘ To ensure data integrity between the physician and the patient, I designed a Key-Based Verification Protocol.
The Architecture:
- Dynamic Key Generation: Every exercise request sent by the doctor generates a unique, algorithmic key (e.g.,
SQ15|20260101|RANDOMKEY).
SQ15: Encodes the Exercise Type and Target Amount.|20260101|: Timestamp for session validation.RANDOMKEY: A unique salt to prevent replay attacks.- Verification Engine: The patientβs application (Rust) decodes this key upon arrival, initializing the AI model with specific parameters (e.g., 15 Squats).
- Asynchronous Reporting: Upon completion, the system would generate a
completed-exercises.jsonfile. This file acts as a local ledger, which is then parsed and transmitted back to the doctor via a secure SMTP bridge, using the unique Key as the primary identifier to ensure that only verified, doctor-requested sessions are logged.
- Kuzey - Lead Software Architect
- π οΈ Focus: Rust Systems, Python AI, FFI, and Desktop UI Engineering.
- π― Goal: Engineering production-ready, safety-critical software.
This project was developed for the TUBITAK science competition to showcase how complex, cross-language systems (Rust & Python) can solve real-world healthcare challenges.