Orthogonium : A Unified, Efficient Library of Orthogonal and 1-Lipschitz Building Blocks

Thibaut Boissin, Franck Mamalet, Valentin Lafargue, Mathieu Serrurier · DOI

Abstract

Orthogonal and 1-Lipschitz neural network layers are essential building blocks in robust deep learning architectures, crucial for certified adversarial robustness, stable generative models, and reliable recurrent networks. Despite significant advancements, existing implementations remain fragmented, limited, and computationally demanding. To address these issues, we introduce Orthogonium, a unified, efficient, and comprehensive PyTorch library providing orthogonal and 1-Lipschitz layers. Orthogonium provides access to standard convolution features—including support for strides, dilation, grouping, and transposed—while maintaining strict mathematical guarantees. Its optimized implementations reduce overhead on large-scale benchmarks such as ImageNet. Moreover, rigorous testing within the library has uncovered critical errors in existing implementations, emphasizing the importance of standardized and reliable tools. Orthogonium thus significantly lowers adoption barriers, enabling scalable experimentation and integration across diverse applications requiring orthogonality and robust Lipschitz constraints.

Introduction

In the pursuit of certified adversarial robustness, 1-Lipschitz neural networks have emerged as a primary solution. By mathematically constraining layers so that small input perturbations cannot lead to large output changes, these networks provide inherent stability. However, implementing such architectures has historically been a "Wild West" of fragmented, unoptimized, and sometimes mathematically incorrect codebases. Practitioners often had to manually port research code that lacked support for standard features like dilated or grouped convolutions, making large-scale application on datasets like ImageNet nearly impossible.

Overview of the Orthogonium library features and open-source standards.

Orthogonium addresses these challenges by providing a unified PyTorch library that bridges the gap between theoretical robustness and practical scalability. It offers a standardized API that extends torch.nn, allowing researchers to swap standard layers for robust alternatives with minimal code changes. The library is built to meet high open-source standards, boasting 94% test coverage and compatibility with PyTorch 2.0+.

Core Building Blocks and Methodology

Orthogonium introduces several classes of constrained layers designed for both efficiency and mathematical rigor:

  • Dense Orthogonal Layers (OrthoLinear): Supports five different orthogonalization algorithms, including Bjorck–Bowie, Cayley transforms, and Cholesky decomposition, integrated with spectral normalization.
  • Adaptive Orthogonal Convolutions (AOC): A flagship feature that supports native striding, dilation, and grouping—features often missing in prior robust convolution implementations. It constructs explicit kernels that maintain strict guarantees while remaining fast.
  • Improved Skew Orthogonal Convolutions (SOC): By deriving explicit convolution kernel exponentials, the library reduces the need for expensive Taylor expansions during inference, saving significant memory.
  • Robust Residual Wrappers: To maintain the 1-Lipschitz constraint across the whole network, the library provides alternatives to standard residual connections, such as L2NormResidual and ConcatResidual.
Comparison of different orthogonal and 1-Lipschitz layers implemented in Orthogonium.

To ensure these layers meet their theoretical promises, Orthogonium employs rigorous unit testing, including explicit Singular Value Decomposition (SVD) on Toeplitz matrices and empirical Jacobian checks. This auditing process revealed critical flaws in existing literature; for instance, the HouseHolder activation was found to be missing a $1/\sqrt{2}$ normalization factor in common implementations, invalidating its Lipschitz guarantees.

Experimental Results and Scalability

The library's efficiency was primarily benchmarked on ImageNet-1K, demonstrating its readiness for real-world computer vision tasks. Key results include:

  • Low Computational Overhead: The AdaptiveOrthoConv2d layer is only 1.13x slower than a standard nn.Conv2d on ImageNet-1K with a batch size of 256, proving that the "robustness tax" is manageable.
  • Improved Convergence: Using "Almost-Orthogonal Layers" (AOL) as a pre-conditioning step for SOC reduced the iterations required for convergence from 6 down to 3 or 4.
  • High Reliability: The library maintains 94% test coverage, ensuring mathematical constraints hold across diverse configurations of stride, dilation, and grouping.

Conclusion and Future Work

Orthogonium lowers the barrier to entry for robust deep learning by providing a high-performance, audited, and feature-rich library. While it currently offers a comprehensive suite of tools, future work includes the full integration of "Sandwich-AOC" layers and expanding support for complex padding constraints in transposed convolutions. By standardizing these building blocks, Orthogonium enables the community to move beyond toy datasets and explore the limits of certified robustness at scale.

Orthogonium is available at: https://github.com/deel-ai/orthogonium

Summary updated

BibTeX
@inproceedings{boissin2025orthogonium,
  author = {Thibaut Boissin and Franck Mamalet and Valentin Lafargue and Mathieu Serrurier},
  title = {{Orthogonium : A Unified, Efficient Library of Orthogonal and 1-Lipschitz Building Blocks}},
  booktitle = {CODEML @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=ZzZAtVcEIK},
}
Figure