Noise Adaptive and Similarity Based Switching Median Filter for Salt & Pepper Noise

Works have been conducted recently to remove high intensity salt & pepper noise by virtue of adaptive and switching median filters. One of the cited works is the Noisy Adaptive Fuzzy Switching Median Filter (NAFSM) by which the noisy pixels are detected through utilization of image histogram. Noiseless pixels are left unprocessed while noisy pixels are passed through the noise adaptive median filter which expands for them. A filter mechanism which performs decision making in line with local similarity and similarity has been proposed for NAFSM. Local similarity information in 3x3 mask has been used for filtering mechanism in the study titled Noise Adaptive and Similar Based Switching Median Filter (NASBSM). Two thresholds with three regions were made by virtue of local similarity information. The logic of the approach was based on more intensive filtering for noisy pixels with high similarity value with neighboring pixels and less for those with less similarity value with neighboring pixels. According to the numerical and visual simulation results of the NASBSM mechanism, it was detected that it eliminates noises with high density.


I. INTRODUCTION
IGITAL IMAGES become deteriorated in the process of transfer or obtaining image.Transfer operations especially in noisy channels, faulty memory placement arising from the hardware and defective pixels created in the camera sensor lead to impulse noise [1].Impulse noises are divided into two groups as salt & pepper noise and random noise.When the image is covered with salt & pepper noise, the noisy pixel takes a maximum or minimum value [2].
Standard Media Filter Filter (SMF) is utilized very often due to its noise reduction power and ease in computing.However, in as much as it makes regulation process for all noisy or noiseless pixels when the noise level increases some details emerge on the image or noise contamination occurs to the edges [3].Adaptive Media Filter (AMF) has good performance in low density noise and in small window sizes however when the window size increases or when the density increases blurring also increases [4].
Switching Media Filter (SMF) has been introduced with an eye to avoid damaging the pixels [5].It is decided if the pixel should be corrected or not before filtering in AMF.Satisfactory improvements for details and edges have not been achieved in this filter in addition to its difficulty in selecting a threshold value.
SMF is applied to noisy pixel, as long as the Decision-Based Algorithm (DBA) noise pixel remains unchanged [6].It is possible that the median value in the window can be noisy itself in a high noise intensive environment, in this case it is replaced by the neighboring pixel [7].Noise Adaptive Fuzzy Switching Median (NAFSM) determines the noise pixels through utilization of histogram.It has performed the fuzzy switching process by creating local information in the filtering mechanism [8].The sum of the valid pixel values in the recently recommended New Part Based Fuzzy Median Filter (NPBFMF) is obtained by weighting and this value becomes the output of the median filter.Fuzzy logic rules are used in the weighting process and the status of the input signal sequence is determined [9].In another study, an adaptive fuzzy inference system was utilized in order to determine and eliminate random impulse noises.Intensity based on directional statistics is utilized in order to build adaptive fuzzy membership function [10].However, satisfying noise reduction has not been achieved yet.
In the second part of this study, introduction of NAFSM filter has been made and the proposed NASBSM local similarity based filter mechanism has been briefly discussed.In the third part, NASBSM filter has been applied to images commonly used in image processing applications.The visual and numerical results obtained have been presented.In the last part, evaluations as regards this method have been made and proposals have been presented for future studies.

A. Noise adaptive fuzzy switching median filter
NAFSM filter is a iterative double gradual filter, where it will perform the salt & pepper noise intensities detection before identifying the locations of possible noise pixels.L salt and L pepper , which are the two local maximum points, will be searched in the regions at the beginning and end of the noisy image histogram curve firstly in the NAFSM filter.When the .L salt and L pepper , which are the two local maximum points are found, the search will be stopped.In Eq. ( 1), binary noise

Noise Adaptive and Similarity Based Switching
Median Filter for Salt & Pepper Noise F. Katircioglu D mask N(i,j) will be generated and the noisy pixels will be marked as mentioned the equality [8].
X (i, j) in Eq. ( 1) is a pixel in (i, j) coordinates with a density of X. N(i,j)=1 represents the noiseless pixel while N(i,j)=0, represents the noisy pixel in the next step for filtering.Commonly preferred W 2s+1 (i,j) square filtering approach has been used in NAFSM filter.
The term of G 2s+1 (i,j) which gives the number of noiseless pixels in the window is given as in Eq. ( 3) .
If the filtering does not have the minimum number of noisy pixels (G 2s+1 (i,j)< 1), the filtering window is extended from of each of the four edges.This procedure (G 2s+1 (i,j)>= 1) is continued until the criterion met.According to Eq. ( 4), each of the noise-free pixels is a candidate for the selection of the median pixel.
Four pixels in the upper left diagonal of the 3x3 filter window have been taken to ensure the repetition feature of NAFSM filter and behavior of making early process.d(i,j) term which is the absolute luminance difference in the local 3x3 information window is present like in Eq. (7).
Eq. ( 7) provides local information with the maximum value of the absolute brightness differences in the window obtained.

