Alternating Direction Implicit (ADI) schemes for a PDE-based image osmosis model

We consider \emph{Alternating Direction Implicit} (ADI) splitting schemes to compute efficiently the numerical solution of the PDE osmosis model considered by Weickert et al. for several imaging applications. The discretised scheme is shown to preserve analogous properties to the continuous model. The dimensional splitting strategy traduces numerically into the solution of simple tridiagonal systems for which standard matrix factorisation techniques can be used to improve upon the performance of classical implicit methods, even for large time steps. Applications to the shadow removal problem are presented.


Introduction
Several imaging tasks can be formulated as the problem of finding a reconstructed version of a degraded and possibly under-sampled image. Removing signal oscillations (image denoising) and optical aberrations (image deblurring) due to acquisition and transmission faults are common problems in applications such as medical imaging, astronomy, microscopy and many more. Further, the image interpolation problem of filling in missing or occluded parts of the image using the information from the surrounding areas is called image inpainting [3,8]. More sophisticated imaging tasks such as shadow removal aim to decompose the acquired image into its component structures, such as cartoon and texture, or into the product of an "intrinsic" component not subject to light-changes (e.g. illumination) and its counterpart describing illumination changes only, see [4,11]. For a given image f , the problem is find u s.t. f (x, y) = l(x, y)u(x, y), (x, y) ∈ Ω, where Ω ⊂ R 2 denotes the image domain, l(x, y) the illumination image and u the reflectance image, i.e. the intrinsic image not subject to illumination changes [11]. Due to the ill-posedness of the problem (1), in [11] a maximum-likelihood approach is used. In [9,10], a PDE-based approach computing the solution of (1) as the stationary state of a linear parabolic PDE is considered. Due to its similarities with the physical process, such model is called image osmosis.
Image osmosis. Given a rectangular image domain Ω ⊂ R 2 with Lipschitz boundary ∂Ω and a positive initial gray-scale image f : Ω → R + , for a given vector field d : Ω → R 2 the linear image osmosis model proposed in [9,10] is a drift-diffusion PDE which computes for every t ∈ (0, T ], T > 0 a regularised family of images {u(x, t)} t>0 of f by solving: where ·, · denotes the Euclidean scalar product and n the outer normal vector on ∂Ω. The extension to RGB images is straightforward by letting the process evolve for each colour channel. In [10, Proposition 1] the authors prove that any solution of (2) preserves the average gray value and the non-negativity at any time t > 0. Furthermore, by setting d := ∇(ln v) for a reference image v > 0, the steady state w of (2) turns out to be a minimiser of a quadratic energy functional and can be expressed as a rescaled version of v via the formula , where µ f and µ v are the average of f and v over Ω, respectively.
In [10] the osmosis model (2) is used as a non-symmetric variant of diffusion for several visual computing applications (data compression, face cloning and shadow removal). A general fully discrete framework for this problem is studied in [9] where, under some standard conditions on the semi-discretised finite differences operators used, the conservation properties described above are shown to be still valid upon discretisation. We synthesise these results as follows: . For a given f ∈ R N + , consider the semi-discretised linear osmosis problem: where A ∈ R N ×N is an irreducible (non-symmetric) matrix with zero-column sum and nonnegative off-diagonal entries. For k ≥ 0, consider the time-discretisation schemes u k+1 = P u k : Then, in both cases, P is an irreducible, non-negative matrix with strictly positive diagonal entries and unitary column sum and for u(t) the following properties hold true: (i) For every t > 0, the evolution preserves positivity and the average gray value of f ; (ii) The unique steady state is the eigenvector of P associated to eigenvalue 1.
For large τ > 0, the numerical realisation via B.E. requires the inversion of a non-symmetric penta-diagonal matrix, which may be highly costly for large images. In this paper we solve problem (3) using accurate dimensional semi-implicit splitting methods, [5]. Similarly, fully implicit splitting schemes are considered in [6] and applied to large images for cultural heritage.
ADI splitting methods. Given a domain Ω ∈ R s , a dimensional splitting method decomposes the semi-discretised operator A of initial boundary value problem (3) into the sum: such that the components A j , j = 1, . . . , s, encode the linear action of A along the space direction j = 1, . . . , s, respectively. The term A 0 may contain additional contributes coming from mixed directions and non-stiff nonlinear terms. Alternating directional implicit (ADI) schemes are time-stepping methods that treat the unidirectional components A j , j ≥ 1 implicitly and the A 0 component, if present, explicitly in time. Having in mind a standard finite difference space discretisation, this splitting idea translates into reducing the s-dimensional original problem to s one-dimensional problems.
For imaging applications s = 2. Let u i,j denote an approximation of u in the grid of size h at point ((i − 1 2 )h, (j − 1 2 )h); the discretisation of (2) considered in [9,10] reads: which can be splitted into the sum of A 1 and A 2 where no mixed and/or nonlinear terms appear (A 0 = 0). Following [5], we recall now the two ADI schemes considered in this paper.
The Peaceman-Rachford scheme. The first method considered is the second-order accurate Peaceman-Rachford ADI scheme. For every k ≥ 0 and time-step τ > 0, compute an approximation u k+1 via the updating rule: where F.E. and B.E. are applied alternatively and in a symmetric way.
The Douglas scheme. A more general ADI decomposition accommodating also the general case (4) is the Douglas method. For k ≥ 0, τ > 0 and θ ∈ [0, 1], the updating rule reads In words, the numerical approximation in each time step is computed by applying at first a F.E. predictor and then it is stabilised by intermediate steps where just the unidirectional components A j of the splitting (4) appear, weighted by θ whose size balances the implicit/explicit behaviour of these steps. The time-consistency order of the scheme is equal to two for A 0 = 0 and θ = 1/2, and it is of order one otherwise. For s = 2 both schemes (6) and (7) are unconditionally stable, see [5]. However, for large time steps, the time-accuracy may suffer due to the presence of the explicit steps.
Scope of the paper. In this work, we apply schemes (6) and (7) to solve (3) and show that similar conservation properties as in Theorem 1 hold. Compared to standard implicit methods used in [9,10], such schemes renders a much more efficient and accurate numerical solution.

