SAR Ship Image Speckle Noise Suppression Algorithm Based on Adaptive Bilateral Filter

Aiming at the shortcomings of traditional bilateral ﬁ ltering in suppressing speckle noise in SAR ship images, especially strong speckle noise and loss of image edge details, it proposes an improved bilateral ﬁ ltering algorithm based on fast adaptive threshold and variable window in this paper. The algorithm was used to suppress speckle noise in SAR ship images. The traditional bilateral ﬁ ltering cannot e ﬀ ectively ﬁ lter out the strong speckle noise, but the SAR image has strong speckle noise because of the defects of its imaging principle. To solve these problems, an image sample truncation method based on fast adaptive truncation statistical characteristics is designed to adjust the photometric similarity weight characteristics to realize the adaptive adjustment of spatial standard deviation and gray standard deviation. After the local reference window is modi ﬁ ed and truncated according to the local characteristics of the image, the adjusted combined similarity weight value greatly reduces the impact of strong speckle noise on the image. It is smoothed into speckle signal with strong impulse noise. In the traditional bilateral ﬁ ltering, in order to enhance the e ﬀ ect of smoothing noise, it is necessary to specify a large value of geometric di ﬀ usion factor and gray similarity di ﬀ usion factor, resulting in the loss of image details. Based on the variable window size ﬁ ltering method, when the extended local reference window is in the case of nonuniform edge, its window can be enlarged to make the speckle noise stronger. When an extended window contains details such as edges and textures, its size is not expanded to maintain image detail. This method can further smooth the speckle noise in the uniform region while preserving the edge details of the image. Finally, the adaptive truncated sample is used as the input of the bilateral ﬁ lter. The image sample truncation method based on fast adaptive threshold can e ﬀ ectively eliminate the strong speckle noise information that a ﬀ ects the photometric similarity and weight accuracy of the image. The method based on variable window can greatly enhance the smoothness of the edge area of the image. The experimental results show that improved adaptive bilateral ﬁ ltering algorithm improves the speckle noise removal ability by 16.06% compared with the traditional bilateral ﬁ ltering algorithm in the speckle noise suppression of the SAR ship image, and the preservation performance of the image edge after ﬁ ltering is improved by 5.41%. Compared with the original image, the ﬁ ltered image has a 1.2% improvement in structural similarity. The algorithm can e ﬀ ectively suppress speckle noise and has a good ability to retain edge and texture information of the SAR ship image, which has strong practicability.


