In the mid-eighties, the PDP group. [4] introduced the back-propagation learning .... 9-12, 1991. [4] D.E. Rumelhart, G.
An Efficient Image Denoising of Random-Valued Positive Impulse Noise by Selective Median Filtering Using Artificial Neural Networks (ANNs) Debapriya Chakraborty (03MF1020) Email:
[email protected] Department of Mechanical Engineering, Indian Institute of Technology, Kharagpur, 721302
Abstract A novel image processing filtering approach is presented that adopts an artificial neural network (ANN) approach for the enhancement of images corrupted by ’Salt and Pepper’ noise. The new filter utilizes selective median filtering in contrast to the tradition median filters and has been reported for improved results with lower complexity. Artificial Neural Network has been utilized as an evolutionary tool to tackle the problem. The performance of the proposed filters has been found to be improved in terms of the image quality and time complexity compared to the performance of commonly used filters, such as the vector median, under a variety of performance criteria. It has also been shown that the proposed algorithm is robust in parameter settings.
Keywords: Image Processing, median filter, filtering
1
Introduction
The corruption by noise is a frequently encountered problem in image acquisition and transmission. Attenuation of noise and preservation of details are usually two contradictory aspects of image processing. Nevertheless, both of them are important to subsequent processing stages [1]. Conventionally, signal restoration and filtering have been realized by a linear framework, which is optimal when the noise being considered is additive and Gaussian [3]. However, linear methods do not perform well in the case of corruption by impulse noise. Their application to images may lead to blurred edges and structures, which may be more objectionable than the noise itself. Such disadvantages have spurred the development of nonlinear filters for the suppression of impulse noise. One of the most popularly used non-linear filters is the median filter. Old photographs are subjected to corruption by black and white spots, which are commonly known as ’Salt and Pepper’ noise. The removal of such kind of noise is the aim of the present work. Traditionally used median filter considers each pixel in the image in turn and looks at its nearby neighbors to decide whether or not it is representative of its surroundings. It replaces it with the median of those values. The median is calculated by first sorting all the pixel values from the surrounding neighborhood into numerical order and then replacing the pixel being 1
considered with the middle pixel value. (If the neighborhood under consideration contains an even number of pixels, the average of the two middle pixel values is used.) For an image with a steady variation in grey level this approach has shown satisfactory results. However most of the images have well-defined boundaries and hence there tends to be ”blurring” effect at these points. Moreover for very high percentage of noise the neighboring pixel may all be black of white which often leads to failure in using median filters. In the mid-eighties, the PDP group [4] introduced the back-propagation learning algorithm for neural networks. This algorithm for the first time made it feasible to train a non-linear neural network equipped with layers of the so-called hidden nodes. Since then, neural networks with one or more hidden layers can, in theory, be trained to perform virtually any regression or discrimination task. Moreover, no assumptions are made as with respect to the type of underlying (parametric) distribution of the input variables, which may be nominal, ordinal, real or any combination hereof. In their 1993 review article on image segmentation, Pal and Pal predicted that neural networks would become widely applied in image processing [5]. In the present work an Artificial Neural Network has been proposed that enables selective filtering so that the original sharpness of the image can be retained. It works on the principle of classification of the as ”healthy” or ”corrupt” and is not affected by concentration of noise in a particular area or very percentage of noise. Pixels with the defined error above the threshold value are classified to be ”Healthy” while those below are categorized as ”corrupt”. A ”healthy” pixel if classified is made to pass as it is. However if the pixel is ”corrupt” is sent to median filter for filtering. Salient feature of this algorithm is that it is efficient with respect to time and hence implementation can be done on real-time basis. The result obtained far overweighs those by the conventional median approach.
2
Artificial Neural Network
Artificial Neural Network An ANN is a massively parallel distributed processor that has a natural propensity for storing experimental knowledge and making it available for further use. It resembles the human brain in two aspects • Knowledge is acquired by the network through a learning process • Inter neuron connection strengths known as synaptic weights are used to store the knowledge. The modification of synaptic weights provides the traditional method for the design of ANNs. Such an approach is closest to linear adaptive filter theory which is well established and successfully applied in many diverse fields such as communications, control, radar, sonar, seismology and biomedical engineering. The computational process involved in ANN is briefly described. An artificial neuron receives inputs from a number of other neurons or from an
2
Figure 1: Nonlinear Model of a Neuron external stimulus. A weighted sum of these inputs constitutes the arguments to a nonlinear activation function. Most widely used activation functions are hard limiter, threshold logic and sigmoidal. The resulting value of the activation function is the output of the neuron. This output gets distributed along weighted connections to other neurons. The nonlinear model of a neuron is shown in fig. 1. The actual manner in which these connections are made defines the flow of information in the network and called the architecture of the ANN. The method used to adjust the weights is the process of training the network and called the learning rule i.e. the ANN systems are not programmed, they are rather taught. The learning may be supervised or unsupervised. In summary, the three essential ingredients of computational system based on ANN are the activation function, the architecture and the learning rule. It is apparent that an ANN derives its computing power through, first, its massive parallel distributed structure and second, its ability to learn and generalize. Generalization refers to the capability of ANN producing reasonable outputs for the inputs not encountered during training. These two information-processing capabilities make it possible for ANNs to solve complex problems that are currently intractable. ANN models are popular and are considered as one of the major component of the soft-computing paradigm. The useful properties and capabilities of ANN are due to its nonlinearity, input-output mapping, adaptability, fault-tolerance and VLSI implementability.
2.1
PROPOSED SCHEME
The proposed NNM (Neural Network Median) filter has two distinct operations to perform: • Impulse Detection using ANN method • Spatial filtering using Median Filter 3
Figure 2: Actual Structure of the ANN based Impulse Detector The scheme is applicable to salt and pepper as well as random positive valued positive impulse noise. The overall filter structure is such that the impulse detector is an ANN impulse detector given in fig. 2. The given structure needs some explanation. It is understood that a 3 x 3 neighborhood around the point X(i,j) is taken so that the points given above are taken into consideration. For points on the border they are padded with zeroes for the necessary filtering. The window XT of the 3 × 3 matrix from the observed image X for the test pixel X(i,j) is
X(i − 1, j − 1) X(i − 1, j) X(i − 1, j + 1) X(i, j − 1) X(i, j) X(i, j + 1)
X(i + 1, j − 1) X(i + 1, j) X(i + 1, j + 1)
XT is passed through a Mathematical Manipulator (MM) which computes ∆i , where i=1,2,3,4 defined using : ∆1 =
X(i − 1, j − 1) + X(i + 1, j + 1) + X(i, j) 2
X(i + 1, j − 1) + X(i − 1, j + 1) + X(i, j) 2 X(i, j − 1) + X(i, j + 1) ∆3 = + X(i, j) 2 X(i − 1, j) + X(i + 1, j) ∆4 = + X(i, j) 2
∆2 =
2.2
(1) (2) (3) (4)
Algorithm
1. Consider a 3 x 3 test window XT from the corrupted image X for the test pixel X(i,j) as shown above.
4
2. Compute ∆1 , ∆2 , ∆3 and ∆4 using the given equations. 3. Pass all ∆i ’s i=1,2,3,4 through the ANN detector to obtain the output O(i,j). 4. Derive the binary decision di,j regarding the presence of an impulse according to: 0 d(i, j) = 1
if O(i,j)≥ T ; otherwise.
where T is a threshold value. 5. Apply the median filtering in place at the test pixel X(i,j) using XT if di,j = 0 else go to Step 6 6. Shift the entire test window column wise and then row wise to cover the entire image pixels. 7. Repeat Step 2 through Step 6 for all windows.
3
Simulation
Simulation has been carried out for both impulse noise detection and filtering of noisy images. The detector structure used above has been implemented for the task. The architecture consists of the four inputs, which forms the input layer. This is followed by two hidden layers i.e. a 6 neuron layer followed by a 4 neuron layer. The output neuron is a single neuron constituting in itself a single layer. The nonlinear activation function used in this case is the tanh function and a threshold limit has been set to decide the binary decision. At first, the LENA image is corrupted with 10% noise. From this image 200 healthy and 200 corrupt pixels are randomly selected. Surrounding each selected pixel a pattern of 3 x 3 window is chosen to constitute a pattern. In this way 200 healthy patterns and 200 corrupted patterns are obtained for training the detector. For each pattern of input the ∆i s are computed using the window and is fed to the neural detector and output is computed. The corresponding desired value is compared with the estimated output and the error signal is used to train the bias and connecting weights of the network. As this network has a 6 neuron followed by 4 neuron followed by a single neuron structure, the total number of weights involved will be 4 ∗ 6 (24), 6 ∗ 4 (24) and 4 ∗ 1 (4) weights i.e. a total of 24 + 24 + 4 = 52 weights. Once trained though these weights suffice to correct the noisiness of any corrupted image. It has been found that for a healthy pattern this output corresponds to 0.1 and for a corrupt output it corresponds to 0.9. Training is continued by applying different patterns and the weights are updated in each case until Mean Square Error (MSE) in dB is reduced to minimum. At this stage, the training is discontinued and the network with final weights represents the impulse detector. The convergence characteristics obtained during training indicates the final 5
Figure 3: Lena image used for training the network MSE in dB to settle around -30 dB after 10,000 iterations. The impulse detector constructed after training is subjected to testing of noisy images. For this purpose, the noise level in LENA and other images are varied between 5 to 50%. In the usual manner the image is grouped into number of running windows each of size 3 ∗ 3 and then applied sequentially to the detector. Based on the outcome of the detection of the center pixel, media filtering is performed on the same window. In the present simulation, the threshold for impulse detection has been set to 0.4. To compare the efficiency of the method we have shown all four images i.e. the clear image, the corrupted image, the image after passing through median filter and the image after passing through the ANN impulse detection network. It must be seen that in no case after the training phase has the original image been used in the restoration process. It has only been provided for viewer reference. It can be seen that not only is the image followed by the impulse-detectorspatial filter combine sharper but is also free of salt and pepper noise.
4
Results
The training of the sequence was done using 200 points selected from the original image shown in fig. 3. and then the filter was run on images corrupted with salt & pepper noise of different intensities. All the results show marked improvements from the conventional median filter results. The training has been done in batch mode. In order to compare the performance using median filter and the present proposed filter, 6
Parameters
Median Filter
NNM Filter
PSNR(dB)
30.0
34.8
SNRI(dB)
17.2
22.0
PONE
10.2
22.0
POSP
67.1
7.6
Table 1: Comparative Analysis of Performance Indices (Lena Image 25% noise)
Figure 4: Image with 25% noise the data is presented using table 1. Once the training has been done the same filter can be used for different images. The filter trained on the Lena image has been used successfully for other images. An image of lungs with salt and pepper noise is used to observe the performance of the trained neural network as shown in fig. 4 and fig. 5 with 25% and 50% respectively. This filter can prove particularly helpful for removing salt & pepper noise in medical images such as shown in fig. 6.
5
Scope for future work
An adaptive fuzzy switching filter can be coupled that avoids the inherent limitation of the median filter and its variants, when there is a high probability of impulse noise. The rule base can be used as in [6].
7
Figure 5: Image with 50% noise
Figure 6: Lungs Image
8
6
Conclusion
This work suggests a novel and efficient nonlinear filtering scheme employing an ANN based impulse detector and selective median filter for removing salt and pepper noises. Extensive simulation on standard images reveals that the proposed scheme offers better filtering performances in terms of edge retention and noise rejection capabilities. Further the ANN detector is unique in the sense that it performs effectively on different noisy images. Thus it may be concluded that the proposed NNM filter is a superior candidate to combat impulse noise from corrupted images as compared to the conventional median filter.
References [1] Astola, J. and Kuosmanen, P., Fundamentals of Nonlinear Digital Filtering, CRC, Boca Raton, FL., 1997 [2] Jingtao Yao and Chew Lim Tan, A case study on using neural networks to perform technical forecasting of forex, Neurocomputing, 34, pp.79-98, 2000. [3] Coyle, E.J., Gabbouj, M., Lin, J.-H., From median filters to optimal stack filtering, IEEE Internat. Symp. Circuits Systems, vol. 1, pp. 9-12, 1991. [4] D.E. Rumelhart, G.E. Hinton and R.J. Williams, Learning internal representations by error propagation. D.E. Rumelhart and J.L. McClelland, Editors, Parallel Distributed Processing: Explorations in the microstructure of Cognition, Vol. I, MIT Press, Cambridge pp. 319-362, 1986. [5] N.R. Pal and S.K. Pal, A review on image segmentation techniques Pattern Recognition 26 9, pp. 1277-1294, 1993. [6] H. Xu, G. Zhu, H. Peng and D. Wang Adaptive fuzzy switching filter for images corrupted by impulse noise, Pattern Recognition Volume 25, Issue 15 , November 2004, Pages 16571663
9