X-ray image denoising based on wavelet transform and median ﬁlter

This paper mainly proposed and researched based on wavelet transform, and then used the X-map denoising technique of value ﬁlter. In other words, the value image was ﬁltered in the spatial domain, and the value ﬁltering was used as the standard pulse (salt) noise, also used as in the wavelet domain. After the ﬁltered image was decomposed by biorthogonal double wavelet transform, a wavelet coefﬁcient matrix was generated, and a soft threshold quantisation process was performed on the wavelet coefﬁcients to produce a new wavelet coefﬁcient matrix. In the end, they used a new wavelet co-efﬁcient matrix for image reconstruction. The processing resulted that the denoising method proposed in this paper showed that the X image can be denoised, which not only reduced the X-picture-like noise but also preserved the X-picture-like details as much as possible. It also helped to enhance diagnostic accuracy and reduced the difference in reading.


Introduction
During the transmission and communication of X-ray images, they are usually accompanied by random pulse interference and other noises, which degrades the quality of the images and is not conducive to early diagnosis. Therefore, in the image preprocessing stage, filtering the noise becomes especially important.
Based on the characteristics of the mixed noise accompanying the X-ray images in the process of transmission and communication, an image denoising method based on wavelet transform and median filtering was proposed. The experiment results make clear that the image denoising method devised in this article can denoise X-ray images and improve the accuracy of reading and diagnosis. The second part of this article introduces the basic theory and application of median filtering. The third part discusses the selection of wavelet. The fourth part proposes an X-ray image denoising method based on wavelet transform and median filtering. Finally, the fifth part gives experimental results and discussion.
2 The basic theory of median filtering and its application

The essential theory of median filtering technology
Median filtering is a nonlinear signal processing technique that can effectively suppress noise based on the sequence statistics theory [1]. The advantages of this kind of filter are simple calculation, easy implementation, and fast speed. In some cases, it can exceed image detail blurring created by linear filters, for example, mean filtering, and it is the most efficient method for filtering out impulse interference and image scanning noise [2].
The basic principle of median filtering [3] is to substitute the value of a digital point or a point in a digital sequence with the median value of each point near the point.
The definition is as follows: For a known original sequence x 1 , x 2 , x 3 ,..., x n , ordering the n numbers in the sequence as x i1 x i2 x i3 ... x in according to the order of the value, there are: When n is an odd number 1 2 x i( n 2 ) + x i( n+1 2 ) When n is an even number (1) where y was called the median of the sequences x 1 , x 2 , x 3 ,..., x n . Set the input sequence as {x i , i∈ I}, I is a natural number set or subset, the window length is n, and the filter output is: where i∈ I, u = (n -1)/2.

The application of median filtering technology
Now change the added noise to Gaussian noise with a mean squared error of 0.02, use the median filtering with 3*3, 5*5 and 7*7 as the templates to denoise and compare the results. See the Figure 1 [4]. Figure 1(a) is the primitive image, Figure 1(b) is Gaussian noise with a mean square error of 0.02, Figure  1(c) is the median filtered image with a window of 3*3, Figure 1(d) is the median filtered image with a window of 5*5 and Figure 1(e) is the median filtered image with a window of 7*7. As can be seen from the Figure 1, the median filter is very efficient in filtering the salt and pepper noise of the image.
3 Image denoising wavelet selection

Wavelet threshold shrinkage method
At present, people have proposed a variety of threshold selection methods, such as VisuShrink, RiskShrink, SureShrink, and WaveJSShrink. The VisuShrink method uses a globally uniform threshold σ √ 2 log N, where σ is the normal deviation of the noise signal (the strength of the noise), and N measures the length of the signal.

