A Modified Median Filter for the Removal of ... - Semantic Scholar

5 downloads 0 Views 2MB Size Report
Abstract: - In this work we present a new approach for the median filter. We modify this nonlinear filter used in impulse noise removal by applying it only to the ...
A Modified Median Filter for the Removal of Impulse Noise Based on the Support Vector Machines H. GOMEZ-MORENO, S. MALDONADO-BASCON, F. LOPEZ-FERRERAS, M. UTRILLAMANSO AND P. GIL-JIMENEZ Departamento de Teoría de la Señal y Comunicaciones Universidad de Alcalá Crta. Madrid-Barcelona km 33,600. D.P. 28871 Alcalá de Henares-Madrid SPAIN {hilario.gomez, saturnino.maldonado, francisco.lopez, manuel.utrilla, pedro.gil}@uah.es Abstract: - In this work we present a new approach for the median filter. We modify this nonlinear filter used in impulse noise removal by applying it only to the noisy pixels and by using a different pixel as output of the modified filter. The decision between the noisy and no noisy pixels is implemented by using the Support Vector Machines classification. We use this new classification tool because of its capability of generalization and the reduced number of training examples needed. The results presented show that this method slightly outperforms previous impulse noise removal methods, both in reconstruction error and in edge preservation. Besides, this method may be applied over highly corrupted images while maintaining the high quality in the recovered images. Key-Words: - Enhancement, impulse noise, support vector machines, classification, median filter, nonlinear filtering.

1 Introduction Sometimes, the images that we are using are corrupted by impulse noise. This noise may be due to camera imperfections (saturation) or to a noisy transmission channel. The ideal impulse noise removal must preserve the edges and the detail information into the images. There are several works in impulse noise removal [1]-[4] that look for this ideal removal. The best results have been obtained with nonlinear techniques rather than the linear ones. One nonlinear classical approximation is the median filter [5] that gives good results when it is applied to low corrupted images. The principal drawback of these methods is that they are applied to all the pixels into the images, noisy and not noisy. This fact leads to an image blurring and edge jitter, especially with highly corrupted images. In [1], the method proposed is applied only to the noisy pixels and the detection of noisy pixels is implemented with some threshold comparisons. The noisy pixels are replaced with the output of a called "Rank ordered mean" (ROM) filter. This filter is a modified median filter which input are the pixels in a window around the noisy pixel but excluding this one. In this work, we present a new modified median filter with an scheme similar to [1]. First, we find the

noisy pixels into the images by using a Support Vector Machines (SVM) classifier and these ones are replaced with the output of a modified median filter. This filter does not use the noisy pixel as input, like in [1]. The difference between both approaches is in the pixel information used as output. We use the SVM due to its capability of generalization with a reduced number of training examples. This property allows a training that can use synthetic images instead of real images and then reduce the training complexity. This new method gives good results, both in "Peak Signal to Noise Ratio" (PSNR) and edge preservation, when applied over images with high noise ratios. Our method gives the bests results when the noise ratio is below 30% (30 percent of noisy pixels into the image) and the results are similar for higher distortion. Section 2 of this paper introduces the SVM classifier and the parameters that must be set in the training process to obtain the bests results. Section 3 explains the method used for the training needed in the noise detection. Section 4 shows the modification made over the median filter and last in Section 5 we can see and compare the results obtained by applying this new method with those presented in [1].

2 SVM Classification There are several ways to classify, Bayesian decision, neural networks or support vector machines, for example. In this work we use the SVM classifier since this method provides good results with a reduced set of data and then we do not require an intensive training like another methods. Thus the SVM gives us a simple way to obtain good classification results with a reduced knowledge of the problem. The principles of SVM have been developed by Vapnik and have been presented in several works as [6][7]. In the decision problem we have a number of vectors divided into two sets, and we must find the optimal decision boundary to divide the sets. The border chosen may be anyone that divides the sets but only one is the optimal election. This optimal election will be the one that maximizes the distance from the frontier to the data. In the two dimensional case, the frontier will be a line, in a multidimensional space the frontier will be an hyperplane. The decision function that we are searching has the following form, n

f (x ) = w ⋅ x + b = ∑ wi xi + b

(1)

i =1

In (1), x is a vector with n components that must be classified. We must find the vector w and the constant b that makes optimal the decision frontier. The basic classification process is made by obtaining the sign of the decision function applied to the given vector, a positive value represents the assignment to one class and a negative one represents the assignment to the another class. In the SVM, the hyperplane w will be a linear combination of the support vectors and then (1) can be expressed as (2).

Normally the data are not linearly separable and this scheme can not be used directly. To avoid this problem, the SVM can map the input data into a high dimensional feature space. The SVM constructs an optimal hyperplane in the high dimensional space and then returns to the original space transforming this hyperplane in a non-linear decision boundary. The non-linear expression for the classification function is given in (3) where K is the non-linear mapping function. l

f (x ) = ∑ α i y i K (x i ⋅ x ) + b