Introduction
Synthetic aperture radar (SAR) uses the principle of synthetic aperture to achieve high-resolution microwave imaging. It has many characteristics such as all-day, all-weather, high-resolution, and large-width [1]. It is widely used in remote sensing fields such as geology and ocean. Due to the imaging characteristics of synthetic aperture radar, the original SAR ship image will seriously affect the quality of the image due to a large amount of speckle noise, which will increase the difficulty for subsequent image processing and classification operations. The ship target detection method based on the statistical characteristics of SAR images is easy to cause generation of false alarms. How to effectively suppress the speckle noise of the image and keep the edge texture information is the research focus and hotspot of SAR ship image processing.
Image filtering, which is to suppress the noise of the image under the condition of better maintaining the image details, is an indispensable operation in image preprocessing, and the quality of its processing effect will directly affect the effectiveness and reliability of subsequent image processing and analysis [2]. From the design method, it can be divided into two categories: linear filtering and nonlinear filtering. The commonly used linear filtering algorithms mainly include mean filtering, Gaussian filtering, and nonlocal mean filtering. The mean filter calculation speed is relatively fast, but as the template size increases, it will damage the details of the image while denoising. Gaussian filters are a class of linear smoothing filters that select weights according to the shape of the Gaussian function. Gaussian filtering is very effective for suppressing noise that obeys a normal distribution; however, Gaussian filtering is difficult to deal with nonsmooth parts of the image and cannot effectively preserve texture information while denoising. Considering the self-similar nature of the image, nonlocal mean filter (NLM) makes full use of the redundant information of the image and can preserve the details of the image to the greatest extent while denoising [3]. Its disadvantage is that the computational complexity is too high and the program is very time-consuming, which makes the algorithm less practical.
Linear filtering is easy to design and implement, but when the signal and noise are related to each other, the edge of the image signal is often blurred while removing the noise, and the processing result is not good. Therefore, the nonlinear filtering algorithm is proposed, which makes up for the shortage of linear filtering to some extent and can keep the high-frequency details of the image signal to the greatest extent while filtering out the noise, so that the image is clear and realistic, so it is widely used [2]. Bilateral filter is a nonlinear filtering method, which has one more Gaussian variance sigma-d than Gaussian filtering. Bilateral filtering considers both spatial information and grayscale similarity to achieve edge preservation and denoising. It has the characteristics of simple, noniterative, and local and has better preservation performance for image edges [4,5]. On the basis of traditional bilateral filtering, related improved research algorithms continue to emerge, which further expands the scalability and innovative applications of bilateral filtering algorithms.
In view of the excellent performance of bilateral filtering in image denoising, many related extension algorithms emerge one after another. Yongxia [6] proposes a speckle noise suppression algorithm based on multiresolution bilateral filtering, which performs wavelet decomposition on the image and then performs frequency division filtering. The disadvantage is that the size of the search window is not clearly set, resulting in poor robustness of the algorithm. Aiming at the insufficiency of the description of the structure information when bilateral filtering processes SAR images, Yang et al. [7] use an iterative image bilateral filtering strategy to combine the edge structure characteristics and the scattering characteristics of ground objects, which effectively improves the filtering performance. Further research is done on the influence of edge structure and scattering feature extraction. In order to solve the problem that the SAR image and speckle noise are sharpened at the same time, Zhang [8] adopts the binary Thiele type vector continued fraction approximation method for the exponential function in the bilateral filter, which makes the bilateral filter easier to implement in hardware. The model has the characteristics of fixed parameters, which requires manual adjustment of parameters to achieve better results, and is not easy to expand and realize due to its low efficiency. Ming [9] studies an improved bilateral filtering algorithm for polarimetric SAR images that fuses edge structure and ground object scattering information and improves the noise reduction performance; however, this algorithm can only use a fixed filter window size for noise reduction; otherwise, it will lead to noise reduction. Image detail information loss is large, or there is a defect of poor noise suppression ability. Lin [10] proposes a denoising algorithm based on bilateral filtering and wavelet multimode threshold, which performs two-layer wavelet decomposition on SAR images, which can denoise well and effectively retain ship information, but there are serious coherent speckles in the image. In the case of noise and sea clutter interference, the effectiveness of the algorithm will be greatly affected. Min et al. [11] proposes a bilateral filtering algorithm using complex image domain data of interferometric synthetic aperture radar along the track. This method has strong interferometric accuracy, but it can provide effective interferometric features for moving ship target detection. Information is very limited. Jiaqiu and Yang [12] improve the color similarity and spatial standard deviation processing method of the joint bilateral filtering algorithm in the depth image processing, which can effectively fill the missing holes in the depth image and suppress the speckle noise, but the real-time performance and reliability of the algorithm need to be improve. Aiming at the deficiency of bilateral filtering in suppressing coherent speckle in polarimetric SAR data, Wang et al. [13] proposed to introduce improved cross bilateral filtering into polarimetric SAR data noise reduction. The algorithm introduces the measurement of scattering type to expand the original weight kernel, so that the neighboring pixels that contribute greatly to the central pixel not only require close spatial distance and small difference in gray value but also require similar scattering types. Shi-cheng et al. [14] proposed an improved bilateral filtering algorithm TS-BF based on truncation statistical characteristics, which can effectively maintain the edge pattern of the image while smoothing the speckle noise to the greatest extent. However, for the sliding window size setting and classification of bilateral filters, more experience intervention is required. Heng et al. [15] proposed a bilateral filtering algorithm with adaptive size of window guided by image gradient, aiming at the problem that the traditional filtering algorithm is prone to reduce the noise suppression ability and the edge halo effect in the heavy noise area. The effect of smoothing edge noise is achieved in one pass by using edge gradients to determine the edge orientation of pixels in the image. However, the 2 Wireless Communications and Mobile Computing algorithm has the disadvantage of a large amount of calculation, especially for the situation that the numerical processing of PSNR and SSIM does not meet the requirements-the iterative processing increases the complexity of the algorithm. Bo and Chen-Feng [16] proposed that the traditional hard threshold function is discontinuous, and the soft threshold function is insufficient in image reconstruction accuracy, and the wavelet adaptive threshold function is combined with bilateral filtering, which improves the filtering effect and improves the image quality at the same time. The algorithm organically combines two independent algorithms, which not only breaks through the effect of a single algorithm but also increases the complexity of the algorithm. The traditional bilateral filtering algorithm needs to preset the spatial standard deviation and the gray standard deviation according to the experience, and the parameters are fixed and not universal; the adaptive bilateral filtering method realizes the self-adaptation of the spatial standard deviation through the gray cooccurrence matrix and uses the statistical method to estimate the smooth area. Noise standard deviation and the gray standard deviation are set according to the noise standard deviation, so as to realize adaptive bilateral filtering [4].
In view of the defects of imaging principle in SAR images, strong speckle noise is common, but the traditional bilateral filtering algorithm needs to preset spatial standard deviation and gray standard deviation according to experience. The parameters are fixed and not universal and cannot effectively filter out strong speckle noise. In this paper, an improved bilateral filtering algorithm based on fast adaptive threshold and variable window size is proposed, which realizes the adaptation of the spatial standard deviation through the gray level cooccurrence matrix and uses statistical methods to estimate the noise standard deviation in the smooth region. Set the gray standard deviation to achieve adaptive bilateral filtering. The innovations involved mainly include the following.
(a) Image sample truncation method based on fast adaptive truncation statistical characteristics to adjust photometric similarity weight characteristics to achieve adaptive adjustment of spatial standard deviation and grayscale standard deviation, and perform adaptive thresholding on the local reference window according to the local characteristics of the image. After the samples are trimmed and truncated, the adjusted combined similarity weight value greatly reduces the influence of strong speckle noise on the image and is smoothed into a speckle signal with strong impulse noise (b) In traditional bilateral filtering, in order to enhance the effect of smoothing noise, it is necessary to specify larger values of geometric diffusion factor and grayscale similarity diffusion factor, resulting in loss of image details. In the filtering method based on variable window size, when the extended local reference window is in a nonuniform edge condition, its window can be enlarged to make the speckle noise stronger; when the extended window contains details such as edges and textures, it will not be. Its size is expanded to maintain image detail. This method can further smooth the speckle noise in uniform regions while preserving the edge details of the image. Finally, the adaptively truncated samples are used as the input to the bilateral filter Compared with the traditional filtering algorithm, the adaptive bilateral filtering method proposed in this paper has better performance and effect. It can not only effectively suppress the speckle noise of the SAR ship image but also better protect the image edge and texture information. Moreover, it has the characteristics of full self-adaptation, which can effectively suppress the speckle noise of SAR ship images, laying a better foundation and guarantee for the subsequent processing of SAR data.

