PSO Algorithm based Adaptive Median Filter for Noise Removal in Image Processing Application

A adaptive Switching median filter for salt and pepper noise removal based on genetic algorithm is presented. Proposed filter consist of two stages, a noise detector stage and a noise filtering stage. Particle swarm optimization seems to be effective for single objective problem. Noise Dictation stage works on it. In contrast to the standard median filter, the proposed algorithm generates the noise map of corrupted Image. Noise map gives information about the corrupted and noncorrupted pixels of Image. In filtering, filter calculates the median of uncorrupted neighbouring pixels and replaces the corrupted pixels. Extensive simulations are performed to validate the proposed filter. Simulated results show refinement both in Peak signal to noise ratio (PSNR) and Image Quality Index value (IQI). Experimental results shown that proposed method is more effective than existing methods. Keywords—Switching median filter; Particle Swarm algorithm; Noise removal; salt and pepper noise


I. INTRODUCTION
Image is a source of information but due to false capturing process, recorded images are degraded form of original image.Image noise is undesirable random fluctuations in color information or brightness of image.In digital cameras Noise depends on exposure time and amount of light.Long exposure time (slow shutter speed) mainly cause salt and pepper noise due to photodiode leakage currents.Image noise is of course inaudible.Different area of applications like medical imaging, remote sensing, robotics, computer vision and astronomical imaging needs good quality of images.
Digital images are prone to a variety of types of noise.Noisy pixels can take only maximum and minimum value in dynamic range in case of salt and pepper noise.In case of impulse noise, negative impulse appears as black (pepper) points and positive impulse appear as white (salt) noises.As a result, ''noisy'' input image gives degraded version of original image and carry inaccurate information.This is because input ''noise'' may be treated as valid information and transferred to output image, significantly degraded system performance [1].Image filtering can be classified into two main categories: linear and nonlinear filtering.In a group of nonlinear filter, median filter gives good performance on impulse noise.A new adaptive switching median filter (SWM) is better than switching median filter in terms of PSNR [2].But adaptive SWM filter handle noise up to 60%.Above 60% performance will decrease.Switching median filter with detector using max-min window is proposed [3].Better than ASWM but it can handle noise only up to 70%.A new algorithm works on both impulse as well as Gaussian noise is known as universal noise removal algorithm.As compare to SD-ROM filter it gives better result in terms of PSNR [4].If noise is more than 25% algorithm does not work.A noise adaptive soft-Switching median (NASM) filter preserves signal details across a wide range of noise densities and it is ranging from 10% to 50% [5].If Noise density greater than 50% performance significantly degraded.Recently proposed switching median filter gives better result on salt and pepper noise.It handles noise up to 70%, known as new switching based median filter (NSWM) [6].But it always considers pixel value 0 and 255 as a corrupted pixel.However practically it may not always true.Fuzzy impulse noise detector works on image corrupted with Gaussian as well as impulse noise if an image is corrupted with random impulse noise, filtering is applied on different part separately [7].A novel switching median filter with impulse noise detection method, called boundary discriminative noise detection (BDND) works on monochrome as well as color images, but handles noise up-to 70% [8].Two step filter (FIDRM) has been developed for reducing all kinds of impulse noise [9].Fuzzy filter based on interval-valued fuzzy sets (IVFS) [10] and Predictive based adaptive switching median filter (PASMF) [11] are neural network based two stage switching median filters.Performance of these filters are better in terms of Peak signal to noise ratio (PSNR) and Image Quality index (IQI) with low noise level.
A new adaptive median filter based on PSO detection technique has been proposed in this paper.PSO algorithm and its features are discussed in 3 rd section.4 th section contains block diagram of proposed filter and it's working.5 th section contains Images and graphs simulated on MATLAB.The conclusion is given in the last section.

