`Journal of Applied MathematicsVolume 2010, Article ID 761783, 19 pageshttp://dx.doi.org/10.1155/2010/761783`
Research Article

## An Overview of the Topological Gradient Approach in Image Processing: Advantages and Inconveniences

1Dammam University, Faculty of Sciences, PO Box 838, 31113 Dammam, Saudi Arabia
2ENIT-LAMSIN, Université de Tunis El Manar, BP 37, 1002 Tunis-Bélvédère, Tunisia

Received 27 July 2010; Accepted 21 November 2010

Copyright © 2010 Lamia Jaafar Belaid. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

Image analysis by topological gradient approach is a technique based upon the historic application of the topological asymptotic expansion to crack localization problem from boundary measurements. This paper aims at reviewing this methodology through various applications in image processing; in particular image restoration with edge detection, classification and segmentation problems for both grey level and color images is presented in this work. The numerical experiments show the efficiency of the topological gradient approach for modelling and solving different image analysis problems. However, the topological gradient approach presents a major drawback: the identified edges are not connected and then the results obtained particularly for the segmentation problem can be degraded. To overcome this inconvenience, we propose an alternative solution by combining the topological gradient approach with the watershed technique. The numerical results obtained using the coupled method are very interesting.

#### 1. Introduction

The goal of topological optimization is to find the optimal decomposition of a given domain in two parts: the optimal design and its complementary. Similarly in image processing, the goal is to split an image in several parts, in particular, in image restoration the detection of edges makes this operation straightforward.

The goal of this work is to show how it is possible to solve some image analysis problems using topological optimization tools. Let us recall that the basic and first idea is based on the work of Amstutz et al. [1] in which the authors propose a solution for crack detection problem using the topological gradient approach. Then, this approach was extended to different problems in image processing like restoration, classification, segmentation, inpainting, and tomography application [26]. This paper presents an overview of the applications of the topological gradient approach to major image processing problems with an illustration of both inconveniences and advantages of this technique in image analysis.

Let be a given noisy image defined in a domain and the restored image. We recall that a classical way to restore the image is to solve the following partial differential equations (PDE) problems where is a small positive constant and denotes the outward unit normal to . This method is well known to give poor results: it blurs important structures like edges and in order to improve this method, nonlinear isotropic and anisotropic methods were introduced. In our topological optimization approach, takes only two values: in the smooth part of the image and a small value on edges. Then classical nonlinear diffusive approaches could be seen as a relaxation of our method that increases the instability of the restoration process. The basic principle of the topological gradient approach is presented briefly in Section 2. The other sections are presented as follows The restoration problem with edge detection is presented in Section 3. Section 4 deals with the classification problem. In Section 5, we present the application of the topological gradient approach to tomography problem. Section 6 is devoted to the segmentation problem; we present in this section the major drawback of the topological gradient approach and propose an alternative to this inconvenience. We end this paper with some concluding remarks. Several numerical tests are also presented for all the applications studied.

#### 2. Topological Gradient Approach: Basic Principle

Let be an open bounded domain of , and let, be a cost function to be minimized, where is the solution to a PDE problem defined in . For a small , let be the perturbed domain by the insertion of a crack , where , is a straight crack and a unit vector normal to the crack. The topological sensitivity theory provides an asymptotic expansion of when tends to zero. It takes the general form where is an explicit positive function going to zero with and is called the topological gradient at point . It is clear that to minimize the criterion , we have to insert small holes at points where is negative. Using this gradient type information, it is possible to build fast algorithms. In most applications, a satisfying approximation of the optimal solution is reached at the first iteration of the optimization process. A topological sensitivity framework allowing to obtain such an expansion for general cost functions has been proposed in the work of Masmoudi [1, 7].