Research Methods and Principles
2.1. The Principle of Bilateral Filtering. The bilateral filtering algorithm is a noise removal method derived from the Gaussian filtering algorithm. While effectively retaining the excellent denoising ability of the Gaussian filtering, it can effectively reduce the additive noise without destroying the edges and details of the image. The edge information of the image is preserved, but impulse noise cannot be removed. SAR images are processed by echoes from successive radar pulses, and the pixel changes generated by the echo intensity appear as speckle noise of the image, which is usually impulsive noise. Especially for strong speckle noise, traditional bilateral filtering cannot effectively reduce the noise. The two weight combinations that determine the traditional bilateral filtering are geometric similarity and grayscale similarity weights.
where cðA, xÞ in this function is the geometric similarity weight value of the central pixel x and its surrounding pixels A, sð f ðAÞ, f ðxÞÞ is the grayscale similarity weight of the central pixel x and its surrounding pixels A, and kðxÞ represents the normalization index.
The image Gaussian kernel function that determines the geometric similarity is constructed as where dðA, xÞ represents the distance between the surrounding pixel point A and the central pixel point x and d is the geometric expansion factor that mainly controls the geometric expansion factor of the low-pass filter strength. The smaller the value of σ d , the lower the low-pass filtering strength and the clearer the filtering result. The Gaussian 3 Wireless Communications and Mobile Computing kernel function of grayscale similarity is constructed as follows: where σ r is the diffusion factor of image grayscale similarity. It can be seen from equations (1) and (2) that in the traditional bilateral filtering, each pixel needs to be calculated many times, which will lead to poor real-time performance of the algorithm. At the same time, because the parameters are fixed, it is necessary to manually adjust the parameters according to the actual noise situation. If the local reference window contains impulse noise, the impulse noise will occupy a large proportion in the filtered samples, which will greatly affect the strong speckle noise denoising of SAR images.

