Image noise Detection and Removal based on Enhanced GridLOF Algorithm

Image noise removal is a major task in image processing where noise can harness any information inferred from the image especially when the noise level is high. Although there exists many outlier detection approaches used for this task, more enhancements are needed to achieve better performance specifically in terms of time. This paper proposes a new algorithm to detect and remove noise from images depending on an enhanced version of GridLOF algorithm. The enhancement aims to reduce the time and complexity of the algorithm while attaining comparable accuracy. Simulation results on a set of different images proved that proposed algorithm achieves the standard accuracy. Keywords—Outlier detection; image noise removal; LOF; GridLOF


I. INTRODUCTION
Image noise removal is one of the low level image processing operations with efficient noise removal is defined as the first step in image processing applications as all tasks are dependent on the efficiency of the noise removal [1], [2].However, this is a very challenging task as noise removal algorithms should preserve useful information in the image while removing noise.
Outlier detection is the process of identifying data items or points that do not agree with an expected pattern or other items in a dataset (outliers) [3].The importance of outlier detection derives from the fact that the deduced data might be translated into actionable information.This actionable information can be used in many applications.These applications include but not restricted to fraud detection for credit cards [4], control systems [5], medical research, parallel software applications [6], steganalysis in image sharing applications [7], intelligent transportation system, wireless sensor networks [8,9], and human skin detection [10].Outlier detection methods can be classified into three categories [3], [11], [12]: statistical methods, proximity-based methods, and clustering-based methods.There are two types of proximity-based outlier detection methods: distance-based and density-based methods.
The local outlier factor (LOF) is considered as the most common density-based outlier detection [13], [14].LOF as proposed in [15] focuses on the relative density of a data item against its neighbors.For each data item, relative density is used to calculate probability of being an outlier which called the local outlier factor (LOF).Although there are many research efforts in the literature on simplifying and enhancing the LOF algorithm [16]- [18], more enhancements need to be done to deal with big data.LOF', LOF", and Grid LOF [19], enhanced GridLOF [20] and FastLOF [21] are examples of these efforts.
Many researches [4], [6], [7] are interested in detecting noise in the image with the aim to save image's useful information.According to this, the noise in the image (outlier) is determined before applying the filter to these pixels (i.e.outliers) only.Thus, the image's useful information is not harmed.
This paper proposes a new noise detection and removal algorithm to eliminate noise from images using an enhancement version of GridLOF introduced in [20].The proposed algorithm is able to detect the noise correctly with better accuracy than GridLOF and in lower time and complexity.
The rest of the paper is organized as follows.Section 2 provides the related work about image filters.Details of our algorithm are introduced in Section 3. Section 4 describes the simulation results and provides an analytical discussion on the quality of our proposed method.Finally, Section 5 introduces conclusions and future work.

II. RELATED WORK
Most research working on removing noise from images depends on filters, such as standard median filter [22], [23], weighted median filter [23]- [25] and adaptive median filter [23], [26].Some research worked based on modern methods such as non-LocalMean based methods [27], [28], PDE based methods [29], [30].All of these filters change the values of both noisy and non-noisy pixels.Thus, researchers started to depend on fuzzy notion such as the work introduced in [31] which proposed an algorithm to remove noise depending on a fuzzy impulse detection technique with a better ability to detect noisy pixels without previous training.Also, in [32] a neurofuzzy operator is proposed based on two adaptive NF filter with a post-processor.Normal filters use the same filter for all pixels in the image which not only fixes the noisy pixels, but also it distorts the right pixels.
Towards enhancing LOF algorithm, many efforts have been seen in the literature.Kernel Density-Based Local Outlier Factor (KLOF) is an outlier detection algorithm which is based on LOF [33].In [34], a hierarchical framework approximated LOF is used for effective outlier detection.Also, an enhanced www.ijacsa.thesai.orgapproach for LOF is proposed to be used for data mining purposes in [35].The complexity of finding the nearest neighbors in LOF algorithm is ( ) where the difficulty of the algorithm itself is ( ).Thus, many researchers tried to skip the step of finding the nearest data point in the LOF algorithm.In this path, LOF', LOF", and GridLOF have been proposed in [19].
GridLOF is the most resourceful and adaptive algorithm in calculating LOF value for each of the data objects in the dataset.GridLOF algorithm also increases accuracy as it avoids some false identification that may occur in LOF.FastLOF has also been proposed in [21] to speed up the LOF computation.This is done by randomly dividing the dataset into groups.For each group, LOF is calculated and the point with LOF value greater than the defined threshold is identified (the threshold is initially selected between 1.0 and 2.0).This process is repeated to find better neighbors.
Although, FastLOF algorithm [21] can get outliers in any dataset, it cannot get all neighbors of a point as the data sets are divided randomly into groups.For this purpose an enhanced version of GridLOF algorithm is proposed by us in an earlier work in [20].The enhanced GridLOF outperforms GridLOF algorithm in terms of speed while achieving the same accuracy of GridLOF algorithm by simplifying the step of finding the nearest neighbors nodes that is the major bottleneck in GridLOF algorithm [19].
In [36], an algorithm is proposed to deal with the noisy image as a data that has some outliers (noise).According to this, the noise in the image (outlier) is determined before applying the filter to these pixels (i.e.outliers) only, in this way, the image's useful information is preserved.In this algorithm, the LOF is used for the whole image window by window to detect the outlier pixels as shown in Fig. 1 [36].for the white pixel and for the black pixel.This idea is used to detect them as noise pixels where their LOF values are very high compared to the normal pixels.

