Image Filtering Using All Neighbor Directional Weighted Pixels: Optimization Using Particle Swarm Optimization
Image Filtering Using All Neighbor Directional Weighted Pixels: Optimization Using Particle Swarm Optimization
4, December 2011
IMAGE FILTERING USING ALL NEIGHBOR DIRECTIONAL WEIGHTED PIXELS: OPTIMIZATION USING PARTICLE SWARM OPTIMIZATION
J. K. Mandal1 and Somnath Mukhopadhyay2
1
ABSTRACT
In this paper a novel approach for de noising images corrupted by random valued impulses has been proposed. Noise suppression is done in two steps. The detection of noisy pixels is done using all neighbor directional weighted pixels (ANDWP) in the 5 x 5 window. The filtering scheme is based on minimum variance of the four directional pixels. In this approach, relatively recent category of stochastic global optimization technique i.e., particle swarm optimization (PSO) has also been used for searching the parameters of detection and filtering operators required for optimal performance. Results obtained shows better de noising and preservation of fine details for highly corrupted images.
KEYWORDS
ADWNP, de noising, random valued impulse noise, miss and false, particle swarm optimization, swarm intelligence, sensitivity and specificity
1. INTRODUCTION
Due to a number of non idealistic encountered in image sensors and communication channels digital images are often corrupted by impulses during image acquisition or transmission. In most of the image processing applications, the most important stage is to remove the impulses because the subsequent tasks such as segmentation, feature extraction, object recognition, etc. are affected by noises [1]. Various filtering methods have been suggested for the removal of impulses from the digital images. Most of these methods are based on median filtering techniques, which use the rank order information of the pixels in the filtering window. The standard median filter [1] removes the noisy pixels by replacing test pixel with the median value of the pixels in the window. This technique provides a standard noise removal performance but also removes thin lines and dots, distorts edges and blurs image fine textures even at low noise ratios. The weighted median filter [2], center weighted median filter [3] and adaptive center weighted median filter [4] are modified median filters. They give extra weight to some pixels of the filtering window and thus these filters achieve betterment to the standard median filter.
DOI : 10.5121/sipij.2011.2416 187
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
The standard and weighted median filters are incapable of making distinction between the noisy and noise less pixels of the noisy image. Hence these filters distort the noise free pixels of the image. For such problems, switching median filter [5] has been proposed in which an impulse detector has been introduced to classify the center pixel of the test window. If the center pixel is detected as noisy then that pixel is replaced by standard median value of the test window. Otherwise the window is not filtered. The performance of this method of filtering purely depends on the performance of impulse detection algorithm but this method of filtering noisy image performs considerably better to standard and weighted median filters. As a result, many impulse detection methods along with switching median filters have been proposed [4] - [8]. Among them, an iterative pixel-wise modification of MAD (median of the absolute deviations from the median) filter [8] is a robust estimator of the variance used to efficiently separate noisy pixels from the image details. The tri-state median filter [9] and multistate median filter [10] are improved switching median filters those are made using a weighted median filter and an appropriate number of center weighted median filters. These filters perform better than weighted and center median filters at the cost of increased computational complexity. The progressive switching median filter [11] is also a variant of switching median filter that recursively performs the impulse detection and removal in two different stages. This filter performs better than many other median filters but it has a very high computational cost due to its recursive nature. The partition based median filter [12] is an adaptive median filter has been introduced to tackle both impulse noise and Gaussian noise, which uses the LMS algorithm for optimization purpose. The signal dependent rank ordered mean filter [13] is a switching mean filter that uses rank order information for impulse detection and filter. This method is similar to the switching median filter except that the median operation is replaced with a rank ordered mean operation. This filter obtains better noise suppression quality than some state-of-the-art impulse noise removal techniques for both gray and color images. To deal with random valued impulse noises in the images, an advance median filter, directional weighted median filter [14] has been proposed. This scheme uses a new impulse detection method and which is based on the differences between the test pixel and its 16 neighborhood pixels aligned with four main directions in the 5 x 5 window. The filtering scheme used here is a variant of median filter. It iterates the detection and filtering algorithm a minimum of 8 to 10 times to give satisfactory results for the images having highly random valued noises. Another switching median filter developed by Sa, Dash and Majhi, the second order difference based impulse detection filter [15] takes all the neighborhood pixels in the 3 x 3 window to detect and filter the random valued impulse noises in the image. This method of removing impulses has a drawback that it does not work well for highly corrupted images but good for very low rate of impulses in images. ANDWP [22] filter has varied the user parameters in a particular range and searched them manually in the 3 dimensional space to optimize the operator. Although it is a difficult task to determine the best parameter set to optimize the results for the various images having different noise density. Hence in this paper we used a global optimization technique, PSO to determine and optimize the restoration results. In addition to the median and mean based filters discussed, a dozens of soft computing tools based filters have also been proposed in this literature such as fuzzy filter [16], neuro fuzzy filter [17]., etc. These filters perform relatively better in terms of noise removal and details preservation compared to median and mean based filters. During noise suppression, a majority of the above mentioned filters have more or less drawbacks of removing thin lines and edges and thus blurring the fine textures in the images. Although these methods work fine for the images corrupted with impulses with up to 30% noise level in the images. But when more percentage of impulses presents in the images, these median and other filters dont able to perform satisfactory and they also cant remove some black patches on the reconstructed image. In this paper the scheme for removal of random valued impulse noise has been proposed which uses all the neighborhood pixels for noise detection as well as for noise filtering in the 5 x 5
188
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
window. The method uses maximum possible information of the neighborhood in order to improve the quality of the reconstructed image. The filtering operator is based on minimum variance of the four directional pixels aligned in the 5 x 5 window. Three user parameters such as number of iterations (I), threshold value (T) and decreasing rate (R) of threshold value in each iteration are searched in a 3-Dimentional space to get global optimal solution using a stochastic search strategy, particle swarm optimization (PSO) technique. The performance of the proposed algorithm is experimented and compared with other methods under several noise densities and different bench mark images. Experimental results show that the proposed algorithm performs better noise suppressing quality and effective image fine details preservation. Rest of the paper organization is as follows. Section 2 illustrates the impulse detection operator. Section 3 explains the filtering strategy. The proposed particle swarm optimization based technique is given in section 4.0. PSO based experiment results, comparisons and discussions are given in Section 5.0. Section 6.0 presents concluding remarks.
2. IMPULSE DETECTOR
2.1. Random Valued Impulse Noise
The images corrupted by impulsive noises with probability p can be described as follows:
Where n (k) denotes the image contaminated by impulse with noise ratio p, and f (k) means the pixels are noise free. There are two types of the impulsive noises: fixed- and random-valued impulses. In a gray-scale image, the fixed-valued impulse, known as salt and pepper noise, shows up as either 0 or 255 with equal probability (i.e. p/2), while the random-valued impulse is uniformly distributed over the range of[0, 255] at probability p.
Fig. 1 Four Directional Weighted Pixels in the 5 x 5 window for impulse detection In this scheme we have focused on the edges aligned with the four main directions along with included the two end pixels in the 5 x 5 window in each direction shown in fig. 1. The impulse detection algorithm is followed.
189
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
Step 1: The center pixel is classified as noisy by comparing the intensity value of that pixel with the maximum and minimum intensity values of its neighborhood pixels. The method first finds the maximum and minimum intensity values in the 5 x 5 window of the test pixel. If the test pixel does not lie within the intensity range spread of its neighbors it is detected as impulses. Otherwise it is assumed that it may not be impulses and passed to next level detection rule. Let yi,j is the test pixel and Wmin and Wmax be the maximum and minimum intensity values respectively within the test window around yi,j. Thus the detection of noisy pixel is given as
0 ( s ,t )sk
s ,t
| yi + s , j + t yi , j |, 1 <= k <= 4)
(2)
(3)
m: ( s, t) 3 o: (s, t) 2 n: otherwise
= {(s, t):-1 s, t 1}, and = {(s, t): (s, t) = {(-1, -2), (1, -2), (2, -1), (-2, -1)}}
(4) (5)
Step 5: d i(,kj ) is termed as direction index. Find the minimum of these four direction indices, which is used for impulse detection, denoted as ri, j = min{ d i(,kj ) : 1 k 4 } There may be three cases for value of ri,j . 1. ri,j is small when the center pixel is on a noise free flat region.
190
(6)
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
2. ri,j is small when the center pixel is on the edge. 3. ri,j is large when the center pixel is a noisy pixel. Step 6: So from the above analysis, classify the center pixel by introducing a threshold T. Define the complete impulse detection rule as
yi , j is a
Noisy pixel: Wmin yi,j Wmax Noise free pixel: ri,j T and Wmin < yi,j < Wmax
(7)
3. IMPULSE DETECTOR
In the proposed technique a novel scheme has been introduced which is based on minimum variance of all the four directional pixels. The followings are the procedure to restore a noisy pixel yi, j using its neighbourhood pixels.
(k ) Step 1: Calculate the standard deviation, i , j of all yi+s, j+t with (s, t) S k0 , k=1 to 4
(k )
li, j =
min k
{ i(,kj) : k=1 to 4}
(8)
Step 3: Select the set of pixels in the l i , j direction as S. And replace the middle pixel by a variable x to form S = {a, b, c, x, d, e, f}. (9)
Step 4: Formulate a quadratic equation f(x) by calculating the variance ( 2) of the above set, given in eq. 10. So
(10) (11)
Step 5: Compute first order derivative (f (x)) and second order derivative (f(x)) of f(x). Step 6: By the principle of maxima/minima on a quadratic equation and where a, b, c, d, e and f are positive integer constants, the value of f(x) is always positive for any value of x, where x [0,255]. So solve the equation f(x) =0, and get an x, where x [0,255] for which f(x) is minimum. Step 7: Replace y ij by x. The methods of detection and filtering of noisy pixels discussed work with three important user parameters. These are number of iterations (I), threshold value (T) and decreasing rate (R) of threshold value in each iteration. These parameters I, T and R are estimated to get optimum restoration results by a population based randomized search technique. Using this technique, the detection and filtering algorithm does not require any parameter to be supplied by the user for any level of noise density in the image.
191
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
2552
1 M *N
( I1 ( m, n ) I 2 ( m,n ))2
m.n
(12)
where M and N are the dimensions of the input images respectively. I1 and I2 are the original and enhanced images respectively.
The detection of noisy pixels depends upon a threshold value T, which is decreased by a rate R and the finite numbers of iterations are required to obtain the optimum fitness value depending upon the parameter R and I respectively. The problem under consideration is to find the particles having the best fitness value (i.e., maximum PSNR) and that has been implemented in supervised way using the algorithm given in section 4.2.
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
(14)
variables and constants of the above equations are initialized as follows: 1. p and g are the positive learning factors respectively. Usually p equals to g and ranges from [0, 4]. Present implementation considered p and g >1. 2. rp and rg random numbers in [0, 1], generated in every iteration separately. They are the real constants used to maintain the diversity of the populations. 3. i is the iteration number initialized to 1 and IMAX is the desired maximum number of generations. In the experimentation, it is set to [10- 20]. 4. h(i) are the inertia factors, which has positive real random values in less than 1. This value is kept fixed for individual iteration. 5. xp(i) and vp(i) are position and velocity of the pth particle at ith iteration, respectively. Initial positions of particles are randomly initialized and initial velocities are initialized to zero as discussed earlier. 6. fpB(i) and fgB(i) are the pBest (personal best fitness value of a particle) value and gBest (global best fitness value of particles) values at ith iteration, respectively. Initially fpB(i) are the values of fp which is calculated in step 1 and the best value among the initialized fp(i) is the global best initialized value which is assigned to all particles as fpB(i). 7. xpB(i) and xgB(i) are the personal best positions and the global best position of pth particle at ith iteration, respectively. These values are initialized by assigning location of particle where fpB(i) and fgB(i) have been obtained respectively, in step 6. Step 3: The velocities and positions of particles are updated using eqns. 13 and 14 respectively. These velocities and positions are calculated using three components; current velocity of each particle, distance between its current position and its pBest position of each particle and distance between its current position and gBest position of the entire swarm particle. Step 4: To keep the new positions in the search boundary, it is set to [vMin, vMax]. If new positions of particles are found beyond the boundaries of search space then they are restricted to the boundary values of the search space. The boundary values of I, T and R is discussed in step 1. Step 5: The fp(i+1) calculated in step 4 is compared with its previous fpB(i). If fp(i+1) is better than previous fpB(i) then fpB(i+1) is updated by fp(i+1), otherwise old fpB(i) is retained as a current fpB(i+1). Similarly xpB(i+1) is also updated according to this updated fitness fpB(i+1). Step 6: Best value among the all current fpB(i+1) calculated in step 5 is considered as new fgB(i+1). If new value of fgB(i+1) is better than previous fgB(i) then values of fgB(i) is updated by new fgB(i+1), otherwise old fgB(i) is retained as new fgB(i+1). Similarly, xgB(i+1) is also updated according to this updated fitness fgB(i+1). Step 7: Steps 3 to 6 is repeated until an adequate fitness is reached or a desired maximum number of iterations are met, but for present implementation the interval [10, 20] is taken as steps for iteration.
5. SIMULATIONS
The proposed impulse detection, filtering and optimization using particle swarm optimization techniques discussed in previous section is implemented and the performance of the proposed algorithm is simulated on various bench mark images like Boats, Bridge, Lena and Baboon corrupted by various noise ratios. All test images have the dimensions of 512 x 512 and 8-bit gray levels. The proposed filter is experimented to see how well it can remove the random valued impulses and enhance the image restoration performance for signal processing. These extensive
193
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
experiments have been conducted to evaluate and compare the performance of the proposed PSO based optimization filter with a number of existing impulse removal techniques. The proposed algorithm have been executed on the machine configuration as ACPI uni-processor with Intel Pentium E2180 @ 2.00 Ghz CPU and 2.98 Gbyte RAM with MATLAB 8a environment.
194
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
Proposed
195
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
(a)
(b)
(c)
(d)
(e)
(f)
Fig.2 (a) SMF [1] (b) FF [16] (c) MSM [10] (d) SD-ROM [13] (e) PSMF [11] (f) Proposed.
Fig.3 (a) Original (b) 60 % Noisy (c) SD-ROM [13] (d) MSM [10] (e) PWMAD [8] (f) DWM [14] (g) Proposed.
196
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
Table 4
PSNR (dB) values obtained against different noise densities on Lena image Filter Name
SMF[1] PSM[11] ACWM[4] MSM[10] SD-ROM[13] Iterative Median [20] Second Order[15] PWMAD[8] DWM Filter[14] ANDWP[22]
20%
30.37 35.09 36.07 35.44 35.72 36.90 34.35 36.50 37.15 34.42 34.53
30%
30 30.85 32.59 31.67 30.77 31.76 32.53 33.44 34.87 33.01 33.12
40%
27.64 28.92 28.79 29.26 29.85 30.25 30.90 31.41 32.62 32.65 32.88
50%
24.28 26.12 25.19 26.11 26.80 24.76 28.22 28.50 30.26 30.50 30.91
60%
21.58 22.06 21.19 22.14 23.41 22.96 24.84 24.30 26.74 28.29 28.53
Proposed
197
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
50% false
411 7258 1759 9928 7761 6018 5836
60% false
998
miss
32566 20857 23683 14490 9514 8260 8066 Table 6
miss
45365 26169 32712 17760 12676 8812 8565
False
2651 15778 7644 19577 12351 9304 9158
Proposed
Comparison of sensitivity and specificity results for Lena image for different noise densities
40% Filter
SDROM[13] MSM[10] ACWM[4] PWMAD[8] DWM[14] ANDWP[22]
50% Spc# %
99 97 98 90 92 94 93
60% Sen# %
71 83 79 88 91 94 94
Sen# %
78 84 84 88 90 93 93
Sen# %
72 84 81 88 92 94 93
Spc# %
99 92 97 88 91 94 93
Spc# %
98 89 95 87 92 94 94
Proposed
6. CONCLUSIONS
In this paper, a novel approach has been presented for filtering high random valued impulse noise from digital images. In this approach tuning parameters of noise detection and filtering operator has been optimized in supervised way using PSO based optimization technique. The main advantage of the proposed operator over most other operators is that it efficiently removes
198
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011
impulse noise from digital images while successfully preserving thin lines, edges and fine details in the enhanced image.
REFERENCES
[1] [2] S.E. Umbough, Computer Vision and Image Processing. Englewood Cliffs, Nj: Prentice- Hall, 1998. O. Yli- Harja, J. Astola, and Y. Neuvo, Analysis of the properties of median and weighted median filters using threshold logic and stack filter representation, IEEE transaction, Signal Processing, Vol. 39, no. 2 PP. 395-410, Feb. 1991. S. J. KO and Y. H Lee, Center Weighted Median Filters and Their Applications to Image Enhancement, IEEE Transactions on Circuits and Systems, Vol. 38, No. 9, pp.984-993, Sep. 1991. Tao Chen and Hong Ren Wu, Adaptive Impulse Detection Using Center Weighted Median Filters, IEEE Signal Processing Letters, vol. 8, no. 1, pp. 1-3, January 2001. T. Sun and Y. Neuvo, Detail Preserving median based filters in image processing, Pattern Recognition Letter, vol. 15, no. 4, pp. 341-347, 1994. S. Zhang and M. A. Karim, A new impulse detector for switching median filters, IEEE Signal Processing Letters, vol. 9, no. 11, pp. 360-363, Nov. 2002. G. Pok, Y. Liu, and A. S. Nair, Selective removal of impulse noise based on homogeneity level information, IEEE Signal Processing Letters, vol. 12, no. 1, pp. 85-92, Jan. 2003. Vladimir Crnojevic, Vojin Senk, Zeljin Trpovski, Advanced impulse Detection based on Pixel- Wise MAD, IEEE Signal Processing Letters, vol. 11, no. 7, pp. 589-592, July 2004. T. Chen, K.-K. Ma, and L.-h. Chen, Tri- state median filter for image de noising, IEEE Transaction Image Processing., vol.8, no. 12, pp. 1834-1838, Dec. 1999.
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10] Tao Chen and Hong Ren Wu, Space variant Median Filters for the Restoration of Impulse noise corrupted images , IEEE Transactions on Circuits and Systems-II: Analog and Digital Signal Processing, Vol. 48, No. 8, pp. 784-789, August2001. [11] Zhou Wang and David Zhang,Progressive Switching Median Filter for the Removal of Impulse Noise from Highly Corrupted Images, IEEE Transactions on Circuits and Systems, vol. 46, pp.78-80 January, 1999. [12] T. Chen and H.R. Wu, Application of partition based median type filters for suppressing noise in images, IEEE Transactions Image Processing, vol. 10, no. 6, pp. 829-836, Jun. 2001. [13] Eduardo Abreu, Michael Lightstone, Sanjit K. Mitra and Kaoru Arakawa, A New Efficient Approach for the Removal of Impulse Noise from Highly corrupted Images IEEE Transactions on Image Processing, vol. 5 , No. 6, pp. 1012- 1025, June 1996. [14] Yiqiu Dong and Shufang XU, A New Directional Weighted Median Filter for Removal of Random Valued Impulse Noise, IEEE Signal Processing Letters, vol. 14, no. 3 March 2007. [15] Pankaj Kumar Sa, Ratnakar Dash and Banshidhar Majhi, Second order difference based Detection and Directional weighted median filter for removal of Random valued impulsive noise, IEEE International Conference on Industrial and Information Systems, ISBN No. 978-1-4244-4836-4, pp.362-364,December 2009. [16] F. Russo and G. Ramponi, A Fuzzy filter for images corrupted by impulse noise, IEEE Signal processing Letters, vol. 3, no. 6, pp. 168-170, 1996. 199
Signal & Image Processing : An International Journal (SIPIJ) Vol.2, No.4, December 2011 [17] H. Kong and L. Guan, A neural network adaptive filter for the removal of impulse noise in digital images Neural Networks Letters, Elsevier Science Ltd, vol.9, no.3,pp.373-378,1996. [18] http://www.swarmintelligence.org/. [19] Kennedy. J., Eberhart, R. C. Particle swarm optimization., IEEE International Conference on Neural Network, Perth, Australia, PP.1942-1948(1995). [20] Forouzan, A.R. Araabi, B.N.,Iterative median filtering for restoration of images with impulsive noise, Electronics, Circuits and Systems, vol. 1, pp. 232-235, 2003. [21] D.R.K Brownrigg, The weighted median filter, Communications of the ACM, vol. 27, no. 8, pp. 807-818, August 1984. [22] J. K. Mandal and Somnath Mukhopadhyay, A Novel Technique for Removal of Random Valued Impulse Noise using All Neighbor Directional Weighted Pixels (ANDWP), International Conference on Parallel, Distributed Computing Technologies and Applications, PDCTA 2011, Communications in Computer and Information Science, Springer, vol. 203, pp. 102-111, September 2011.
Authors:
Jyotsna Kumar Mandal, M. Tech.(Computer Science, University of Calcutta),Ph.D.(Engg., Jadavpur University) in the field of Data Compression and Error Correction Techniques, Professor in Computer Science and Engineering, University of Kalyani, India. Life Member of Computer Society of India since 1992 and life member of cryptology Research Society of India. Dean Faculty of Engineering, Technology & Management, working in the field of Network Security, Steganography, Remote Sensing & GIS Application, Image Processing. 25 years of teaching and research experiences. Eight Scholars awarded Ph.D. and 8 are pursuing. Total number of publications 189.
Somnath Mukhopadhyay did his graduation in Bachelor of Computer Application form the University of Burdwan in 2004 and MCA in 2008 from the same university. He did his M.Tech (CSE) in 2011 from the University of Kalyani. Currently he is engaged in teaching profession with three years of experience. Broad area of his research interest includes Signal and Image Processing, Bioinformatics and Pattern Recognition. He has 7 publications in international conference proceedings and journals.
200