Improved Bilateral Filtering Method Based on Fast
Adaptive Threshold. In this paper, an improved bilateral filtering method based on a fast adaptive threshold is proposed, which realizes the adaptive adjustment of the spatial standard deviation and the gray standard deviation by adjusting the photometric similarity characteristics and then applies the adjusted sample information to the improved bilateral filter. Speckle noise, especially strong speckle noise, can be largely eliminated.
The sample information processing rules for fast adaptive thresholds are defined as follows: where I i,j is the intensity value of the sample ði, jÞ within the image reference window and a is the depth of sample trimming. σ w and μ w are the standard deviation and mean of all samples in the image reference window, N is the size of the local window, and σ w and μ w are defined as follows [17]: If σ w and μ w satisfy equation (5), all samples in local reference window will be retained and processed by bilateral filtering; otherwise, the samples will be deleted. After the samples are trimmed, the combined filtering weight hðxÞ is generated by formulas (1) to (4), and the original sample A will be replaced by the trimmed sample φ. After performing sample trimming and stage of adaptive thresholding on the local reference window according to the local features of the image, the adjusted combined similarity weight value greatly reduces the influence of strong speckle noise on the image and is smoothed into strong impulse noise speckle signal. Based on different trimming depth value a, the equivalent view number ENL and the edge degree similarity index ESI are used to measure the edge-preserving ability of the bilateral filter to process the image. The larger the trimming depth value a, the more sample information is retained, and more image edge details will be preserved; however, the despeckling performance will be reduced.
In order to meet the good speckle noise suppression and smoothing effect and edge preservation performance at the same time, this paper proposes a fast adaptive threshold method. The depth kernel function is constructed as follows: where σ h is the standard deviation values of the entire SAR ship image and σ w is the standard deviation values of the local reference window. The smaller the strength weight value θ of the truncated sample, the stronger the ability to truncate the sample information. If the filtered pixel is a pixel at the edge of the image, σ w is greater than σ h and the value of a is larger, the number of automatically truncated sample information is less, and the edge information and texture of the image are well preserved. Otherwise, if the filtered pixels are mostly cluttering pixels, then σ w is smaller than σ h and the smaller a is, and more pixels that deviate from the average value of the image will be eliminated, and the number of automatically truncated samples will be large, which can be very smooth speckle noise to a large extent. Therefore, the improved combined similarity weight is more accurate, which not only smooths the strong speckle noise signal but also preserves the edge detail information of the image.

Improved Bilateral Filtering Method Based on Variable
Window. In the above adaptive threshold bilateral filtering, when the value of geometric diffusion factor σ d that controls the strength of the low-pass filter and the grayscale similarity diffusion factor σ r is larger, the effect of smoothing noise can be enhanced [17]. However, the details of the image will be destroyed. In order to satisfy the requirements of smoothing noise and preserving details at the same time, an improved bilateral filtering algorithm based on variable windows was proposed in this paper. In the improved filtering method based on variable window size, when the extended local reference window is in a nonuniform edge condition, its window can be enlarged to make the speckle noise stronger; when the extended window contains details such as edges and textures, it will not be. Its size is expanded to maintain image detail. This method can further smooth the speckle noise in uniform regions while preserving the edge details of the image. Finally, the adaptively truncated samples are used as the input to the bilateral filter.
Firstly, set T as the expansion threshold that controls the size of the window, initialize the size of the window r w , and calculate the standard deviation of the entire image σ h and the local window σ w . If σ h and σ w satisfy formula (9), the window size will be enlarged, and the enlargement method is formula (10), and i is the number of rounds of enlargement.
The main operation steps are as follows: (1) Initialize the size of the window r w , and its expansion threshold is T; the trimming intensity, the geometric diffusion factor σ d , and the grayscale similarity diffusion factor σ r value (2) Calculate the standard deviations σ h and σ w of the entire image window and the local window. If equations (9) and (10) are satisfied, the size of the local window will increase; if equation (9) is not satisfied, the final gets the size of the window (3) Use the kernel function of equation (8) to calculate the truncated depth of the window sample, and calculate the adaptive threshold through equations (5)- (7) to truncate the sample information in the local reference window of the image (4) Calculate the photometric similarity weight sðxÞ of the sample by formula (4) (5) Calculate the combined similarity weight hðxÞ determined by both the geometric similarity and the grayscale similarity through equations (2) and (3), and use bilateral filtering to process image pixels (6) Repeat steps (2) to (5) until the end of the entire SAR image, and output the processed filtering results

