K-MEANS BASED IMAGE DENOISING USING BILATERAL FILTERING AND TOTAL VARIATION

Bilateral filter and Total variation image denoising are widely used in image denoising. In low noisy level, bilateral filtering is better than TV denoising for it reveals better SNR and sharper edges. However, in high noisy level, TV denoising outperforms bilateral filtering in terms of SNR and more details of non edges. It is very difficult to perform denoising of a very noisy image for the resulted image rarely improves its SNR comparing to the original noisy one. Even though Total variation image denoising could be used for a very noisy image, the resulted SNR still needs some improvement. In this research, the K-means-based Bilateral-TV denoising (K-BiTV) approach using pixel-wise bilateral filtering and TV denoising has been derived based on the gradient magnitude calculation of the guideline map using K-means clusters. The denoising result of K-BiTV was depended on the level of noise density and the appropriate cluster. The experimental result showed that comparing to the conventional TV denoising and bilateral filter, K-BiTV gave the higher SNRs for some images with higher level of noise density.


INTRODUCTION
One of the most common topics in image processing is image denoising. Many researches about image denoising were concerned with Gaussian noise reduction. Gaussian noise could be interference with the image data for it was frequently happened in the malfunctioned sensors of typical cameras while photographing. The Gaussian noise could be generally expressed by the following Equation 1: where, u is the average noise intensity, σ is the standard deviation of the noise intensity and 1 2 σ π is the normalize term used to adjust the Gaussian noise into the normal standard:. (2) where, η (x, y) is the noise (additive zero mean Gaussian noise) added to the image f (x, y). Such additive noise reduces the quality of the image. In order to measure the quality of the image, we can calculate for the signal interference by Equation 3: Therefore, the Signal to Noise Ratio (SNR) of the noisy image is expressed by Equation 5: The discretion of gray intensities in the image with Gaussian noise may be alleviated by using noise filtering. Simple solutions including linear filters such as median filter illustrated by Guichard and Morel (2001), Weiner filter and Gabor filter applied by Lindenbaum et al. (1994) could remove some noise but fail to preserve the edges and fine details of the image. Nonlinear filtering are alternate methods and being focused by many researchers. Nonlinear diffusion equation was applied to denoising problem by Alvarez et al. (1992). Weiner filter was used to restore the image distorted by systems with noisy point spread functions by Guan and Ward (1989). However; nonlinear filtering suffers from more computation time and some blurring of fine details or non sharp edges in the image.
Recently, the methods used in Gaussian denoising of the image are mostly involved with non-linear filtering. There were some research studies on non linear filtering methods in spatial domain including bilateral filtering (Tomasi and Manduchi, 1998), anisotropic filtering model (Perona and Malik, 1990), total variation model (Rudin et al., 1992), non local means algorithm (Buades et al., 2005) and wavelet denoising (Coifman and Donoho, 1995;Donoho, 1995).
Notice that bilateral filter and total variation image denoising are widely used in image denoising. In low noisy level, bilateral filtering is better than TV denoising for it reveals better SNR and sharper edges. However, in high noisy level, TV denoising outperforms bilateral filtering in terms of SNR and more details of non edges. It is very difficult to perform denoising of a very noisy image since the resulted image rarely improves its SNR comparing to the original noisy one. Eventhough Total variation image denoising can be used for a very noisy image, still the resulted SNR is needed to be improved.

JCS
Therefore, in this research, the hybrid method is derived by encompassing two genuine methods:-Bilateral filtering and Total variation methods together with K-means clustering algorithm in order to improve the denoising output resulted from a very noisy image. This hybrid method was tested and compared with its genuine parent methods-bilateral filtering and Total variation image denoising method in order to examine the denoising improvement on SNR. The comparison result revealed that the proposed method is the most effective method in denoising comparing to bilateral and TV denoising method, which could be noticed by its SNR, which is the highest among those images with high level of noise density (SD>50).
The rest of this study was organized as follows. The next section begins with an introduction to the idea of Bilateral filtering and TV denoising based on Euler-Lagrange equations. The general idea of K-means clustering was also described in this section. In section 3, the proposed algorithm for K-BiTV is presented based on the gradient magnitude of the K-means mapped clusters. Then the experimental result was presented in section 4. Finally, the research summary and discussion were presented in section 5 and 6, respectively.