(3)

i =1

The choice of this non-linear mapping function or kernel is very important in the performance of the SVM. The applied SVM uses the radial basis function to perform the mapping, since we have obtained the bests results with it. This function has the expression given in (4).

(

K (x , y ) = exp − γ (x − y )

2

)

(4)

The γ parameter in (4) must be chosen to reflect the degree of generalization that is applied to the data used. The more available training data the less generalization needed in the SVM. A little γ reflects more generalization and a big one represents less generalization. Besides, when the input data is not normalized, this parameter performs a normalization task. When some data into the sets can not be separated, the SVM can include a penalty term (C) that makes more or less important the mismatch classification. The lower C the more important is the misclassification error. C and the kernel are the only parameters that must be chosen to obtain the SVM.

l

f (x ) = ∑ α i y i x i ⋅ x + b

(2)

i =1

The y values that appear into this expression are +1 for positive classification training vectors and –1 for the negative training vectors. Besides, the inner product is performed between each training input and the vector that must be classified. Thus, we need a set of training data (x,y) in order to find the classification function and the α values that makes it optimal. The l value will be the number of vectors that in the training process contribute in a high quantity to form the decision frontier. The election of these vectors is made by looking at the α values, if the value is low the vector is not significant. The vectors elected are known as support vectors.

3 Noise detection training In this section we present a way to detect impulse noise by using the SVM classification. In this case, the decision needed is between "the pixel is noisy" or "the pixel is not noisy". The noise type that we are detecting is known as “salt&pepper”. In this noise type the corrupted pixels have values 0 or 255 with equal probabilities. In order to obtain the classification function we must extract the information needed from the images. We cannot use the entire image as a vector because of computations. We must divide the images to obtain small and significant vectors. In this work a vector is formed for each pixel, using the values of the pixels in a 3x3 window around it. This way a nine components vector is calculated at each pixel except

for the border of the image. These vectors are used as inputs to the training process and based on them we obtain the function (2). The next step is to find the images to be used into the training process. The images elected must be simple to avoid an excessive training time but significant enough to give good results. The option elected was to make controlled images with an eight bits gray scale and with added random noise in a known position. In Fig.1 an example is presented.

In [1] a modification is given for the median filter called “Rank ordered mean” (ROM). This modification consists of the exclusion of the central pixel in the window when we calculate the median. The central pixel has been detected as noisy previously. The output of this modified median filter is given in (5),

m(n ) =

r4 (n ) + r5 (n ) 2

(5)

where r4(n) and r5(n) are the values of the two central pixels in the ordered list of pixels,

r (n ) = [r1 (n ), r2 (n ),⋅ ⋅ ⋅, r8 (n )]

(a) White pixels

(b) Black pixels Fig.1. Example of training images As we can see the training to detect white and black noisy pixels is divided into two parts. First we use images like in Fig.1-a to train the SVM for white noisy pixels detection and images like Fig.1-b for black noisy pixels detection. This strategy reduces the number of support vectors and then increases the speed of the process. When we are searching noisy pixels in an image with salt&pepper noise, really we search for white and black pixels separately. In the training images we must control the size and the noise ratio. The images in Fig.1 have a 32x64 size and a 30 percent noise. When we increase the noise ratio we obtain best results over highly corrupted images but the number of support vectors is increased too. A higher size of the images produces a finer gray scale but increases the training and the execution time.

4 Modified median filter The classical median filter replaces the central pixel in a window with the median of the pixels into this window. The median is the value of the pixel that occupies the central position when we arrange the window pixels in ascending order. In a 3x3 window we take the fifth value in this ordered list.

(6)

The strategy used in this work is similar but we do not use m(n) as output. The value used as output is r5(n) since we find empirically that the results obtained are better. The application of the modified median filter can be made directly over the noisy image or in a recursive implementation that uses the previously replaced values into the sliding window, i.e. the window contains noisy and filtered image pixels. The recursive implementation improves the results obtained especially when the noise ratio is high.

5 Results The results presented here have been obtained by using LIBSVM [8] as implementation for the SVM. The programs used were written in C++ and compiled using the Visual C++ 6.0 compiler. The computer has a Pentium III processor with 128 Mbytes RAM. The 8-bit, 512x512 images used for the experiments are shown in Fig.2. They are varied and have been used in different works of impulse noise removal. The first results are shown in Table 1. In this table we show the PSNR obtained over the tests images for various noise ratios and for recursive and nonrecursive implementation of the filter. The γ parameter of the kernel has been elected to obtain the best results, in this case the value elected is γ = 5e-6. The C parameter must be elected to obtain accurate results with a reduced number of support vectors. In this work the parameter has a value C = 1000. A greater value increases the training time and a more little value decreases the accuracy of the process. The images used in the SVM training are shown in Fig.1. The number of support vectors after the training was 30 for white noisy pixels and 41 for black ones.

(a)

(b)

(c)

(d)

