SVMax: A Feature Embedding Regularizer

Ahmed Taha, Alex Hanson, Abhinav Shrivastava, Larry Davis

Abstract

A neural network regularizer (e.g., weight decay) boosts performance by explicitly penalizing the complexity of a network. In this paper, we penalize inferior network activations -- feature embeddings -- which in turn regularize the network's weights implicitly. We propose singular value maximization (SVMax) to learn a more uniform feature embedding. The SVMax regularizer supports both supervised and unsupervised learning. Our formulation mitigates model collapse and enables larger learning rates. We evaluate the SVMax regularizer using both retrieval and generative adversarial networks. We leverage a synthetic mixture of Gaussians dataset to evaluate SVMax in an unsupervised setting. For retrieval networks, SVMax achieves significant improvement margins across various ranking losses.

Introduction

In deep learning, "knowledge" is stored in both weights and activations. While weight regularization techniques like weight decay are standard, direct regularization of the structure of feature embeddings (the final layer activations) is less common. A frequent failure mode in representation learning is model collapse, where the network projects data into a narrow subspace, wasting the available dimensions of the embedding space. This is particularly prevalent in metric learning and Generative Adversarial Networks (GANs), often requiring carefully tuned, small learning rates to maintain stability.

Singular Value Maximization (SVMax)

The authors propose Singular Value Maximization (SVMax) to address these issues. Inspired by Principal Component Analysis (PCA), which identifies directions of maximum variance, SVMax forces the network to maximize variance across all orthogonal directions.

Comparison of singular values and embedding distributions. SVMax encourages more uniform distributions (b) compared to polarized ones (a).

During training, embeddings from a mini-batch are collected into a matrix $E$. Singular Value Decomposition (SVD) is performed on $E$ to extract its singular values. SVMax adds a term to the loss function that maximizes the mean singular value ($s_\mu$). This objective pushes the network to produce high-rank representations where features are distributed uniformly rather than being polarized along a single axis. For L2-normalized embeddings, the authors derive theoretical bounds for $s_\mu$, enabling a normalized loss that is easier to tune.

Experimental Evaluation

The SVMax regularizer was evaluated across several domains:

  • Image Retrieval: Benchmarked on CUB-200-2011, Stanford CARS196, and Stanford Online Products (SOP).
  • Generative Modeling: Tested on a synthetic 2D Mixture of Gaussians to visualize mode collapse prevention.
  • Self-Supervised Learning: Evaluated on MNIST and ImageNet using the "Representation Counting" pretext task.

Key Results and Insights

SVMax demonstrates that high-rank embedding spaces are superior for retrieval and discriminative tasks as they maximize expressive power. Because it operates solely on the singular values of activations, it is a class-oblivious regularizer, making it versatile for both supervised and unsupervised settings.

Performance (Recall@1) across different ranking losses and learning rates. SVMax maintains high performance even at larger learning rates where vanilla methods often collapse.

A significant practical advantage of SVMax is its role as a safety net for large learning rates. In image retrieval tasks on the CUB-200 dataset with a learning rate of 0.01, SVMax improved the Recall@1 of a vanilla contrastive loss from 25.73% to 41.26%. Furthermore, in GAN training on toy datasets, SVMax prevented mode collapse, allowing the generator to recover all target modes perfectly. Despite involving SVD, the computational overhead is negligible for typical mini-batch sizes.

Conclusion

SVMax provides a robust mechanism for regularizing feature embeddings by maximizing their singular values. While it performs best when the batch size exceeds the embedding dimension, it remains effective even in smaller batch regimes. Future work may explore the application of SVMax to intermediate network layers to further enhance representation learning.

Summary updated

Abstract

A neural network regularizer (e.g., weight decay) boosts performance by explicitly penalizing the complexity of a network. In this paper, we penalize inferior network activations -- feature embeddings -- which in turn regularize the network's weights implicitly. We propose singular value maximization (SVMax) to learn a more uniform feature embedding. The SVMax regularizer supports both supervised and unsupervised learning. Our formulation mitigates model collapse and enables larger learning rates. We evaluate the SVMax regularizer using both retrieval and generative adversarial networks. We leverage a synthetic mixture of Gaussians dataset to evaluate SVMax in an unsupervised setting. For retrieval networks, SVMax achieves significant improvement margins across various ranking losses. Code available at https://bit.ly/3jNkgDt

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CUB-200-2011SVMaxRecall@1 (R@1)0.4626941256N-pair loss without L2-normalization; GoogLeNet, batch size 144, embedding dimension 12…
Source quote
L440: SVMax (Ours) │ 0.561 │ \bf \recall{0.4626941256} │ \bf \recall{0.7986158001} │ \margin{0.4626941256-0.4608372721}
CUB-200-2011VanillaRecall@1 (R@1)0.4608372721N-pair loss without L2-normalization; GoogLeNet, batch size 144, embedding dimension 12…
Source quote
L428: Vanilla │ 0.560 │ \recall{0.4608372721} │ \recall{0.7908507765}
BibTeX
@misc{taha2021svmax,
  author = {Ahmed Taha and Alex Hanson and Abhinav Shrivastava and Larry Davis},
  title = {{SVMax: A Feature Embedding Regularizer}},
  year = {2021},
  eprint = {2103.02770},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.02770},
}
Figure