Evaluation Indicators.
For the operating efficiency of the algorithm, this paper takes equivalent view number of looks (ENL) count, the edge preservation index (EPI) count, peak signal-to-noise ratio (PSNR), structural similarity, and running time as evaluation indicators (SSIM), and all experiments are completed on the following computers. The experimental environment adopts Intel Core™ i7 dual-core, memory 8 G, main frequency 3.60 GHZ, and is completed under the MATLAB R2018 platform. The equivalent view number of looks (ENL) is used to measure the intensity of speckle noise in the image. The ENL of the filtered image is usually larger than that of the original image, which means that the filtered image is smoother than the unfiltered image. The larger the ENL value, the better the ability to remove speckle noise. The edge preservation index (EPI) indicates the preservation performance of the image edge after filtering. The higher the EPI value, the better the image edge preservation ability. Peak signal-to-noise ratio (PSNR) is the ratio of the maximum power of the signal to the maximum power of the noise. The clearer the image, the higher the PSNR value. Structural similarity (SSIM) measures the similarity of images in terms of contrast, brightness, and struc-ture. When the SSIM value is closer to 1, it means that the similarity of two images is higher. The speckle index β is a good measure of the intensity of the coherent speckle on the image [18]. It is the ratio of the standard deviation of the pixel value in the homogeneous area on the image to the mean value. The smaller the β value, the smaller the speckle noise and the better the filtering ability. The mean square error value (MSE) represents the mean value of the square sum of the differences before and after filtering in the homogeneous area in the image. The larger the β value, the better the filtering performance.

