Algorithm Search⌘K

Algorithmadvanced

Split Bregman method

Also called Goldstein-Osher split Bregman, split Bregman iteration.

Solve L1 and total variation problems by moving the regularizer onto a new variable d = Φx, then alternate a linear solve, a shrinkage and a Bregman update.

Time
O(n^3 + K (n^2 + (m + q) n)) worst
Space
O(n^2 + q) extra
Where
K = the number of iterations; m = the number of data values; n = the number of unknowns; q = the number of rows of Φ
Properties
converges for every mudeterministicequivalent to admmnot exactiterative
Origin
Tom Goldstein, Stanley Osher, 2009

The split Bregman method solves problems of the form min⁡x12∥Ax−y∥2+λ∥Φx∥1\min_x \tfrac12\|Ax - y\|^2 + \lambda\|\Phi x\|_1, where Φ\Phi is a linear map such as the image gradient. This covers total variation denoising, total variation deblurring and the LASSO. The ℓ1\ell_1 term is hard because it is not smooth and Φ\Phi couples the unknowns. The method adds a new variable dd with the constraint d=Φxd = \Phi x, so that the coupling and the nonsmooth part are in different variables. It then applies Bregman iteration to the constraint, with one alternating sweep per step: a linear solve for xx, a soft thresholding for dd, and an update of the Bregman variable bb. The method is the same as ADMM with penalty μ\mu and scaled multiplier bb, so it converges for every μ>0\mu > 0, and μb\mu b converges to a dual solution.

In plain words

Some image problems ask for an image that matches the measurements and has few edges. The two wishes pull in different directions, and the "few edges" part has sharp corners that break normal solvers. The method gives the edges their own variable. Now there are two easy jobs. The first job finds an image that matches the measurements and is close to the current edge map: this is a linear system, which is easy. The second job cleans the edge map by setting small edges to zero: this is one simple rule per pixel. A third variable keeps a record of how much the edge map and the image still disagree, and it pushes them together a little more at each round. After enough rounds they agree, and the image is the solution of the original problem.

The problem

The input is a matrix A∈Rm×nA \in \mathbb{R}^{m \times n}, data y∈Rmy \in \mathbb{R}^m, a matrix Φ∈Rq×n\Phi \in \mathbb{R}^{q \times n}, a weight λ>0\lambda > 0 and a penalty μ>0\mu > 0. The goal is a minimizer of

F(x)=12∥Ax−y∥2+λN(Φx),F(x) = \tfrac12\|Ax - y\|^2 + \lambda N(\Phi x),

where NN is the ℓ1\ell_1 norm (anisotropic total variation when Φ\Phi is the gradient) or the sum of the Euclidean norms of pairs ((Φx)i,(Φx)i+g)\big((\Phi x)_i, (\Phi x)_{i+g}\big) (isotropic total variation, with the horizontal and vertical differences of one pixel in one pair). We require that AA and Φ\Phi have no common null vector, so that M=A⊤A+μΦ⊤ΦM = A^\top A + \mu\Phi^\top\Phi is positive definite and FF has a minimizer. For denoising A=IA = I and this holds for any Φ\Phi. The weight λ\lambda is a design choice of the model; the penalty μ\mu is a parameter of the solver and does not change the solution.

The algorithm

The split problem is min⁡x,d12∥Ax−y∥2+λN(d)\min_{x, d} \tfrac12\|Ax - y\|^2 + \lambda N(d) subject to d=Φxd = \Phi x. Bregman iteration on the constraint, with the quadratic penalty μ2∥d−Φx−b∥2\tfrac\mu2\|d - \Phi x - b\|^2, and one Gauss-Seidel sweep over xx and dd in place of the exact joint solve, gives:

  1. SplitBregman(A, y, Φ, λ, μ, K)
  2. 1factor M = AᵀA + μΦᵀΦ by Cholesky; d ← 0; b ← 0
  3. 2for k = 0 to K - 1
  4. 3x ← M⁻¹ (Aᵀy + μΦᵀ(d - b)) ▷ argmin ½‖Ax - y‖² + μ/2‖Φx - d + b‖²
  5. 4d ← shrink(Φx + b, λ/μ) ▷ argmin λN(d) + μ/2‖d - Φx - b‖²
  6. 5b ← b + Φx - d ▷ Bregman update, add back the misfit
  7. 6return x

For the ℓ1\ell_1 norm, shrink⁡(v,t)i=sign⁡(vi)max⁡(∣vi∣−t,0)\operatorname{shrink}(v, t)_i = \operatorname{sign}(v_i)\max(|v_i| - t, 0). For the isotropic norm, each pair ww of vv is replaced by wmax⁡(∥w∥−t,0)/∥w∥w \max(\|w\| - t, 0)/\|w\|. Both are the proximal operator of tNtN. Line L3 is the only coupled step. Here it uses a Cholesky factor computed once. For deconvolution with periodic boundaries, MM is diagonalized by the fast Fourier transform, and for large problems a few conjugate gradient or Gauss-Seidel steps are enough.

Line L5 is the Bregman step of the constraint d=Φxd = \Phi x: the misfit Φx−d\Phi x - d is added back, in the same way as Bregman iteration adds back the data residual. If lines L3 and L4 were repeated until (x,d)(x, d) minimizes the joint problem, the method would be exact Bregman iteration, which is the augmented Lagrangian method for the split problem. One sweep is enough, and that is the point of the method.

Example

Take total variation denoising of the signal f=(0,0,3,3)f = (0, 0, 3, 3): A=IA = I, Φ=D\Phi = D the forward difference matrix with 3 rows, λ=1\lambda = 1 and μ=1\mu = 1. Then M=I+D⊤DM = I + D^\top D is tridiagonal with diagonal (2,3,3,2)(2, 3, 3, 2) and off diagonal −1-1.

