arXiv:2611.08359math.OCNov 2026

Manuscript Offprint

arXiv:2611.08359

A Theoretical Analysis of a Bilevel Optimization Formulation for Combined Local-Global Optical Flow Models

El Mostafa Kalmoun

Abstract

This paper analyzes a bilevel formulation for learning the regularization parameter of combined local-global (CLG) optical flow models. The lower-level problem computes the flow from a Lucas-Kanade data term and a quadratic or total variation (TV) regularizer, and the upper-level problem selects the parameter that minimizes the squared distance to a ground-truth flow. The setting is finite-dimensional, and a full-rank assumption makes the lower-level solution unique. For the quadratic model we derive sufficient conditions for the existence of an optimal parameter, for every optimal parameter to be positive, and for strict local optimality. For TV regularization an optimal parameter always exists, because the lower-level solution vanishes for large parameters, and we give a sufficient condition for positivity that accounts for the coupling of the two flow components through the local structure tensors. Synthetic examples illustrate the conditions, including cases in which they fail.

Keywords: Bilevel Optimization, Optical Flow, Regularization Parameter Learning, Total Variation, Local-Global Models

1 Introduction

Variational methods estimate the optical flow between two frames by minimizing an energy that combines a data term, derived from brightness constancy, with a regularizer weighted by a parameter α>0\alpha > 0. The quality of the estimate depends strongly on α\alpha. Too small a value leaves the flow noisy, and too large a value oversmooths it. This paper studies the choice of α\alpha by bilevel learning from ground-truth flow and asks, in a fully discrete setting, when an optimal parameter exists and when it is positive.

The linearized brightness constancy constraint gives one equation per pixel for the two flow components, so the flow is not determined locally (the aperture problem). Lucas and Kanade [1] assume that the flow is constant in a window around each pixel and solve the resulting local least-squares problems. Horn and Schunck [2] instead add a global quadratic penalty on the flow gradient, which yields dense flow fields but smooths motion boundaries. Total variation (TV) regularization, introduced for image denoising [3], preserves such boundaries. Shulman and Hervé [4] proposed an early non-quadratic regularizer for discontinuous flow fields, and TV is widely used for optical flow [5–11]. We use its isotropic form, applied to each flow component. TV is convex but not differentiable, and it is usually minimized by primal-dual methods [7, 9, 12] or replaced by a smooth approximation such as the Huber function [13]. The combined local-global (CLG) model of Bruhn et al. [14] joins the Lucas–Kanade data term with a global regularizer. It inherits the robustness of the local method and the density of the global one, and it can be minimized efficiently, for instance by multigrid methods [15]. Spatially varying parameters α(p)\alpha(p) adapted to image features have also been proposed [16–18].

Given two frames and a ground-truth flow wg∈R2Nw_g \in \mathbb{R}^{2N} on a grid Ω\Omega of NN pixels, we consider

min⁡α≥0∥wα−wg∥22subject towα=arg⁡min⁡w∈R2N12∑p∈Ω∥Apw(p)−bp∥22+αR(w),(1.1)\min_{\alpha\geq0}\|w_{\alpha}-w_{g}\|_{2}^{2}\quad subject~to\quad w_{\alpha}=\arg\min_{w\in\mathbb{R}^{2N}}\frac{1}{2}\sum_{p\in\Omega}\|A_{p} w(p)-b_{p}\|_{2}^{2}+\alpha R(w), \tag{1.1}

where Apw(p)=bpA_{p}w(p) = b_{p} is the Lucas–Kanade system of the window around the pixel p, and R is either a quadratic penalty on the discrete flow gradient or the TV seminorm. Section 2 defines all objects precisely.