II. SALT AND PEPPER NOISE
It appears as randomly scattering white and black pixels over the image.Noisy pixels take either minimum or maximum value in the dynamic range.In non-linear filters, median filter is most popular to remove salt & pepper noise.However when noise level is above 50%, edge details and other information of image are smeared.The Probability density function of bipolar impulse noise is given by P a for x=a P(x) = P b for x=b 0 otherwise (1) www.ijacsa.thesai.org If a > b, intensity "b" will appear as white dot in the image and "a" as a dark dot.If P a or P b is zero then impulse noise becomes uni-polar.Four different impulse noise models are discussed here [11,12].

A. Noise model 1
Impulse noise is modeled as salt and pepper noise, where pixels are corrupted by two fixed Intensity values, 0 and 255 randomly (for gray-level image), generated with the same probability.Every image pixel have intensity value S i, j ,where (i,j) is the location of pixel.In noisy image X i, j is the corresponding pixel having probability density function given by, Evolutionary techniques such as Genetic Algorithms shares many similarities with PSO [13].For solving complex problems, the system is initialized with a population of random solutions and searches for optima by updating generations.Each particle is initialized with a random position and a random initial velocity in the search space.The velocity and position of each particle is updated based on its own intelligence and on the experience of its neighbour [14].

A. The Particle Swarm Algorithm
In Particle swarm optimization each particle is refining its knowledge by interacting with one another.Each particle has arbitrarily small mass and volume & and also feels velocities and accelerations [15].Each Particle updated its coordinates which are associated with the best solution, it has achieved so far.It is local best or pbest.Another 'best' is tracked by the particle taking all the population as its topological neighbors, it is global best or gbest.
Its position is x i and velocity v i , each particle stores the best position in the search space it has found thus far in a vector p i .The velocity of the particle is adjusted stochastically toward its previous best position, and the best position found by any member of its neighborhood:

A. PSO optimizer
The algorithm for PSO based decision maker is as follows: Step 1: For FVT, taking 3x3 window from image and calculate the mean, median, max, min, std.deviation values of this window.
Step 2: Now taking the difference of centre pixel by these five values.
Step 3: For generating Feature vector Table taking 5000 pixels in which half is corrupted and half uncorrupted.
Step 4: Initialize population p=10.Taking small value of initial position and initial velocity.
Step 5: Multiply the FVT with Particles value.
Step 6: Compared the fitness value with threshold value and get fitness value.
Step 7: Updating the values for getting better fitness value.These values are local best values of particles, called "pbest".
Step 9: Now training is completed.Detector uses these best value particles for generating the noise map of Image.

if output of FVT <1
Noise Map (i, j) =

B. Filtering Stage
Filter uses a 3 x 3 sliding window W, corrupted pixel (X i , j ) is located in its centre.Adaptive median filter locally calculates the median value of uncorrupted neighboring pixels of 3 x 3 sliding window.It replaces the value of corrupted pixels by the calculating median value, uncorrupted pixel retains as is it.The proposed filter was compared with standard median filter (MED), adaptive median filter (AMED) [2], MNASM filter with BDND detector (MNASM) [8,13], Kaliraj et al. [17] and predictive based adaptive switching median filter (PASMAF) [11].It is justified by the simulated result that proposed filter gives better results with different noise levels in terms of PSNR and IQI values.In Fig. 4 to 11 results are shown is the form of graph, generated by using noise models 1, 2, 3, 4 respectively.
X i, j+1 X i+1 , j+1 www.ijacsa.thesai.orgTo validate and compare the results of proposed algorithm a gray scale Lena, circuit , Goldhill images having 512 x 512 are being taken.Figure 12    VI.CONCLUSION Proposed filter works efficiently on highly corrupted images.It handles noise up to 90%.Experimental results show that this method produces good output as compare to fuzzy based filter.In model 1, 46% improvement in PSNR and 53% improvement in IQI has been found as compared with PASMF filter.PSNR value is improved upto 14% and IQI value is increased 28% when noise density is 20%S + 60%P.PSNR increased by 24% and IQI improved 44% when 90% noise is introduced according to model 3. PSNR value is improved by 33% and IQI value is improved 48% , as compared with PASMF when noise level is 20%S+ 60%P according to noise model 4. It is the ultimate filter for removing salt and pepper noise.Even at a very high noise levels Image Quality Index is very light which shows good quality restored image.Some points can be discussed for further research.
1) It can also compare with more parameters as Image Enhancement Factor (IEF), Structure Similarity Index measure (SSIM).
2) Proposed filter can also test on colour images.
3) This technique may also be implemented on medical Images.