We recall that a classical way to restore an image from its noisy version defined in a domain is to solve the following PDE problem where is a small positive constant, called the conductivity, denotes the normal derivative and is the outward unit normal to . The idea of the topological gradient approach is to consider only two values for the conductivity : in the smooth part of the image and 0 (or rather undefined) in its complementary (the edges). For this reason, classical nonlinear diffusive approaches, where c takes all the values of , could be seen as a relaxation of our method. By enlarging the set of admissible solutions, relaxation increases the instability of the restoration process, and this could explain why our method is so efficient with respect to the algorithm cost.

#### 3. Application to Image Restoration

The goal of this section is to use the topological gradient approach as a tool for detecting edges for image restoration [5, 6]. In fact, an image can be viewed as a piecewise smooth function and edges can be considered as a set of singularities. The basic idea consists then in applying the topological gradient approach used for crack detection [1]. More precisely, let be the perturbed domain obtained by the insertion of a crack . The perturbed solution satisfies The variational formulation of problem (3.1) is given by where is the bilinear form, defined on by and is the linear form defined on by

Edge detection is equivalent to look for a subdomain of where the energy is small. So, our goal is to minimize the energy norm outside edges The variation of the cost function induced by the insertion of the small crack is given by the topological gradient theory [1]: with where is the solution of the direct problem (3.1) such that and is the solution of the following adjoint problems We note here that the solutions and are calculated in the initial domain without cracks, in the sense that the crack size is equal to zero. Then, the topological gradient can be rewritten in the following ways where is the symmetric matrix given by We can deduce that is minimal when the normal is the eigenvector associated to the smallest (i.e., most negative) eigenvalue of the matrix . In the following, this eigenvalue will be considered as the topological gradient. Our algorithm consists in inserting small heterogeneities in regions where the topological gradient is smaller than a given threshold . These regions are the edges of the image. The algorithm is as follows.

Restoration Algorithm
(i)Initialization: .(ii)Calculation of and the solutions of the direct (3.1) and adjoint (3.8) problems respectively.(iii)Computation of the matrix and its lowest eigenvalue at each point of the domain.(iv)Set (v)Calculation of solution to problem (3.1) with .

For numerical experiments, we considered, in a first step, grey level images (see Figure 1). We note that the perturbed image is obtained by adding a gaussian noise () to the original image, which grey level takes its values in the interval [0, 255]. We present in Figure 1 images restored by different approaches. More precisely, the restored image using the topological gradient approach is presented and compared to both linear and nonlinear diffusion methods [8]. Notice that the convergence of the nonlinear approach is achieved after 53 iterations. Our method can be interpreted as a linear isotropic diffusion method defined in the complementary of edges. In the anisotropic case, not only the amount of diffusion is adapted locally to the data but also the direction of smoothing. Like in the anisotropic nonlinear method, we smooth along image edges while inhibiting smoothing across edges. This can be achieved by replacing the diffusivity scalar by a diffusivity tensor. To show the efficiency of our method, we test an anisotropic algorithm with the topological gradient as follows

Figure 1: (a) Initial Lena image, (b) restored image using the linear diffusion method, (c) restored image using a nonlinear diffusion method, and (d) restored image using the topological gradient method.

(i)Initialization: .(ii)Calculation of and : solutions of the direct (3.1) and adjoint (3.8) problems. (iii)Computation of the matrix and its lowest eigenvalue at each point of the domain. (iv)Set , with and , where and represent the tangent and normal directions.(v)Calculation of solution to problem (3.1).

In Figure 2, we show that there is no significant difference between the results obtained using the isotropic or the anisotropic approach with the topological gradient method. Our two algorithms are tested on several images. All numerical tests show that the results obtained using the two algorithms are very similar. We show in Figure 2 a zoom of the Lena image and its restoration by the nonlinear method presented in [8], and the isotropic and the anisotropic topological gradient algorithms.

Figure 2: (a) zoom of the noisy Lena image (), (b) zoom of the restored Lena image using the nonlinear diffusion method, (c) zoom of the restored Lena image using topological gradient approach with the isotropic algorithm, and (d) zoom of the restored Lena image using topological gradient approach with the anisotropic algorithm.

