High Density Impulse Noise Removal from Color Images by K-means Clustering based Detection and Least Manhattan Distance-oriented Removal Approach

Removal of impulse noise from color images is a stringent job in the arena of image processing. Impulse noise is fundamental of two types: Salt and pepper noise (SAPN) and Random valued impulse noise (RVIN). The key challenge in impulse noise removal from color images lies in tackling out the randomness in the noise pattern and in handling multiple color channels efficiently. Over the years, several filters have been designed to remove impulse noise from color images, but still, the researchers face a stringent challenge in designing a filter effective at high noise densities. In this study, a combination of K-means clustering-based detection followed by a minimum distance-based approach for removal is taken for high-density impulse noise removal from color images. In the detection phase, K-means clustering is applied on combined data consisting of elements from designated 5 × 5 windows of all the planes from RGB color images to segregate noisy and non-noisy elements. In the removal phase, noisy pixels are replaced by taking the average of medians of all non-noisy pixels and non-noisy pixels under 7 × 7 windows residing at least Manhattan distance from the inspected noisy pixel. Performance of the proposed method is evaluated and compared up against the latest filters, on the basis of well-known metrices, such as Peak signal to noise ratio (PSNR) and Structural similarity index measurement (SSIM). Based on these comparisons, the proposed filter is found superior than the compared filters in removing impulse noise at high noise densities. Keywords—Impulse noise; color image; salt and pepper noise; random valued impulse noise


I. INTRODUCTION
Digital images are susceptible to be corrupted by noise while in transmission. There are certain procedures involved in image registering which captures the digital images by multi sensor imaging. During this type of image acquisition, transmission and recording events, different type"s noise [1] can be incorporated into images. One of the noise types is impulse noise, which affects images by generating fixed or random changes in the pixel"s intensities in the range of "0" to "255". These sudden intensity changes not only degrade the images but also hamper the successive image processing procedures like morphological processing, segmentation, object recognition etc. Impulse noise is of two types: salt and pepper noise (SAPN) [2] and random valued impulse noise (RVIN) [3]. Both the types of noises disturb the homogeneity of the pixel"s intensities of images. Salt and pepper noise is categorized as fixed valued impulse noise, as it creates sudden dots in images by "0" (pepper noise) and "255" (salt noise) intensities. Due to these fixed but sudden fluctuations in pixel"s intensities produces spikes in images. It may be possible that some "0" and "255", which are actual values may reside in the images. Those are either edge or texture pixels. On the other hand, random valued impulse noise degrades the images in arbitrary ways. RVIN can have any changed value in the range of 0 to 255. It is very tough to remove both the noise categories as it needs efficient detectors to find impulse-noise-like pixels and a removal mechanism to remove those noises without impeding the minute features of the images.
Fundamentally, a lot of filters [1 -3] have been designed for removing impulse noise from grayscale images, but occasionally there are filters [1 -23] designed for color images. The challenges in dealing with the multiple color panels and emulating a solution that integrates all those said channels have laid the way for further researches in this field. In this paper, an amalgamation of k-means clustering oriented detection trailed by least distance-based removal method is proposed for high density impulse noise removal from color images. The different clustering methods are found to be doing generously well in noise detection. It sorts out the noisy pixels effectively by applying K-Means clustering on each window of color images and the replacement of the noisy pixel is being performed by the combined average of non-noisy pixels at minimum distance from the designated noisy pixel and median of all detected non-noisy pixels within a certain window. Typically, the proposed work accentuated its superiority in producing excellent qualitative and quantitative outcome at high noise densities; however it yields moderate performance at low noise densities. Investigational results show the preeminence of the proposed method over the other recent methods. www.ijacsa.thesai.org The next section is oriented as follows. Section II exemplifies the literature review part. Section III illustrates the proposed methodology consisting of a detection algorithm followed by a removal algorithm. In Section IV, results of the proposed work are portrayed and discussed allover. The paper ends with a Section V on conclusion.

