Fitness-AQAML / Computer Vision

Evaluate human motion with precision and deep networks.

A pose-based machine learning pipeline that automatically detects unsafe exercise form using standard camera input, utilizing MediaPipe and Temporal Convolutional Networks.

Explore Architecture
Gym athlete overhead press in monochrome lighting
Pose CaptureTCN Stream
Normalized Joint Velocities222 Features/Frame
Lightweight TCN Core147k Parameters
Strict Subject SplitsZero Data Leakage

4,979

Annotated repetitions

222

Features per frame

33

Body landmarks tracked

147k

Model parameters

Motivation

The Silent Epidemic

Poor exercise form is a major cause of injuries, yet the vast majority of athletes train without real-time supervision. They repeat the exact same errors over and over until they inevitably lead to injury.

Human supervisionorHardware-heavy motion capture systems

Current solutions are completely unscalable. Our objective is to automatically evaluate posture and classify exercises to provide corrective feedback using a software-based alternative on standard RGB video.

Incorrect Joint Angles

Incorrect Joint Angles

Knee valgus, elbow flare, shoulder impingement — small angular errors that compound into serious injuries over time.

Poor Spinal Alignment

Poor Spinal Alignment

Lumbar rounding under heavy load creates dangerous shear forces on the spine. A problem invisible to the lifter themselves.

Asymmetric Movement

Asymmetric Movement

Left-right imbalances and uneven loading patterns lead to chronic overuse injuries that develop gradually.

Why Machine Learning

Rules Can't
Keep Up

The same joint angle can mean “perfect form” in one exercise and “injury risk” in another. Fixed rules break down when the real world is this complex.

1

Context-Dependent

Same knee angle is correct for squats but dangerous for lunges. ML learns the context.

2

High Variability

Different body types, camera angles, and movement speeds make hard-coded rules impractical.

3

Pattern Recognition

ML learns from massive datasets (like Fitness-AQA) and generalizes across users and environments.

Rule-Based Approach

“If knee angle < 90°, flag as unsafe”

Breaks with different exercises, body types, camera angles

ML Approach

Learns from 4,979 annotated repetitions across the Fitness-AQA dataset

Generalizes to new users, angles, and speeds automatically

Proposed Pipeline

End-to-End Architecture

A multi-stage machine learning pipeline performing pose extraction, feature normalization, and temporal action quality assessment.

Step 01

Input Data

Unprocessed video clips representing single repetitions of compound barbell exercises, capturing high variance in tempo and camera angles.

Step 02

Pose Estimation

MediaPipe extracts 33 body landmarks per frame. Missing frames are linearly interpolated and coordinates are normalized using shoulder width and hip centering.

Step 03

Temporal Processing

A Temporal Convolutional Network (TCN) processes 222 biomechanical features (coordinates, 12 joint angles, velocities) over a fixed sequence of 100 frames.

Step 04

Multi-Task Output

Dual heads perform classification to predict specific form errors and regression to generate a composite score of exercise quality.

222 features per frame

Each video frame is transformed into a rich feature vector combining spatial positions, joint mechanics, and movement dynamics.

99Landmark coordinates (33 x 3)
12Joint angles via law of cosines
111Velocity features (first-order)

88%

Reduction in variance via hip-centred normalization

The Datasets

Trained on Real Data

The Fitness-AQA dataset provides 4,979 annotated repetitions across compound exercises, with temporal error annotations and subject-level splits to guarantee robust modeling.

Back Squat

1,934reps
251subjects

Error Prevalence

Knees ForwardTemporal
68.1%
Shallow DepthBinary
31.4%
Knees InwardTemporal
13.6%
~7.7 reps/subjectZero subject leakageTrain/Val/Test splits
Built with:MediaPipePyTorchTCNAdamWHuber LossBCE + pos_weight
Architecture

Under the Hood

A Temporal Convolutional Network with dual-task heads — lightweight enough for real-time deployment, powerful enough to catch subtle form errors.

Why TCN over LSTM?

All timesteps processed simultaneously — parallelizable on GPU, no sequential bottleneck.

Exponential Dilation

Dilations of 1, 2, 4, 8, 16, 32 — the final block sees the entire 100-frame sequence.

Dual Output Heads

Quality score regression via Huber Loss + error classification via BCE with pos_weight up to 12x for rare errors.

Lightweight Model

Only ~147k parameters. Small enough for mobile deployment, large enough to capture complex biomechanics.

Regularization Stack

Dropout 0.2, weight decay 1e-4, gradient clipping at 1.0, early stopping with patience of 10 epochs.

Model ArchitectureTCN Core

Temporal Convolutional Network

100 frames222 featuresd=1d=2d=4d=8d=16d=32ScoreErrors

147k

Parameters

6

TCN Blocks

100+

Receptive Field