ADI methods for image osmosis
We show that ADI schemes (6) and (7) show similar conservation properties as in Theorem 1.
. Then, the Peaceman-Rachford scheme (6) on the splitting (5) preserves the average gray value, the positivity and converges to a unique steady state.
Proof. We write the Peaceman-Rachford (6) iteration as and observe that for i = 1, 2 the matrices P − i := I − τ 2 A i −1 and P + i := I + τ 2 A i , are non-negative and irreducible with unitary column sum and positive diagonal entries being each A i a one-dimensional implicit/explicit discretised osmosis operator satisfying the assumptions of Theorem 1. Therefore, at every implicit/explicit half-step and using the restriction on τ , the average gray-value and positivity are conserved. Furthermore, the unique steady state is the eigenvector of the operator P := P − 1 P + 2 P − 2 P + 1 associated to the eigenvalue to one.
The following lemma is useful to prove a similar result for the Douglas scheme (7). Proof. Writing each element b i,j in terms of the elements of C and D, we have that for every j: Proposition 2. Let f ∈ R N + , τ > 0 and θ ∈ [0, 1]. Then, the Douglas scheme (7) applied to the splitted semi-discretised scheme (5) preserves the average gray value.
Proof. For every k ≥ 0, we write the Douglas iteration (7) as where both P 1 and P 2 are non-negative, irreducible, with unitary column sum and strictly positive diagonal entries by Theorem 1, while A = A 1 + A 2 is zero-column sum being the standard discretised osmosis operator (5). By Lemma 1, the operator B := P 2 P 1 A has zero column sum and the operator P := I + τ B has unitary column sum. Thus, for every k ≥ 0:

Remark 1.
There is no guarantee that the off-diagonal entries of B are non-negative. Therefore, it is not possible to apply directly Theorem 1 to conclude that the iterates u k k≥0 remain positive and converge to a unique steady state. However, our numerical tests suggest that both properties remain valid. A rigorous proof of these properties is left for future research.

Numerical results
We present in Algorithm 1 and 2 the pseudocode for the Peaceman-Rachford (6) and the Douglas (7) schemes, respectively, when applied to images of size m × n pixels, with N := mn. We recall that in [9,10], the non-split problem is solved iteratively by B.E. using BiCGStab, whose performance is influenced by the accuracy and maximum iterations required. Due to the structure of the ADI matrices A 1 and A 2 , a tridiagonal LU factorisation can be used for improved efficiency after a permutation on matrix A 2 based on [7] to reduce the bandwidth to one: this is convenient for images with large m, where standard methods become prohibitively expensive. Without splitting, one LU factorisation plus T τ −1 system resolutions for the penta-diagonal matrix A, with lower and upper bandwidth equal to m, costs O(2m 3 n + 4T τ −1 m 2 n) flops overall. Using splitting, the computational cost is reduced to O(6(mn − 1) + T τ −1 (10mn − 8)) flops because of the use of tridiagonal 1-bandwidth matrices. For the same reason, the inverse operators A 1 and A 2 require less storage space than the full operator A while the inverse of A has significantly more non-zeros entries. Note that since τ is constant, all the LU factorisations can be computed only once before the main loop.

Input
: for k = 0 to T − τ do

Input
: As a toy example, we let the osmosis model (2) evolve towards a known steady state starting from an initial constant image. In Table 1 we compare the numerical solutions at T = 5000 for different fixed time-steps τ and values of θ. The benchmark solutionū is computed using Exponential Integrators [2], which for linear equations are exact-in-time solvers. Similarly as in [9], the approach is solved without splitting by BiCGStab (with parameters tol=1e-07 and maxiter=3e+05). For comparison, we test the direct LU factorisation applied to the full problem. The order of the methods for the relative Root Mean Square (RMS) error (rRMSE) rms(u T −ū)/rms(ū) are plotted in Figure 1a. For large τ , ADI methods are up to 10× faster than methods solving the problem without any splitting. In Figure 1b the ADI numerical solution of the shadow-removal problem [10] is shown, starting from a shadowed image f and setting d = ∇(ln f ) = 0 on the shadow boundary. In order to  correct the diffusion artefacts, an inpainting correction (e.g. [1]) is applied.

Conclusions
In this paper, we consider the image osmosis model proposed in [9,10] for imaging applications. We proposed dimensional splitting approaches to decompose the discretised 2D operator into two tridiagonal operators. We proved that the splitting numerical schemes preserve analogous properties holding in the continuous model. Numerically, these methods are efficient and accurate. We tested the proposed methods for a shadow removal problem, with an inpainting post-processing step. Future research directions include the rigorous convergence proof of the discrete models to the continuum one as N → ∞ as well as a rigorous stability and convergence analysis for the Douglas method (7).