We consider now color images such that the RGB model is used. Then, the image is defined by a 3D vector which represents the intensity of the three colors: red, green, blue, and since each component can be treated as a grey level image, then the topological gradient approach can easily be used, provided the cost function to be minimized has no coupling terms between the several channels. For the restoration problem, one usually set the cost function to the square norm of the gradient of the image. If we consider the most simple case, that is, the standard norm of the gradient, then the cost function can be easily written as a sum of the three independent terms, one for each channel. Then, the color image problem can be decomposed into three channel-by-channel independent problems. We mention here that the three channels can be supposed to be coupled, and a tensor gradient of the image can be considered as it is proposed in the work of Di Zenzo [9].

Some other coupling techniques have been defined in order to process multichannel images. We can cite for instance the Beltrami diffusion-type process, in which images are considered as manifolds. A nonlinear structure tensor is defined and locally adjusted according to a gradient-type measure and allows one to control the diffusion process [1012].

For the numerical tests, we first consider in Figure 3 the natural extension of the topological gradient method to multi-channel images, using the standard gradient norm and we compare this approach with the Ambrosio-Tortorelli version of the Mumford-Shah functional.

Figure 3: (a) original image, (b) noisy image (), (c) restored image by the classical topological gradient method (, ), and (d) restored image using Ambrosio-Tortorelli algorithm (, ).

Then to improve the restoration process, we propose in Figure 4 to present numerical results using the Di Zenzo approach coupled with the topological gradient approach. Figure 4 shows the restoration algorithm applied to the Di Zenzo gradient using a color image. The noisy image is obtained with an additive gaussian noise, such that the signal-to-noise ratio (SNR) is equal to 10.54. The third image corresponds to the restored image by our algorithm. The SNR of the restored image is 19.23. The identified edges given in the fourth image, correspond to the pixels where the most negative eigenvalue of the matrix is smaller than a given threshold.

Figure 4: (a) the initial image, (b) noisy image, (c) the restored image, and (d) edges of the restored image.

We must note here that, for the case corresponding to the classical topological gradient method, the solution of (2.2) can be written as , where are solutions of the following problems: for , which implies that the cost function can also be decomposed into three terms, one for each channel, as follows: with and the topological gradient can be rewritten in the following way: where is the symmetric matrix given by with and being the solutions of the direct and adjoint problems with respect to each channel .

On the other hand, for the case corresponding to the topological gradient method using the Di Zenzo gradient, a multispectral tensor associated to the image vector field is considered and the largest eigenvalue of the tensor corresponds to the norm of the gradient, called the Di Zenzo gradient [9]. The authors of [13] have proved the following result.

Lemma 3.1. For in , the Di Zenzo gradient is given by where is the function defined by with and is the standard norm in . As in the previous section, the topological gradient can be written as where is the symmetric matrix given by where is given by and is defined by (3.18).

#### 4. Application to Image Classification

This section is concerned with the problem of classifying an original image using predefined classes , , by choosing the color intensity as a classifier. More precisely, let be the original image defined on an open set of . Our goal is to find color , , and a partition , , of such that is close to in . The classified image will then be defined by where are defined by We recall that the variational approach consists in defining a cost function measuring the root mean square difference between the original image and the classified image The minimization of is easy, because for each point , we only have to find and add to subset . This can be called the closest class algorithm because each pixel of the original image is assigned in the classified image to its closest class. Inspired by the work of Samson et al. [14] in which the authors propose a classification model coupled with a restoration process, we propose to use the topological gradient approach applied to image restoration problem for both supervised and unsupervised classification problems [3, 4]. Our idea is to still consider the PDE problem given by (2.2) and instead of considering (or from a numerical point of view) on the edge set and elsewhere, we consider on the contours of the image and elsewhere. As is supposed to be small, then and are almost the same. Otherwise, , which implies that the PDE defined in (2.2) is nearly equivalent to with Neumann boundary condition (normal derivative) equal to zero, and this will provide a really smooth image. The classification problem is then as follows.