2
In this model Intensities of two noises are fixed similar to noise model 1, but Image pixels are corrupted by salt and pepper noise with unequal probabilities.That is, Where p = p1 + p2 and p1 ≠ p2.C. Noise model 3 Instead of two fixed values, impulse noise modeled more realistically by two fixed ranges.It ranges from [0, m] or [255-m, 255], with a length of "m" appears at both extreme ends with equal probability.The probability density function of X i, j will be, Model 4 also have two ranges of noise intensities similar to Noise Model 3, except that the intensities of low-density impulse noise and high density impulse noise are unequal.That is, where p = p1 + p2 and p1 ≠ p2.III.PARTICLE SWARM OPTIMIZATION Particle swarm optimization is introduced by Dr. Kennedy and Dr. Eberhart in 1995, is a population based stochastic optimization.It is inspired by social behaviour of bird flocking or fish schooling.

Fig. 1 .
Fig. 1.Block diagram of Particle Swarm optimization IV.PROPOSED MEDIAN FILTER A proposed median filter works in two steps.PSO optimizer works as Decision maker.It generates the noise map of Image.Noise map gives information about the corrupted and non

Fig. 2 .
Fig. 2. Block diagram of Proposed Filter corrupted pixels.If contaminated, a median fitter is applied.Median value is calculated only through the non-corrupted pixels of window.

Fig. 3 .
Fig. 3. Elements of 3X 3 sliding window W V. PERFORMANCE MEASURES Four different noise models are introduced to check the performance of filtering process.All the possible combination of noise densities are covered under experiments.Performance are measured in terms of PSNR and IQI.PSNR = 10 log 10 (255 2 /MSE) (7) Where MSE = ∑m ∑n [O(m,n)-R(m,n)] 2 ∕ (MN) Where MSE is mean squared error, O is a original image, R is a restored image and MN is the dimensions of the image.Image quality Index is a Integration of three different factors: loss of correlation, luminance distortion and contrast distortion [16].IQIw = Corr(Ow, Rw) × Lum(Ow, Rw) × Cont(Ow, Rw) (8) IQI of an image is an average value.The Image quality index IQIw is computed locally within a particular sliding window W.Here Ow represents the original and Rw represents the sliding window of restored images.IQI can vary from -1 to 1. 1 is the best value represents the best restored image.Image quality map of restored image is appears as a black dots on white background.Black dots in Image quality map shows dissimilarity in original and restored image while white dots shows similarity.Light colour map shows excellent result.

Fig. 4 .
Fig. 4. Comparison in terms of PSNR value Based on noise model 1

Fig. 11 .
Fig. 11.Comparison in terms of IQI value based on noise model 4 , 13, 14, 15 all having result images based on noise model 1, 2, 3, 4 respectively.Each figure consist of original image and corrupted image with edge map of original image and corrupted image produced by applying canny operator.To make it more clear, here one dimensional signal of original image and corrupted image are also shown.It is a histogram of a row intensity of image.The last image shows the image quality map of restored image.It's look like a black dots on white background.Black dots represent the mismatching between original image and restores image.Light quality map shows better restoration.All the simulations are done on MATLAB R2014a software.Noise intensities for different models are different.Every possible combination of noise have covered in experiments.The results have shows enhanced performance in terms of PSNR and IQI.