Image Denoising using Wavelet Cycle Spinning and Non-local Means Filter

—Removing as much noise as possible in an image while preserving its fine details is a complex and challenging task. We propose a wavelet-based and non-local means (NLM) denoising method to overcome the problem. Two well-known wavelets: dual-tree complex wavelet transform (DT-CWT) and discrete wavelet transform (DWT), have been used to change the noise image into several wavelet coefficients sequentially. NLM filtering and universal hard thresholding with cycle spinning have been used for thresholding on its approximation and detail coefficients, respectively. The inverse two-dimensional DWT was applied to the modified wavelet coefficients to obtain the denoised image. We conducted experiments with twelve test images on the set12 data set, adding the additive Gaussian white noise with variances of 10 to 90 in increments of 10. Three evaluation metrics, such as peak signal noise to rate (PSNR), structural similarity index metric (SSIM), and mean square error (MSE), have been used to evaluate the effectiveness of the proposed denoising method. From these measurement results, the proposed denoising method outperforms DT-CWT, DWT, and NLM almost in all noise levels except for the noise level of 10. At that noise level, the proposed denoising method is lower than NLM but better than DT-CWT and DWT.


I. INTRODUCTION
The emergence of noise in digital images is possible during image acquisition, transmission, and processing steps [1]. The additive Gaussian noise is the type of noise most often found [2]. Hence, suppressing this noise type from digital images is necessary before further processing like texture analysis, feature extraction, and segmentation [3]. Maintaining the essential features of the images, such as edges and textures, is one of the main issues faced during the denoising process [4]. However, since noise, texture, and edge are high-frequency components, it is arduous to distinguish them in the denoising process, and the denoised images could ineluctably lose some details [5].
Numerous denoising methods have been developed in the literature. Among such methods, wavelet transforms and nonlocal means (NLM) filters are one of the suggested denoising methods [6]. In the wavelet transforms method, the noisy image is decomposed into the low-and high-frequency subbands, followed by wavelet thresholding on these frequency sub-bands. The wavelet thresholding is quite effective applied to the high-frequency sub-bands but fails when applied to the low-frequency sub-band [7]. In most of them, discrete wavelet transform (DWT) was widely used, but it has three other main issues. These issues are lack of poor directionality, shiftinvariant, and aliasing [8]. Conversely, the non-local means filter is highly effective in retaining the proper morphology of the signal at low-frequency. At the same time, the NLM filter fails to properly denoise the high-frequency [7]. Another drawback is a very time-consuming process.
The ill effects of noise can be reduced by addressing the shortcomings of both above-denoising methods. Motivated by this, a denoising method is proposed by utilizing the efficacy of both wavelet-and NLM-based methods. The NLM is more efficient in denoising the low-frequency content, and applying it in the wavelet domain can significantly decrease the processing time [9]. On the other hand, although DWT offers the advantages of smoothness and adaptation, as Coifman and Donoho [10] suggest, DWT exhibits visual artefacts known as Gibbs phenomena in the vicinity of discontinuities. To address this issue, the translation-invariant denoising method called cycle spinning is applied to remove such artefacts. Meanwhile, DT-CWT is a well-known method introduced to solve the main issues of DWT. Its implementation is to be combined with NLM can be found in [11] [12] [13]. Two well-known wavelets, i.e., DT-CWT and DWT with one-level decomposition, are applied sequentially. Only the lowfrequency sub-band is denoised utilizing the NLM filtering. Since the high-frequency sub-bands contain noises, those are denoised using hard thresholding with cycle spinning-based. The inverse DWT on the modified sub-bands are used to reconstruct the image.
The main contributions of the proposed denoising method are summarized below: 1) The proposed denoising method utilizes the advantages of the wavelet-and NLM-based methods for eliminating highfrequency and low-frequency noises present in the noisy image, respectively.
2) The main disadvantage of DWT, i.e., it does not effectively eliminate the low-frequency noise, lack of poor directionality, shift-invariant, and aliasing, is mainly resolved by NLM, cycle spinning, and DT-CWT.
The fundamentals of the DWT, DT-CWT, wavelet thresholding, cycle spinning, and non-local means filter are summarized in the Section ""Theoretical Background"", and the proposed denoising algorithm to suppress noise is explained in the Section ""The Proposed Method"". In the Section ""Experimental Results"", the performance of the proposed (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 14, No. 3, 2023 486 | P a g e www.ijacsa.thesai.org denoising method is evaluated using test images simulated with additive white Gaussian noise. Section ""Conclusion"" describes our conclusions.

Discrete Wavelet Transform
In general, the discrete wavelet transform (DWT) is an image decomposition at the sub-band frequency of the image. The wavelet transforms sub-band component is generated by decreasing the decomposition level. DWT implementation can be done by passing the signal through a low and high pass filter. Filterization itself is a function used in signal processing [9]. The decomposition of averages and differences plays a vital role in understanding the wavelet transform. Averaging is done by calculating the average value of 2 pairs of data using Eq. (1).

  
where, p is pixel in the digital image, x is the first number in decimal is obtained, and y is the second number in decimal is obtained.
While the reduction is carried out with the following Eq. (2).

   
The decomposition process is carried out on the results of the flattening process. The result of the decomposition process is a combination of the flattening process results with all the image pixel reduction processes. The decomposition process is carried out in two stages. The first stage is performed on all rows, and then is carried out in the column direction on the resulting image of the first stage.
The signal is passed through a high-pass filter and a lowpass filter, and then half of each output is taken as a sample through a down-sampling operation or referred to as a onelevel decomposition process. The output of the low-pass filter is used as input for the next level of the decomposition process. This process is repeated until the desired level of the decomposition process. The decomposition process produces the wavelet coefficient, a combination of the output of the last high-pass and low-pass filters. The wavelet coefficient contains compressed transformed signal information.
The one-level decomposition is written using the mathematical expressions in Eq. (3) and (4): where is the result of high pass filter (which is a detail of signal information), is the result of low pass filter (which is a rough approximation of the scaling function), is source signal, is high pass filter, and is low pass filter.
Using this DWT coefficient, the Inverse Discrete Wavelet Transform (IDWT) process can be carried out to reconstruct it into the original signal, as shown in Eq. (5).

 
In the discrete wavelet transform, an image is decomposed into sub-images (sub-bands) at different frequencies and orientations, namely low-low (LL), low-high (LH), high-low (HL), and high-high (HH). An illustration of the discrete wavelet transform is shown in Fig. 1. Several parameters, such as the selected mother wavelet function and decomposition level, should be chosen carefully when DWT-based processing methods are used [14]. Due to improper selection of the mother wavelet function and the number of decomposition levels may cause distortion or under denoising of the signal [15]. To ensure an effective denoising procedure of the image denoising, we selected the mother wavelet families of Coiflets with the order of 4 (Coif4) and one-level decomposition.

Dual-Tree Complex Wavelet Transform
Dual-Tree Complex Wavelet Transform (DT-CWT) was the combination of the advantages of DWT and CWT (complex wavelet transform). It is shift invariance, perfect reconstruction, either in directional selectivity, has a little redundancy, and the minimalist computation algorithm. DT-CWT transformation was a variation of DWT implementation, but the main difference is DT-CWT uses two tree filters, as shown in Fig. 2. www.ijacsa.thesai.org Unlike the DWT, the DT-CWT is built through a complexvalued wavelet function and a complex-valued scaling function. The complex-valued wavelet function is built as follows: The complex-valued scaling function is expressed similarly [16].

  
where is even and real, is odd and imaginary, but is real. In addition, and form a Hilbert transform pair.
Consider 2D DT-CWT associated with the row-column implementation of the 1D DT-CWT.

  
where and are given by formula (6). To represent an integrated real 2D signal completely, the row or column of the complex conjugate filter is required. Three subbands are produced in both the first and second quadrants, corresponding to six directions in space: , and .
We used one-level decomposition when applying DT-CWT in this study.

Wavelet Thresholding
Wavelet thresholding is a method that maintains wavelet coefficients whose value is greater than a particular threshold value and ignores small wavelet coefficients. This value is called the threshold value, and the estimator can be written as:

 
where is threshold value, represents the indicator function of set A. The estimator in Equation (8) can be considered a non-linear operator in the coefficient vector, which produces vector of coefficient estimation. The thresholding estimator is defined as.

  
with is thresholding function and is threshold parameter.
The thresholding steps can be sequenced as follows: select thresholding function, value estimation , and selection of threshold parameter.

1) Thresholding function:
According to Coifman and Donoho [10], there are two thresholding functions: hard and soft thresholding. Both can be written with their respective equations as follows: The hard thresholding function is better known because there is a discontinuity in the function, so the t values above the threshold λ are not touched. On the other hand, the soft thresholding function is continuous since the t value is above the threshold λ. In this study, we used hard thresholding rules.
2) Value estimation : Wavelet thresholding is enforced rules where at least to estimate the value because its value is usually unknown. The value is deviation standard value from the observation . The authors in [14] proposed an estimation is based on empirical wavelet coefficient at the high level resolution. This consideration is because, at the highest coefficient level, there is usually a lot of noise. Given in [17], the Median of Absolute Deviation (MAD) estimation to estimate value is expressed as Because coefficient close to zero, then it can be replaced median value ( above with zero. www.ijacsa.thesai.org 3) Selection of threshold parameter: There are two selection categories to select the optimal threshold value: selecting one threshold value for all resolution levels (global selection) and selecting a threshold that depends on the resolution level (level-dependent thresholding). Ogden [17] provides two threshold choices for global threshold selection that only depend on the number of n observation data. Both are tabulated by Donoho and Johnstone [17], known as the universal threshold and the minimax threshold. Minimax threshold values are always smaller than universal threshold values for the same sample size. Choosing a threshold that depends on the level of resolution means choosing depending on the resolution j. Thus there is a possibility of differences in the threshold value selected from for each level of wavelet j. This study used the universal threshold, which applied to the detail coefficients.

