Mitul Aggarwal
Completed ETH KI Challenge Winner

AI Personal Trainer

Real-time pose estimation for accessible physiotherapy feedback

AI / Computer Vision / Health Technology

Python MediaPipe OpenCV Tkinter Pose estimation Joint angle calculation
AI Personal Trainer application interface
The working AIPT prototype in use: live pose tracking, repetition logic, form scoring, and simple corrective feedback on screen.

Project Story

I started AIPT after a lower-back spasm from badminton. In physio, every repetition felt safe because someone was watching my posture and correcting me immediately. At home, the same exercises felt different. I kept wondering whether I was helping the injury or making it worse. That was the starting point: could a normal laptop camera act like a second pair of eyes when a physio or coach is not there?

Why I Built It

The problem was not just counting reps. The real problem was confidence. Rehab exercises only work if you do them consistently and correctly, but most people do them alone between appointments. I also had friends recovering from knee injuries who felt the same hesitation: they wanted to train, but they did not fully trust their form.

What I Built

I built a desktop app around MediaPipe, OpenCV, and a Tkinter interface. The camera finds body landmarks, my code turns those landmarks into joint angles and movement phases, and the app gives direct cues such as back position, knee drift, and range of motion. I also added an injury-aware flow so the user can enter pain location, sport history, and recovery context before starting.

What I Did

  • Designed and built the full app from the original idea to a working prototype
  • Wrote the pose-estimation, angle-calculation, smoothing, and repetition logic
  • Built the GUI so the feedback felt like coaching rather than raw data
  • Tested the app on real rehab-style movements and tuned it from repeated video trials
  • Presented the project at ETH KI Challenge 2025

How I Built It

Build Flow

Webcam input -> MediaPipe pose detection -> joint angle computation -> threshold comparison -> real-time UI feedback loop.

How It Works

The app reads webcam frames, extracts 33 body landmarks with MediaPipe, ignores low-confidence landmarks, and smooths the motion so a single bad frame does not trigger a false warning. For each exercise, it watches the angles that matter most, such as knee flexion, torso position, elbow angle, or back alignment, then uses multi-frame checks to decide whether a rep actually happened.

Software

  • Python
  • MediaPipe
  • OpenCV
  • Tkinter

What Was Hard

  • Early versions sometimes treated furniture as body landmarks, which made the feedback obviously wrong
  • Noisy keypoints made the rep counter jump unless I smoothed the motion over time
  • Different camera angles and body types changed the joint ranges more than I expected
  • The feedback had to be short enough to read while exercising
System architecture diagram

Build Reference

Data path from user input to camera capture, pose landmarks, joint-angle logic, corrective feedback, and plan generation.

Click to inspect

Demos and Build Notes

Product Demos

Complete working prototype: MediaPipe landmarks, vector-based angle calculations, EMA smoothing, repetition detection, form scoring, and GUI feedback running live. This build won the ETH Zurich KI Challenge in the AI for Good category.
First version with live corrective feedback. The system tracks bicep curls, analyses joint angles in real time, and displays posture cues when movement moves outside safe ranges.
Early MediaPipe and OpenCV overlay test, validating the real-time camera pipeline before scaling from hand tracking to full-body pose analysis.
Code walkthrough showing the implementation behind the pose pipeline, geometry utilities, feedback checks, and UI integration.

Photos and Notes

Project photos

Early ETH KI Challenge planning: problem statement, rehab and beginner-gym user cases, and the goal of turning a laptop or phone camera into an always-available form coach.

Handwritten AI Personal Trainer ideation notes

Handwritten AI Personal Trainer ideation notes
Early ETH KI Challenge planning: problem statement, rehab and beginner-gym user cases, and the goal of turning a laptop or phone camera into an always-available form coach.
System flow from user injury details and exercise selection through MediaPipe pose detection, joint-angle calculation, and real-time feedback overlay.

Hand-drawn AI Personal Trainer system flow diagram

Hand-drawn AI Personal Trainer system flow diagram
System flow from user injury details and exercise selection through MediaPipe pose detection, joint-angle calculation, and real-time feedback overlay.
Computer-vision planning notes covering orientation handling, exercise-specific relevant angles, unsafe-form detection, beginner prompts, form scoring, and set or break detection.