Step 1: with d=b=0d = b = 0, line L3 solves Mx=fMx = f, which gives x=(3/7,6/7,15/7,18/7)x = (3/7, 6/7, 15/7, 18/7). Then Dx=(3/7,9/7,3/7)Dx = (3/7, 9/7, 3/7), and shrinkage by λ/μ=1\lambda/\mu = 1 gives d=(0,2/7,0)d = (0, 2/7, 0). Line L5 gives b=Dx−d=(3/7,1,3/7)b = Dx - d = (3/7, 1, 3/7).

kk xkx^k dkd^k bkb^k F(xk)F(x^k)
1 (0.4286,0.8571,2.1429,2.5714)(0.4286, 0.8571, 2.1429, 2.5714) (0,0.2857,0)(0, 0.2857, 0) (0.4286,1,0.4286)(0.4286, 1, 0.4286) 3.0612
2 (0.7143,1,2,2.2857)(0.7143, 1, 2, 2.2857) (0,1,0)(0, 1, 0) (0.7143,1,0.7143)(0.7143, 1, 0.7143) 3.0816
3 (0.7347,0.7551,2.2449,2.2653)(0.7347, 0.7551, 2.2449, 2.2653) (0,1.4898,0)(0, 1.4898, 0) (0.7347,1,0.7347)(0.7347, 1, 0.7347) 2.6406
5 (0.6064,0.5394,2.4606,2.3936)(0.6064, 0.5394, 2.4606, 2.3936) (0,1.9213,0)(0, 1.9213, 0) (0.6064,1,0.6064)(0.6064, 1, 0.6064) 2.7140
10 (0.4997,0.4968,2.5032,2.5003)(0.4997, 0.4968, 2.5032, 2.5003) (0,2.0064,0)(0, 2.0064, 0) (0.4997,1,0.4997)(0.4997, 1, 0.4997) 2.5088
20 (0.5,0.5,2.5,2.5)(0.5, 0.5, 2.5, 2.5) (0,2,0)(0, 2, 0) (0.5,1,0.5)(0.5, 1, 0.5) 2.5000

The limit x=(0.5,0.5,2.5,2.5)x = (0.5, 0.5, 2.5, 2.5) is the exact total variation solution: each half moves toward the other by λ\lambda divided by its length 2, and F=12⋅4⋅0.25+2=2.5F = \tfrac12 \cdot 4 \cdot 0.25 + 2 = 2.5. The edge variable dd has the single jump 2 at the right place from step 2 on; only its size still changes. The limit μb=(0.5,1,0.5)\mu b = (0.5, 1, 0.5) is the dual solution: it satisfies x−f+D⊤(μb)=0x - f + D^\top(\mu b) = 0, its entries are at most λ=1\lambda = 1 in size, and it equals λ\lambda where DxDx is not zero. The table also shows that F(xk)F(x^k) is not monotone (it rises at steps 2 and 5), so it is not a useful stop test.

Correctness

The full proof is in proofs/correctness.md. The steps:

  • Equivalence with ADMM. With f(x)=12∥Ax−y∥2f(x) = \tfrac12\|Ax - y\|^2, g(d)=λN(d)g(d) = \lambda N(d) and the constraint Φx−d=0\Phi x - d = 0, lines L3 to L5 are the three steps of scaled ADMM with penalty ρ=μ\rho = \mu and scaled multiplier u=bu = b. This is a theorem (Esser 2009, Setzer 2009).
  • Optimality of each step: with vk=μbkv^k = \mu b^k, line L3 gives A⊤(Axk+1−y)+Φ⊤(vk+1+μ(dk+1−dk))=0A^\top(Ax^{k+1} - y) + \Phi^\top(v^{k+1} + \mu(d^{k+1} - d^k)) = 0, and line L4 gives vk+1∈∂g(dk+1)v^{k+1} \in \partial g(d^{k+1}).
  • A saddle point exists. Since AA and Φ\Phi have no common null vector, FF is coercive and has a minimizer x∗x^*, and the subdifferential chain rule gives v∗v^* with A⊤(Ax∗−y)+Φ⊤v∗=0A^\top(Ax^* - y) + \Phi^\top v^* = 0 and v∗∈∂g(Φx∗)v^* \in \partial g(\Phi x^*).
  • Lyapunov function: Vk=1μ∥vk−v∗∥2+μ∥dk−d∗∥2V_k = \tfrac1\mu\|v^k - v^*\|^2 + \mu\|d^k - d^*\|^2 satisfies Vk+1≤Vk−μ∥Φxk+1−dk+1∥2−μ∥dk+1−dk∥2V_{k+1} \le V_k - \mu\|\Phi x^{k+1} - d^{k+1}\|^2 - \mu\|d^{k+1} - d^k\|^2 for k≥1k \ge 1. This follows from the monotonicity of ∇f\nabla f and ∂g\partial g only.
  • Convergence: the iterates are bounded and the two residuals go to 0, so every cluster point satisfies the optimality conditions. Using VV with that cluster point gives convergence of the whole sequence: xk→xˉx^k \to \bar x, a minimizer of FF, and μbk→vˉ\mu b^k \to \bar v, a dual solution. This holds for every μ>0\mu > 0.
Proof: Split Bregman is ADMM, has a nonincreasing Lyapunov function, and converges to a minimizer and a dual solution for every penaltyfull

