Temporal Distance Matrices for Squat Classification

Ryoji Ogata, Edgar Simo-Serra, Satoshi Iizuka, Hiroshi IshikawaWorkshops @ CVPR 2019

Introduction

Proper form is critical in strength training. Common mistakes like a "rounded back" or "inward knees" during a squat are not only inefficient but are significant risk factors for long-term injury. While personal trainers can provide real-time correction, they are often expensive and inaccessible to many.

Automating form correction via computer vision presents unique challenges. Standard video classification models, such as 3D CNNs, often overfit to specific backgrounds, lighting, or clothing. Additionally, variations in human limb lengths make it difficult for coordinate-based models to generalize across different body types. This research introduces a method for squat classification that is invariant to camera angle, background, and individual proportions by utilizing geometric relationships between joints.

Examples of squat form classification, showing correct form and common errors like inward knees and rounded backs.

Methodology: From Pixels to Geometry

The proposed system employs a multi-stage pipeline to transform raw video into an abstract geometric representation:

  1. 3D Pose Estimation: 19 3D keypoints are extracted from each video frame using a pre-trained estimator.
  2. Body Normalization: To account for varying body types, limb lengths are normalized to a unit scale, shifting the model's focus to relative positions and angles.
  3. Temporal Distance Matrices: For every frame, the Euclidean distance between every pair of joints is calculated, forming a symmetric matrix. The upper triangle is flattened into a 171-dimensional vector. This representation is mathematically invariant to global translation and rotation.
  4. 1D Convolutional Neural Network (CNN): These vectors are sequenced over time to create a "temporal distance matrix." A ResNet-based architecture with 1D convolutions then classifies the sequence as "Good" or one of six common mistakes.
A temporal sequence of a squat with a 'rounded back' error highlighted.

Datasets and Evaluation

To evaluate the model, the authors curated four distinct datasets:

  • Single Individual: 2,001 videos of one person for baseline performance.
  • Multiple Individual: 599 videos of 14 people to test body-type generalization.
  • Background Change: 2,001 videos designed to test robustness against environmental clutter.
  • YouTube Dataset: 23 real-world videos for "in the wild" testing.

Key Results and Insights

The geometric approach demonstrated significant advantages over traditional pixel-based methods:

  • Environmental Robustness: On the "Background Change" dataset, the proposed method achieved 75.00% accuracy, outperforming 3D ResNet50 (64.66%) and Non-local Networks (69.48%).
  • Generalization through Normalization: Body normalization improved accuracy on the diverse YouTube dataset from 73.91% to 78.26%, highlighting the importance of skeletal scaling.
  • Canonical Pose Importance: Performance increased when the model was forced to start sampling from a "canonical" standing pose, reaching 81.05% on the single-subject dataset.

Conclusion and Future Work

By prioritizing geometry over raw pixels, this method achieves superior generalization across different environments and body types. However, the system's accuracy is tied to the quality of the initial 3D pose estimation. Future improvements could include adding more torso keypoints to better detect subtle back curvature and extending this "temporal distance matrix" approach to other domains like physical therapy or dance.

Summary updated

BibTeX
@inproceedings{ogata2019temporal,
  author = {Ryoji Ogata and Edgar Simo-Serra and Satoshi Iizuka and Hiroshi Ishikawa},
  title = {{Temporal Distance Matrices for Squat Classification}},
  booktitle = {Workshops @ CVPR},
  year = {2019},
  doi = {10.1109/cvprw.2019.00309},
}
Figure