Bilateral Filter
Bilateral filtering proposed by Tomasi and Manduchi (1998) was meant to filtering noise without blurring the edges of the image. It encompasses the ideas of domain and range filtering in order to selectively filter pixels with similar intensities by finding its averages intensity. Pixels with different intensities from the center pixel were less significant (less weight) in the computation than those pixels with similar intensities to the center pixel. The process of noise filtering by selecting pixels with similar intensities to the center pixel as the center pixel is being denoised could be reference to evenly local averaging of gray intensities which still preserves edges. The bilateral filter is consisted of both domain and range filtering. The domain filter is described by Equation 6: is used to measure the likeliness of the center pixel and the nearby pixels of ( ) , d k x ξ r is used to normalize the convolution result as the following Equation 7: Where Equation 8: And Equation 9: Is the Euclidean distance between nearby pixels of ξ r and the center pixel of the mask. The range filter is the second characteristic of bilateral filter. It measures the similarity of gray intensity between the center pixel ( ) x r and the nearby pixels of ξ r . It could be expressed as follows Equation 10: where, , is the function used for measuring the similarity of gray intensity between f ξ In this case, the weighted average is applied by assigning higher weight on pixels with similar intensity to the center pixel and lower weight on those pixels that could not meet the similarity condition. The function used to make the normal standard in range filtering is defined by Equation 11: where, Equation 12: Science Publications

JCS
And the pixels similarity is measured by Euclidean distance using the following Equation 13: The range filter prevents blurring since it selects only pixels with similar intensity to for computing average. However, in order to reduce noise and preserve the sharpness of the image, neither range filter nor domain filter could obtain the desired properties. Therefore, bilateral filter integrates the domain and range filters by using convolution equation as follows Equation 14: And Equation 15: are domain and range filters, respectively. Bilateral filter could be used to reduce Gaussian noise and prevent blurring of the edges by the inherited domain filter and range filter.

TV Denoising
Total Variation (TV) is the quantity that used to determine the fluctuation of the image components. Since typical noises usually increase TV of the image, Total Variation Minimization problem proposed by Rudin and Oscher (1994) meant to smooth-out the image components; which is very useful for image restoration. The idea of Total Variation can be simply addressed by the following Equation 16: Which tries to measure the accumulation of varied discontinuities within the image u.
Total variation is usually applied in order to restore the image u using denoising model from Rudin and Osher, (1994) as Equation 17: Where z is the noisy image with the domain Ω.
This equation could be transformed into Tikhonov denoising form (Engl et al., 1996;Baumeister, 1987) Within Ω and Equation 21: On ∂Ω. This Euler-Lagrange could be discretized and solved simply by using iterative method.
Although conventional iterated TV denoising is not popular and considered to be inactive comparing to other techniques, it is useful in this research for it could be integrated with bilateral filtering using pixel-wise fashion. Moreover, K-means clustering is applied in order to improve the denoising performance as revealed by the experimental result.

K-Means Clustering
In K-means clustering, the number of clustered groups is needed to be specified before clusterization. Then the algorithm will randomly select each center data for every K groups. After that the Euclidean distance is applied to each instance in order to find the closest distance to the center data and allocate it to the specified group. Finally, the instances of each group will be included in the mean calculation for the new center data before finding the new members using Euclidean distance again. The process keeps repeating until the new reinitialized center data is identical to the previous one.

JCS
The idea of K-means clustering algorithm was formally described by Krishna and Murty (1999) K-means clustering algorithm originally proposed by MacQueen (1967) is considered to be a statistical technique which is simple but effective for data clustering.