II. LITERATURE REVIEW
Over the years, several linear and non-linear filters  were projected to remove impulse noise from grayscale and color images. The linear noise removal filters followed the convolution procedure with a window of coefficients. Later non-filters were proposed, out of which the median filter was the most popular one. The filter used median operation of surrounding pixels to restore every pixel which produced blurry outputs. But, in the restoration procedure, subtle features of images were lost. In the upcoming years adaptive median filters [4,5] and weighted median filters [7,8] were proposed. In those filters adaptive and weighted pixel-oriented approaches were taken respectively. Moreover, only the noisy pixels were restored leaving out the non-noisy ones. This approach created a revolution in image restoration. One of the established traditional switching filters among those, having the similar approach with boundary discriminative noise detection [4] created massive impact in the noise restoration arena. It was later reformed by amending with elimination tactics to form BDNDE [5]. Challenges came with designing noise restoration for color images as the complexity of the images increased with different color panels having diverse intensities. In a very recent approach, a switching filter [6] with fast processing speed was designed. The filter used the analogous neighborhood pixels in least distance as a measure of precipitateness and the replacement of noisy pixels were done by a practical fast processing switching algorithm.
Vector median filter (VMF) [7] was one of the most proven filters, having effective noise removal capability for color images by using vector median approach for reinstatement operation. It was improvised later, amalgamated with center weighted approach to form Center Weighted Vector Median Filter (CWVMF) [8]. With further research, an adaptive noncausal linear prediction-based vector median filter [9] was designed based on adaptive error prediction-oriented approach which was a further advancement of the VMF. Recently, another modification was performed on VMF where the researchers came up with an idea to integrate adaptive VMF with weighted median filter method [10]. This approach was equally effective at both low-and high-density noises. In vector median filtering approach [11] another used quaternion depiction to find out color distances based on which the filter classified noisy and non-noisy pixels using four directional criteria. That was followed by weighted median filter for removal operation. This approach was improvised with the previous filter"s upgradation [12] by using a weighted adaptive approach in the quaternion depiction for finding out more justified color distances which, thereby vividly enhanced the outcomes. One more adaptive vector median filter (ANCLPVMF) [13] was proposed in the similar timeframe which used the concept of linear estimation to calculate error components and thereby compare it with a defined threshold to sort out noisy pixels. The removal phase used an adaptive VMF for carrying out replacement of detected noisy pixels. Quaternion approach became popular as it combined three color planes into a single unit. Here, a rank-based approach [14] was proposed in recent times using quaternion theory which had segregated noisy pixels by rank criteria, along with edge detection mechanism and thereafter substituted those noisy pixels by weighted vector median filter. In the meantime, a relatively new filter [15] came up with a thought-provoking awareness by using statistical Moran"s I (MI) index for noise detection operation, which was followed by VMF for carryingout noise removal activity. In the same time, a support vector machine (SVM) oriented fuzzy filter [16] has been proposed. The approach used SVM in training phase and thereby, the testing phase segregated noisy and non-noisy pixels. Thereafter, fuzzy filtering was applied on the noisy pixel elements in removal operation. In the category of fuzzy filters, histogram fuzzy color (HFC) filter [17] was introduced where the association amid the planes was measured to estimate the original histogram and thereby rebuild the image by fuzzification. This approach was revised in Modified HFC [18] to scale up the performance for both RVIN and SPN. It was further restructured by using support vector machine-based approach to produce Multiclass support vector machine adaptive filter (MSVMAF) [19]. In the equivalent period an adaptive iterative fuzzy filter (AIFF) [20] was proposed that worked based on a trimming approach which created a new insight in fuzzy filtering. Among the recent approaches [21], a fuzzy averaging oriented noise detection and removal was carried out where detection was based on fuzzification of renowned ROD statistics and removal mechanism followed a thresholding based fuzzy oriented noise removal. In most recent times a method used deep convolution neural network for impulse noise removal. The method [22] first trained a classifier for noise detection and it was followed by putting the noise detected images into a denoiser for carrying out denoising operation. In current times a new filter [23] was designed which has used trimmed median filter, decision based median filter and unsymmetric trimmed mean filtering in circumstances based on the impulse values. The combined effect of those filters shaped virtuous outcome.