Setting. A∈Rm×nA \in \mathbb{R}^{m \times n}, y∈Rmy \in \mathbb{R}^m, Φ∈Rq×n\Phi \in \mathbb{R}^{q \times n}, λ>0\lambda > 0, μ>0\mu > 0. NN is the ℓ1\ell_1 norm on Rq\mathbb{R}^q or a sum of Euclidean norms of disjoint groups of entries. Let f(x)=12∥Ax−y∥2f(x) = \tfrac12\|Ax - y\|^2, g(d)=λN(d)g(d) = \lambda N(d) and F(x)=f(x)+g(Φx)F(x) = f(x) + g(\Phi x). We assume ker⁡A∩ker⁡Φ={0}\ker A \cap \ker\Phi = \{0\}. Then M=A⊤A+μΦ⊤ΦM = A^\top A + \mu\Phi^\top\Phi is positive definite, because x⊤Mx=∥Ax∥2+μ∥Φx∥2>0x^\top Mx = \|Ax\|^2 + \mu\|\Phi x\|^2 > 0 for x≠0x \ne 0.

The method starts with d0=b0=0d^0 = b^0 = 0 and, for k≥0k \ge 0, does

xk+1=argmin⁡xf(x)+μ2∥Φx−dk+bk∥2,dk+1=argmin⁡dg(d)+μ2∥d−Φxk+1−bk∥2,x^{k+1} = \operatorname*{argmin}_x f(x) + \tfrac\mu2\|\Phi x - d^k + b^k\|^2,\qquad d^{k+1} = \operatorname*{argmin}_d g(d) + \tfrac\mu2\|d - \Phi x^{k+1} - b^k\|^2,
bk+1=bk+Φxk+1−dk+1.b^{k+1} = b^k + \Phi x^{k+1} - d^{k+1}.

The first problem is strictly convex with the normal equation Mx=A⊤y+μΦ⊤(dk−bk)Mx = A^\top y + \mu\Phi^\top(d^k - b^k), which is line L3. The second is the proximal map of (λ/μ)N(\lambda/\mu)N at Φxk+1+bk\Phi x^{k+1} + b^k, which is the shrinkage of line L4 (for the ℓ1\ell_1 norm entry by entry, for groups group by group). Both minimizers exist and are unique. Write vk=μbkv^k = \mu b^k, rk+1=Φxk+1−dk+1r^{k+1} = \Phi x^{k+1} - d^{k+1} and Δk=dk+1−dk\Delta^k = d^{k+1} - d^k, so vk+1=vk+μrk+1v^{k+1} = v^k + \mu r^{k+1}.

Remark (ADMM). For min⁡f(x)+g(d)\min f(x) + g(d) subject to Φx−d=0\Phi x - d = 0, scaled ADMM with penalty ρ\rho and scaled multiplier uu is xk+1=argmin⁡f(x)+ρ2∥Φx−dk+uk∥2x^{k+1} = \operatorname{argmin} f(x) + \tfrac\rho2\|\Phi x - d^k + u^k\|^2, dk+1=argmin⁡g(d)+ρ2∥Φxk+1−d+uk∥2d^{k+1} = \operatorname{argmin} g(d) + \tfrac\rho2\|\Phi x^{k+1} - d + u^k\|^2, uk+1=uk+Φxk+1−dk+1u^{k+1} = u^k + \Phi x^{k+1} - d^{k+1}. With ρ=μ\rho = \mu and u=bu = b these are the three steps above. The proof below is the ADMM argument written out for this case.

Lemma 1 (optimality of the steps). For k≥0k \ge 0,

A⊤(Axk+1−y)+Φ⊤(vk+1+μΔk)=0,vk+1∈∂g(dk+1).A^\top(Ax^{k+1} - y) + \Phi^\top(v^{k+1} + \mu\Delta^k) = 0, \qquad v^{k+1} \in \partial g(d^{k+1}).

Proof. The xx-step gives A⊤(Axk+1−y)+μΦ⊤(Φxk+1−dk+bk)=0A^\top(Ax^{k+1} - y) + \mu\Phi^\top(\Phi x^{k+1} - d^k + b^k) = 0, and Φxk+1−dk+bk=rk+1+bk+Δk=bk+1+Δk\Phi x^{k+1} - d^k + b^k = r^{k+1} + b^k + \Delta^k = b^{k+1} + \Delta^k. The dd-step gives 0∈∂g(dk+1)+μ(dk+1−Φxk+1−bk)0 \in \partial g(d^{k+1}) + \mu(d^{k+1} - \Phi x^{k+1} - b^k), and μ(Φxk+1+bk−dk+1)=μbk+1=vk+1\mu(\Phi x^{k+1} + b^k - d^{k+1}) = \mu b^{k+1} = v^{k+1}. □\square

Lemma 2 (optimality conditions). Call (x∗,d∗,v∗)(x^*, d^*, v^*) a KKT point if

A⊤(Ax∗−y)+Φ⊤v∗=0,v∗∈∂g(d∗),d∗=Φx∗.A^\top(Ax^* - y) + \Phi^\top v^* = 0, \qquad v^* \in \partial g(d^*), \qquad d^* = \Phi x^*.

(a) If (x∗,d∗,v∗)(x^*, d^*, v^*) is a KKT point, then x∗x^* minimizes FF. (b) A KKT point exists.

Proof. (a) For any xx, convexity of ff and the subgradient inequality for gg at d∗=Φx∗d^* = \Phi x^* give

F(x)≥f(x∗)+⟨A⊤(Ax∗−y),x−x∗⟩+g(d∗)+⟨v∗,Φx−Φx∗⟩=F(x∗)+⟨A⊤(Ax∗−y)+Φ⊤v∗,x−x∗⟩=F(x∗).F(x) \ge f(x^*) + \langle A^\top(Ax^* - y), x - x^*\rangle + g(d^*) + \langle v^*, \Phi x - \Phi x^*\rangle = F(x^*) + \langle A^\top(Ax^* - y) + \Phi^\top v^*, x - x^*\rangle = F(x^*).

