Eigendecomposition-free Training of Deep Networks with Zero Eigenvalue-based Losses

Zheng Dang, Kwang Moo Yi, Yinlin Hu, Fei Wang, Pascal Fua, Mathieu Salzmann

Abstract: Many classical Computer Vision problems, such as essential matrix computation and pose estimation from 3D to 2D correspondences, can be solved by finding the eigenvector corresponding to the smallest, or zero, eigenvalue of a matrix representing a linear system. Incorporating this in deep learning frameworks would allow us to explicitly encode known notions of geometry, instead of having the network implicitly learn them from data. However, performing eigendecomposition within a network requires the ability to differentiate this operation. Unfortunately, while theoretically doable, this introduces numerical instability in the optimization process in practice. In this paper, we introduce an eigendecomposition-free approach to training a deep network whose loss depends on the eigenvector corresponding to a zero eigenvalue of a matrix predicted by the network. We demonstrate on several tasks, including keypoint matching and 3D pose estimation, that our approach is much more robust than explicit differentiation of the eigendecomposition, It has better convergence properties and yields state-of-the-art results on both tasks.

Introduction

In classical computer vision, fundamental tasks like estimating camera motion (Essential Matrix) or determining 3D pose (PnP problem) are typically solved by finding the "null space" of a matrix. Mathematically, this involves identifying the eigenvector associated with the smallest (ideally zero) eigenvalue. Integrating these geometric solvers into deep learning models allows networks to respect physical laws and learn from less data. However, training these models end-to-end requires backpropagating gradients through Eigendecomposition (ED) or Singular Value Decomposition (SVD), which presents significant challenges.

The Challenge of Eigendecomposition in Deep Learning

Differentiating through ED/SVD is notoriously unstable for two main reasons. First, the mathematical formulation involves dividing by the difference between eigenvalues; if two eigenvalues are nearly equal, gradients explode. Second, as a network's predicted matrix evolves during training, the "smallest" eigenvalue may suddenly swap places with another. This "eigenvector switching" causes massive, discontinuous jumps in the gradient, often leading to optimization failure.

Figure 1: Illustration of the eigenvector switching problem. In standard SVD-based training, small changes in the predicted matrix can cause the 'smallest' eigenvalue to swap with another, leading to gradient instability.

Methodology: Eigendecomposition-free Loss

This paper proposes a loss function that bypasses the need for explicit ED/SVD during both the forward and backward passes. Instead of differentiating the solver itself, the authors define a loss based on the properties of the matrix $\mathbf{M}$ predicted by the network. Given a ground-truth eigenvector $\tilde{\mathbf{e}}$, the loss is constructed from two terms:

  1. Minimization Term: The network minimizes $\tilde{\mathbf{e}}^T \mathbf{M} \tilde{\mathbf{e}}$. When this value is zero, $\tilde{\mathbf{e}}$ is effectively in the null space of $\mathbf{M}$.
  2. Anti-Triviality Term: To prevent the network from outputting a trivial zero matrix, this term forces the matrix to have a large trace (sum of eigenvalues) in directions orthogonal to the ground truth.

By focusing on the ground-truth solution rather than the solver's output, the loss landscape becomes significantly smoother, and the eigenvector switching problem is entirely avoided.

Experimental Results

The authors evaluated their approach across several benchmarks, including the SUN3D dataset for keypoint matching and various synthetic and real-world datasets for PnP pose estimation.

  • Optimization Stability: In toy plane-fitting experiments, the proposed method converged smoothly in a few hundred iterations, whereas standard SVD-based training often required millions of iterations or failed to converge.
  • Keypoint Matching: The method achieved state-of-the-art results on the SUN3D and Strecha datasets. Unlike previous approaches, it did not require a "warm-up" phase with auxiliary losses to stabilize training.
  • Robustness in Pose Estimation: The deep network trained with this loss proved incredibly robust to outliers. In PnP experiments, the model maintained high accuracy even when 65% of the input data points were random outliers, significantly outperforming traditional solvers like EPnP and REPPnP.

Conclusion

By introducing an eigendecomposition-free loss, this work provides a robust framework for incorporating geometric constraints into deep learning. The approach eliminates the numerical instabilities associated with differentiating through SVD/ED, leading to faster convergence and superior performance in complex geometric tasks. Future work may extend this formulation to non-zero eigenvalue problems and self-supervised settings.

Summary updated

Abstract

Many classical Computer Vision problems, such as essential matrix computation and pose estimation from 3D to 2D correspondences, can be solved by finding the eigenvector corresponding to the smallest, or zero, eigenvalue of a matrix representing a linear system. Incorporating this in deep learning frameworks would allow us to explicitly encode known notions of geometry, instead of having the network implicitly learn them from data. However, performing eigendecomposition within a network requires the ability to differentiate this operation. Unfortunately, while theoretically doable, this introduces numerical instability in the optimization process in practice. In this paper, we introduce an eigendecomposition-free approach to training a deep network whose loss depends on the eigenvector corresponding to a zero eigenvalue of a matrix predicted by the network. We demonstrate on several tasks, including keypoint matching and 3D pose estimation, that our approach is much more robust than explicit differentiation of the eigendecomposition, It has better convergence properties and yields state-of-the-art results on both tasks.
BibTeX
@inproceedings{dang2018eigendecomposition,
  author = {Zheng Dang and Kwang Moo Yi and Yinlin Hu and Fei Wang and Pascal Fua and Mathieu Salzmann},
  title = {{Eigendecomposition-free Training of Deep Networks with Zero Eigenvalue-based Losses}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01228-1\_47},
}
Figure