III. PROPOSED METHODOLOGY
In this paper, it has been primarily concentrated on removal of high-density impulse noise from RGB color images. An amalgamation of k-means clustering based noise detection tactic followed by a minimum distance-oriented removal mechanism is portrayed here (see Fig. 1 and 2). A 5 × 5 window is used here in the detection trailed by a 7 × 7 window in removal method to process the whole image pixel wise. These local windows are formed by centering each designated pixels in the image. Let us define the center pixel as C m, n and the window by WD 5×5 . Then the window criterion is outlined like below where: Here C row, col denotes all the pixel elements under the local window where each of those pixels have corresponding red, green and blue components, well-defined in RGB color images. www.ijacsa.thesai.org

A. Detection Method
In the beginning of the detection procedure, red, green and blue planes are extracted from the input noisy RGB color image (CLIM). A binary flag matrix FCLIM of the same size as the RGB image CLIM is created and is filled by "0". The center pixel of a window is denoted as CE and its intensity is denoted as PINT CE . The proposed detection algorithm is applied on each 5 × 5 window shaped surrounding the pixels obeying window criteria residing at each of the red, green and blue planes independently.
1) Primarily the designated local 5 × 5 window elements are skimmed and put into an array. By this process, the respective 5 × 5 window elements of each red, green and blue plane are stored in three independent arrays ARYRED, ARYGREEN, ARYBLUE.
2) The elements of each of the above defined three arrays are chronologically put into three successive columns to form a new 3 × 25 matrix MATRGB. Thereby the 1st, 2nd and 3rd column of MATRGB represents ARYRED, ARYGREEN, ARYBLUE elements in unchanged order.
3) K-Means clustering method has been employed on MATRGB having combined data from each red, green and blue plane. K-Means clustering would engender four different clusters Cl 1 , Cl 2 , Cl 3 , Cl 4 and group the analogous elements having similar properties into an equivalent cluster. K-Means clustering is performed on combined data to get the overall impact of a particular pixel at identical position on the red, green, blue planes and thereby putting the designated pixel into a proper cluster. The work is primarily focused on detecting random valued impulse noise affected pixel elements from noisy images. This implies that the noisy pixel elements of despoiled images are having random or arbitrary intensity value, whereas the non-noisy pixel elements have non-arbitrary values. So, after the application of K-Means algorithm on the combined data there is more likelihood that the non-noisy pixels having similar properties are likely to fall in the same cluster, while the noisy pixels, having dissimilar properties will be falling in random clusters.
4) The cluster having maximum number of elements is marked as maximum cluster (MC). The maximum cluster is most likely to be formed by non-noisy elements, as the nonnoisy pixels having homogenous properties are most likely to fall in a same cluster although the noisy pixels having heterogeneous properties are likely to be scattered in different clusters. So, there is a mere chance for the randomized noisy pixels to group together to form a superlative cluster that can surpass a non-noisy element-contained cluster based on the component count.

5)
All the elements in the maximum cluster are marked as non-noisy and the corresponding marked pixels intensities in the flag image FCLIM is filled by "0" and others are filled by "1".

