Anisotropic diffusion

In image processing and computer vision, anisotropic diffusion, also called Perona–Malik diffusion, is a technique aiming at reducing image noise without removing significant parts of the image content, typically edges, lines or other details that are important for the interpretation of the image. Anisotropic diffusion resembles the process that creates a scale space, where an image generates a parameterized family of successively more and more blurred images based on a diffusion process. Each of the resulting images in this family are given as a convolution between the image and a 2D isotropic Gaussian filter, where the width of the filter increases with the parameter. This diffusion process is a "linear" and "space-invariant" transformation of the original image. Anisotropic diffusion is a generalization of this diffusion process: it produces a family of parameterized images, but each resulting image is a combination between the original image and a filter that depends on the local content of the original image. As a consequence, anisotropic diffusion is a "non-linear" and "space-variant" transformation of the original image.
In its original formulation, presented by Perona and Malik in 1987, the space-variant filter is in fact isotropic but depends on the image content such that it approximates an impulse function close to edges and other structures that should be preserved in the image over the different levels of the resulting scale space. This formulation was referred to as "anisotropic diffusion" by Perona and Malik even though the locally adapted filter is isotropic, but it has also been referred to as "inhomogeneous and nonlinear diffusion" or "Perona-Malik diffusion" by other authors. A more general formulation allows the locally adapted filter to be truly anisotropic close to linear structures such as edges or lines: it has an orientation given by the structure such that it is elongated along the structure and narrow across. Such methods are referred to as "shape-adapted smoothing" or "coherence enhancing diffusion". As a consequence, the resulting images preserve linear structures while at the same time smoothing is made along these structures. Both these cases can be described by a generalization of the usual diffusion equation where the diffusion coefficient, instead of being a constant scalar, is a function of image position and assumes a matrix (or tensor) value (see structure tensor).
Although the resulting family of images can be described as a combination between the original image and space-variant filters, the locally adapted filter and its combination with the image do not have to be realized in practice. Anisotropic diffusion is normally implemented by means of an approximation of the generalized diffusion equation: each new image in the family is computed by applying this equation to the previous image. Consequently, anisotropic diffusion is an iterative process where a relatively simple set of computation are used to compute each successive image in the family and this process is continued until a sufficient degree of smoothing is obtained.
Formal definition.
Formally, let formula_1 denote a subset of the plane and formula_2 be a family of gray scale images. formula_3 is the input image. Then anisotropic diffusion is defined as
where formula_5 denotes the Laplacian, formula_6 denotes the gradient, formula_7 is the divergence operator and formula_8 is the diffusion coefficient. 
For formula_9, the output image is available as formula_10, with larger formula_11 producing blurrier images.
formula_8 controls the rate of diffusion and is usually chosen as a function of the image gradient so as to preserve edges in the image. Pietro Perona and Jitendra Malik pioneered the idea of anisotropic diffusion in 1990 and proposed two functions for the diffusion coefficient:
and
the constant K controls the sensitivity to edges and is usually chosen experimentally or as a function of the noise in the image.
Motivation.
Let formula_15 denote the manifold of smooth images, then the diffusion equations presented above can be interpreted as the gradient descent equations for the minimization of the energy functional formula_16 defined by
where formula_18 is a real-valued function which is intimately related to the diffusion coefficient. Then for any compactly supported infinitely differentiable test function formula_19,
where the last line follows from multidimensional integration by parts. Letting formula_21 denote the gradient of E with respect to the formula_22 inner product evaluated at I, this gives
Therefore, the gradient descent equations on the functional "E" are given by
Thus by letting formula_25 the anisotropic diffusion equations are obtained.
Ill-Posedness problem.
Diffusion coefficient, formula_8, which is proposed by Perona and Malik can be negative value when formula_27.
From here, the system is restricted by one-dimension for simplicity.
If flux function is defined as formula_28, where formula_29and formula_30, then the
Perona-Malik equation can be rewritten based on the flux function by
formula_31. Here, formula_32are denoted by first derivative of time, position, and second derivative of position, respectively. 
Now, it is clear that formula_33 plays a role in diffusion coefficient of linear heat equation. By calculating formula_33,
formula_35.
If formula_36, diffusion coefficient becomes negative and it leads to backward diffusion that enhances contrasts of image intensity rather than smoothes them in image processing.
In terms of theoretical perspective, backward diffusion is not only physically unnatural, but also gives numerically unstable solutions which are very sensitive to parameter(formula_37). In addition, it is known that backward diffusion have numerous of solutions and this is called ill-posedness problem. 
To avoid the problem, regularization is necessary and people have shown that spatial regularizations lead to converged and constant steady-state solution.
Regularization.
"Modified Perona-Malik model" (that is also known as regularization of P-M equation) will be discussed in this section. In this approach, the unknown is convolved with a Gaussian inside the non-linearity to obtain the modified Perona-Malik equation
Where formula_39.
The well-posedness of the equation can be achieved by regularization but it also introduces blurring effect, which is the main drawback of regularization. A prior knowledge of noise level is required as the choice of regularization parameter depends on it.
Applications.
Anisotropic diffusion can be used to remove noise from digital images without blurring edges. With a constant diffusion coefficient, the anisotropic diffusion equations reduce to the heat equation which is equivalent to Gaussian blurring. This is ideal for removing noise but also indiscriminately blurs edges too. When the diffusion coefficient is chosen as an edge seeking function, such as in Perona-Malik, the resulting equations encourage diffusion (hence smoothing) within regions and prohibit it across strong edges. Hence the edges can be preserved while removing noise from the image.
Along the same lines as noise removal, anisotropic diffusion can be used in edge detection algorithms. By running the diffusion with an edge seeking diffusion coefficient for a certain number of iterations, the image can be evolved towards a piecewise constant image with the boundaries between the constant components being detected as edges.