2019 Effect of kernel size on Wiener and Gaussian image

zramadan@ammanu.edu.jo Abstract In this paper, the effect of the kernel size of Wiener and Gaussian filters on their image restoration qualities has been studied and analyzed. Four sizes of such kernels, namely 3x3, 5x5, 7x7 and 9x9 were simulated. Two different types of noise with zero mean and several variances have been used: Gaussian noise and speckle noise. Several image quality measuring indices have been applied in the computer simulations. In particular, mean absolute error (MAE), mean square error (MSE) and structural similarity (SSIM) index were used. Many images were tested in the simulations; however the results of three of them are shown in this paper. The results show that the Gaussian filter has a superior performance over the Wiener filter for all values of Gaussian and speckle noise variances mainly as it uses the smallest kernel size. To obtain a similar performance in Wiener filtering, a larger kernel size is required which produces much more blur in the output mage. The Wiener filter shows poor performance using the smallest kernel size (3x3) while the Gaussian filter shows the best results in such case. With the Gaussian filter being used, similar results of those obtained with low noise could be obtained in the case of high noise variance but with a higher kernel


Introduction
Noise is one of the main problems that attract attention of researchers working in digital image processing. Images are subject to several types of noise due to many sources or processes such as capturing instrument, acquisition and transmission. Some examples of such noise are Gaussian noise, speckle noise, Poisson noise, salt and pepper noise, periodic noise and others. This paper is mainly focused on two types, namely Gaussian noise and speckle noise. Additive White Gaussian (AWG) noise is commonly used in practice since it is a statistical model for many real-world noise sources. It is called additive noise as it can be modeled by random values added to an image (signal). Specifically, every pixel in the corrupted (noisy) image is the sum of a true original pixel value and a random, Gaussian distributed noise value. The term 'white noise' is analogous with white light which has the same value of power for all frequencies or wavelengths. In other words, it has a flat power spectral density. The noise intensity at each pixel is independent of other pixels. The term Gaussian refers to the probability distribution function (pdf) of the noise. The probability density function of the Gaussian or normal distribution can be expressed mathematically as: where ̅ and 2 are the mean and variance, respectively. Filtering of such kind of noise has been studied by many researchers [1][2][3][4][5]. In [1], an imaging filter for elimination of Gaussian noise is presented. The filter mechanism is mainly based on finding quaternion optimal weights and the non-local means filtering. In [2], the main concentration is on making a neural network that works for a wide range of Gaussian noise variances. In [3], it is shown that a prior knowledge of some statistics of the Gaussian noise corrupting an image can be useful in designing an optimal filter for such kind of noise. In [4], a filtering scheme is proposed for restoring images corrupted by Gaussian noise using local statistics of the image such as local weighted mean, local weighted activity, and local maximum. In [5], the proposed filter for reducing Gaussian noise is based on statistical estimation theory. A prior knowledge of some noise statistics is essential in this filter. These noise statistics are commonly obtained using training data. In contrast with the AWG noise which can be modelled by random values added to the pixel values of an image, speckle noise, often caused by errors in data transmission, can be modelled by random values multiplied by those pixel values; hence it is also called multiplicative noise. Speckle noise reduction is frequently used in medical ultrasound imaging [6-10] and radar applications [11][12][13][14][15][16][17]. It follows Gamma distribution whose probability density function can be expressed as where is the shape parameter and is the rate parameter of the gamma distribution function.
The mean value of this distribution is ( / ) and its variance is ( / 2 ). Image restoration rises as a necessity since a low image quality has an impact on the image features extraction, recognition, analysis, and the quantitative measurements and interpretation of these noisy images either by human or using computer assisted techniques. Restoration of images generally deals with restoring the true images by different imaging filtering schemes or algorithms. Many research methods for such restoration or denoising have been proposed over years including those which consist of moving a kernel over each pixel in the image and applying a mathematical function on this neighborhood of pixels by replacing the central pixel of the kernel with the computed function value. The kernel is moved along the image one pixel at a time until the entire image has been covered [18][19][20][21][22][23][24][25][26][27][28][29]. In this paper, the effect of the kernel size of two main filters, namely Gaussian filter and Wiener filter, on their performance evaluation is discussed and analyzed through computer simulations applied to several images corrupted with Gaussian noise and speckle noise.

