A Small Target Detection Method for Sea Surface Based on Guided Filtering and Local Mean Gray Difference ()
1. Introduction
The accurate detection of ship targets on the sea is essential in various contexts, including military operations for identifying potential threats, civilian applications such as search and rescue operations for shipwrecks. Infrared thermal imaging technology is commonly used due to its advantages of concealment, long detection range, and all-weather functionality. However, when objects are located far away from the observer, they appear as small targets that can easily blend into the complex and dynamic sea clutter, bright bands, and island backgrounds. This poses significant challenges for detecting these small targets, leading to false alarms and missed detections [1] .
Over the past few decades, extensive research has been conducted on single-frame small target detection methods. These methods are primarily on analysis to the spatial grayscale information of individual infrared images to detect small targets. They are characterized by their simple structure, ease of operation, and convenient hardware implementation. Some of the commonly used algorithms in this field include max-median filtering [2] , morphological filtering [3] , and two-dimensional least mean square (TDLMS) filtering [4] .
Max-median filtering retains image details while filtering out small targets based on differential operations between the original image and the estimated background map. Morphological filtering eliminates small voids in the image by expanding and corroding the original image. TDLMS filtering [5] minimizes the error between the original image and an expected image through continuous iteration, resulting in an estimated background map that closely resembles the actual background.
Other approaches employed in this area include Gaussian difference filtering and the local contrast method (LCM). Gaussian difference filtering applies Gaussian kernels of different scales to process the image and then performs differential operations. Threshold segmentation is used to extract targets from the processed image. However, Gaussian difference filtering tends to have poor robustness and low accuracy in complex scenes.
The local contrast algorithm, first proposed by Chen et al., utilizes the visual saliency mechanism of the human eye [6] . It calculates the local contrast information for each point in the infrared image and enhances weak points that meet certain conditions while suppressing other pixels. Finally, small targets in the image are obtained through threshold segmentation [7] . Building upon the local contrast algorithm, Wei et al. proposed MPCM (multiscale patch-based contrast measure) by utilizing multiscale means for detection [8] [9] . New algorithms such as Novel Weighted Image Entropy (NWIE) and Local Difference Measure (LDM) have further improved background and noise suppression capabilities by introducing the probability of information entropy [10] [11] [12] [13] . However, these algorithms based on the visual saliency mechanism of the human eye may not be effective for small targets that are prone to being drowned out by noise and difficult to detect.
Considering the specific challenges posed by far-range detection applications characterized by a low signal-to-noise ratio and significant disturbances, a small target detection method for the sea surface based on guided filtering and local average gray level difference is proposed in this paper. The proposed method enhances the details of small targets using guided filtering while suppressing the background and noise to improve target saliency. Then, the local average gray level difference of the image is calculated to further distinguish noise and disturbance points. The location of targets is determined through threshold segmentation. Experimental results demonstrate that the algorithm proposed in this paper can effectively detects small targets on the sea surface from long distances, achieving a high detection rate with a low false alarm rate [14] .
2. Principle of Guided Filtering
Guided filtering [15] , as the name suggests, makes use of a guided map to process a image. Assuming that q represents the output image, I represents the guided image, and p is the original image, the local linear model of guided filtering can be expressed as follows:
(2.1)
In the above equation,
represents the weighted value of guide image I at the corresponding position. When the guided image is the same as the original image, the result shows the effect of edge preservation. the above equation can be written as:
(2.2)
k For a pixel point in the guided image,
and
are the linear coefficients of the guided image at point k.
Taking derivatives on both sides of Equation (2.2) yields:
(2.3)
From Equation (2.3), it can be seen that there is a linear relationship between the gradient of the output image q and the gradient of the guided image I, which is why the output image is able to get the corresponding guided information from the guided image.
The original image p is usually blended with noise, q is the output image, To solve
and
, according to the principle of unconstrained recovered image, it is necessary to
, that is:
(2.4)
This was then transformed into the solution of a least squares problem with a penalty term introduced for computational convenience, i.e., regularization was applied.
(2.5)
In Equation (2.5):
is the regularization factor, which is used to regularize the larger value of
, and p represents the original image. After calculation, the corresponding
and
are respectively:
(2.6)
(2.7)
In Equation (2.6):
is the number of pixels in the window,
is the average value of the gray scale of I in the window
,
is the variance of the gray scale of I in the window
, and
is the average gray scale value of the input image p in the window
. When calculating the linear coefficients for each window, it will be found that a pixel will be contained by more than one window. so it is sufficient to average the values of all the linear functions that contain the point, as shown in Equation (2.8) and Equation (2.9):
(2.8)
(2.9)
After completing the computation of
and
, the resultant graph after processing by the guided filtering algorithm can be obtained by the computation of Equation (2.2).
3. Detection Metod
3.1. Adaptive Detail Enhancement and Noise Suppression
The image obtained by subtracting the original image from the guided filter is the detail layer of the image.
(3.1)
In Equation (3.1) q represents the base layer of the image, which Means the slowly changing background part, while r represents the detail part of the image. Since it is required to enhance need to enhance the details of the image, so first assume that multiplying by a certain gain coefficient
, and get the enhanced detail layer
, as shown in the following equation:
(3.2)
This can be obtained by bringing Equation (3.2) into Equation (2.2)
(3.3)
Thus the gradient of the enhanced detail layer is calculated as shown below
(3.4)
And the gradient of the base layer can be calculated as follows.
(3.5)
The detail layer represents the part of the image where the gradient Variation is more obvious, which naturally contains the noise in the image. To ensure that the details of the enhanced image do not amplify the noise at the same time, it is necessary that the gradient value of the enhanced detail layer at any point should be less than or equal to the gradient value of the base layer at the corresponding position. From this, the value of
is calculated as shown in Equation (3.7), and
are the coefficients of the linear function obtained from the guided filtering calculation.
(3.6)
(3.7)
(3.8)
From the derivation of guided filtering, it can be concluded that: when a pixel is located in the “high variance”, that is to say, the image I in the window
has a large variation in
, so
will be close to 1,
will be close to 0. on the contrary, if the variation is slow in the flat area of
will be close to 0, and
will be close to
, then
will decrease, so as to restrain the noise.
When
will is close to 1, the value of
will become very large. In order to prevent the edge details of the image from being over-amplified, the adjustment coefficient
is introduced in Equation (3.9), and
can take a value between 0 and 1. With the help of
, the problem of over-amplification of the edge information can be avoided effectively.
(3.9)
The results of the enhancement of the detail layer after the guided filtering process can be observed in Figure 1. In this figure, the upper part of each subfigure represents the original image, while the lower part shows the results of adaptive detail enhancement and noise suppression.
From the figures, it is evident that the brightness of the small target in the processed sea surface image remains unchanged, indicating that the guided filtering process effectively preserves the details of the targets. Meanwhile, the background and noise are significantly suppressed, leading to a clearer and more distinguishable small target against the background. This outcome demonstrates the effectiveness of the guided filtering method in enhancing the details of small targets while reducing the impact of noise and clutter.
Figure 1. Adaptive detail enhancement and noise suppression.
3.2. Local Average Grayscale Difference
The results of the enhancement of the detail layer after the guided filtering process analyze common small targets and noise, such as bright spots and islands. Figure 2 provides further insight into these characteristics. In this figure, Figure 2(a) represents a typical infrared small target, while Figures 2(b)-(d) represent different types of background or noise in the image. The upper part of each subfigure shows the grayscale map, while the lower part displays the corresponding three-dimensional maps, which reveal distinct structural characteristics.
In Figure 2(a), the bright pixels are mainly concentrated in the center of the window, with a rapid decrease in grayscale value in the surrounding area. This spike-like pattern is a typical characteristic of small targets. Figure 2(b) exhibits a brighter center area; however, the distribution of bright pixels is more dispersed. The three-dimensional map shows that although the overall gray value is higher, it fluctuates similarly to noise patterns. Figure 2(c) demonstrates that the gray value is larger in the horizontal direction but significantly smaller in all other directions. This pattern often corresponds to waves or bright spots in the sea surface image. Lastly, Figure 2(d) displays an obvious high gray value along the sub-diagonal, while remaining very dark in all other directions. Such patterns are commonly observed at the edges of islands or large ships on the sea surface.
These observations provide valuable information about the characteristics of small targets and different types of noise in the sea surface image. By utilizing guided filtering, the algorithm effectively enhances the details of small targets while suppressing the background and noise. This enables the detection of small targets with improved clarity and distinction against the complex and dynamic background.
Combining the above analysis, it can be known that the weak targets on the sea surface have a unique local average grayscale difference, i.e., presenting a kind of raised spike-like shape. And from the local average grayscale difference, we can further distinguish the targets and non-targets (background and noise), which there by improves the accuracy of the algorithm and reduces the false alarm rate of the algorithm.
Based on this, a combination of guided filtering and local average gray level difference is proposed for the detection of small targets on the sea surface, and the overall flow of the algorithm is shown in Figure 3.
The original infrared image is first processed by guided filtering, and then the detail layer of the image is enhanced meanwhile noise suppressed, By the above method, the target is enhanced, while the background and noise are suppressed, and then the local average gray difference of the image is calculated, which consequently completes the detection of small targets on the sea surface under the complex background of the sea surface.
For the Guided Filtering, the original window is divided into 9 chunks as shown in Figure 4, and then the average grayscale difference on the horizontal, vertical, main diagonal, and sub-diagonal is calculated separately.
Figure 2. Difference between local structural features of targets and non-targets.
Figure 3. Flowchart of small target detection method at sea surface based on guided filtering and average gray level difference.
Figure 4. Schematic structure of a sliding window.
(3.10)
In the above equation,
denotes the average grayscale of each subregion from
to
, and
denotes the average grayscale difference between the center subregion
and the i subregion. From the previous analysis, if the subregion is a target, then
will be larger in all directions, while the non-target subregions (background and noise) have average grayscale values in other directions similar to the center region. And to further expand these differences, multiplication will be applied on average grayscale difference of two regions on the same directional line.
(3.11)
denotes the product of two average grayscale differences in a certain direction, For example,
denotes the product of two average grayscale differences in the horizontal direction, If the two average grayscale differences is small, then the result of the product is small but if the difference of the gray scale values in a certain direction is large, then the product will also be large. For small target, the product is usually large, while for noise and some disturbance, it should be.
To further amplify these differences, we multiply the smallest two of
as our result. The resulting computational expression is given below:
(3.12)
In the above equation,
and
represent the smallest and the penultimate values in
, and then
and
are multiplied as the result for output.
With the above calculations, the final output
turns out to be very large in the target area, while the values in the non-target area are very small and, in some cases even negative.
The final output will still contain some intrusive regions that require further threshold segmentation, and a suitable threshold is summarized based on experiments to be one-half of the maximum
value.
(3.13)
Th denotes the threshold value of the output map based on the local structural features algorithm, and the binarization of
using this threshold value can get the position where the small target is located on the sea surface. The result of the algorithm in this paper is shown in Figure 5.
Where Figure 5(a) represents the original image, Figure 5(b) represents a three-dimensional image of the original image, Figure 5(c) represents a three-dimensional image processed by the algorithms Figure 5(d) represents the detection result, and Figure 5(e) represents the three-dimensional image of Figure 5(d).
4. Analysis and Evaluation of Results
4.1. Detection Results and Comparative Analysis
To analyze the detection ability of the proposed method for small infrared targets on the sea surface, several comparison methods are employed, including the background subtraction method (BS), top-hat filtering, 2D minimum mean square filtering, maximum median filtering, and the LCM algorithm. The results of the experiments are shown in Figure 6, where Figure 6(a) displays the original infrared images of five different scenes, and Figures 6(b)-(g) represent the processed results of the above methodology, including the proposed method.
In Figure 6, the red box indicates the actual position of the small target in the image, while the yellow circles represent the false alarm points generated by each method. From the overall results, it can be observed that the algorithm proposed in this paper exhibits superior detection ability, accurately detecting all the targets with fewer false alarm points compared to other methods.
The second-best performance is achieved by the traditional LCM algorithm, which successfully detects all the targets but generates some false alarm points due to clutter.
The next methods, including top-hat filtering, 2D minimum mean square filtering, and maximum median filtering, demonstrate varying levels of adaptability depending on the complexity of the current background. The more complex the background, the poorer their rangeability, indicating that these methods may struggle to effectively detect targets under challenging conditions.
The last method, the background subtraction method, proves effective for predicting the complex sea background. However, it faces difficulties in completely separating the target from the background, leading to potential limitations in accurate target detection.
Figure 5. Graph of the results of the algorithm of Th.
Figure 6. Comparison of detection results of various algorithms.
Based on the comparative analysis, the algorithm proposed in this paper outperforms the other methods in terms of detection ability, accurately identifying all the targets with fewer false alarms. This demonstrates the effectiveness of the proposed method for small infrared target detection on the sea surface, particularly in handling complex backgrounds and reducing false alarms.
4.2. Quantitative Comparative Analysis
For a more objective evaluation of algorithm performance, this paper adopts the widely used Local Signal-to-Clutter Ratio Gain (LSCRG), Background Suppression Factor (BSF), and Receiver Operating Characteristic (ROC) curve as the evaluation criteria.
1) Localized Signal-to-Hash Ratio Gain (LSCRG)
The defined expression for Local Signal-to-Clutter Ratio (LSCR) is shown below:
(4.1)
In the above equation,
represents the average gray value of the target pixel;
represents the average gray value of the background pixel around the target;
represents the standard deviation of the background around the target. The LSCRG indicates the change of the local signal-to-heterodyne ratio after the algorithm processing, the larger the LSCRG, the better noise suppression effect, and the stronger target detection capability.
(4.2)
The five scenes in the above section are used for experiments, and Table 1 presents the LSCRG results of six algorithms.
2) Background suppression factor (BSF)
The formula for calculating the background suppression factor is as follows:
(4.3)
Where,
denotes the standard deviation of the background around the target of the input original image and
d denotes the standard deviation of the background around the image target of the processed image.
The above images in Figure 7 are used as the experiment image, and Table 2 presents the BSF results of the six methods in the above five scenes.
Table 1. Comparison of LSCRG indices for each algorithm.
Figure 7. Comparison of ROC curves for each target detection algorithm.
Table 2. Comparison of the BSF indices of the algorithms.
3) ROC curve
The ROC curve is an important objective evaluation index of the classifier, the ROC curve is the ROC curve is the relationship curve between the detection rate TPR and the false alarm rate FPR, and the expressions of the detection rate TPR and the false alarm rate FPR are shown below:
(4.4)
In the given equation, “TP” represents the number of true positives (real targets detected), “FN” represents the number of false negatives (real targets missed), “FP” represents the number of false positives (false targets detected), and “TN” represents the number of true negatives (non-target elements correctly identified as non-targets).
The coordinates in the ROC curve correspond to different detection rates and false alarm rates obtained at various thresholds. There is a positive correlation between the false alarm rate and the detection rate. When the threshold is set low, more potential targets are detected, leading to a higher detection rate. However, this also increases the likelihood of false alarms, resulting in a higher false alarm rate.
The ROC curve provides a visual representation of this trade-off between the detection rate and false alarm rate at different operating points. By adjusting the threshold, one can move along the curve to achieve different trade-offs according to the specific requirements of the application.
The area under the ROC curve (AUC) serves as an important performance metric for the algorithm. The AUC quantifies the overall accuracy of the target’s location judgment provided by the algorithm. A larger AUC indicates better performance, indicating that the algorithm achieves higher accuracy in distinguishing between targets and non-targets. Conversely, a smaller AUC suggests lower accuracy in target localization.
Thus, the ROC curve and its associated AUC provide valuable information for evaluating the performance of a small target detection algorithm, allowing for comparisons between different approaches and determining the effectiveness of target detection in terms of both detection rate and false alarm rate.
In Figure 7, the ROC curves for the six methods are displayed. Each algorithm’s results for images 1-5 are represented by plots a-e, respectively. It is evident that different scenes yield varied outcomes for the algorithms.
Overall, the algorithm proposed in this paper demonstrates the best detection performance among the six methods. Top-hat filtering and max-median filtering are significantly influenced by the size of the target. TDLMS (Time-Domain Least Mean Square) is greatly affected by the background, with image 2 being much brighter than image 1 due to differences in capture time. As a result of limited background brightness prediction ability, the detection capability of TDLMS is considerably reduced.
The traditional LCM algorithm generally outperforms the other four methods but falls short in image 4 and image 5. Image 4 includes large ships, while image 5 contains a significant amount of clutter on the sea surface. These factors impede target detection, resulting in a high number of false alarms.
The background subtraction method proves unsuitable for all scenes, and the simple time-domain low-pass algorithm struggles to accurately predict the complex sea surface background.
In summary, compared to the other five methods, the improved algorithm proposed in this paper demonstrates superior detection ability for infrared small targets on the sea surface. It achieves better performance across different scenes and exhibits improved accuracy in target detection, making it an effective approach for small target detection in challenging maritime environments.
5. Conclusions
Traditional small target detection algorithms encounter significant challenges in the unique marine environment, which is often cluttered with bright spots, islands, ships, and other disturbances. These obstructions inhibit effective target detection, leading to an inflated false alarm rate for the algorithm. This article proposes a novel small target detection method on marine surfaces that utilizes guided filtering and local average gray level difference to enhance image detail.
Upon analysis, it is found that while small targets and interference spots share characteristics like small size, high energy, and noticeable contrast, they exhibit local structural differences. Small targets display a substantial average grayscale difference in all directions surrounding them, whereas interference spots maintain a similar average grayscale in certain directions. It is thus feasible to differentiate targets based on disparities in local average gray scale difference.
The superiority and applicability of the proposed algorithms for detecting small targets on marine surfaces are substantiated through comparative experiments with five other methods on actual marine scenarios. Performance indices including the LSCRG index, BSF index, and ROC curve for each algorithm were calculated, and the resultant data underscores the efficacy of the algorithms presented in this study.
This paper’s objective is to improve identification techniques for minuscule infrared targets on marine surfaces using an algorithm derived from intensive examination and analyses of real-world marine scenes. It is important to acknowledge that the complexity of marine scenes implies that the experimental data may not encompass all possible scenarios. As such, the universality of the algorithm’s implementation for all forms of marine surface infrared small target detection may be somewhat restricted.
Future research endeavors will aim to mitigate this limitation through more comprehensive experimentation and meticulous analysis. A wider range of experiments and thorough investigations of results can facilitate the refinement of the algorithm and deepen understanding of its effectiveness across diverse marine surface scenarios. The continuing research seeks to offset previously mentioned limitations and further elevate the algorithm’s performance for small target detection on marine surfaces.