Cycle Spinning
References [14] introduced a translation-invariant denoising method called cycle spinning. This method calculates different estimates of noisy image by shifting images to different phases and then linearly averaging these estimates. The cycle spinning will result in different estimates of the original image with statistically other noises reduced by the averaging.
If we show the two-dimensional circular shift by S ij , the denoising operator by T, and the thresholding operator by η, then cycle spinning can be expressed as:


where and are the maximum number of shifts. In this study, we used two shifts.

Non-local Means
The non-local means (NLM) was proposed by Buades et al. [17]. Given the 2D noise image , where k is the pixel index and K is the number of pixels, then the NLM is calculated as a weight average of all the pixels in an image,

 
where is a square neighborhood of the pixel k referred to as the search window, is the weight depend on the similarity between the pixels a and b, and satisfying the conditions and . The weight is built as follows.

 
where is a square neighborhood of fixed size and centered at a pixel a referred to as the similarity window, denotes the vector of pixel values within the similarity windows, and is the normalizing factor,

 
where the parameter filter h controls the degree of filtering. We set the parameter of NLM as follows: the patch size is 7x7 pixels, the search window is 5x5 pixels, and the filtering parameter h is obtained from the deviation standard value.

III. PROPOSED METHOD
The wavelet-based and NLM denoising techniques are efficient and have complementary benefits and drawbacks. Therefore, combining both can produce a powerful denoising method. However, the direct cascading of these methods will result in a denoising system that is ineffective and costly in computation. Henceforth, this study combines wavelet-based and NLM techniques to get the desired results. The block diagram of the proposed denoising method is shown in Fig. 3. It consists of three steps: decomposition of the noisy image using DT-CWT and DWT, denoising of the lowand high-frequency sub-bands, and reconstruction. A detailed description of the proposed denoising method and its advantages over DWT, DT-CWT, and NLM is discussed in the following.
Step 1: Decomposition: Decompose the noise image into one real and imaginary approximation coefficient and the six real and imaginary detail coefficients using 2D DT-CWT with one-level decomposition. Process the real approximation coefficient through DWT to obtain the high-and lowfrequency sub-bands. The decomposition process, including Step 3 Step 1

