Learning Linearized Assignment Flows for Image Labeling

Alexander Zeilmann, Stefania Petra, Christoph Schnörr · DOI

Abstract

We introduce a novel algorithm for estimating optimal parameters of linearized assignment flows for image labeling. An exact formula is derived for the parameter gradient of any loss function that is constrained by the linear system of ODEs determining the linearized assignment flow. We show how to efficiently evaluate this formula using a Krylov subspace and a low-rank approximation. This enables us to perform parameter learning by Riemannian gradient descent in the parameter space, without the need to backpropagate errors or to solve an adjoint equation. Experiments demonstrate that our method performs as good as highly-tuned machine learning software using automatic differentiation. Unlike methods employing automatic differentiation, our approach yields a low-dimensional representation of internal parameters and their dynamics which helps to understand how assignment flows and more generally neural networks work and perform.

1. Introduction

Image labeling—the task of assigning a categorical label to every pixel in an image—is a fundamental challenge in computer vision. Assignment flows provide a geometric framework for this task, modeling the labeling process as a dynamical system on a manifold. However, the effectiveness of these flows depends heavily on regularization parameters that govern how information is aggregated spatially. Traditionally, these parameters are learned using Automatic Differentiation (AD). While AD is powerful, it often functions as a "black box," obscuring the underlying dynamics and incurring significant computational costs for complex numerical schemes.

This paper presents a "differentiate-then-approximate" approach. By deriving an exact analytical gradient for linearized assignment flows, we provide a mathematically transparent alternative to AD that is both memory-efficient and interpretable.

2. Linearized Assignment Flows

The core of the proposed method is the linearization of the assignment flow. The labeling process is governed by a large system of linear Ordinary Differential Equations (ODEs). To solve these equations efficiently, the authors employ exponential integration via the Duhamel formula. This approach utilizes matrix exponentials, offering superior stability and allowing for larger time steps compared to standard Euler methods.

3. Parameter Learning and Gradient Approximation

The primary contribution of this work is the derivation of an exact formula (Theorem 3.8) for the gradient of the loss function with respect to model parameters. To make this formula computationally tractable for high-resolution images, two key techniques are employed:

  1. Krylov Subspace Projection: Using Arnoldi iteration, the massive matrices involved in the ODE system are projected into a low-dimensional Krylov subspace (typically dimension $m \approx 10$).
  2. Low-Rank Approximation: The authors demonstrate that a low-rank approximation—specifically a rank-1 approximation—of the parameter gradient captures sufficient information for effective training.

This strategy reduces the theoretical memory requirement for a 512x512 image from over 50 terabytes to less than 500 megabytes, making the approach feasible on standard hardware. Furthermore, since the parameters reside on a probability simplex, the learning process utilizes Riemannian gradient descent to maintain valid parameter constraints.

4. Experimental Evaluation

The method was evaluated on synthetic datasets designed to test regularization capabilities, such as random Voronoi line structures and noisy colored Voronoi regions.

  • Voronoi Line Structures: The model successfully separated thin cell boundaries from interiors, a task where naive smoothing typically fails.
  • Noisy Color Regions: In tasks with high Gaussian noise, the proposed method reduced labeling error from approximately 50% to near 0% over 100 iterations.

Results indicate that the analytical gradient approach performs on par with highly-tuned AD implementations in PyTorch. Moreover, the method provides unique insights: gradient norms concentrate at image boundaries, highlighting where the model actively adapts its weights to preserve structure.

5. Conclusion

By moving away from the "black box" of automatic differentiation, this work provides a more interpretable and memory-efficient framework for training assignment flows. The discovery that a rank-1 approximation is sufficient for learning suggests that the essential dynamics of these models reside in a very low-dimensional subspace. Future work will explore extending this framework to "deep" sequences of flows, potentially offering a more transparent alternative to traditional deep neural networks.

Summary updated

BibTeX
@article{zeilmann2023learning,
  author = {Alexander Zeilmann and Stefania Petra and Christoph Schnörr},
  title = {{Learning Linearized Assignment Flows for Image Labeling}},
  journal = {J. Math. Imaging Vis.},
  year = {2023},
  doi = {10.1007/s10851-022-01132-9},
}
Figure