Analysis of Experimental
Results. The contrast experiment filtering algorithms used in this paper contains sigma filtering (sigma), bilateral filtering (BF), improved bilateral filtering algorithm (truncated statistics-based bilateral filter, TS-BF) based on truncated statistical characteristics, nonlocal mean filtering algorithm (NLM), and the improved bilateral filtering algorithm (adaptive threshold and variable window size bilateral filtering, ATS-BF) that are compared and experimentally studied to verify the better performance of the algorithm proposed in this paper. The proposed algorithm has excellent speckle noise suppression and edge preservation performance. The relevant simulation parameters of each filter are set as follows: (1) In order to comprehensively consider the contrast speckle smoothing effect and the preservation of edge details of the image, the window size of the traditional speckle noise filter and bilateral filter is both 5 * 5; the initial value of the improved bilateral filter window in this paper is also set to 5 * 5. At the same time, the requirements of formulas (9) and (10) are required (2) Since the sigma filter is based on the sigma probability of Gaussian distribution, it mainly eliminates image noise by averaging the pixels within the two sigma ranges of the central pixel in the filter mouth, while the remaining pixels are not processed as edge pixels. The two-sigma probability of the Gaussian distribution is 95.5%. 95.5% of the random samples of the Gaussian distribution fall within the two standard ranges of their mean, so 95.5% of the pixels in the local reference window are reserved for filtering. For the modified sigma filter, specify that the sigma value of ξ is 0.9, set the percent value of Z to 98%, and set the threshold to 6.0 for strongly reflective pixels in the window Tk. The photometric similarity diffusion factor σ r and geometric diffusion factor σ d of the traditional bilateral filter and the improved bilateral filter proposed in this paper are 40 and 3.0, respectively The truncation strength weight of the improved bilateral filter proposed in this paper is very important to the performance of bilateral filtering. If the value of θ is too high, the adjustment range of the truncation depth A will be small, and the samples will be truncated less, which will cause the speckle noise unable to be smoothed. Otherwise, the 5 Wireless Communications and Mobile Computing adjustment range of the truncation depth A will be large, the samples will be truncated too much, and the image details will be destroyed. Different θ values are used to conduct experiments on images contaminated by speckle noise, and the equivalent viewing number of looks (ENL) and edge preservation index (EPI) are obtained and recorded. It is shown in Figure 1. ENL and EPI performances of speckle smoothing effect and image detail preservation, the optimal value of truncation intensity weight is 0.5 in this experiment 3.2.1. Simulation Experiment. In this paper, experimental research and analysis are carried out to simulate standard images affected by speckle noise. It can be seen from Figure 2 and Table 1 that the sigma algorithm has a good ability to suppress speckle noise, but there is obvious lack of details in the heterogeneous area. The BF algorithm has better texture information protection performance, but the performance of smoothing noise is poor. TS-BF algorithm is similar to ATS-BF algorithm in edge preservation effect, but the former has slightly worse smooth noise effect. The NLM algorithm is better than ATS-BF algorithm in smoothness, but its edge preservation ability is worse. After comprehensive comparison, it is concluded that the ATS-BF algorithm proposed in this paper has strong advantages in smoothing noise and texture detail protection; that is, it shows better speckle noise suppression and edge preservation performance for simulated images. Mean squared error (MSE) refers to the expected value of the square of the difference between the estimated value of the parameter and the true value of the parameter. It is a more convenient method to measure the average error. MSE can evaluate the degree of change in the data. The smaller the MSE value is, the better the prediction model describes the experimental data with better accuracy. It shows that the prediction model has better accuracy in  As can be seen from Figure 3 and Table 2, the five methods can filter out most of the noise on the SAR image. The NLM algorithm has a better effect on coherent speckle noise processing in the homogeneous area, but there is a large loss of texture detail information in the texture area.
However, the sigma filtering algorithm and the traditional bilateral filtering algorithm BF have poor noise suppression effect in the surrounding homogeneous area in the detail protection of the texture area. The TS-BF filtering algorithm makes up for the above deficiencies, but it is less effective in protecting the details of linear textures. Compared with other filtering algorithms, the ATS-BF algorithm has smaller MSE value and larger ESI and ENL values, and it has better     advantages, but it also suffers from the loss of a small amount of texture detail information. The comprehensive simulation image experiment and SAR image experiment results show that the ATS-BF algorithm can effectively suppress the speckle noise in the original data and improve the protection of the edge detail information of the SAR image compared with other filter algorithms. The experimental results verify the superiority of the algorithm proposed in this paper.

Conclusion
In this paper, for the bilateral filtering algorithm, all samples in the local reference window are used to generate photometric similarity weights, which not only cannot eliminate the strong speckle noise signal in the SAR ship image but also will enhance the noise signal and cause image edge detail damage, etc. Therefore, an improved bilateral filtering algorithm based on fast adaptive threshold and variable window size is proposed. The innovations of the algorithm mainly include the image sample truncation method with fast adaptive truncation statistical characteristics that is introduced to suppress the influence of coherent speckle noise, which solves the problem that traditional bilateral filtering is difficult to filter out strong speckle noise. The filtering method based on variable window size is used in speckle noise in uniform areas which can be further smoothed while preserving image edge detail. Finally, the adaptively truncated samples are used as the input to the bilateral filter.
The experimental results show that improved adaptive bilateral filtering algorithm improves the speckle noise removal ability by 16.06% compared with the traditional bilateral filtering algorithm in the speckle noise suppression of the SAR ship image, and the preservation performance of the image edge after filtering is improved by 5.41%. Compared with the original image, the filtered image has a 1.2% improvement in structural similarity. The algorithm can effectively suppress speckle noise and has a good ability to retain edge and texture information of the SAR ship image, which has strong practicability. However, when the algorithm deduces the adaptive sample truncation formula, there is a single deficiency of the sample model, which may lead to the problem of reducing the application scope of the algorithm. The follow-up will increase the algorithm research of different models. At the same time, when calculating the deformation of the filter window in the edge area, compared with other algorithms, the amount of calculation has increased, and the deformation will be improved and optimized in the future to further improve the efficiency and real-time performance of the algorithm.

Data Availability
The data used to support the findings of this study are included within the article.

Conflicts of Interest
The authors declare that they have no competing interest.