Denoised Image
Step1: Wavelet Transform Step2: Thresholding Step3:The Inverse Wavelet Transform www.ijacsa.thesai.org the selection of the decomposition level and the mother wavelet function, has already been briefed in Section II.
Step 2: Denoising of the low-and high-frequency subbands: Denoise the low-frequency sub-band obtained in one level of decomposition using the non-local means filter. Next, carry out the hard-thresholding-based cycle spinning to the high-frequency sub-bands. The selection of NLM parameters and wavelet threshold has already been briefed in Section II.
Step 3: Reconstruction: Reconstruct the denoised image by inverse 2D-DWT using denoised low-frequency and highfrequency sub-bands. The reconstruction process has already been briefed in Section II.
In the proposed denoising method, the thresholding of high-frequency sub-bands will effectively eliminate the highfrequency noise components present in the noisy image. Besides, the NLM filter will denoise the low-frequency subband and retain the morphological structure of the image. The proposed denoising process consists of only one-level DWT decomposition in contrast to the earlier DWT method requiring more significant decomposition levels to effectively denoise the low-frequency components. In addition, hard thresholdingbased cycle spinning of the high-frequency and NLM filter of the low-frequency sub-band can be performed simultaneously. As a result, the overall computing cost of the process is significantly decreased.

IV. EXPERIMENTAL RESULTS
As was the case with the experiment carried out by Balasubramanian et al. [8], the effectiveness of the proposed denoising method is evaluated on four standard test images: Lena, the boat, the house, and the cameraman corrupted by AWGN with zero mean and standard deviation σ=10 to 90 with increment 10. The proposed denoising method has been implemented by writing Python code. Python function random is used to add additive white Gaussian noise to the test images.
During experiments, to evaluate the effectiveness of the denoising performance, apart from the peak signal-to-noise ratio (PSNR) and mean square error (MSE), which is the general measure of denoising performance, we also measure the structural similarity index (SSIM).
As we stated earlier, our proposed denoising method is compared with the conventional DT-CWT, DWT, and NLM using PSNR, MSE, and SSIM. The parameters of each method have been set according to our experiment to have uniformity in comparison. The denoising experiment has been performed, and the results of PSNR, MSE, and SSIM are tabulated in Table I. A detailed examination of the tabulated results led to the following findings:  Cameraman image: The proposed denoising method outperforms DT-CWT, DWT, and NLM when the noise level of 40 and above for all measurement results. In contrast, the obtained PSNR and MSE are lower than NLM when the noise level of 30 and below. However, still better than DT-CWT. Lower than DWT when the noise level is 10 when measured using PSNR. Including a noise level of 20 when measured using MSE. For the SSIM result, the proposed denoising method outperforms all except the noise level of 10. At that noise level, NLM is better than the proposed denoising method.
 House and Boat images: When observing both images using PSNR, MSE, and SSIM results, the proposed denoising method is superior to DT-CWT, DWT, and NLM in almost all the noise levels except for 10. At that noise level, NLM is better than the proposed denoising method. However, the proposed denoising method is still better than DT-CWT and DWT.
 Lena image: Out of these three other test images; Lena's image is the only best gain of our proposed denoising method because it the superior to all techniques used for comparison in all noise levels with different measurement techniques results.