Computer vision planning notes for AI Personal Trainer

Computer vision planning notes for AI Personal Trainer
Computer-vision planning notes covering orientation handling, exercise-specific relevant angles, unsafe-form detection, beginner prompts, form scoring, and set or break detection.
First full-body overlay tracking shoulders, elbows, hips, knees, and wrists, which proved the camera feed and joint detection could run smoothly in real-world lighting.

Full-body pose overlay for AI Personal Trainer

Full-body pose overlay for AI Personal Trainer
First full-body overlay tracking shoulders, elbows, hips, knees, and wrists, which proved the camera feed and joint detection could run smoothly in real-world lighting.
Annotated overlay showing the shift from visual pose detection to analytical motion assessment with exercise phase, repetition count, and live form score.

Annotated skeleton overlay with exercise metrics

Annotated skeleton overlay with exercise metrics
Annotated overlay showing the shift from visual pose detection to analytical motion assessment with exercise phase, repetition count, and live form score.
GUI integration milestone: exercise-plan buttons were connected to the OpenCV backend so choosing an exercise launched a live coaching session with scoring and feedback.

AI Personal Trainer GUI before and after backend integration

AI Personal Trainer GUI before and after backend integration
GUI integration milestone: exercise-plan buttons were connected to the OpenCV backend so choosing an exercise launched a live coaching session with scoring and feedback.
ETH Zurich KI Challenge recognition for the AI Personal Trainer project in the AI for Good category.

ETH KI Challenge winning recognition for AI Personal Trainer

ETH KI Challenge winning recognition for AI Personal Trainer
ETH Zurich KI Challenge recognition for the AI Personal Trainer project in the AI for Good category.
Competition result confirmation for AIPT, documenting the project outcome alongside the technical build.

AI Personal Trainer award confirmation

AI Personal Trainer award confirmation
Competition result confirmation for AIPT, documenting the project outcome alongside the technical build.

Technical Evidence

Screenshots

Core geometry utilities: calculate_angle(a, b, c), vertical and horizontal alignment helpers, and orientation estimation convert raw landmarks into biomechanical signals.

Pose geometry utility code for AI Personal Trainer

Pose geometry utility code for AI Personal Trainer
Core geometry utilities: calculate_angle(a, b, c), vertical and horizontal alignment helpers, and orientation estimation convert raw landmarks into biomechanical signals.
Exercise-specific feature extraction selects only the relevant metrics for each movement, such as knee, torso, back, neck, elbow, and arm-verticality values.

Exercise-specific pose metric extraction code

Exercise-specific pose metric extraction code
Exercise-specific feature extraction selects only the relevant metrics for each movement, such as knee, torso, back, neck, elbow, and arm-verticality values.
Quantitative validation of smoothing and phase detection. EMA smoothing and multi-frame validation reduced jitter and aligned repetition markers with squat cycles while maintaining around 18-20 FPS.

Quantitative analysis of smoothed and unsmoothed squat tracking

Quantitative analysis of smoothed and unsmoothed squat tracking
Quantitative validation of smoothing and phase detection. EMA smoothing and multi-frame validation reduced jitter and aligned repetition markers with squat cycles while maintaining around 18-20 FPS.
Additional motion-analysis plots used to tune thresholds, compare smoothed versus noisy joint-angle traces, and verify stable real-time repetition counting.

AI Personal Trainer quantitative tracking analysis

AI Personal Trainer quantitative tracking analysis
Additional motion-analysis plots used to tune thresholds, compare smoothed versus noisy joint-angle traces, and verify stable real-time repetition counting.

Results & Impact

  • 1st Prize, AI for Good - ETH KI Challenge 2025
  • Working prototype with real-time corrective feedback, rep counting, and form scoring
  • Prize funding and investor interest created a path to expand the exercise and injury library
  • Validated approach for accessible at-home rehabilitation support

What I Learned

  • Pose estimation accuracy depends heavily on camera angle, lighting, confidence filtering, and temporal smoothing
  • In health tools, a wrong cue can be worse than no cue, so feedback must be conservative and legible
  • The most useful interface is the one that gives confidence during the exact moment of uncertainty

Next Steps

  • Mobile deployment with on-device inference
  • Exercise library expansion with clinician-validated protocols
  • Integration with progress tracking and session history