Supervised Classification Algorithm
(i)Initialization: .(ii)Calculation of and the solutions of the direct (3.1) and adjoint (3.8) problems respectively.(iii) Computation of the matrix and its lowest eigenvalue at each point of the domain. (iv)Set (v)Calculation of solution to problem (3.1) with .(vi) Application of the k-mean classification algorithm to .

As in the restoration process, the classification algorithm is applied to color images by decomposing the image in the RGB color space and then we deal separately with the three component images. The topological gradient of the sum can be considered as the sum of the three topological gradients with respect to each channel. Figure 5 shows the classification of a color image, using 30 color levels (whereas the original image has different colors), without regularization in a first time, then with regularization. We should mention here that the control of the regularization process can be made by considering progressively different values of ,  ,  , and so on.

Figure 5: From (a) The unregularized classified image and and (b)the regularized classified image.

On the other hand, the unsupervised classification corresponds to a classification problem in which the classes are not given. In this case, it is possible to determine them in an optimal way, still by using the topological gradient method. The idea is to study the impact of changing the value of a class or on the cost function which implies that for each class, we add (or substract, depending on which variation provides the most negative variation) one to the value of the class. This algorithm has been applied in the previous numerical tests in order to determine the optimal value of the classes: in Figure 5, the values of   32, and 5 classes with respect to the channels RGB have been determined with this algorithm. One may notice that this algorithm needs at least that the number of classes is known. But in unsupervised classification, it is not the case. The idea is then to add another term in the cost function defined in (4.3), measuring the number of classes. This can be seen as a regularization term, because we usually do not want to get too many classes. We propose here to rewrite the cost function given by (4.3) as follows: where is a positive regularization coefficient. It is then possible to bound as the two terms of the cost function are positive. The unsupervised classification algorithm is as follows

Unsupervised Classification Algorithm
(i)Initialization with . (ii)Determination of the optimal value.(iii) While is smaller than its upper bound: (iv) set and determine the optimal values of the new classes.(v)Stop if the value of the cost function at the optimum (with respect to ) is larger than the previous optimal value with classes.

This algorithm has been applied in Figure 5 in order to find the optimal number of classes and their optimal values.

#### 5. Application to Tomography Problem

In this section, we use the topological gradient as a tool for the reconstruction problem in tomography. We recall that a standard approach for regularizing the ill-posed problem of tomographic imaging consists in the following optimization problem: where denotes a system matrix defining the discrete Radon transform, is the measured projection, is a regularization functional, and represents a parameter which controls the tradeoff between a good fit to the data and the smoothness of the solution. Inspired by the work of. Chan et al. [15], we propose to consider the following minimization problem: where is a positive constant and is equal to 1 on the edges and to 2 elsewhere. Using the same idea of the topological gradient approach, we consider, for a given regular function , the following direct problem: where denotes the outward unit normal to and and are respectively the discrete Radon transform and the dual discrete Radon transform.

Let be the solution of the adjoint problem By considering the same algorithm applied for image restoration, we compute the reconstruction solution by solving the following proble: with where is a given constant. In order to obtain the optimal value of the coefficient , we have studied the behavior of the SNR of the reconstructed image as a function of . In fact, we have experimentally confirmed that the quality of the reconstructed image is first increasing rapidly with and then decreasing slightly, as we can see it in Figure 6. The optimal value is , and it has then been considered for our numerical tests. We have tested our method on the well known Shepp-Logan head phantom, for which projections data have been computed using a discrete Radon transform. Figure 7(a) shows the original image. A gaussian noise is added to the data with a signal to noise ratio , the sinogram is represented in Figure 7(b). Figure 7(c) shows the reconstruction result (). We also present in this paper a numerical comparison using several methods. Table 1 shows the PSNR (peak signal to noise ratio, in dB), SNR (signal-to-noise ratio, in dB), SSIM (structural SIMilarity), and MSE (mean squared error) of the reconstructed images for several methods: FBP (filtered backprojection), FBP + Hamming (with a Hamming filter on the FBP image), and the topological gradient approach using either the TV (total variation) norm or both TV and norms. The sinogram has a noise level such that the SNR is 24.5. We can see in Table 1 that the best results for all indicators are obtained with the hybrid norm within the topological gradient approach. The peak SNR is higher of more than 3 decibels, the structural similarity index is larger than 94% and the mean squared error is smaller than 1%. Note that both topological gradient methods provide much better results than the filtered backprojection, which is not surprising.

