On the Continuity of Rotation Representations in Neural Networks

Yi Zhou, Connelly Barnes, Jingwan Lu, Jimei Yang, Hao Li

Abstract: In neural networks, it is often desirable to work with various representations of the same space. For example, 3D rotations can be represented with quaternions or Euler angles. In this paper, we advance a definition of a continuous representation, which can be helpful for training deep neural networks. We relate this to topological concepts such as homeomorphism and embedding. We then investigate what are continuous and discontinuous representations for 2D, 3D, and n-dimensional rotations. We demonstrate that for 3D rotations, all representations are discontinuous in the real Euclidean spaces of four or fewer dimensions. Thus, widely used representations such as quaternions and Euler angles are discontinuous and difficult for neural networks to learn. We show that the 3D rotations have continuous representations in 5D and 6D, which are more suitable for learning. We also present continuous representations for the general case of the n-dimensional rotation group SO(n). While our main focus is on rotations, we also show that our constructions apply to other groups such as the orthogonal group and similarity transforms. We finally present empirical results, which show that our continuous rotation representations outperform discontinuous ones for several practical problems in graphics and vision, including a simple autoencoder sanity test, a rotation estimator for 3D point clouds, and an inverse kinematics solver for 3D human poses.

Introduction

In computer vision and robotics, neural networks are frequently tasked with predicting 3D rotations. Traditionally, researchers rely on compact representations such as Euler angles (3D), axis-angles (3D), or quaternions (4D). However, these representations suffer from a fundamental topological flaw: they are discontinuous.

Because the space of 3D rotations ($SO(3)$) is topologically complex, any attempt to map it into a Euclidean space of four or fewer dimensions inevitably results in "jumps." For example, in quaternions, $q$ and $-q$ represent the same rotation, creating a "double cover" where the network must suddenly switch signs to represent a continuous motion. Since neural networks are essentially large continuous functions, forcing them to learn a discontinuous mapping leads to high approximation errors and training instability.

Figure 1: Illustration of how a continuous set in the original space can become a disconnected set in a lower-dimensional representation space, creating discontinuities.

Continuous Representations: 5D and 6D

To resolve this, we propose looking for the most continuous representation rather than the most compact one. We introduce two novel representations:

  1. The 6D Representation: We utilize the first two columns of a $3 \times 3$ rotation matrix. To reconstruct a valid rotation matrix (the "decoder" step), we apply a Gram-Schmidt-like process to derive the third column, ensuring all columns are orthogonal and unit-length. This mapping is mathematically proven to be continuous.
  2. The 5D Representation: By applying a stereographic projection to the 6D representation, we can further reduce the dimensionality to 5D while maintaining continuity.

These representations allow the neural network to operate in a space where small changes in rotation correspond to small changes in the representation, eliminating the "jumps" that plague traditional methods.

Experimental Results

We evaluated our continuous representations across three distinct scenarios: a synthetic autoencoder sanity test, 3D point cloud pose estimation using ShapeNet, and inverse kinematics (IK) for human poses using the CMU Motion Capture Database.

Figure 5: Comprehensive empirical results across the three test scenarios, showing mean errors, error percentiles, and summary statistics.

Key Findings

  • Superior Accuracy: In the autoencoder sanity test, the 6D representation achieved a mean error of 0.49°, significantly outperforming quaternions (3.32°) and Euler angles (6.98°).
  • Elimination of Worst-Case Failures: Discontinuous representations often fail catastrophically at specific "jump" angles, with errors reaching 180°. Our continuous representations maintain a low maximum error (e.g., 1.98° in the sanity test).
  • Faster Convergence: The smoother loss landscape provided by continuous mappings allows networks to converge much faster than when using quaternions or Euler angles.
  • Practical Application: In the human IK task, the 6D representation reduced average joint position error to 1.9cm (vs. 3.3cm for quaternions) and avoided the physically impossible "broken" skeletons often produced by discontinuous models.

Conclusion

The difficulty in learning rotations is fundamentally a topological problem. $SO(3)$ cannot be continuously embedded in $\mathbb{R}^4$ or lower. By utilizing 5D or 6D representations, we provide neural networks with a continuous space that aligns with their inherent functional nature, leading to more robust and accurate geometric deep learning.

Summary updated

BibTeX
@inproceedings{zhou2019continuity,
  author = {Yi Zhou and Connelly Barnes and Jingwan Lu and Jimei Yang and Hao Li},
  title = {{On the Continuity of Rotation Representations in Neural Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00589},
}
Figure