Integrating structured optimization into deep neural networks (DNNs) remains a significant challenge. While DNNs excel at pattern recognition, many real-world tasks—such as object matching between video frames or solving assignment problems—require solving Linear Programs (LPs) as internal sub-routines. This paper introduces $\gamma$-AuxPD, a differentiable LP layer inspired by the biological growth dynamics of slime mold (Physarum polycephalum), providing a fast, "plug-and-play" solution for end-to-end training.
The Challenge of Differentiable Optimization
To train a neural network using backpropagation, every component must be differentiable. Standard industrial LP solvers are typically non-differentiable "black boxes." When placed in the middle of a network, they break the gradient flow. While existing solutions like OptNet or CVXPY-SCS offer differentiability, they are often computationally expensive, require complex "feasible" starting points, or suffer from numerical instability during the training loop.
Methodology: $\gamma$-AuxPD
The authors turn to nature for a solution, specifically Physarum Dynamics (PD). Slime mold is renowned for finding the shortest path in a maze by thickening "tubes" leading to food and shrinking others. Mathematically, this mimics a steepest descent algorithm on a specific Riemannian manifold using a geodesic metric rather than a standard Euclidean metric. This allows the solver to navigate optimization constraints more efficiently.
Key Innovations
Standard Physarum Dynamics require positive costs and invertible matrices. The proposed $\gamma$-AuxPD overcomes these via:
- $\gamma$-Perturbation: A small adjustment to the cost vector allowing the solver to handle auxiliary/slack variables common in computer vision.
- Iterative Linear Solves: The optimization is broken down into simple linear system updates ($Lp=b$) that are highly efficient on GPUs.
- Flexible Differentiability: The solver can be "unrolled" like a Recurrent Neural Network or use implicit differentiation to pass gradients back to earlier layers.
Applications and Results
The authors evaluated $\gamma$-AuxPD across several benchmarks, including synthetic bipartite matching, video object segmentation (YouTube-VOS), and few-shot learning (CIFAR-FS and FC100).
Performance and Efficiency
In few-shot learning experiments, the $\gamma$-AuxPD layer achieved a 4× speedup in training time compared to the CVXPY-SCS baseline. On the CIFAR-FS 5-way 1-shot task, it achieved 71.4% accuracy, outperforming both OptNet (69.9%) and CVXPY-SCS (70.2%).
In video segmentation tasks, the solver matched the performance of highly specialized, hand-tuned solvers while being significantly easier to implement. A key insight was that "unrolling" the solver for a few iterations (typically < 10) proved more numerically stable and faster for training than complex implicit differentiation methods.
Conclusion and Future Work
$\gamma$-AuxPD demonstrates that biologically inspired dynamics can provide robust, efficient, and differentiable solutions for complex optimization in deep learning. While the current implementation is highly effective for the LP sizes common in computer vision, future work will focus on scaling the solver to massive LPs with millions of variables and improving the numerical stability of implicit gradients. Potential broader applications include calculating Wasserstein Distance (Optimal Transport) and performing hierarchical clustering within neural architectures.
Summary updated