(b) Existence of a minimizer: the map x↦(Ax,Φx)x \mapsto (Ax, \Phi x) is injective, so there is c>0c > 0 with ∥Ax∥+∥Φx∥≥c∥x∥\|Ax\| + \|\Phi x\| \ge c\|x\| for all xx. Since N(d)≥∥d∥N(d) \ge \|d\|, we have F(x)≥12∥Ax−y∥2+λ∥Φx∥F(x) \ge \tfrac12\|Ax - y\|^2 + \lambda\|\Phi x\|. If ∥x∥→∞\|x\| \to \infty then ∥Ax∥≥c∥x∥/2\|Ax\| \ge c\|x\|/2 or ∥Φx∥≥c∥x∥/2\|\Phi x\| \ge c\|x\|/2, and in both cases this lower bound tends to ∞\infty. So FF is continuous and coercive and has a minimizer x∗x^*. Since ff is differentiable and gg is convex and finite everywhere, ∂F(x)=∇f(x)+Φ⊤∂g(Φx)\partial F(x) = \nabla f(x) + \Phi^\top\partial g(\Phi x) (Rockafellar, Convex Analysis, Theorems 23.8 and 23.9). So 0∈∂F(x∗)0 \in \partial F(x^*) gives v∗∈∂g(Φx∗)v^* \in \partial g(\Phi x^*) with ∇f(x∗)+Φ⊤v∗=0\nabla f(x^*) + \Phi^\top v^* = 0. Put d∗=Φx∗d^* = \Phi x^*. □\square

Lemma 3 (Lyapunov function). Let (x∗,d∗,v∗)(x^*, d^*, v^*) be a KKT point and Vk=1μ∥vk−v∗∥2+μ∥dk−d∗∥2V_k = \tfrac1\mu\|v^k - v^*\|^2 + \mu\|d^k - d^*\|^2. Then for k≥0k \ge 0

Vk+1≤Vk−μ∥rk+1+Δk∥2,V_{k+1} \le V_k - \mu\|r^{k+1} + \Delta^k\|^2,

and for k≥1k \ge 1

Vk+1≤Vk−μ∥rk+1∥2−μ∥Δk∥2.V_{k+1} \le V_k - \mu\|r^{k+1}\|^2 - \mu\|\Delta^k\|^2.

Proof. The gradient of the convex function ff is monotone. With Lemma 1 and the KKT condition, ∇f(xk+1)=−Φ⊤(vk+1+μΔk)\nabla f(x^{k+1}) = -\Phi^\top(v^{k+1} + \mu\Delta^k) and ∇f(x∗)=−Φ⊤v∗\nabla f(x^*) = -\Phi^\top v^*, so

0≤⟨∇f(xk+1)−∇f(x∗),xk+1−x∗⟩=⟨v∗−vk+1−μΔk,Φxk+1−d∗⟩.0 \le \langle \nabla f(x^{k+1}) - \nabla f(x^*), x^{k+1} - x^*\rangle = \langle v^* - v^{k+1} - \mu\Delta^k, \Phi x^{k+1} - d^*\rangle.

The subdifferential of gg is monotone, so 0≤⟨vk+1−v∗,dk+1−d∗⟩0 \le \langle v^{k+1} - v^*, d^{k+1} - d^*\rangle. Add the two and use Φxk+1−d∗=rk+1+(dk+1−d∗)\Phi x^{k+1} - d^* = r^{k+1} + (d^{k+1} - d^*):

0≤⟨v∗−vk+1,rk+1⟩−μ⟨Δk,rk+1⟩−μ⟨Δk,dk+1−d∗⟩.0 \le \langle v^* - v^{k+1}, r^{k+1}\rangle - \mu\langle \Delta^k, r^{k+1}\rangle - \mu\langle \Delta^k, d^{k+1} - d^*\rangle.

Now rk+1=(vk+1−vk)/μr^{k+1} = (v^{k+1} - v^k)/\mu. The identity 2⟨a−b,b−c⟩=∥a−c∥2−∥a−b∥2−∥b−c∥22\langle a - b, b - c\rangle = \|a - c\|^2 - \|a - b\|^2 - \|b - c\|^2 gives

2⟨v∗−vk+1,vk+1−vk⟩=∥vk−v∗∥2−∥vk+1−v∗∥2−∥vk+1−vk∥2,2\langle v^* - v^{k+1}, v^{k+1} - v^k\rangle = \|v^k - v^*\|^2 - \|v^{k+1} - v^*\|^2 - \|v^{k+1} - v^k\|^2,
2⟨dk+1−dk,dk+1−d∗⟩=∥dk+1−d∗∥2+∥Δk∥2−∥dk−d∗∥2.2\langle d^{k+1} - d^k, d^{k+1} - d^*\rangle = \|d^{k+1} - d^*\|^2 + \|\Delta^k\|^2 - \|d^k - d^*\|^2.

Multiply the inequality by 2 and insert these. With ∥vk+1−vk∥2/μ=μ∥rk+1∥2\|v^{k+1} - v^k\|^2/\mu = \mu\|r^{k+1}\|^2:

0≤Vk−Vk+1−μ∥rk+1∥2−2μ⟨Δk,rk+1⟩−μ∥Δk∥2=Vk−Vk+1−μ∥rk+1+Δk∥2.0 \le V_k - V_{k+1} - \mu\|r^{k+1}\|^2 - 2\mu\langle\Delta^k, r^{k+1}\rangle - \mu\|\Delta^k\|^2 = V_k - V_{k+1} - \mu\|r^{k+1} + \Delta^k\|^2.

For k≥1k \ge 1, Lemma 1 at steps k−1k - 1 and kk gives vk∈∂g(dk)v^k \in \partial g(d^k) and vk+1∈∂g(dk+1)v^{k+1} \in \partial g(d^{k+1}), and monotonicity gives ⟨vk+1−vk,dk+1−dk⟩≥0\langle v^{k+1} - v^k, d^{k+1} - d^k\rangle \ge 0, that is, μ⟨rk+1,Δk⟩≥0\mu\langle r^{k+1}, \Delta^k\rangle \ge 0. So ∥rk+1+Δk∥2≥∥rk+1∥2+∥Δk∥2\|r^{k+1} + \Delta^k\|^2 \ge \|r^{k+1}\|^2 + \|\Delta^k\|^2. □\square