B. Removal Method
In the noise removal process, the output flag image FCLIM is segregated into 7 × 7 windows, where each window"s center element CE is noisy.
The following section portrays the removal algorithm for individual windows: 1) Primarily, for each 7 × 7 window, the detected nonnoisy pixels are kept on an array DRR. Instantaneously the array is sorted in ascending order to find out the median MD. The median value can effectively take part in the removal procedure as it brings out the overall impact of all of the nonnoisy pixels in the DRR array. Furthermore, as the median value is a part of the non-noisy array, it can be more effective in removal.
2) Then, the non-noisy pixel or pixels in the DRR, partaking least Manhattan distance from the noisy center pixel CE is or are accumulated. Manhattan distance is calculated by taking the absolute difference between the center noisy pixel CE and the designated non-noisy pixel. If only such one-pixel value or multiple non-noisy values is or are present at minimum distance, then that value or those values are accrued in an array MDRR.
3) In a 7 × 7 window, the maximum Manhattan distance possible is 6, whereas the minimum Manhattan distance possible is 1. Let DS be the Manhattan distance from CE. DS is initialized to 1. If any non-noisy pixel or pixels is or are found at DS from CE, then that or those non-noisy pixel or pixels are put in MDRR and we stop. If no non-noisy pixel is found at www.ijacsa.thesai.org DS, then DS is incremented and again non-noisy pixel or pixels is or are tried to be found. This process of finding non-noisy pixel at least distance is carried out up to the DS value of 6, until found. By this procedure, MDRR is formed with the nonnoisy pixel or pixels at a least Manhattan distance of DS from CE. 4) Finally, the pixel intensity of center noisy pixel CE is replaced by using the equation below: ∑ Here, n is the number of elements in MDRR.

