Geometry Aware Constrained Optimization Techniques for Deep Learning

Soumava Kumar Roy, Zakaria Mhammedi, Mehrtash Harandi

Abstract

In this paper, we generalize the Stochastic Gradient Descent (SGD) and RMSProp algorithms to the setting of Riemannian optimization. SGD is a popular method for large scale optimization. In particular, it is widely used to train the weights of Deep Neural Networks. However, gradients computed using standard SGD can have large variance, which is detrimental for the convergence rate of the algorithm. Other methods such as RMSProp and ADAM address this issue. Nevertheless, these methods cannot be directly applied to constrained optimization problems. In this paper, we extend some popular optimization algorithm to the Riemannian (constrained) setting. We substantiate our proposed extensions with a range of relevant problems in machine learning such as incremental Principal Component Analysis, computating the Riemannian centroids of SPD matrices, and Deep Metric Learning. We achieve competitive results against the state of the art for fine-grained object recognition datasets.

1. Introduction

Standard deep learning optimization typically assumes a flat Euclidean parameter space. However, many machine learning problems are inherently constrained. For example, in Principal Component Analysis (PCA), the weight matrices are required to be orthonormal, defining a Stiefel manifold. In metric learning, the parameters often represent a distance metric that must remain within the space of Symmetric Positive Definite (SPD) matrices.

Applying standard Euclidean optimizers like Stochastic Gradient Descent (SGD) or RMSProp to these problems often results in parameters drifting away from the constraint set. While one can "snap" parameters back via projection, this can be inefficient and lead to poor convergence. This paper proposes a more principled approach: Riemannian optimization, where the optimizer is aware of the manifold's geometry.

2. Riemannian Optimization Framework

A Riemannian manifold $\mathcal{M}$ is a mathematical space that is locally Euclidean but globally curved. At any point $\theta \in \mathcal{M}$, there exists a tangent space $T_\theta \mathcal{M}$. Optimization on a manifold involves three key components:

  • Gradients on Manifolds: The Riemannian gradient is the orthogonal projection of the Euclidean gradient onto the tangent space.
  • Retractions: After taking a step in the tangent space, a retraction mapping is used to map the result back onto the manifold surface.
  • Parallel Transport: To use historical information (like momentum), vectors must be "transported" from one tangent space to another as the point $\theta$ moves along the manifold.

3. Proposed Algorithms: cSGD-M and cRMSProp

We introduce two novel algorithms that extend popular Euclidean optimizers to the Riemannian setting.

cSGD-M (Constrained SGD with Momentum): Standard momentum updates involve adding a fraction of the previous update to the current gradient. On a manifold, the previous update $\mathbf{m}^{(t-1)}$ lives in $T_{\theta^{(t-1)}} \mathcal{M}$, while the current gradient lives in $T_{\theta^{(t)}} \mathcal{M}$. We use parallel transport to move $\mathbf{m}^{(t-1)}$ to the current tangent space before updating, ensuring geometric consistency.

Riemannian optimization with momentum and parallel transport.

cRMSProp (Constrained RMSProp): Similarly, cRMSProp maintains a moving average of squared gradients. By using parallel transport, we ensure that the historical gradient information remains valid as the optimizer traverses the curved surface of the manifold.

4. Experimental Evaluation and Results

We evaluated the proposed methods across several tasks, including Incremental PCA on the YaleB and MNIST datasets, and Deep Metric Learning on fine-grained object recognition benchmarks like CUB-200-2011 and CARS196.

Convergence in PCA

Our experiments demonstrate that geometry-aware optimizers consistently outperform their Euclidean counterparts in both convergence speed and final accuracy. As shown in the figure below, cRMSProp and cSGDM achieve lower reconstruction errors significantly faster than standard SGD or RMSProp on the YaleB dataset.

Convergence comparison for PCA on the YaleB dataset.

State-of-the-Art in Metric Learning

In deep metric learning, cRMSProp achieved a Normalized Mutual Information (NMI) score of 63.58% on the CARS196 dataset, surpassing existing specialized methods like DFL (59.04%) and DSC (58.04%). This success is attributed to the optimizer's ability to handle the rotation invariance of the metric space by operating directly on the Stiefel manifold, bypassing the ambiguities that often confuse Euclidean optimizers.

5. Conclusion

By treating constraints as a fundamental part of the optimization landscape rather than an afterthought, Riemannian optimization techniques like cSGD-M and cRMSProp offer a powerful tool for training complex deep learning models. These methods provide a principled way to maintain constraints while leveraging the benefits of momentum and adaptive learning rates.

Summary updated

BibTeX
@inproceedings{roy2018geometry,
  author = {Soumava Kumar Roy and Zakaria Mhammedi and Mehrtash Harandi},
  title = {{Geometry Aware Constrained Optimization Techniques for Deep Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  url = {https://openreview.net/forum?id=pEmTmD4GSu5},
}
Figure