Theorem 1 (residual rate). VkV_k is nonincreasing, ∑k≥1(∥rk+1∥2+∥Δk∥2)≤V1/μ≤V0/μ\sum_{k \ge 1}\big(\|r^{k+1}\|^2 + \|\Delta^k\|^2\big) \le V_1/\mu \le V_0/\mu, and

min⁡1≤k≤K(∥rk+1∥2+∥Δk∥2)≤V0μK,V0=1μ∥v∗∥2+μ∥d∗∥2.\min_{1 \le k \le K}\big(\|r^{k+1}\|^2 + \|\Delta^k\|^2\big) \le \frac{V_0}{\mu K}, \qquad V_0 = \tfrac1\mu\|v^*\|^2 + \mu\|d^*\|^2.

In particular rk→0r^k \to 0 and dk+1−dk→0d^{k+1} - d^k \to 0.

Proof. Lemma 3 with a KKT point from Lemma 2(b). Sum the second inequality for k=1,…,Kk = 1, \dots, K; the smallest term is at most the mean. V0V_0 has this form because d0=0d^0 = 0 and v0=0v^0 = 0. □\square

Theorem 2 (convergence). For every μ>0\mu > 0, xk→xˉx^k \to \bar x, dk→Φxˉd^k \to \Phi\bar x and μbk→vˉ\mu b^k \to \bar v, where xˉ\bar x minimizes FF and (xˉ,Φxˉ,vˉ)(\bar x, \Phi\bar x, \bar v) is a KKT point. In particular ∣vˉi∣≤λ|\bar v_i| \le \lambda for all ii and vˉi=λsign⁡((Φxˉ)i)\bar v_i = \lambda\operatorname{sign}((\Phi\bar x)_i) where (Φxˉ)i≠0(\Phi\bar x)_i \ne 0 (for the ℓ1\ell_1 norm).

Proof. By Theorem 1, the sequences vkv^k and dkd^k are bounded. The xx-step is xk+1=M−1(A⊤y+Φ⊤(μdk−vk))x^{k+1} = M^{-1}\big(A^\top y + \Phi^\top(\mu d^k - v^k)\big), a fixed affine map of (dk,vk)(d^k, v^k), so xkx^k is bounded too. Choose a subsequence kjk_j with (xkj,dkj,vkj)→(xˉ,dˉ,vˉ)(x^{k_j}, d^{k_j}, v^{k_j}) \to (\bar x, \bar d, \bar v). By Theorem 1, Δkj−1→0\Delta^{k_j - 1} \to 0 and rkj=Φxkj−dkj→0r^{k_j} = \Phi x^{k_j} - d^{k_j} \to 0, so dˉ=Φxˉ\bar d = \Phi\bar x. Lemma 1 at step kj−1k_j - 1 gives, in the limit, A⊤(Axˉ−y)+Φ⊤vˉ=0A^\top(A\bar x - y) + \Phi^\top\bar v = 0. The graph of ∂g\partial g is closed, because gg is convex and continuous, so vkj∈∂g(dkj)v^{k_j} \in \partial g(d^{k_j}) gives vˉ∈∂g(dˉ)\bar v \in \partial g(\bar d). So (xˉ,dˉ,vˉ)(\bar x, \bar d, \bar v) is a KKT point, and xˉ\bar x minimizes FF by Lemma 2(a).

Now apply Lemma 3 with this KKT point. The sequence Vˉk=1μ∥vk−vˉ∥2+μ∥dk−dˉ∥2\bar V_k = \tfrac1\mu\|v^k - \bar v\|^2 + \mu\|d^k - \bar d\|^2 is nonincreasing and Vˉkj→0\bar V_{k_j} \to 0, so Vˉk→0\bar V_k \to 0: vk→vˉv^k \to \bar v and dk→dˉd^k \to \bar d. Then xk+1→M−1(A⊤y+Φ⊤(μdˉ−vˉ))x^{k+1} \to M^{-1}\big(A^\top y + \Phi^\top(\mu\bar d - \bar v)\big). This vector is xˉ\bar x: from the KKT conditions Mxˉ=A⊤Axˉ+μΦ⊤dˉ=A⊤y−Φ⊤vˉ+μΦ⊤dˉM\bar x = A^\top A\bar x + \mu\Phi^\top\bar d = A^\top y - \Phi^\top\bar v + \mu\Phi^\top\bar d, and MM is invertible. The last claim is vˉ∈∂g(Φxˉ)\bar v \in \partial g(\Phi\bar x) written out for g=λ∥⋅∥1g = \lambda\|\cdot\|_1. ■\blacksquare

Remarks. The minimizer of FF need not be unique, for example when AA has a null space; the method then converges to one of them. The proof uses exact solves in lines L3 and L4. The ergodic O(1/K)O(1/K) bound for the objective and the constraint residual follows from the general ADMM argument on the ADMM page with B=−IB = -I and c=0c = 0.

Complexity

With dense matrices, line L1 costs O(n3)O(n^3) once. Each step then costs O(n2)O(n^2) for the two triangular solves, O((m+q)n)O((m + q)n) for the products with A⊤A^\top, Φ\Phi and Φ⊤\Phi^\top (only A⊤yA^\top y is needed, and it is computed once), and O(q)O(q) for the shrinkage. So KK steps cost O(n3+K(n2+(m+q)n))O(n^3 + K(n^2 + (m + q)n)) time and O(n2+q)O(n^2 + q) extra memory for the factor and dd, bb. For an image with NN pixels, Φ\Phi the gradient and AA a convolution, all products cost O(N)O(N) and line L3 costs O(Nlog⁡N)O(N \log N) with the FFT, so each step is O(Nlog⁡N)O(N \log N).

