Constrained Sliced Wasserstein Embedding

Navid Naderializadeh, Darian Salehi, Xinran Liu, Soheil KolouriarXiv 2025 · DOI

Abstract

Sliced Wasserstein distances offer a computationally efficient alternative to high-dimensional Optimal Transport (OT) but often require numerous random projections to be effective. This paper proposes a constrained learning framework that optimizes slicing directions by ensuring they approximate the true high-dimensional OT plan. By incorporating this as a neural network pooling layer, the authors demonstrate improved accuracy and reduced overfitting across image, point cloud, and protein datasets using significantly fewer slices.

The Challenge of High-Dimensional Optimal Transport

Optimal Transport (OT) provides a robust metric for comparing probability distributions by finding the most efficient way to transform one shape into another. While powerful, its high computational cost in high dimensions limits its scalability for large-scale machine learning tasks.

Sliced Optimal Transport addresses this by projecting high-dimensional data onto 1D lines (slices), where OT is easily computed via sorting. However, achieving an accurate measurement typically necessitates a massive number of random slices, which negates the intended speed advantage. Selecting a small set of highly informative slices without overfitting to task-specific noise or ignoring the underlying geometric structure remains a critical challenge in the field.

Methods: Constrained Sliced Wasserstein Embedding (C-SWE)

The authors tackle the selection of slicing directions ($\theta$) by framing it as a constrained learning problem. Instead of allowing a neural network to pick slices solely to minimize task loss (e.g., classification error), they enforce a geometric rule: the 1D transport plan on a given slice must closely approximate the optimal transport plan in the original high-dimensional space. This gap is measured using Sliced Wasserstein Generalized Geodesics (SWGG).

To implement this, the authors utilize several key techniques:

  1. Primal-Dual Optimization: A Lagrangian dual approach is used where a "dual variable" acts as a dynamic penalty. If a slice deviates too far from the high-dimensional geometry, the penalty pulls it back toward a meaningful direction.
  2. Differentiable Sorting: Since standard sorting blocks gradients, the authors employ a "softsort" approximation during training, enabling the network to update slicing directions via backpropagation.
  3. Pooling Layer Integration: This technique is applied as a Sliced Wasserstein Embedding (SWE) pooling layer, aggregating sets of features (like transformer tokens) into fixed-size vectors.

Experimental Evaluation

The authors evaluated the C-SWE pooling layer across three distinct domains using foundation models:

  • Images (Tiny ImageNet): Using a DeiT-Tiny Vision Transformer, C-SWE achieved ~49% test accuracy compared to ~43% for unconstrained SWE. It exhibited significantly less overfitting, maintaining performance even when extracting tokens from earlier layers.
  • Point Clouds (ModelNet40): C-SWE consistently outperformed both standard SWE and Global Average Pooling (GAP) across all tested slice counts (from 4 to 64), with the most notable gains at lower slice counts.
  • Proteins (Subcellular Localization): Using ESM-2 protein language models, just 16 slices of C-SWE matched the performance of the standard CLS token embedding, showing significant gains over standard SWE at very low slice counts ($L=1$ or $4$).

Key Insights and Results

  • Quality over Quantity: By forcing slices to respect high-dimensional geometry, the network achieves higher accuracy with drastically fewer slices, restoring the computational efficiency of Sliced OT.
  • Structural Regularization: The primal-dual framework acts as a smart regularizer, preventing the model from memorizing arbitrary 1D projections and forcing it to learn representations that generalize better to unseen data.
  • Efficiency Trade-offs: While the "softsort" operation increases training complexity from $O(M \log M)$ to $O(M^2)$, this overhead is only present during training. Inference remains fast, making it suitable for real-time applications.

Limitations and Future Work

The performance gap between constrained and unconstrained SWE tends to shrink as the number of slices grows very large, as the optimization problem becomes increasingly difficult to satisfy. Future research directions include exploring alternative constraints, such as slice orthogonality, and using learned dual or slack variables as attention weights to more intelligently combine information across different slices.

Summary updated

BibTeX
@misc{naderializadeh2025constrained,
  author = {Navid Naderializadeh and Darian Salehi and Xinran Liu and Soheil Kolouri},
  title = {{Constrained Sliced Wasserstein Embedding}},
  year = {2025},
  eprint = {2506.02203},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.02203},
}
Figure