To compare the visual quality of the denoising methods, the free noise, noisy, and denoised images when AWGN added with variances of 70 are shown in Fig. 4.
 Cameraman image: Based on denoising results on this image show the proposed denoising method has better appearance of the denoising result. The noise in the texture of clothes and background can be effectively removed, including the noise present at edges.
 House image: The proposed denoising method results on house image can be seen in Fig. 4. It can be seen that the proposed denoising method is better in removing amount noise on the texture of house wall and sky as background. Comparatively, noise present in the edges also can be removed very well.
 Lena image: Like the cameraman and house images, the result of the proposed method in removing the noise in the hat, skin, mirror, hair, and wall is better than other denoising method.
 Boat image: Visually, the proposed method result is more effective in suppressing the noise in the boat image.
From the analysis above, it can be stressed that the suggested work effectively addresses the individual limitations of NLM and DWT approaches.

V. CONCLUSION
Noise shows the image quality that has begun to lose detail, where large numbers of dots will appear in the image. Noise appearance dramatically affects an image's sharpness, clarity, and quality. Therefore, noise within an image must be appropriately addressed to minimize noise while maintaining fine image details, such as edges and textures. This paper presents the denoising method to handle such issues. The proposed denoising method utilizes the efficacy of waveletand NLM-based denoising. In the proposed denoising method, the noisy image is first decomposed using the DT-CWT, followed by DWT, to obtain the low-and high-frequency subbands. The high-frequency sub-bands are then threshold in the output of DWT to eliminate high-frequency noise using hard thresholding with cycle spinning. Meanwhile, the NLM removes the low-frequency noise. When the proposed method is applied to Lena, the boat, the house, and the cameraman images with AWGN variance noise of 10 to 90 in increment 10, the effectiveness outperforms the conventional DT-CWT, discrete wavelet transforms, and NLM. This superiority is numerically analyzed using three evaluation metrics: SSIM, PSNR, and MSE, also including when analyzed based on its visual quality results.
Future improvement is needed to increase the capability of the proposed denoising method, such as by selecting the mother wavelet and decomposition level, NLM parameter setting, and experimenting with another image to know the capability of the proposed denoising method in a different case.