The rate is that of ADMM: the smallest squared constraint residual among the first KK steps is at most V0/(μK)V_0/(\mu K), and the averaged iterates of (x,d)(x, d) have an objective error and a constraint residual of order 1/K1/K (see the ADMM page). These are theorems. In the example above, 20 steps give 4 correct digits; that is a measurement on one small problem, and the count depends on μ\mu.

Properties

  • The penalty μ\mu does not change the limit, only the speed. A large μ\mu enforces d=Φxd = \Phi x fast but shrinks by the small amount λ/μ\lambda/\mu, so the edge set settles slowly. A small μ\mu does the opposite. This trade-off is a heuristic, not a theorem.
  • Line L3 is a linear system with the same matrix at every step. This is the main practical gain over methods that need a new system per step.
  • Line L4 sets entries of dd exactly to zero, so the edge map is sparse at every step, while xx is only close to piecewise constant.
  • At a limit, μb\mu b is a dual certificate; a stop test can use the two residuals ∥Φxk−dk∥\|\Phi x^{k} - d^k\| and μ∥Φ⊤(dk−dk−1)∥\mu\|\Phi^\top(d^{k} - d^{k-1})\|, as for ADMM.
  • The objective F(xk)F(x^k) is not monotone.
  • The iteration is deterministic and uses no step size, unlike Chambolle-Pock, whose steps must satisfy τσ∥K∥2<1\tau\sigma\|K\|^2 < 1.

Variants and improvements

  • Several inner sweeps: Goldstein and Osher allow NN sweeps of lines L3 and L4 before line L5. Many sweeps approach the augmented Lagrangian method, one sweep is ADMM. One sweep is usually the fastest.
  • Inexact line L3: one Gauss-Seidel sweep for xx, as in the original paper for denoising, or a few conjugate gradient steps. The method still works in practice; the convergence proof above needs an exact solve or summable errors.
  • More splittings: for problems with several terms, for example a total variation term and a nonnegativity constraint, each term gets its own variable and Bregman variable. This is ADMM with several blocks stacked into one dd.
  • Frames and wavelets: Φ\Phi can be a tight frame. Setzer (2009) related the method to Douglas-Rachford splitting on the dual problem and studied frame shrinkage.
  • Total generalized variation and other higher order models fit the same template with a larger Φ\Phi.
  • Adaptive penalty: changing μ\mu during the run needs a new factor of MM and a rescaling b←b μold/μnewb \leftarrow b\,\mu_{\text{old}}/\mu_{\text{new}}, so that μb\mu b stays the same.

When to use it

Use it when the regularizer is an ℓ1\ell_1 norm of a linear map and the system (A⊤A+μΦ⊤Φ)x=r(A^\top A + \mu\Phi^\top\Phi)x = r is cheap to solve, for example deconvolution with the FFT, or compressed sensing MRI with Fourier sampling, where both matrices are diagonal in the Fourier basis. If that system is expensive, a method that uses only products with AA, A⊤A^\top, Φ\Phi and Φ⊤\Phi^\top is better: Chambolle-Pock, or iterative shrinkage thresholding when Φ=I\Phi = I.

Pitfalls

  • A common null vector of AA and Φ\Phi makes MM singular. With Φ\Phi the gradient, constants are in the null space of Φ\Phi, so AA must not map constants to 0. The implementation raises an error in that case.
  • The shrinkage threshold is λ/μ\lambda/\mu, not λ\lambda. Mixing the two gives the solution of a problem with a different weight.
  • Line L5 must use the new xx and dd of the same step. With an old value it is not the Bregman update, and the proof does not apply.
  • Changing μ\mu without rescaling bb breaks the method, because the true multiplier is μb\mu b.
  • The isotropic shrinkage must act on the pair of differences of one pixel together. Shrinking each component on its own gives anisotropic total variation, which favors edges along the axes.
  • Do not judge convergence by F(xk)F(x^k), which can rise; use the residuals.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

split_bregman_method.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/split-bregman-method/. The authors are listed in prov/4TK5JZ.jsonl.
"""The split Bregman method of Goldstein and Osher (2009).

It solves min_x (1/2)||A x - y||^2 + lam ||Phi x||_1 (anisotropic) or with the
isotropic group norm sum_i |((Phi x)_i, (Phi x)_{i+g})|, by introducing
d = Phi x and applying Bregman iteration to the constraint d = Phi x with one
alternating sweep per step. A and Phi are dense matrices (lists of rows).
The x-step solves (A^T A + mu Phi^T Phi) x = A^T y + mu Phi^T (d - b) with a
Cholesky factor computed once.
"""

import math

Mat = list[list[float]]
Vec = list[float]


def mat_vec(M: Mat, x: Vec) -> Vec:
    return [sum(a * b for a, b in zip(row, x)) for row in M]


def mat_t_vec(M: Mat, y: Vec) -> Vec:
    n = len(M[0])
    out = [0.0] * n
    for row, v in zip(M, y):
        if v != 0.0:
            for j in range(n):
                out[j] += row[j] * v
    return out


def cholesky(M: Mat) -> Mat:
    """Lower triangular L with L L^T = M. Precondition: M symmetric positive definite. Cost O(n^3)."""
    n = len(M)
    L = [[0.0] * n for _ in range(n)]
    for i in range(n):
        for j in range(i + 1):
            s = M[i][j] - sum(L[i][k] * L[j][k] for k in range(j))
            if i == j:
                if s <= 0.0:
                    raise ValueError("matrix is not positive definite: ker A and ker Phi meet")
                L[i][i] = math.sqrt(s)
            else:
                L[i][j] = s / L[j][j]
    return L