THE PROPOSED ALGORITHM
Although, total variation image denoising and bilateral filtering are both considered being nonlinear filtering method, they carry out some different result according to Danda and McGraw (2007). Bilateral filtering tends to lowering the gray intensity of non edges region in the image but sharpening the edges significantly. However, the non edges intensities are more sustainable using TV denoising but the texture may be blurred by it.
Accordingly, bilateral filtering and TV denoising should be synchronized in order to keep sharp edges and more details of textures. The synchronizing mechanism in this scenario is concerned with the median gradient magnitude of the image, which is used to verify the gradient magnitude of the instance pixel whether to apply bilateral filtering or TV denoising method. If the gradient magnitude of the instance pixel is bigger than the mean gradient magnitude of the image, this pixel should be on the strong edge and bilateral filtering will be applied in order to obtain significant denoising on the edge. Otherwise, the pixel should more likely be included in the weak edge or texture area and TV denoising will be chosen to denoise the surrounding pixels of the edges.
However, it is not necessary for a non strong edge to be considered as a texture or weak edge but it could be something else. It is very difficult to directly denoising the image based on the proposed gradient magnitude on bilateral-TV since there are various pixel intensities including Gaussian noise. Generally, to correctly cluster the texture pixels and non texture pixels of the image requires a lot of computation and the result may not be perfectly satisfied. The more feasible justification of texture pixels leads to more effective TV denoising in Bi-TV method. Woong and Thomas (2007) used K-means cluster (edge map) for denoising using diffusion equation derived from Perona-Malik's model since the pixel intensities of the clustered image in homogeneous regions, without image features, change smoothly, but not for the edge region of the real image which changes rapidly. According to Kim, filtering edge map produces better result than applying filtering to an image directly. However, also in this research, Kmeans clustering is used to cluster pixels of the noisy image but not used for real denoising. Each clustered image resulted from K-means algorithm was effectively used as a mapping guideline for gradient magnitude calculation but not for real denoising even though it shares a common beneficial to the edge map in Kim's work. The mean gradient magnitude of each cluster image is computed and used to classify the instance pixel of the clustered image whether the real instance pixel of the noisy image could be denoised by bilateral filtering or TV denoising. If the gradient magnitude of the instance pixel is lower or equal to the mean gradient magnitude of the cluster image, TV

JCS
denoising should be applied. Otherwise, bilateral filtering should be used. Notice that the real denoising is only applied to the noisy image whereas the clustered image is used for calculation of gradient magnitude only.
Let I 0 (i,j) be the noisy image of M×N pixels (1≤I≤M, 1≤j≤N) where K = total number of clusters, Wi = i th cluster of M×N pixels. For simplicity, let M = N for the The boundary pixels of I 0 could be defined as follows: Notice that 0 ≤ λ ≤ 1, h = 1/M, ε → 0, n = number of iteration used in iterative TV denoising and the involving notations were defined as follows: Let Ω = bilateral filter mark with center position at x, f r range kernel, g s = spatial kernel and W p = normalization term = 2) for s = 1 to k do 3) K-means clusters contain both texture and non texture pixels. The cluster which mostly contains texture pixels was benefitted by TV denoising rather than bilateral filtering. On the other hand, the cluster which contains mostly non texture pixels would be benefitted by bilateral filtering. Finally, the best denoising result implies the characteristic of the noisy image and it will be discussed later in section 4.

RESULT AND DISCUSSION
The original samples used in this research were 4 gray scale images with the same size of 256×256 pixels before being added with zero-mean Gaussian noise SD = 20,50,80 and 120, respectively for creating 4 noisy images. Fig. 2-5 revealed the noisy images with SD=120 (a), the corresponding cluster for K-BiTV (b) and the denoised results obtained from BiTV(c), TV(d), K-BiTV(e) and bilateral filter(f).
More experiment was conducted on higher SD values and it was assured that the more SD values, the more performance gap of K-BiTV comparing to TV denoising and bilateral has been found. Notice that in Table 1, %TV and %Bilateral indicates the percentage used for TV denoising and bilateral filtering of the denoised images applied by BiTV and K-BiTV. In this research, all noisy images have more percentages of bilateral filtering than those of TV denoising for BiTV and K-BiTV methods but TV denoising and bilateral filtering ratios of BiTV less vulnerable than that of K-BiTV.

JCS
According to Fig. 6 and 7, for noisy images with Gaussian noise SD between 20 and 50, K-BiTV's performance was almost as good as TV denoising and inferior to bilateral filtering in the begining. The best denoising results for noisy images with SD between 20 and 50 were obtained from bilateral filtering which represented by camera man, brain, Lena and baboon, correspondingly. On the other hand, the best denoising results for very noisy images with SD more than 50 were the output images from K-BiTV which were found in camera man, baboon, brain and Lena, respectively. This revealed the superior performance of K-BiTV to the other methods mentioned above according to this criteria.
The number of total clusters in K-means could be any number but the best denoising result was not more than 6 for all images used in this research did not have many distinguished levels of gray intensities. The use of K-means clusters as a guiding map for gradient magnitude calculation could deliver more effective denoising than directly applying gradient calculation on the noisy image before performing real denoising for each pixel of the original noisy image. The K-means cluster that gave the best denoising result for K-BiTV was considered to have more probability to include more contiguous intensity of sharp edges of the original noisy image in correspondence with the black pixels of the cluster image. Therefore, the better mapping of contiguous intensity of sharp edges of the original image in the cluster could help improving the performance of the BiTV.