III. PROPOSED APPROACH
In the same direction of the work introduced in [31], [32], [36], a new algorithm is proposed in this paper, which detects noise pixels in the image using the proposed enhanced GridLOF in [20] before applying the noise removal approaches on it.The important merit of the proposed algorithm is that the enhanced GridLOF is applied on all of the image pixels at the same time and not window by window as in [36].In this way, all the points will be subject to the detection process all at once which is more accurate and realistic as the image is a single unit and the data within it is homogenous.Fig. 2 shows a noisy gray image (football image) and its color values of the pixels.The image has salt and pepper noise where noise pixels have values and for pepper and salt, respectively.These noisy pixels are thus outliers to the original image data.These outliers marked by circles in the right side of Fig. 2 must be detected before using a noise removal algorithm so as to correct their values only.
The steps of Local outlier factor (LOF) proposed in [15] can be summarized as follows: 1) For each object p in the dataset, find k-nearest neighbours.
2) For each object p in the dataset, calculate k-distance.
3) For each object p in the dataset, calculate reachability distance with his k-nearest neighbors: Where, d(p, o) is the distance between object p and its neighbor object o 4) For each object p in the dataset, calculate local reachability density: ( ) Fig. 2. A noisy image and its outliers' pixels.www.ijacsa.thesai.orgThis is based on the minimum points (MinPts) which is the nearest neighbours of p.

5)
For each object p in the dataset, LOF is calculated by: The core idea of our enhanced version of GridLOF algorithm [20] is to convert all points in the data to polar coordinates (by two values: ( )), where ( ) are computed as (Fig. 3): To get nearest neighbours, a circle with radius R is drawn from the center P as shown in Fig. 4. To define the hashed area in Fig. 4, the following terms are defined: For any point , the following equations are satisfied: Thus, any point satisfies (11) and ( 12) lies in the hashed area.
As shown in Fig. 4, the hashed area is bigger than the circle drawn around the P.So index points will be increased to be 4 index points (P0, P1, P2 and P3) instead of only one index point as shown in Fig. 5.
The hashed area in this case can be defined using the following equations:     Any point satisfies ( 13) through (20) lies in the hashed area.To use the above idea in finding the k-nearest neighbours, for each point in the dataset, a circle with initial radius is drawn which is centered at point .The number of points in this circle is deduced using the ( ) values which are calculated only once with each index point using ( 4) and ( 5).The radius of this circle is then increased until the number of points in the circle becomes equal to the required number of neighbors (k-neighbors).
The main goal of the proposed algorithm is to detect the noise in the image as outlier data.To mark whether a pixel is outlier or not, the outlier detection algorithm is utilized in the following steps (Fig. 6 shows the pseudo code of the proposed algorithm): 1) Calculate LOF for all pixels.If LOF > σ (certain threshold), the pixel is considered as an outlier.In any other case, we proceed to Step 2. σ equals to theoretically by the definition of LOF [22], but in real-life applications, this value does not apply due to rounding results of the calculations.Thus, in real-life applications, a value slightly greater than www.ijacsa.thesai.org[22], [31] can be chosen while other applications may be chosen to calculate a value that depends on LOF values for all pixels such as the mean of the LOF values and assign it to σ as in [36].
2) Obtain the 8 neighbors of each pixel and calculate the absolute difference between the value of each pixel and the value of its neighbors.We call this difference a "Change Rate".
3) Put as initial value for "OutlierFlag" parameter for each pixel and check the 8 absolute differences.If the absolute different > α, where α is a fixed value per application which depends on the nature of each application, then increase this parameter by .
4) If OutlierFlag > φ, then the pixel is considered as an outlier, otherwise, the pixel is normal.The value of φ determines the required level of useful information to be saved in the noisy image.In our experiments, we set φ to be equal to: , , , and (where represents the best quality of outlier detection and represents the best saving of useful information in noisy image).The proposed approach is applied only on gray images, we didn't try the proposed approach with color images but according to research proposed in [37], the same approach supposed to be applied individually on each color component.For example, for color model, the approach will be applied on Red, Green and Blue components individually for each pixel [37] so, we believe that this will give the same performance of the gray images.