Algorithm description of wavelet threshold shrinkage method
The wavelet threshold shrinkage method for denoising is composed of the following three steps: (1) Calculating the orthonormal wavelet transform of the noisy signal.
(2) Non-linear thresholding of wavelet coefficients. To keep the overall shape of the signal unchanged, retain all low-frequency coefficients v L,k , k = 1, . . . , 2 L . Take the threshold value λ = σ √ 2 log N, for each wavelet coefficient, use the soft threshold method or hard threshold method for processing: Performing inverse wavelet transform. Since the noise is mainly concentrated in the highest resolution level J -1, so we can use the wavelet coefficients {w J −1,k , k = 1, 2, . . . , 2 J−1 }to estimate the noise standard deviation, Denoising by the threshold method not only can completely suppress the noise but also can retain the characteristic peak points reflecting the original signal well, so it has a good denoising effect.

Image denoising combining median filtering and wavelet denoising
From the above analysis, we can know that the median filtering has a clear denoising effect on X-ray images containing impulse (salt and pepper) noise when the denoising effect on Gaussian noise-containing X-ray images is not very good, it is quite fuzzy, the contrast is poor, and some details are lost. The wavelet image denoising method has ideal denoising and plays a role in the X-ray images containing Gaussian noise, while its denoising plays a role in the X-ray images containing impulse (salt and pepper) noise and is far worse than that of the median filtering.
However, impulse (salt and pepper) noise, and then the Gaussian noise are the two most ordinary types of noise in an image. In real life, during the transmission and communication of X-ray images, they often coexist as a kind of mixed noise. The simple median filtering denoising method or wavelet image denoising method is also not ideal for denoising this kind of mixed noise.
For mixed noise in which the impulse (salt and pepper) noise and Gaussian noise coexisted at the same time, we need to combine different methods to denoise many a time. In recent years, people have proposed many new methods to remove the mixed noise, and regarding this, Zhang Xuming et al. proposed a mixed filtering method based on adaptive median filtering and adaptive weighted average filtering [5]. Wang Jianyong et al. who combined median and fuzzy filtering techniques, proposed a new image mixed noise filtering algorithm [6], while Ni Hongxia et al. proposed a denoising system for median filtering in wavelet domain [7]. These methods can simultaneously suppress Gaussian and impulse (salt and pepper) noise in the image. Overall, these methods can be summarised as two categories: the first is the combination of median filtering and mean filtering techniques, first classifying the noise by detection, perform median filtering on impulse (salt and pepper) noise, and perform mean filtering on Gaussian noise. The second category is the combination of median filtering and wavelet denoising, which makes full use of the advantages of median filtering to impulse (salt and pepper) noise and the advantages of wavelet denoising to take out Gaussian noise. The algorithm in this paper belongs to the latter category.
The median filtering can well denoise the mixed impulse (salt and pepper) noise in the X-ray images, while the wavelet denoising method can well denoise the mixed Gaussian noise in the X-ray images. If these two kinds of noises can be separated, or when denoising the first kind of noise, the effect of the second noise on the denoising effect of the first one can be minimised, and then perform denoising on the second kind of noise, then the two filtering methods can each exert their advantages in denoising the X-ray images.
Therefore, the most critical thing is to separate the two kinds of noises or to minimise the effect of one noise on the denoising effect of the other noise. We have found that the impulse (salt and pepper) noise changed the grayscale worth of the pixels in the X-ray images greatly, but the number of these pixels is not large; while the Gaussian noise changed the grayscale value of the pixels in the X-ray image a little, the number of these pixels becomes large, and the grayscale values of all pixels have changed.
Based on the above analysis, we can first perform median filtering on the noise image. In each window, we take the middle grayscale value so that we can restore the grayscale values of those pixels whose grayscale values change greatly. The visual sensation is to filter out those spots that are significantly whiter or blacker than their surroundings.
As for the standard median filtering method, its method is to employ a window to scan on the image and arrange the image pixels contained in the window in the ascending or descending order of the grayscale, take the pixel greyscale with the centred grayscale value as the grayscale of window centrr pixel, and then complete the median filtering [8].
Formulated as: . . , f i+u }i ∈ Z, u = m − 1 2 Usually, the amount of pixels in the window is odd so that there is an intermediate pixel. If the amount of pixels in the window is an even in number, the median value is on the average of the grayscales of the two pixels in the middle.
About the soft threshold denoising method based on the Bior wavelet, it can be divided into the following two steps: The first step is the decomposition and reconstruction of X-ray images. Choose the appropriate wavelet and then the appropriate decomposition level (marked as N) and perform an N-layer decomposition calculation on the 2D X-ray image signal to be analysed. A 3.3 biorthogonal wavelet was chosen and the number of decomposition layers N was chosen to be 3.
What is shown in the Figure 2 is the result of the image after three-layer wavelet decomposition, where W LL3 is the low-frequency part of the image and focused on its main part of the energy. W HLK (k=1,2,3) is the horizontal element, W LHK (k=1,2,3) is the vertical element, W HHK (k=1,2,3) is the diagonal element, and these three elements are the details of the image [9]. For every layer of decomposition, select an appropriate threshold, and threshold the high-frequency coefficients of this layer. According to the Donoho threshold, the threshold value λ k of the wavelet coefficient for each layer is calculated by the formula (1), where σ k is the noise standard deviation, N is the number of original image pixels [10]. The calculation method of λ k is as follows: For the threshold, we choose the soft threshold method. is a soft threshold function. Then, following the N-th layer approximation (low-frequency coefficients) after wavelet decomposition and the details of the layers after the threshold quantization (high-frequency coefficients), calculate the wavelet reconstruction of the two-dimensional signal [11][12][13][14][15].