def chol_solve(L: Mat, r: Vec) -> Vec:
    n = len(r)
    z = [0.0] * n
    for i in range(n):
        z[i] = (r[i] - sum(L[i][k] * z[k] for k in range(i))) / L[i][i]
    x = [0.0] * n
    for i in range(n - 1, -1, -1):
        x[i] = (z[i] - sum(L[k][i] * x[k] for k in range(i + 1, n))) / L[i][i]
    return x


def shrink(v: Vec, t: float, group: int = 0) -> Vec:
    """Soft thresholding by t; with group = g > 0, entries i and i + g form one 2-vector (isotropic)."""
    if group == 0:
        return [math.copysign(max(abs(a) - t, 0.0), a) for a in v]
    out = v[:]
    for i in range(group):
        r = math.hypot(v[i], v[i + group])
        s = max(r - t, 0.0) / r if r > 0.0 else 0.0
        out[i], out[i + group] = v[i] * s, v[i + group] * s
    return out


def split_bregman(A: Mat, y: Vec, Phi: Mat, lam: float, mu: float, iters: int,
                  group: int = 0) -> tuple[Vec, Vec, Vec]:
    """Return (x, d, b) after iters steps.

    Precondition: lam > 0, mu > 0, and A and Phi have no common null vector,
    so that A^T A + mu Phi^T Phi is positive definite. The iterates converge
    to a minimizer for every mu > 0 (it is ADMM). At a limit, mu b is a dual
    certificate: A^T (A x - y) + Phi^T (mu b) = 0 and mu b in lam d||.||_1(Phi x).
    Cost: O(n^3) once for the factor, then O(n^2 + (m + q) n) per step.
    """
    n, q = len(Phi[0]), len(Phi)
    M = [[sum(A[k][i] * A[k][j] for k in range(len(A))) + mu * sum(Phi[k][i] * Phi[k][j] for k in range(q))
          for j in range(n)] for i in range(n)]
    L = cholesky(M)  # @line L1
    d, b = [0.0] * q, [0.0] * q
    aty = mat_t_vec(A, y)
    x = [0.0] * n
    for _ in range(iters):  # @line L2
        rhs = [a + mu * c for a, c in zip(aty, mat_t_vec(Phi, [di - bi for di, bi in zip(d, b)]))]
        x = chol_solve(L, rhs)  # @line L3
        phx = mat_vec(Phi, x)
        d = shrink([a + c for a, c in zip(phx, b)], lam / mu, group)  # @line L4
        b = [bi + a - di for bi, a, di in zip(b, phx, d)]  # @line L5
    return x, d, b  # @line L6


def objective(A: Mat, y: Vec, Phi: Mat, lam: float, x: Vec, group: int = 0) -> float:
    r = [a - c for a, c in zip(mat_vec(A, x), y)]
    p = mat_vec(Phi, x)
    reg = sum(abs(a) for a in p) if group == 0 else sum(math.hypot(p[i], p[i + group]) for i in range(group))
    return 0.5 * sum(a * a for a in r) + lam * reg


def difference_matrix(n: int) -> Mat:
    """The (n-1) x n forward difference matrix."""
    return [[(-1.0 if j == i else 1.0 if j == i + 1 else 0.0) for j in range(n)] for i in range(n - 1)]


def gradient_matrix(n1: int, n2: int) -> Mat:
    """The 2N x N forward difference gradient with a Neumann border (zero rows at the border)."""
    N = n1 * n2
    G = [[0.0] * N for _ in range(2 * N)]
    for i in range(n1):
        for j in range(n2):
            k = i * n2 + j
            if i < n1 - 1:
                G[k][k], G[k][k + n2] = -1.0, 1.0
            if j < n2 - 1:
                G[N + k][k], G[N + k][k + 1] = -1.0, 1.0
    return G
test_split_bregman_method.py 133 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/split-bregman-method/. The authors are listed in prov/4TK5JZ.jsonl.

import itertools
import math
import random

from split_bregman_method import (
    chol_solve,
    cholesky,
    difference_matrix,
    gradient_matrix,
    mat_t_vec,
    mat_vec,
    objective,
    split_bregman,
)


def eye(n):
    return [[1.0 if i == j else 0.0 for j in range(n)] for i in range(n)]


def rof_brute(f, lam):
    """Exact 1D TV denoising by trying every sign pattern of the differences."""
    n = len(f)
    I, D = eye(n), difference_matrix(n)
    best, best_val = None, math.inf
    for s in itertools.product((-1, 0, 1), repeat=n - 1):
        cuts = [0] + [b + 1 for b in range(n - 1) if s[b] != 0] + [n]
        u = []
        for a, b in zip(cuts, cuts[1:]):
            sl = s[a - 1] if a > 0 else 0
            sr = s[b - 1] if b < n else 0
            u.extend([sum(f[a:b]) / (b - a) - lam * (sl - sr) / (b - a)] * (b - a))
        val = objective(I, f, D, lam, u)
        if val < best_val:
            best, best_val = u, val
    return best


def lasso_brute(A, y, lam):
    n = len(A[0])
    best, best_val = [0.0] * n, objective(A, y, eye(n), lam, [0.0] * n)
    for s in itertools.product((-1, 0, 1), repeat=n):
        S = [j for j in range(n) if s[j] != 0]
        if not S:
            continue
        M = [[sum(A[i][p] * A[i][q] for i in range(len(y))) for q in S] for p in S]
        r = [sum(A[i][p] * y[i] for i in range(len(y))) - lam * s[p] for p in S]
        try:
            xs = chol_solve(cholesky(M), r)
        except ValueError:
            continue
        x = [0.0] * n
        for p, v in zip(S, xs):
            x[p] = v
        val = objective(A, y, eye(n), lam, x)
        if val < best_val:
            best, best_val = x, val
    return best