Table 1: Comparison between several reconstruction methods, quantified by several ratios and similarity indexes, for a noisy sinogram with .
Figure 6: Evolution of the PSNR (in dB) of the reconstructed image by the topological gradient method, as a function of the level of the regularization coefficient .
Figure 7: Reconstruction of the Shepp-Logan head phantom using the topological gradient method.

#### 6. Application to Image Segmentation

Figure 8: Segmentation using a watershed transformation combined with the topological gradient: (a) is a fruit-basket gray level image, (b) is a road scene image, (c) is the segmented fruit-basket image with , is the same segmented image such that , (d) is the segmented road scene image with , and (f) represents the same segmented image such that .

Finally, due to a large number of approaches used for the segmentation problem, it clearly appears that it is important to compare our experimental results with methods already proposed in the literature. Particularly, we propose to compare our method with an active contour model based on the level set approach, which is well known to be an efficient method, extensively used in many applications over the last decade. The basic idea in active contour models is to evolve a curve subject to constraints from a given image, in order to detect different objects in that image. To achieve this goal, we start with a curve around the object to be detected, the curve moves toward its interior normal and has to stop on the boundary of the object. This was the first idea of classical snakes and active contour models proposed by [20]. Our numerical tests are based on a level set method proposed by [21] and given by the following evolution equation: with boundary and initial conditions given by on and in , is a positive given coefficient, is an edge detector function defined in our numerical tests by , and represents the initial level set function. We refer the reader to [8] for more details about geodesic active contours and level set methods. Figure 9 shows the numerical results obtained. We should mention that in order to obtain the final contour illustrated in Figure 9(e), the algorithm requires 500 iterations and a computational time of 78 seconds. We present in Figure 9 some solutions as time evolves: during the evolution, the initial curve is shrinking and stopping as soon as it is close to an object boundary and spilling in order to detect the others objects.

Figure 9: Segmentation results of a synthetic image using an active contour model: different iterations are displayed from (b) to (e), (f) is the segmented image using our new approach.

#### 7. Conclusion

We presented in this paper many applications in image processing of the topological gradient approach with an illustration of both advantages and inconveniences of this technique. We proved that the topological gradient approach provides an excellent frame for solving different image processing problems, same if an alternative way to overcome its major drawback to give not connected contours is to combine it with other approaches. It has been applied to image restoration, edge detection, image classification, and image segmentation for both grey level and color images. It has also been applied to tomography problem, and our main goal consists in applying it to other real life problems mainly that in all the applications proposed, we obtained good results and the computing time is very short. We propose in a forthcoming paper to perform the application of the topological gradient approach to image segmentation, eventually by combining it with other approaches and particularly using marker criteria. In fact, as the edges are detected in regions where the topological gradient is the most negative, then it suffices to extract some points which belong to the edge set and then use these points as a selected marker set. We also intend to extend this work to color image segmentation and three-dimensional segmentation.

#### References