IV. SIMULATION RESULTS
To assess the proposed algorithm, our experiments use accuracy metric.The proposed algorithm is applied on three different images after adding , , and of the images' pixels as "Salt and Pepper" noise and compute Peak signal-to-noise ratio (PSNR) [38] in each case.The proposed algorithm is also compared with other approaches in [36].PSNR is defined as [38]: In the following experiments, the median filter is used to replace the noisy pixels detected by the proposed algorithm.Two different images are used with different noise levels of , , and to assess the proposed approach.The effect of φ (determines the required level of useful information to be saved in the noisy image) on the accuracy of the image after removing the detected noise pixels will be assessed.Fig. 7 shows the original lifting body image and the image after adding noise to it, while Fig. 8 shows the values of each pixel in this image.Fig. 9 shows the result of applying the median filter the lifting body image after detecting the noise pixels using the proposed algorithm using different values of φ.The pixels values of the resulted image are shown in Fig. 10.Fig. 9 and 10 show that the images are correctly restored and the best outlier detection and removal is done at Table I shows the PSNR (in dB) for football image after using the proposed approach at different noise types, different noise density and with different values of φ.Table I shows that the accuracy is inversely proportional to the value of .The proposed approach is compared with the work presented in [40] which depends on LOF algorithm to detect the noise pixels.The experiments use Lena image with noise.The results show the good performance of the proposed algorithm.Table I shows that the proposed approach has the best performance in case of Salt & Pepper noise, so we used this case to compare the proposed approach with other approaches.
Thus, the median filter is not suitable to work with this case as the median filter is ineffective with high noise densities [39], [40].The filter proposed in [39], [40] is used instead.The experiments are implemented using Matlab software.Table II shows PSNR (in dB) for football image after using the proposed approach with these filters.Fig. 11 shows the original Lena image and the same image after adding noise to it, while Fig. 12 shows pixels' values of these images.Fig. 13 shows the result of applying the proposed approach for followed by the filter presented in [39] with window size to replace the values of noisy pixels (outliers).The value of each pixel after correcting noisy pixels is also shown in the same figure.Table III shows the comparison between PSNR values resulted from applying the proposed algorithm and other algorithms proposed in [24], [36], [37], [41], [42] on Lena image with noise.
As shown in Table III, the proposed algorithm provides a good performance compared with the other recent approaches proposed in the literature.Although some approaches provides better performance than the proposed approach, we believe that working in finding a better filter than the used one will provide the performance we wish.This point will be our next line of research in the coming months.
Finally, we compared the execution time needed to detect the noisy point and we found that the proposed algorithm improved the execution time for all cases with an improvement ratio that ranges from to compared to LOF time.www.ijacsa.thesai.org29.88 ASWM [42] 30.53 LOFBDND [36] 33.95The Proposed Algorithm using the filter proposed in [39] 27.52 The Proposed Algorithm using the filter proposed in [40] 27.49This paper proposed a new algorithm to detect and remove noise from images depending on the enhanced GridLOF algorithm.Simulation results shows that proposed approach achieves the standard accuracy while the resulting PSNR still needs some enhancement.The future work at this point is to consider more enhancement of the proposed noise detection algorithm to provide better accuracy than the existing approaches and to use other filters or de-noising functions.

Fig. 1 shows
Fig. 1 shows Lena's image containing salt and pepper noise.On the right side of the figure, a window is taken and magnified from the image which shows two pixels noise; the first pixel with value (white pixel) represents a pepper noise and the second pixel with value (black pixel) represents a salt noise.The LOF values of pixels are computed (at the bottom left part of the figure) in this window that range from up to for the normal pixels while the noise pixels have very high LOF values;for the white pixel and for the black pixel.This idea is used to detect them as noise pixels where their LOF values are very high compared to the normal pixels.

Fig. 14
Fig.14shows the result of applying the proposed algorithm for followed by the filter introduced in[40] on Lena image with 40% noise.The figure also shows the value of each pixel after correcting the detected noise.

TABLE I .
PSNR FOR FOOTBALL IMAGE WITH DIFFENT TYPES OF NOISE AFTER APPLYING PROPOSED ALGORITHM

TABLE II .
PSNR FOR FOOTBALL IMAGE WITH HIGHER NOISE DENSITY AFTER APPLYING PROPOSED ALGORITHM

TABLE III .
PSNR COMPARISON