Experimental results and analysis
In the simulation experiment, a 256*256 X-ray image FEI was used as an experimental object, and the mixed noise of Gaussian noise and impulse (salt and pepper) noise were added. By changing the variance of the Gaussian noise and the noise density of the impulse (salt and pepper) noise, several sets of experimental results were obtained for comparison. For the denoising method used in the comparison of the experiment, we choose to use the simple median filtering, wavelet image denoising, and the proposed algorithm of this paper for denoising and then make comparisons.
Compare the filtering effect after adding the mixed noise in which the mean value of the Gaussian noise is 0, the variance is 0.01, and the impulse (salt and pepper) noise density is 0.1. As shown in the Figure 3, Figure 3(a) is the noise-added image, Figure 3(b) shows the image after median filtering, Figure 3(c) shows the image after VisuShrink soft threshold denoising and Figure 3(d) is the algorithm proposed by this article. By comparison, it is found that the denoising effects on the proposed algorithm is much better than the simple median filtering and the VisuShrink soft threshold wavelet denoising method. The denoising have more obvious effect than it, and the details of the image and edge information remain intact. The mixed noise of impulse (salt and pepper) is also filtered out thoroughly.
By changing the density and intensity of the mixed noise, we get a set of information, which is precisely described by Peak Signal to Noise Ratio (PSNR) and Mean Square Error (MSE).
Where the mean square error (MSE) is defined as: The restored image after processing and original image, respectively, the image size is M × N. The expression of Peak Signal to Noise Ratio (PSNR) is: where Q represents the quantitative level, and here Q takes 255. As a measure of the filter performance, the larger the PSNR, the better the effect of filtering out the noise. From Table 1, it is known that the method used in this article has the best effect on mixed noise denoising, the mean square error after denoising is the smallest, and the peak signal-to-noise ratio is the largest. The algorithm of this article is quite good for processing images with mixed noise, and its advantages are quite obvious compared to other methods; therefore, for the processing of images with mixed noise, the method chosen in this paper is better.
The experimental results make clear that the denoising effect of the proposed system is far superior to the traditional mean filtering method and the single wavelet soft thresholding method. The traditional mean filtering method loses more effective detail elements and makes the image blur and unclear, while the single wavelet soft threshold method is not ideal for the effect of denoising of impulse (salt and pepper) noise, and it often leads to blurring of the edges. This system not only reduces the noise of the image but also preserves the details of the image as much as possible. Through the denoising method proposed in this paper, the denoising of X-ray images can be achieved, which not only reduces the noise of X-ray images but also attributes to modify the accuracy of diagnosis and reduce the reading differences.
T h i s p a g e i s i n t e n t i o n a l l y l e f t b l a n k