Problem (1.1) rests on four modeling choices. First, the parameter is learned from ground truth. Classical parameter-choice rules, such as the discrepancy principle [19], the L-curve [20], generalized cross-validation [21] and Stein's unbiased risk estimate [22], need no ground truth. They rely instead on knowledge of the noise or on heuristic criteria, and they do not target the flow error itself. Bilevel learning uses training data with known ground truth and minimizes the reconstruction error directly. Second, the upper-level loss is the squared Euclidean distance, which equals the sum over all pixels of the squared endpoint errors, a standard accuracy measure for optical flow [23]. It is smooth in w, whereas the endpoint error itself and the angular error [24] are not differentiable where the error vanishes. Third, a single scalar parameter is the natural first case. It is the setting in which existence and positivity can be characterized by explicit conditions, and spatially varying parameters, as in the bilevel framework of [25], can build on it. Fourth, the CLG data term makes the lower-level problem well posed. When every window contains two pixels with linearly independent gradients, the data term is strongly convex, and the lower-level solution is unique for every α≥0\alpha \geq 0, including α=0\alpha = 0 (Lemma 1). The Horn–Schunck data term alone is never strongly convex, because its matrix J⊤JJ^\top J in (2.1) has a null space of dimension at least N.

Bilevel learning of regularization parameters in imaging was established by Kunisch and Pock [26] for variational denoising and by De los Reyes and Schönlieb [27] for learning noise models in TV denoising. Its theory includes existence results for a broad class of regularizers [28], refined stationarity systems for TV [29], stationarity and second-order conditions through a reformulation as a mathematical program with complementarity constraints [30], and spatially dependent parameters [25]. For finite-dimensional linear inverse problems with a continuously differentiable regularizer, Ehrhardt, Gazzola and Scott [31] give a sufficient condition for a positive optimal parameter. Our positivity result for the quadratic model (Theorem 3) is a special case of their condition. Applications include blind deconvolution [32] and the learning of fractional differential operators [33], and Crockett and Fessler [34] survey the field. Computational work addresses inexact lower-level solves through derivative-free methods [35], inexact hypergradients [36] and single-loop schemes [37]. Learning through truncated or approximate inference [38, 39] and learned variational inference layers [40] aim at empirical performance rather than at the analysis of a regularization weight. For optical flow, Jiang et al. [41] use a bilevel scheme that couples flow and camera motion in unsupervised deep learning. Closest to the present setting, El Hakoume et al. [42] learn the two Lamé coefficients of a fluid optical flow registration model by bilevel supervised learning, within a multi-frame super-resolution method. Positivity is imposed through a fixed box, uniqueness of the lower-level solution is assumed, and the bilevel problem “is not theoretically studied” because their model lacks the required regularity. Related work by Laghrib and coauthors learns spatially varying weights for nonlocal deblurring [43]. To our knowledge, no previous work establishes existence, positivity and second-order conditions for learning the regularization parameter of a variational optical flow model from ground-truth flow. Here all objects are finite-dimensional, the proofs are direct, and the conditions are explicit and computable from the data for both regularizers.

The main contributions are the following.

  • A finite-dimensional bilevel formulation for CLG optical flow in which a scalar regularization parameter is learned from ground-truth flow.

  • Existence of an optimal parameter. For any convex regularizer that vanishes only at zero, a sufficient condition is that the Lucas-Kanade estimate be closer to the ground truth than the zero flow (Proposition 2). For TV with zero boundary values this condition is not needed, because the lower-level solution vanishes beyond a finite value of α\alpha (Corollary 5).

  • Sufficient conditions under which α=0\alpha = 0 is not optimal, so that every optimal parameter is positive, for the quadratic model (Theorem 3, an instance of the condition of [31]) and for TV (Theorem 8), and second-order sufficient conditions for strict local optimality in the quadratic model (Theorem 4). The TV condition is not covered by [31], because TV is not differentiable, and it differs structurally from the analyses of scalar data terms [28, 29]. The Lucas-Kanade data term couples the two flow components through 2×22 \times 2 blocks that vary from pixel to pixel. This coupling requires a four-way partition of the pixels, a term Rmix\mathcal{R}_{\text{mix}} for the pixels at which only one flow component has a nonzero gradient, and a term Rvar\mathcal{R}_{\text{var}} for the spatial variation of the blocks. These terms vanish for spatially uniform scalar data terms.

  • Synthetic examples that illustrate the conditions, including cases in which the sufficient conditions fail.

Section 2 introduces the discrete setting and states the bilevel problem. Section 3 analyzes quadratic regularization and Section 4 total variation regularization. Section 5 presents the examples, and Section 6 discusses the limitations of the analysis and concludes.

References (44)