1. S. Amstutz, I. Horchani, and M. Masmoudi, “Crack detection by the topological gradient method,” Control and Cybernetics, vol. 34, no. 1, pp. 81–101, 2005.
2. D. Auroux and M. Masmoudi, “A one-shot inpainting algorithm based on the topological asymptotic analysis,” Computational & Applied Mathematics, vol. 25, no. 2-3, pp. 251–267, 2006.
3. D. Auroux, L. Jaafar Belaid, and M. Masmoudi, “Image restoration and classification by topological asymptotic expansion,” in Variational Formulations in Mechanics: Theory and Applications, E. Taroco, E. A. de Souza Neto, and A. A. Novotny, Eds., pp. 23–42, Catalonia, Spain, CIMNE, 2006.
4. D. Auroux, L. Jaafar Belaid, and M. Masmoudi, “A topological asymptotic analysis for the regularized grey-level image classification problem,” Mathematical Modelling and Numerical Analysis, vol. 41, no. 3, pp. 607–625, 2007.
5. L. Jaafar Belaid, M. Jaoua, M. Masmoudi, and L. Siala, “Image restoration and edge detection by topological asymptotic expansion,” Comptes Rendus Mathématique, vol. 342, no. 5, pp. 313–318, 2006.
6. L. Jaafar Belaid, M. Jaoua, M. Masmoudi, and L. Siala, “Application of the topological gradient to image restoration and edge detection,” Engineering Analysis with Boundary Elements, vol. 32, no. 11, pp. 891–899, 2008.
7. M. Masmoudi, “The topological asymptotic,” in Computational Methods for Control Applications, R. Glowinski, H. Karawada, and J. Periaux, Eds., vol. 16 of GAKUTO International Series. Mathematical Sciences and Applications, pp. 53–72, GAKUTO, Tokyo, Japan, 2001.
8. G. Aubert and P. Kornprobst, Mathematical Problems in Image Processing, vol. 147 of Applied Mathematical Sciences, Springer, New York, NY, USA, 2nd edition, 2001.
9. S. Di Zenzo, “A note on the gradient of a multi-image,” Computer Vision, Graphics, and Image Processing, vol. 33, no. 1, pp. 116–125, 1986.
10. A. Brook, R. Kimmel, and N. A. Sochen, “Variational restoration and edge detection for color images,” Journal of Mathematical Imaging and Vision, vol. 18, no. 3, pp. 247–268, 2003.
11. R. Kimmel, R. Malladi, and N. Sochen, “Image processing via the Beltrami operator,” in Proceedings of the 3rd Asian Conference on Computer Vision, pp. 574–581, Hong Kong, 1998.
12. N. A. Sochen, G. Gilboa, and Y. Y. Zeevi, “Color image enhancement by a forward-and-backward adaptive Beltrami °ow,” in Proceedings of the International Workshop on Algebraic Frames for the Perception-Action Cycle (AFPAC '00), G. Sommer and Y. Y. Zeevi, Eds., vol. 1888 of Lecture Notes in Computer Science, pp. 319–328, Springer, 2000.
13. D. Auroux, L. Jaafar Belaid, and B. Rjaibi, “Application of the topological gradient method to color image restoration,” SIAM Journal on Imaging Sciences, vol. 3, no. 2, pp. 153–175, 2010.
14. C. Samson, L. Blanc-Féraud, G. Aubert, and J. Zerubia, “A variational model for image classification and restoration,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 22, no. 5, pp. 460–472, 2000.
15. T. Chan, A. Marquina, and P. Mulet, “High-order total variation-based image restoration,” SIAM Journal on Scientific Computing, vol. 22, no. 2, pp. 503–516, 2000.
16. J. Serra, Image Analysis and Mathematical Morphology I, Academic Press, London, UK, 1984.
17. J. Serra, Image Analysis and Mathematical Morphology II: Theoretical Advances, Academic Press, London, UK, 1984.
18. L. Vincent and P. Soille, “Watersheds in digital spaces: an efficient algorithm based on immersion simulations,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 13, no. 6, pp. 583–598, 1991.
19. L. Jaafar Belaid and W. Mourou, “Image segmentation: a watershed transformation algorithm,” Image Analysis & Stereology, vol. 28, no. 2, pp. 93–102, 2009.
20. M. Kass, A. Witkin, and D. Terzopoulos, “Snakes: an active contour models,” International Journal of Computer Vision, vol. 1, pp. 133–144, 1987.
21. V. Caselles, R. Kimmel, and G. Sapiro, “Geodesic active contours,” International Journal of Computer Vision, vol. 22, no. 1, pp. 61–79, 1997.