def test_cholesky() -> None:
    rng = random.Random(1)
    B = [[rng.uniform(-1, 1) for _ in range(5)] for _ in range(7)]
    M = [[sum(B[k][i] * B[k][j] for k in range(7)) for j in range(5)] for i in range(5)]
    r = [rng.uniform(-1, 1) for _ in range(5)]
    x = chol_solve(cholesky(M), r)
    assert max(abs(a - b) for a, b in zip(mat_vec(M, x), r)) < 1e-10


def test_example_first_step() -> None:
    f = [0.0, 0.0, 3.0, 3.0]
    x, d, b = split_bregman(eye(4), f, difference_matrix(4), 1.0, 1.0, 1)
    assert max(abs(a - c) for a, c in zip(x, (3 / 7, 6 / 7, 15 / 7, 18 / 7))) < 1e-12
    assert max(abs(a - c) for a, c in zip(d, (0, 2 / 7, 0))) < 1e-12
    assert max(abs(a - c) for a, c in zip(b, (3 / 7, 1, 3 / 7))) < 1e-12


def test_tv1d_brute_force() -> None:
    rng = random.Random(6)
    for _ in range(8):
        n = rng.randint(2, 6)
        f = [float(rng.randint(-3, 3)) for _ in range(n)]
        lam = rng.choice((0.3, 0.7, 1.5))
        mu = rng.choice((0.5, 1.0, 2.0))
        x, _, _ = split_bregman(eye(n), f, difference_matrix(n), lam, mu, 400)
        ref = rof_brute(f, lam)
        assert max(abs(a - c) for a, c in zip(x, ref)) < 1e-6


def test_isotropic_step_image() -> None:
    f = [0.0, 0.0, 4.0, 4.0] * 4
    x, _, _ = split_bregman(eye(16), f, gradient_matrix(4, 4), 1.0, 1.0, 300, group=16)
    for a, c in zip(x, [0.5, 0.5, 3.5, 3.5] * 4):
        assert abs(a - c) < 1e-6


def test_lasso_brute_force() -> None:
    rng = random.Random(3)
    for _ in range(5):
        m, n = 5, rng.randint(2, 4)
        A = [[rng.gauss(0, 1) for _ in range(n)] for _ in range(m)]
        y = [rng.gauss(0, 1) for _ in range(m)]
        lam = rng.choice((0.2, 0.8, 2.0))
        x, _, _ = split_bregman(A, y, eye(n), lam, 1.0, 600)
        ref = lasso_brute(A, y, lam)
        assert max(abs(a - c) for a, c in zip(x, ref)) < 1e-6


def test_deblur_dual_certificate() -> None:
    # TV deblurring with a 3-tap blur: check the optimality conditions with v = mu b.
    rng = random.Random(10)
    n, lam, mu = 8, 0.3, 1.0
    A = [[{0: 0.5, 1: 0.25, -1: 0.25}.get(j - i, 0.0) for j in range(n)] for i in range(n)]
    x0 = [0.0, 0.0, 2.0, 2.0, 2.0, -1.0, -1.0, -1.0]
    y = [a + rng.gauss(0, 0.05) for a in mat_vec(A, x0)]
    D = difference_matrix(n)
    x, d, b = split_bregman(A, y, D, lam, mu, 3000)
    v = [mu * bi for bi in b]
    grad = [a + c for a, c in zip(mat_t_vec(A, [p - q for p, q in zip(mat_vec(A, x), y)]), mat_t_vec(D, v))]
    assert max(abs(g) for g in grad) < 1e-6
    dx = mat_vec(D, x)
    for vi, di in zip(v, dx):
        assert abs(vi) <= lam + 1e-6
        if abs(di) > 1e-4:
            assert abs(vi - lam * math.copysign(1.0, di)) < 1e-6
    # The certificate implies optimality: no random point does better.
    best = objective(A, y, D, lam, x)
    for _ in range(50):
        z = [a + rng.uniform(-0.05, 0.05) for a in x]
        assert objective(A, y, D, lam, z) >= best - 1e-9

History

Osher, Burger, Goldfarb, Xu and Yin (2005) introduced Bregman iteration for total variation imaging, and Yin, Osher, Goldfarb and Darbon (2008) applied it to ℓ1\ell_1 problems. In 2009 Tom Goldstein and Stanley Osher proposed to split the ℓ1\ell_1 term off with a new variable and to apply the Bregman update to the constraint. They gave fast results for total variation denoising and compressed sensing MRI. In the same year Ernie Esser (UCLA CAM report 09-31) and Simon Setzer showed that the method with one sweep is the alternating direction method of multipliers, which Glowinski and Marroco and Gabay and Mercier had studied in the 1970s, and that it is Douglas-Rachford splitting on the dual. This gave convergence for every μ>0\mu > 0 and placed the method in the wider family of operator splitting methods.

References

  1. Tom Goldstein and Stanley Osher, The split Bregman method for L1-regularized problems, SIAM Journal on Imaging Sciences 2(2), 2009, pages 323 to 343
  2. Simon Setzer, Split Bregman algorithm, Douglas-Rachford splitting and frame shrinkage, Scale Space and Variational Methods in Computer Vision (SSVM 2009), LNCS 5567, pages 464 to 476
  3. Stanley Osher, Martin Burger, Donald Goldfarb, Jinjun Xu and Wotao Yin, An iterative regularization method for total variation-based image restoration, Multiscale Modeling and Simulation 4(2), 2005, pages 460 to 489
  4. Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato and Jonathan Eckstein, Distributed optimization and statistical learning via the alternating direction method of multipliers, Foundations and Trends in Machine Learning 3(1), 2011, pages 1 to 122

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example