Why Approximate Matrix Square Root Outperforms Accurate SVD in Global Covariance Pooling?

Yue Song, Nicu Sebe, Wei Wang

Abstract

Global Covariance Pooling (GCP) aims at exploiting the second-order statistics of the convolutional feature. Its effectiveness has been demonstrated in boosting the classification performance of Convolutional Neural Networks (CNNs). Singular Value Decomposition (SVD) is used in GCP to compute the matrix square root. However, the approximate matrix square root calculated using Newton-Schulz iteration outperforms the accurate one computed via SVD. We empirically analyze the reason behind the performance gap from the perspectives of data precision and gradient smoothness. Various remedies for computing smooth SVD gradients are investigated. Based on our observation and analyses, a hybrid training protocol is proposed for SVD-based GCP meta-layers such that competitive performances can be achieved against Newton-Schulz iteration. Moreover, we propose a new GCP meta-layer that uses SVD in the forward pass, and Padé approximants in the backward propagation to compute the gradients. The proposed meta-layer has been integrated into different CNN models and achieves state-of-the-art performances on both large-scale and fine-grained datasets.

Introduction: The SVD Stability Mystery

Global Covariance Pooling (GCP) is a powerful technique for capturing second-order statistics in CNNs, often yielding superior classification performance compared to standard first-order pooling. To normalize the covariance matrix, researchers typically compute its square root. Two primary methods exist: mathematically exact Singular Value Decomposition (SVD) and the GPU-friendly Newton-Schulz iteration. Surprisingly, the "approximate" Newton-Schulz iteration often outperforms "accurate" SVD in final model accuracy. This paper investigates this counter-intuitive phenomenon, identifying numerical instability in SVD gradients as the primary culprit.

The Gradient is the Ghost in the Machine

The core issue lies not in the forward pass accuracy, but in the smoothness of the backward pass. Analytical SVD gradients involve terms proportional to $1/(\lambda_i - \lambda_j)$. When eigenvalues are very small or nearly identical—a common occurrence in high-dimensional feature maps—these gradients explode, leading to weight instability.

Comparison of training error and gradient smoothness across different GCP methods. Note the high instability (spikes) in MPN-COV gradients compared to more stable alternatives like iSQRT-COV and SVD variants.

Furthermore, data precision plays a critical role. SVD-based pooling effectively requires float64 (double precision) to avoid zeroing out small eigenvalues in float32, which causes immediate numerical failure.

SVD-Padé: A Robust Hybrid Approach

To address these instabilities, the authors introduce the SVD-Padé Meta-Layer. This novel approach uses exact SVD for the forward pass to obtain the precise square root but replaces the unstable analytical gradient in the backward pass with a Padé approximant. Unlike Taylor series expansions, which have a narrow convergence radius and fail near singularities, Padé approximants (rational functions) are robust at approximating functions with poles, effectively modeling singularities without letting values hit infinity.

Additionally, a Hybrid Training Protocol is proposed. Recognizing that covariance matrices are ill-conditioned early in training but stabilize as the model converges, the protocol starts with robust Newton-Schulz iterations and switches to SVD-based methods in the final stages to fine-tune representations with exact mathematics.

Experimental Results

The proposed methods were evaluated on ImageNet-2012 and several Fine-Grained Visual Categorization (FGVC) datasets.

Training Top-5 error and Validation Top-1 error in the final training stage. SVD-Padé (dark red) demonstrates competitive convergence and performance compared to other iterative and SVD-based methods.

Key results include:

  • State-of-the-Art Accuracy: On ImageNet with AlexNet, SVD-Padé achieved a top-1 error of 47.63%, outperforming standard SVD (48.77%) and iSQRT-COV (47.81%).
  • Fine-Grained Dominance: On the CUB-200-2011 bird dataset, SVD-Padé reached 87.29% accuracy, significantly surpassing the iterative iSQRT-COV (86.45%).
  • Efficiency: The SVD-Padé backward pass is faster than Taylor-based alternatives, requiring fewer iterations for a high-quality approximation.

Conclusion and Future Work

The research highlights that for GCP, gradient smoothness is more critical than forward-pass precision. While SVD-Padé sets a new benchmark, challenges remain in scaling to larger covariance matrices due to the computational cost of eigendecomposition on current GPU platforms. Future work may focus on optimizing these hardware bottlenecks and exploring the role of small eigenvalues in distinguishing fine-grained classes.

Summary updated

BibTeX
@misc{song2021why,
  author = {Yue Song and Nicu Sebe and Wei Wang},
  title = {{Why Approximate Matrix Square Root Outperforms Accurate SVD in Global Covariance Pooling?}},
  year = {2021},
  eprint = {2105.02498},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.02498},
}
Figure