IV. RESULT AND DISCUSSION
This section portrays the simulation results of the proposed method executed in MATLAB R2018a installed on a Windows PC having core i5 processor and 8 GB of RAM. Experiment has been carried out on 10 color test images at various noise densities for both salt and pepper and random valued impulse noise. Experimental results of 4 images: Lena, Baboon, Tower and Barbara, out of those 10 test images are shown in this paper. Seven different filters have been compared against the proposed filter at various noise densities. Qualitative results are portrayed by three figures. Two images: Lena and Baboon are used to show visual output and comparison of the proposed filters in contrast to different filters. Peak signal to noise ratio (PSNR) and Structural similarity index measurement is used to measure the quantitative performance of the proposed filter.
Visual performance of the proposed filter is portrayed by two established test images: Lena and Baboon. The filter has been tested on 20 images but only these two images are shown in this paper. Fig. 3 displayed the qualitative performance comparison of the proposed filter with the existing established recent filters in terms of Baboon image and from the said Fig. 3 it is pertinent that the proposed filter outpaced the compared state-of-the-art filters with respect to habitual human viewpoint. The performance variety of the proposed filter is depicted in Fig. 4 and Fig. 5 using standard Lena image. The proposed filter is tested on both salt and pepper and random valued impulse noise effected images. Fig. 4 and Fig. 5 interpret the visual output of the proposed filter at diverse noise densities on the Lena image affected by RVIN and SAPN respectively. From the visual perspective, the proposed filter has shown notable result for both the types of impulse noise patterns. Quantitative performance of the proposed filter is judged by Peak signal to noise ratio and Structural similarity index measurement. Definition of Peak signal to noise ratio (PSNR) in "dB" is demonstrated below: Here, Bi = Base Image, De = De-noised image, A = Count of rows, and B = Count of Columns.   The structural semblance amid the base and restored image is quantified by Structural similarity index measurement (SSIM) and is defined as follows: Here, and are the mean of image and image correspondingly. The standard deviation of image and image is portrayed by and correspondingly. , are the defined constants.
is the co-variance of and . Table I assesses the proposed filter"s efficiency by means of PSNR for both RVIN and SAPN for standard Lena image. These two noise patterns create fixed and random dots on images thereby generating distorted images. The proposed algorithm takes care of both the noise patterns effectively as shown in Table I. Some recent filters are compared to the proposed filter to showcase its competence. It can be seen that at various noise densities, especially at higher noise densities the filter works superior to the recent reputable filters.  Table II portrays the performance comparison of the proposed filter counter to some of the recent filters with respect to another metric SSIM, to judge the efficacy of the filter to embrace the shape and structure of the investigated images while going through the restoration procedure. Three different images Lena, Baboon and Tower are used to depict the result. As seen from the comparison, the proposed filter holds over www.ijacsa.thesai.org 80% resemblances for all those images at a high noise density of 80% with respect to both SAPN and RVIN and also embraces 99% alikeness at a minimum 10% noise density. These results point toward the potential of the proposed algorithm to reinstate the structure of the images to a commendable extent post restoration.
One more imperative factor of the proposed filter was to choose the window size to be applied all over the image on both detection and removal stages. As the method is applicable for color image restoration, the same window size was applicable for all the red, green and blue color planes. Trial and error method was used to find the window size for the proposed method. After implementing the algorithm with different odd numbered window sizes, 5 × 5 and 7 × 7 size was found suitable for the proposed detection and correction method respectively. The PSNR outcome of the proposed filter using different odd numbered window sizes is demonstrated in Table III and it can be seen that, our method produced a superlative PSNR result for the selected window sizes.
It is intrinsic that, detection is the primary aspect for a filtering before applying a removal mechanism. While applying K-Means in the proposed method to cluster the least variant non-noisy elements, a cluster size has to be selected. As, 5 × 5 window size is used in the detection procedure, we have 25 elements, which will be segregated into different clusters after applying the K-means method to the data. If higher cluster size is taken, that could invalidate the objective of clustering as several small cluster would be created and it will be hard to find a maximum cluster having non-noisy elements. So, smaller cluster sizes were taken and investigation was performed on a trial-and-error basis. From Table IV, it can be perceived that, cluster size 4 yielded maximum output for the proposed method after being tested on different images.  By all the results shown and analyzed above, the proposed emerged to be superior to all the compared state-of-art filters. In the work, the key aspect of the enhancement lies in the Kmeans clustering-oriented detection. K-means clustering of size 4 is used here on each of the 5 × 5 kernels to generate four clusters having respective pixel intensities based on the randomized clustering method. As the non-noisy pixels have more propensity to have the least variant values within the defined small kernels, it is more likely that those pixels will be grouped by the clustering procedure and will belong to the same cluster. On the other hand, the noisy pixels are more probable to have scattered values and least possible to belong to the same cluster and also very occasional to form a cluster having the greatest number of elements. This creates the foundation of the proposed work followed by captivating the least Manhattan distance criteria in removal operation which has strengthened the proposed algorithm. Here, the non-noisy pixels, residing at least distance from the evaluated noisy pixel are taken as the key element in the removal operation. Because these non-noisy pixels at least distance are having the most influence on the assessed noisy pixel for each kernel. Altogether, these crucial facets of the proposed work justify its groundwork and showcase the reason behind the enhancement.

V. CONCLUSION
This paper demonstrates a high-density noise removal scheme from color images. The proposed method is fabricated on K-means clustering based detection followed by least distance criteria-oriented removal. Applying K-means clustering on the collective data, formed by elements of each defined windows of a color image, extracts the mutual effect of all color planes for individual pixels, residing at identical positions in each plane and thereby categorizing each pixel into a specific cluster. Clustering is applied in the conjecture that, the non-noisy pixels from each window having similarity are categorized into a specific cluster while noisy elements having variations will be scattered into different clusters and thus can easily segregate non-noisy and noisy pixels effectively. Then the non-noisy pixels, found at least distance from the inspected noisy pixel, are used along with allover median criteria of segregated non-noisy pixels from each window, for the replacement operation. This removal scheme uses the impact of closest non-noisy pixels, because these pixels are having maximum influence on the inspected noisy pixel. The overall work is justified by the superior qualitative and quantitative results up against the recent reputable filters. It can be seen that; the proposed algorithm works brilliantly at high noise densities and effectively at lower middle noise densities. Our www.ijacsa.thesai.org future objective is to design a filter that is equally capable at both low and high noise densities.