𝐷(𝑖, 𝑗) = 𝑚𝑎𝑥{𝑑(𝑖 + 𝑘, 𝑗 + 𝑙)}
Fuzzy logic is applied to the obtained local information as a part of filtering mechanism in NAFSM.The membership function of the accepted fuzzy set has been specified in Eq. (9).
Local information D(i,j) in Eq. ( 9), has been used as fuzzy input value.T1 and T2 are predetermined values of the threshold values 10 and 30 respectively.Finally, linear integration is made between the process pixel X(i, j) and the median pixel M(i, j) for making the restoration process of the designated noisy pixel.Restoration term Y(i, j) is provided in Eq. ( 10) below [8].

B. Noise adaptive and similarity based switching median filter
Similarity image forming the basis of NASBSM is a gray image in the form of white and black which emerges as result of examining the color difference values between pixels and makes the process of converting the image information to have a two-dimensional feature [11].It will be used in the decision making process during the work to determine the relation between the pixels in the mask with the central pixel.
Distances between them must be found in order to find the similarity values in the mask with an eye to obtain local information.The distance between the pixels, due to working on gray level image, is in the form of one dimensional usage of Euclidean distance.
The linear function in Eq. ( 11) has been used for calculating similarity values of two pixels [12].The dispersion range of similarity value varies in the (0,1) range.If the value obtained from this function is close to zero two pixels do not resemble each other, and if these values are close to 0, the result that resemble each other is obtained [13].
The D value normalizing coefficient and its value given in Eq. ( 11) has been determined as 255 which is the maximum value of gray level value.Equations ( 12), ( 13) and ( 14) are obtained by using the similarity values in the obtained mask.

𝑚𝑎𝑥_𝑆 = 𝑚𝑎𝑥 (𝑆 𝑖 )
(12) Giving decision by using the Eq. ( 12) and ( 13), and adaptive threshold selection for switching operation is performed in Equation ( 15). = (max _ − min _)/6 (15) Linear integration is made between the process pixel X (i,j) and the median pixel M (i,j) for making the restoration process of noisy pixel.Restoration term Y (i, j) is applied in the same way in Eq. ( 10) .

III. RESULTS
The filtering algorithm performed with NASBSM has been tested in grayscale comparison images consisting of ship, monkey and camera man in Fig. 1.These images are in the size of 225x225, 204x204 and 256x256 pixels respectively and is in JPEG format.Some criteria are utilized with evaluation of achievements and compare the success of the noise reduction algorithms used.Some of these are listed as signal -to -noise ratio (SNR), peak signal -to -noise ratio (PSNR) and mean square error (MSE).
I 0 denotes noiseless image while K denotes the image which contains noise.M and N denote the number of rows and columns of the image pixels.MSE, from the signal noise ratio, represents the mean square error.The PSNR criterion, used as the first criterion in the application, is defined as follows [1].
M I denotes the maximum number of gray levels in the image.This value has been determined as 255 in the application.A higher PSNR value denotes the fact that the restoration process has been done well.As a second criterion, MSSIM which calculates a similarity value between two images has been provided in Eq. ( 19) [14].
μ x and μ y are the average of x and y respectively while c 1 and c 2 are constant values.σ x and σ y are the variance of x and y respectively while σ xy is the covariance value of x and y.M denotes the number of pixels in the window within the image.The MSSIM value is present between 0 and 1, and if it is close to 1, it indicates that the performance of the application is good.Fig. 2. includes visual results applied to ship, monkey and camera man images -which are commonly used in the literature-in NASBSM's %20, %40, %60 and %80 noise intensities.High-intensity salt & pepper covered images seem to have captured the original image.The risks of image's blurring and losing their edge properties have only been achieved in very small quantities in %80 application.MSSIM value's being very high for all images used, emphasizes the proximity of the proposed work to real images according to the results in Table 1.PSNR value decrease as the noise intensity percentage value increases is normal and the decrease rate has been very low.NASBSM filter mechanism and performance are powerful and has been close to the original image to a large extent by eliminating the saltand-pepper noise.

IV. CONCLUSION
Local similarity information in 3x3 mask for filtering mechanism has been used in this study.Two thresholds with three regions have been realized with local similarity information.The logic of the approach was based on more intensive filtering for noisy pixels with high similarity value with neighboring pixels and less for those with less similarity value with neighboring pixels.It has been detected by visual and numerical results that it makes the filtering process in images covered with high-intensity salt & pepper noise and achieves the original image.MSE, PSNR and MSSIM have been preferred for performance evaluation.The risks of blurring of images and their losing edge properties were realized in a very small amount only in the %80 application NASBSM filter proposed in the next process will be compared with the median filters which are well-known in the literature and their performance evaluations will be detailed.Also its contribution to engineering applications by using the image processing application will be underlined.