Research Method
Analysis of the effect of increasing and decreasing the size of the sliding window of Gaussian and Wiener filters has been studied in this paper. Those filters have been used to restore images contaminated with Gaussian noise and speckle noise with different values of variances. The size of the sliding window, or kernel, is a kind of neighborhood processing where a particular mathematical function is applied to the neighborhood of each pixel in the image. The kernel is a filter mask of a particular shape that moves pixel by pixel over the entire image until it is completely covered. Each pixel in the center of the shape being used is replaced by the outcome of the applied particular function. Mathematically, this is equivalent to convolving the image with this function.
Gaussian filtering effectively convolves the image with a 2-D Gaussian function, or equivalently it uses a kernel of a Gaussian shape ('bell-shape"). In the Wiener filter, the pixel value at the center of the mask is adaptively changed based on the value of the variance of the pixels under the mask. Little smoothing is performed when the variance is small and more smoothing is performed when the variance is large. This is equivalent to minimizing the mean squared error between the input and output images of the filter. For quality evaluation of those image filters, several performance measuring indices could be used to measure the similarity or closeness between the restored filtered image and the uncorrupted true image, and the capability of preserving image edges and details. In this paper, mean absolute error (MAE), mean square error (MSE) and the structural similarity (SSIM) have been used. These performance measuring metrics are defined as follows: where is the mean squared error between the output filtered image ( ) and the input true image ( ), is the total number of pixels in the image, , is the pixel value in the

1457
( , ) ℎ location of the filtered image and , is the pixel value in the ( , ) ℎ location of the original true image. Since it has been illustrated by many researchers that MSE and MAE are inconsistent with the human eye perception, an alternative measuring index called the SSIM index was proposed to improve the images quality measurement. The SSIM index measures the similarity between the restored output image and the input true image, and its value is always between 0 and 1.
If the two images are very similar to each other, then the SSIM index is close to 1, and if they are very dissimilar then the SSIM index will be close to zero. Unlike MAE and MSE, the SSIM quality index is based on visible structures in the image. It is claimed to be an improvement over other traditional metrics such as MAE and MSE, which might not be consistent with human eye perception. The SSIM quality metric between two images and is a function of their luminance, contrast, and structure. The luminance is a function of the mean values of the intensities of these two images, the contrast is a function of their standard deviations, and the structure is a function of their covariance. The SSIM quality index can be defined as follows: where and are the mean values of the and images, respectively, 2 and 2 are their variances, is their covariance, and 1 and 2 are constants [30].

Results and Analysis
Computer simulations in this research work were performed using MATLAB software. Large number of images has been examined in these simulations. However, results of three images are shown in this paper. These images are Lake, Elaine and Boats, all of the same size (512x512), and are depicted in Figure 1. In Tables 1-6, MAE (detail preservation measuring index), MSE and SSIM have been used as measuring quality metrics for restoration of these three images using Gaussian and Wiener filters with different kernel sizes: 3x3, 5x5, 7x7 and 9x9. The higher the values of MAE and MSE the worse the performance of the restoration method is. On the other hand, since the SSIM index measures the similarity between two images, if the two images are identical, then SSIM=1, and if they are very dissimilar then the SSIM will be close to zero.
Two types of noise, namely Gaussian and speckle noise with zero mean and different values of variance V have been used in Tables 1-3 and Tables 4-6, respectively. In all of these tables, and for all values of variance of Gaussian noise and speckle noise, the Gaussian filter has a better performance since it requires a small kernel size (3x3). To get a similar quality with the Wiener filter, a 7x7 kernel is required. The Wiener filter produces poor performance for the 3x3 kernel size (the size that produces the least blur) even for small values of noise variance in both Gaussian and speckle types of noise. On the other hand, the Gaussian filter shows good results using small kernel size for both small and high values of noise variance, and it has better or close results compared with that of the Wiener filter.
Tables 1-3, show that with the Gaussian noise being used, increasing the kernel size improves the performance of the Wiener filter, and that is not the case with the Gaussian filter where increasing the kernel size does not necessarily improve the performance of the Gaussian filter. With speckle noise corrupting the images, increasing the kernel size does not necessarily improve the performance of the Wiener filter as illustrated in Tables 4-6. Except for the small 3x3 size kernel which shows the lowest quality, the performance of Wiener filtering for all other kernel sizes is almost the same.
The Gaussian filter on the other side demonstrates the best performance for the smallest kernel size (3x3), and the quality is almost the same if the noise variance increases while the smallest kernel size is still being used. It should be noted that restoration of images operation which results in images that appear much worse than the original ones might still be

Conclusion
The effect of the kernel size in Wiener and Gaussian image filters on the measurements of their quality performance has been investigated in this paper. Three images corrupted by zero mean Gaussian and speckle noise with different variances have been used in the computer simulations. The results show that Gaussian filter proves a better performance for all values of noise variance for both Gaussian and speckle noise, as it requires the smallest kernel size (3x3). The Wiener filter produces poor performance with such kernel size (3x3), the size that generally results in minimal blur, even for small values of noise variances. The Gaussian filter shows good results using small kernel size for both small and high values of noise variance, and has better or comparable results relative to that of the Wiener filter.