Fig.2. Images used in the experiments: (a) Lena; (b) Albert; (c) Bridge; (d) Sail.

10% 38.88 Lena 39.70 36.53 Sail 37.42 33.40 Bridge 33.93 36.40 Albert 36.66

Noise Ratio 15% 20% 25% 35.35 32.32 28.93 37.66 35.97 34.42 32.93 29.52 26.44 35.13 33.31 31.65 30.94 28.21 25.74 31.99 30.34 29.01 33.15 30.13 26.96 34.84 33.16 31.36

30% 26.12 32.83 23.78 30.52 23.79 27.94 24.28 30.29

Table 1. PSNR (dB) values with nonrecursive (up) and recursive (down) implementation. In Table 1 is shown how the recursive implementation increases the reconstruction PSNR especially for high noise ratios. We can see that this method is applicable to various noise ratios with success. The nonrecursive implementation shows a poor performance for high ratios. In this case some noisy pixels remain as noise and are not well replaced. But, if we repeat the filtering over the previously filtered image the results are clearly improved. For example, by filtering two times the “Albert” image with a 30% of noise, the PSNR obtained is 30.28 dB similar to the recursive implementation of the filtering process.

Median filter (3x3) ROM [1] (M=2)(No training) ROM [1] (M=1296)(Training) New modified median filter

Lena 28.57

Bridge 24.50

33.47

28.01

35.70

30.00

35.97

30.34

Table 2. Comparison of methods over 20% impulse noise images. Table 2 shows a comparison between the method presented here and the median filter and the ROM filter. In [1], the ROM filter is superior to other previous method and here we can see how our method is superior to ROM filter. The main goal for an impulse noise removal algorithm is the preservation of the edges and image information since this is the principal drawback of the nonlinear filtering. In Fig.3 we show two examples of noise removal (recursive implementation) in images with a 20% noise ratio where we can see how the edge structure is preserved and only minimal details makes the recovered images different from the original ones.

(a)

(b)

Fig.3. Examples of recovered images. (a) 20 % Noisy images. (b) Reconstructed images.

(a)

(b)

(c)

(d)

Fig.4. Results over a detail of Lena with 40% of noise. (a) Original image (b) Noisy image (c) Image after first pass (d) Image after second pass

The images in Fig.3 present good visual results for a high noise ratio. This method may be also applied over noisy images with a higher ratio. In Fig.4 we present results over a detail of “Lena” with a 40% noise ratio. The images in Fig.4-(c) and Fig.4-(d) show how the image details and the edges are preserved even when the noise ratio is high. The image in Fig.4-(c) is the first obtained when our method is applied. As we said, if the results are not satisfactory the process can be repeated in a second iteration and we can see the results in Fig.4-(d) where most of the remain noisy pixels are recovered. In both cases the method is applied recursively. The training process with images like in Fig.1 takes about 10 seconds and the execution time when the method is applied over 512x512 images takes about 5 seconds.

6 Conclusions In this paper, a new method for removal of impulse noise has been presented. The nonlinear filtering operation is made using a modified median filter. This filter uses a classifier based on SVM to decide between noisy and no noisy pixels. A modified median filtering is then applied over the noisy pixels. A training strategy for SVM is presented that is based on synthetic images with a controlled noise ratio. The results presented show that our new approach gives good performance both in visual and in PSNR results for various noise ratios even when compared with other significant previous methods. These good results do not increase the training time or the execution time.

References: [1] E. Abreu, M. Lightstone, S.K. Mitra, K. Arakawa, A new Efficient Approach for the Removal of Impulse Noise from Highly Corrupted Images, IEEE Trans. on Image Processing, Vol. 5, No. 6, 1996, pp. 1012-1025. [2] F. Russo, Noise Removal from Image Data Using Recursive Neurofuzzy Filters, IEEE Trans. On Instrumentation and Measurement, Vol. 49, No. 2, 2000, pp. 307-314. [3] Y.H. Lee and S.A. Kassam, Generalized median filtering and related nonlinear filtering techniques, IEEE Transactions on Acoustics, Speech, Signal Processing, vol. ASSP-33, 1985, pp. 672-683. [4] J.P. Fitch, E.J. Coyle and N.C. Gallagher, Jr., Median filtering by threshold decomposition, IEEE Transactions on Acoustics, Speech, Signal Processing, vol. ASSP-32, 1984, pp. 1183-1188. [5] R.C. Gonzalez and R.E. Woods, Digital Image Processing, Addison-Wesley, Reading, MA, 1992. [6] V. Vapnik. The Nature of Statistical Learning Theory, New York, Springer-Verlag, 2000. [7] N. Cristianini and J. Shawe-Taylor. An introduction to Support Vector Machines and other kernel-based methods, Cambridge, Cambridge University Press, 2000. [8] C.C. Chang and C.J. Lin. "Libsvm: Introduction and benchmarks". 2000. http://www.csie.ntu.edu.tw/~cjlin/libsvm.