An adaptive CFAR detection method based on scene classification

By combining scene classification and adaptive CFAR detection methods with K-means clustering and VI-CFAR algorithm, the problem of high false alarm rate of traditional CFAR algorithm in port and land environment is solved, and stable target detection in complex background is achieved. In particular, it significantly improves detection accuracy and efficiency in the detection of ships on the sea surface.

CN119540738BActive Publication Date: 2025-12-05NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411843035.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-12-05
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

Traditional CFAR algorithms struggle to effectively distinguish targets from the background in port and land environments, resulting in unstable detection performance and a high false alarm rate, making them unsuitable for target detection needs in complex environments.

Method used

An adaptive CFAR detection method based on scene classification is adopted. SAR images are classified by K-means clustering algorithm, and VI-CFAR and saliency model are combined for adaptive adjustment. Target detection is performed for inland, coastal and marine scenes respectively. Pre-trained deep learning network is used to extract features and combined with SLIC and Otsu algorithms for land-sea segmentation.

Benefits of technology

It effectively reduces the false alarm rate and improves the robustness and accuracy of target detection. In particular, it reduces false alarms caused by complex land areas in the detection of ships on the sea surface, ensuring that the detection algorithm focuses on sea surface targets and improving detection efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540738B_ABST
    Figure CN119540738B_ABST
Patent Text Reader

Abstract

The application provides a kind of adaptive CFAR detection method based on scene classification, uses K-means clustering algorithm and the scene classification of input SAR image, uses VI-CFAR to the pure sea area region obtained by classification for target detection, using saliency model to the CFAR detection of coastal area.The application effectively solves the problem that the false alarm rate of traditional CFAR algorithm is high in the complex background of port and land, and the detection performance is unstable, optimizes the detection parameter according to the complexity of different scene backgrounds, so as to ensure that the CFAR algorithm can still maintain a constant false alarm rate in the sea clutter background, and significantly improve the robustness of target detection.Effectively distinguish the marine area and land area in the image, and shield the land area.This technical scheme solves the problem that the traditional CFAR detection algorithm is disturbed by the complex background of land when detecting ships on the sea.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of radar target detection, and more specifically to an adaptive CFAR detection method based on scene classification. Background Technology

[0002] Synthetic Aperture Radar (SAR) imagery, due to its unique imaging mechanism, can acquire high-quality images of the Earth's surface under conditions of no light or severe weather, and has broad application prospects in marine monitoring. The Constant False Alarm Rate (CFAR) algorithm, as a crucial target detection method in radar automatic detection systems, has attracted considerable attention. In recent years, researchers have developed various types of CFAR detectors, such as the Average Constant False Alarm Rate Detector (CA-CFAR), the Stepped Constant False Alarm Rate Detector (GO-CFAR), and the Sequential Test Constant False Alarm Rate Detector (SO-CFAR). These detectors, by adapting to different environmental characteristics, can achieve target detection in air, sea, and some land scenarios, and exhibit good detection performance.

[0003] However, CFAR algorithms face numerous challenges in port and land environments. In port environments, due to the low contrast between targets and background, and the complexity of the background, traditional CFAR algorithms struggle to effectively distinguish targets from clutter signals, leading to unstable detection performance and a high false alarm rate. In land environments, complex background factors such as terrain, vegetation, and man-made structures weaken the feature differences between targets and background, making traditional CFAR detectors susceptible to false alarms and reducing target detection accuracy. Furthermore, traditional CFAR algorithms typically assess background noise levels based on fixed window sizes and structures, but this approach struggles to handle non-uniform backgrounds in port and land environments. Variations in background height and irregularities in target shape further increase the difficulty of target detection, making traditional CFAR detectors unsuitable for different scene requirements.

[0004] Therefore, there is an urgent need for an adaptive CFAR detection method based on scene classification, capable of adaptively adjusting to different target detection scenarios to achieve more accurate and stable target detection performance. This method utilizes advanced scene classification algorithms and adaptive strategies to dynamically adjust detection parameters, enabling it to maintain a constant false alarm rate in complex backgrounds and significantly improve the robustness of target detection. This invention primarily addresses the problem of CFAR failing to accurately detect targets and generating numerous false alarms in coastal and land environments. Summary of the Invention

[0005] To overcome the shortcomings of existing technologies, this invention provides an adaptive CFAR detection method based on scene classification.

[0006] The purpose of this invention is to address the issue of CFAR's inability to maintain excellent detection performance in port and land scenes. It provides an adaptive CFAR detection method based on scene classification, ensuring that CFAR does not detect land scenes and achieves land-sea separation in ports to avoid generating a large number of false alarms. This method uses the K-means clustering algorithm to classify scenes, and then applies a land-sea separation strategy for port scenes and an adaptive CFAR detection algorithm to achieve excellent target detection in different environments.

[0007] The adaptive CFAR detection method based on scene classification described in this invention is a hybrid expert model that uses the K-means clustering algorithm to classify images and employs different experts for object detection for images in different scenes.

[0008] The technical solution adopted by this invention to solve its technical problem includes the following steps:

[0009] Step 1: Use the K-means clustering algorithm to classify the scene in the input SAR image;

[0010] By clustering, SAR images are divided into three datasets: inland, inshore, and offshore, which refer to the land area occupying 100%, 0-100%, and 0% of the image, respectively. After obtaining the three types of images, inland images are filtered out and no target detection is performed. Offshore images are subjected to target detection in step 2, and inshore images are subjected to target detection in step 3.

[0011] Step 2: Use VI-CFAR to detect targets in the pure offshore area obtained from Step 1 classification;

[0012] VI-CFAR (Variance Index CFAR) employs a CFAR strategy that selects different mean-based CFAR strategies based on the VI and MR values. Cell-averaged CFAR (CA-CFAR) averages the data from neighboring reference cells surrounding the cell to be detected as a background clutter power estimate to obtain the detection threshold, adapting to the case of averaged background clutter. Cell-minimum selected CFAR (SO-CFAR) selects the smaller of the sums of the two half-windows and averages them as the background clutter estimate, preventing the background estimate from being too large and thus avoiding missed detections. Cell-maximum CFAR (GO-CFAR) selects the reference cells in the half-window with the larger clutter power and averages them as the background clutter estimate to improve the false alarm rate increase problem at clutter edges.

[0013] Step 3: Use the saliency model to perform CFAR detection on the inshore area obtained in Step 1;

[0014] CFAR detection using a saliency model is a method that combines saliency feature extraction with constant false alarm rate (CFAR) detection technology. It is suitable for target detection in complex backgrounds such as coastal port environments, especially for ship target detection in synthetic aperture radar (SAR) images. It can more accurately distinguish targets from the background, thereby improving detection accuracy and reducing false alarms.

[0015] The specific steps of step 1 are as follows:

[0016] Step 1-1: Extract image features using a pre-trained deep learning network;

[0017] Using MobileNetV2 pre-trained on the ImageNet dataset as the feature extraction model, the input SAR image X is processed to extract its feature vector f. The formula for extracting the feature vector is as follows:

[0018] f i =MobileNetV2(X i (1)

[0019] Among them, X i f represents the input data for the i-th image. i Image X extracted using the MobileNetV2 model i eigenvectors;

[0020] Step 1-2: Cluster the feature vectors into K categories using the K-means algorithm;

[0021] The extracted feature vector f is input into the K-means algorithm. At the same time, the feature centers of different categories are calculated according to formula (2). The K-means algorithm calculates the Euclidean distance d between each feature vector f and the center of each category through formula (3), and uses the Euclidean distance d as a similarity measure to calculate the distance between samples and assign the image to the closest category.

[0022]

[0023] Among them, C k c represents the number of all feature vectors in the k-th category. k It is the center vector of the kth category;

[0024]

[0025] Where M represents the dimension of the feature vector; f i,j f represents the feature vector of the i-th data point iThe value in the j-th dimension; c k,j c represents the center vector of the k-th cluster. k The value in the j-th dimension; d(f i ,c k f represents the feature vector of the i-th image. i With the center vector c of the kth cluster k The Euclidean distance between them;

[0026] In K-means clustering, to determine the optimal number of clusters K, the silhouette score is used to evaluate the clustering performance of different K values. The formula for calculating the silhouette score is as follows:

[0027]

[0028] Where a is the average distance within the same cluster, b is the average distance to the nearest cluster, max is the maximum value, and finally the K value with the highest silhouette coefficient S is selected as the optimal number of clusters;

[0029] By calculating the silhouette coefficient, the clustering effect is optimized to ensure that the sum of squared distances between each data point and the center of its class is minimized, thereby achieving the best clustering effect. Experiments were conducted on the SARDet-100K dataset. After optimization, the K value was 3, which correctly divided the dataset into three categories: inland, inshore, and offshore.

[0030] In step 2, the VI algorithm first calculates the VI and MR values ​​of the reference window. VI stands for Variance Index, used to determine whether the sampled values ​​of the reference window are uniform, and MR stands for Mean Ratio, used to determine whether the power mean of the reference window before and after is consistent. The VI and MR values ​​are calculated as follows:

[0031]

[0032] In the formula, σ 2 μ represents the variance of the sample values ​​within the reference window. 2 for The square of x, where n is the number of half-window reference units, and x i This represents the value of the i-th sample in the reference window. This represents the mean of all samples in the reference window; This indicates the mean of the samples within the front window. Let A represent the mean of the samples within the back window, and B represent the mean of the samples within the front window.

[0033] After obtaining the VI and MR values, the VI and MR values ​​are respectively compared with the VI decision threshold K. VIand MR decision threshold K MR The comparison and judgment of clutter background type is based on the following criteria: if VI <K VI If the reference window is uniform, then it is not uniform; otherwise, it is not uniform. If the mean values ​​of the front and rear windows are the same, then it is determined that the mean values ​​are different. After the VI decision and MR decision, VI-CFAR adaptively selects the appropriate CFAR method to calculate the detection threshold based on the decision results as shown in the table below.

[0034]

[0035] Where, α N / 2 and α N The threshold product factors corresponding to all reference cells and half of the reference cells in CA-CFAR, respectively:

[0036]

[0037] In the formula P fa This represents the probability of a false alarm, which is the probability of mistakenly detecting noise as a target when there is no target. N represents the number of cells in the entire reference window.

[0038] In step 2, for a uniform environment, the front and rear reference windows are uniform and have the same mean value, so the background of the front and rear reference windows is considered to be the same. Therefore, option 1 is applied, and the CA-CFAR concept is chosen. The background power level is estimated using the sampled values ​​within all reference windows, thus obtaining the detection threshold. This is essentially the calculation method of CA-CFAR. For a clutter edge environment, when the reference cells of one side of the reference window belong to two different power level clutter regions, one side of the reference window is uniform while the other side is non-uniform. Since the unit to be detected is in the same clutter region as the uniform side reference window, option 3 or 4 is applied to obtain a single-sided CA-CFAR. The mean of the sampled values ​​from the uniform side reference window is used as the power level estimate to avoid the influence of clutter sampled values ​​from other levels on the detection threshold. When the two reference windows belong to or are close to belonging to two different power levels of clutter (i.e., the number of reference cells occupied by the two clutter regions varies by a small amount from the window length on one side), the front and rear reference windows are uniform, but the mean values ​​do not belong to the same power level. In this case, the front and rear reference windows are considered to belong to two clutters with different average powers, and option 2 applies. In this case, the GO-CFAR concept is used to control the false alarm probability, and the side with the larger mean value is selected as the background power level estimate, thus obtaining the detection threshold. Since in reality, α CA,N / 2 It must be greater than α under the same parameters. GO,N / 2 Therefore, the ability to control the probability of false alarms is further improved.

[0039] For multi-target environments, numbers 3, 4, and 5 represent two different scenarios. Numbers 3 and 4 are applicable when one window is uniform while the other is non-uniform, indicating that only one side contains interfering targets or clutter edges. Using the mean of the uniform side reference window as the power level estimate theoretically achieves detection performance similar to CA-CFAR in a uniform environment where the number of reference cells is halved, largely ensuring that it is not affected by the high power sampling values ​​of the non-uniform side reference window. When both reference windows are non-uniform, indicating that both reference windows may contain interfering targets or clutter edges, number 5 is applicable. In this case, the SO-CFAR approach is adopted, selecting the smaller mean of one side as the background power level estimate, and due to α... CA,N / 2 It should be less than α under the same parameters. SO,N / 2 Therefore, this may further increase the probability of successful detection.

[0040] The specific steps of step 3 are as follows:

[0041] Step 3-1: Perform superpixel segmentation using the SLIC algorithm;

[0042] Step 3-2: Generate a saliency map and perform land-sea segmentation;

[0043] Step 3-3: Use the VI-CFAR from step 2 to perform target detection in the inshore area that has been shielded from land interference.

[0044] The specific steps of superpixel segmentation using the SLIC algorithm in step 3-1 are as follows:

[0045] Superpixel segmentation is a method in image processing that divides an image into multiple small regions with similar features. These small regions are called "superpixels." When using the SLIC (Simple Linear Iterative Clustering) algorithm for superpixel segmentation, cluster centers need to be initialized in each grid region of the image first to ensure that the initial centers are uniformly distributed in the image. The grid spacing B is:

[0046]

[0047] Where P is the total number of pixels in the image, and K is the desired number of superpixels;

[0048] Simultaneously, each pixel is represented by a feature representation (x, y, l, a, b), where (x, y) represents the pixel's position coordinates, and (l, a, b) represents the color value in the Lab color space, where l is the brightness, representing the grayscale value from black to white, a represents the color value from green to red, and b represents the color value from blue to yellow. The feature representation combines the spatial position information and color information of the pixel, and when calculating the distance, it considers not only the color similarity but also the spatial proximity, thereby better preserving the structure of the image.

[0049] Then, the distance D between each pixel and the cluster center is calculated. The distance metric takes into account both positional and color similarity, and the calculation formula is as follows:

[0050]

[0051] Where, d c d is the Euclidean distance between the pixel and the cluster center in the Lab color space. s is the spatial distance between the pixel and the cluster center, and m is a parameter that balances color and spatial similarity. A larger m will emphasize color and ignore spatial distance.

[0052] Each pixel is assigned to the nearest cluster center, and then the position and color of each cluster center are updated to the average of all its pixels until the cluster centers no longer change significantly or the predetermined number of iterations is reached. Each small region generated by the clustering is a superpixel S.

[0053] The steps in step 3-2, which involve generating a saliency map and performing land-sea segmentation, are as follows:

[0054] For the i-th superpixel S generated in step 3-1 i Feature extraction is performed; firstly, the color histogram of each superpixel S is obtained by calculating the color histogram in the Lab color space. i Color feature F color A color histogram is a statistical representation of color distribution, capable of capturing the frequency and distribution of colors within a superpixel region. For a superpixel region S... i Calculate its Lab color histogram H L (S i H a (S i ) and H b (S i For each superpixel, the color histogram is normalized to eliminate the influence of different superpixel sizes on the histogram. The normalization process involves dividing each histogram value by the total number of pixels |S|. i |, respectively obtain H′ L (S i ),H′ a (Si ) and H′ b (S i ), color feature vector F color (S i Then it is H′ L (S i ),H′ a (S i ) and H′ b (S i () connection;

[0055]

[0056]

[0057] F color (S i )=[H′ L (S i ), H′ a (S i ), H′ b (S i (13)

[0058] Where δ is the Dirac delta function, used to calculate the degree of matching between pixel value p and color values ​​L, a, b in the histogram;

[0059] Secondly, the LBP algorithm is used to obtain the S of each superpixel. i Texture features F texture For superpixel S i The difference LBP(p) between the center pixel and each neighboring pixel is calculated, and then the LBP values ​​of the entire superpixel region are statistically analyzed to generate an LBP histogram H. LBP (S i This is used to describe the distribution of texture patterns in the region; then the LBP histogram H is analyzed. LBP (S i Normalization is performed to obtain H′ LBP (S i This eliminates the influence of different superpixel region sizes, allowing LBP features of different superpixels to be compared on the same scale. Then F... texture Equal to H′ LBP (S i );

[0060]

[0061] Among them, g c It is the grayscale value of the center pixel, g iis the gray value of the i-th pixel in the neighborhood, s(x) is the sign function, v is the possible value of the LBP mode, and δ is the Dirac delta function, which is used to count the number of times each LBP mode appears in the superpixel region.

[0062] Then, the superpixel region S is calculated. i Spatial location features F spatial For each superpixel S i Calculate the centroid location (C) of this region. x (S i ), C y (S i The centroid position is then normalized by dividing it by the width and height of the image, yielding (C′). x (S i ), C′ y (S i Then F spatial For [C′ x (S i ), C′ y (S i )];

[0063]

[0064] in, and They represent superpixels S respectively i The position of the centroid of the image on the x-axis and y-axis, where x(p) and y(p) are the coordinates of pixel p in the image;

[0065] Finally, for the obtained superpixel features F color F texture and F spatial As shown in formula (18), Z-score standardization is performed on each feature, and the mean and standard deviation are used to standardize each feature. The value of each feature is scaled to the range of [0, 1] to maintain the relative proportion of the features. After processing, F′ is obtained. color F′ texture and F′ spatial ;

[0066]

[0067] Where μ is the mean, σ is the standard deviation, F is the extracted feature value, and F′ is the standardized feature value;

[0068] The significance score is calculated using formula (19). Different weights are assigned to each standardized feature, and then a weighted sum is calculated. The resulting comprehensive significance score S is then calculated. superpixelEach pixel in the superpixel is mapped to form a complete saliency map. The saliency map is then post-processed, either by smoothing or thresholding, to further optimize the object detection performance.

[0069] S superpixel =ω color ·F′ color +ω texture ·F′ texture +ω spatial ·F′ spatial (19)

[0070] Where S superpixel It is the saliency score of the superpixel, ω color ω texture ω spatial F′ represents the weights of color, texture, and spatial location features, respectively. color F′ texture F′ spatial These represent the standardized feature values ​​for color, texture, and spatial location, respectively.

[0071] For the generated saliency map, the image is binarized using the Otsu algorithm. Since the saliency score in the saliency map is not always a clear 0 or 1 value, but a continuous value between 0 and 1, the Otsu algorithm determines a threshold T to binarize the continuous values, that is, marking the region with the higher score as the foreground and the region with the lower score as the background. The Otsu algorithm is an adaptive threshold selection method that determines the optimal binarization threshold T of the image by maximizing the inter-class variance, as shown in formula (20). The inter-class variance under each possible threshold T is calculated. Find the variance between classes The largest T is the optimal threshold T. max Based on the selected optimal threshold T max will significantly Figure 2 The values ​​are converted into foreground and background, and areas with scores above a threshold are considered land, while areas with scores below a threshold are considered sea, thus generating a binary image.

[0072]

[0073] in, For the inter-class variance, μ T μ is the saliency mean of all pixels. b W represents the saliency mean of the background pixels. b The proportion of foreground pixels; S superpixel [S i [For Superpixel S] i The significance score;

[0074] For the generated binary image, the Canny edge detection algorithm is used to further clarify the boundary between the ocean and land regions in the binary image and find the sea-land dividing line. The Canny edge detection algorithm is an effective edge detection method. It identifies edges by finding significant changes in the image gradient. First, the image is smoothed by a Gaussian filter to filter out high-frequency noise and retain the main features of the image. Then, the gradient of the image is calculated using the Sobel operator to obtain the gradient magnitude map and direction map. Because edges usually correspond to areas where the image gray values ​​change rapidly, and the Sobel operator is a discrete differential operator, its core idea is to use a convolution kernel (i.e., a matrix) to perform convolution operations on the image in order to highlight areas where the image gray values ​​change significantly. It can calculate the gradient of the image in the horizontal x and vertical y directions, as shown in formula (22).

[0075]

[0076] The Sobel operator calculates the gradient G in the horizontal direction. x In the matrix, -1 and +1 are symmetrical, representing the difference between the left and right sides; -2 and +2 increase the weight of the central column, emphasizing the horizontal edge. Its core idea is to obtain the local gradient of the image by subtracting the values ​​of adjacent pixels from the value of the central pixel. Similarly, as shown in formula (23):

[0077]

[0078] The Sobel operator calculates the gradient G in the vertical direction. y The upper and lower rows of the matrix are [-1,-2,-1] and [1,2,1] respectively, which are also symmetrical and used to calculate the vertical edges. The difference weight of the central row also increases the detection effect of the vertical edges. Finally, according to the calculation of formula (24):

[0079]

[0080] The gradient magnitude G and direction θ are obtained;

[0081] Next, non-maximum suppression is performed to extract single-pixel-wide edge lines from wide edges. For each pixel, its neighboring pixels in the gradient direction θ are found, and the gradient magnitude G of the pixel is compared with the gradient magnitudes of its two neighboring pixels. If the gradient magnitude G of the pixel is a local maximum, the pixel is retained; otherwise, it is set to 0 to suppress the pixel. Finally, a double-threshold detection and edge-connection step is used to further enhance the accuracy of the edges. Based on the histogram of the gradient magnitude G, a high threshold and a low threshold are determined. The high threshold is set to 80% of the gradient magnitude, and the low threshold is set to 50% of the high threshold. Then, the edges are divided into strong edges (the part above the high threshold) and weak edges (the part between the low threshold and the high threshold). Strong edges are always retained, while weak edges are only retained when connected to strong edges, and the rest are suppressed. Thus, an accurate land-sea segmentation line is obtained in the binary image.

[0082] Finally, the detected land areas are masked by using region filling technology, setting all their pixel values ​​to black to ensure that the land is completely invisible in the image. This ensures that subsequent detection algorithms only process the sea surface, thus eliminating noise and interference that the land areas may cause.

[0083] An electronic device includes: one or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the methods described above.

[0084] A computer-readable storage medium storing program code that can be invoked by a processor to perform the method described above.

[0085] The beneficial effect of this invention lies in its effective solution to the problems of high false alarm rate and unstable detection performance of traditional CFAR algorithms in complex backgrounds such as ports and land, by combining scene classification with adaptive CFAR detection. The technical solution of this invention is to design a hybrid expert model that classifies images using K-means clustering. Different experts are used for target detection for images in different scenes. For inland areas, no ship targets are identified and directly filtered out. For offshore areas, VI-CFAR is used for target detection, enabling the detection process to adaptively adjust and optimize detection parameters according to the complexity of different scene backgrounds. This ensures that the CFAR algorithm maintains a constant false alarm rate in cluttered sea environments and significantly improves the robustness of target detection. For inshore areas, a combination of a saliency model and CFAR is used for target detection, combined with the Otsu algorithm and the Canny edge detection algorithm. This effectively distinguishes between marine and land areas in the image and performs occlusion processing on the land areas. This technical solution solves the problem of interference from complex land backgrounds when traditional CFAR detection algorithms detect ships on the sea surface.

[0086] The technical advantages and effects of this invention are as follows:

[0087] 1. No manual annotation or training required: This invention extracts features from SAR images using a pre-trained deep learning model and automatically classifies scenes using K-means clustering, completely independent of manually labeled datasets and time-consuming model training. This approach avoids the extensive data preparation and manual annotation work of traditional methods, reducing reliance on the quality of labeled datasets and thus lowering labor and time costs. Furthermore, this unsupervised processing method better addresses the changing marine environment, ensuring the algorithm's adaptability and universality.

[0088] 2. Reduced False Alarm Rate: This invention classifies images into scenes and adaptively adjusts CFAR detection parameters according to the characteristics of different scenes, avoiding the false alarm problem caused by background interference in complex backgrounds (such as ports, land, etc.) that is common in traditional methods. In particular, by combining the VI-CFAR algorithm and saliency model technology, it effectively reduces the false alarm rate in complex environments and enhances the reliability of detection results.

[0089] 3. Ensuring the detection algorithm focuses on the target area: Through land-sea segmentation and region filling techniques, this invention effectively shields the interference from non-target areas, allowing the detection algorithm to focus on the locations where targets may exist on the sea surface, thereby improving detection efficiency and reliability. Especially in ship detection tasks at sea, this invention can significantly reduce the false alarm rate caused by complex land areas, enabling the CFAR detection algorithm to focus more on ship targets on the sea surface, greatly improving the efficiency of target detection.

[0090] In summary, this invention is particularly suitable for the accurate detection of ship targets in synthetic aperture radar (SAR) images. It can more accurately distinguish between targets and background, reduce false alarms caused by background complexity, and ultimately improve the accuracy and reliability of target detection. It has practical value and technical advantages. Attached Figure Description

[0091] Figure 1 This is a flowchart of the method of the present invention.

[0092] Figure 2 This is a schematic diagram of VI-CFAR.

[0093] Figure 3 This is a schematic diagram of the mean-based CFAR algorithm.

[0094] Figure 4 This is a flowchart of CFAR object detection using a saliency graph model. Detailed Implementation

[0095] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0096] Step 1: Use the K-means clustering algorithm to classify the scene in the input SAR image.

[0097] By clustering, SAR images are divided into three datasets: inland, inshore, and offshore (referring to land area accounting for 100%, 0-100%, and 0% of the image, respectively). After obtaining the three types of images, inland images are filtered out and no target detection is performed. Offshore images are subjected to target detection in step 2, and inshore images are subjected to target detection in step 3.

[0098] The specific steps of step 1 are as follows:

[0099] Step 1-1: Extract image features using a pre-trained deep learning network;

[0100] Using MobileNetV2 pre-trained on the ImageNet dataset as the feature extraction model, the input SAR image X is processed by the model to extract its feature vector f. The formula for feature vector extraction is as follows:

[0101] f i =MobileNetV2(X i (25)

[0102] Among them, X i f represents the input data for the i-th image. i Image X extracted using the MobileNetV2 model i eigenvectors;

[0103] Step 1-2: Cluster the feature vectors into K categories using the K-means algorithm;

[0104] The extracted feature vector f is input into the K-means algorithm. At the same time, the feature centers of different categories are calculated as shown in formula (2). The K-means algorithm calculates the Euclidean distance d between each feature vector f and the center of each category through formula (3), and uses the Euclidean distance d as a similarity measure to calculate the distance between samples and assign the image to the closest category.

[0105]

[0106] Among them, C k c represents the number of all feature vectors in the k-th category. k It is the center vector of the kth category;

[0107]

[0108] Where M represents the dimension of the feature vector; f i,j f represents the feature vector of the i-th data point i The value in the j-th dimension; c k,j c represents the k-th cluster center. k The value in the j-th dimension; d(f i ,c k f represents the feature vector of the i-th image. i With the kth cluster center c k The Euclidean distance between them;

[0109] In K-means clustering, the silhouette score is used to evaluate the clustering performance of different K values ​​in order to determine the optimal number of clusters K. The formula for the silhouette score is as follows:

[0110]

[0111] Where 'a' is the average distance within the same cluster, and 'b' is the average distance to the nearest cluster. The K value with the highest silhouette coefficient S is ultimately selected as the optimal number of clusters.

[0112] By calculating the silhouette coefficient, the clustering effect is optimized to ensure that the sum of squared distances between each data point and the center of its class is minimized, thus achieving the best clustering effect. Experiments were conducted on the SARDet-100K dataset. After optimization, the K value was 3, which correctly divided the dataset into three categories: inland, inshore, and offshore.

[0113] Step 2: Use VI-CFAR to detect targets in the pure offshore area obtained from Step 1 classification;

[0114] The CFAR strategy adopted by VI-CFAR selects different mean-based CFAR strategies based on VI and MR values. Among them, Cell Average Constant False Alarm Rate (CA-CFAR) averages the data of neighboring reference cells around the cell to be detected as a background clutter power estimate to obtain the detection threshold, which is suitable for the case of averaged background clutter. Cell Minimum Selection Constant False Alarm Rate (SO-CFAR) selects the smaller of the sums of the front and rear half-windows and then averages them as the background clutter estimate to prevent the background estimate from being too large and thus avoid missing the target. Cell Maximum Constant False Alarm Rate (GO-CFAR) selects the reference cells in the half-window with the larger clutter power and averages them as the background clutter estimate to improve the false alarm rate increase problem at the clutter edge.

[0115] The VI algorithm first calculates the VI and MR values ​​of the reference window. VI stands for Variance Index, used to determine whether the sampled values ​​of the reference window are uniform, and MR stands for Mean Ratio, used to determine whether the power mean of the reference window before and after is consistent. The VI and MR values ​​are calculated as follows:

[0116]

[0117] In the formula, x i This represents the value of the i-th sample in the reference window. σ represents the mean of all samples in the reference window. 2 μ represents the variance of the sample values ​​within the reference window. 2 for The square of , where n is the number of half-window reference units; This indicates the mean of the samples within the front window. This represents the mean of the samples within the back window.

[0118] After obtaining the VI and MR values, the VI and MR values ​​are respectively compared with the decision threshold K. VI and KMR The type of clutter background is determined by comparison. The criterion is: if VI <K VI If the reference window is uniform, then it is not uniform; otherwise, it is not uniform. If the mean values ​​of the front and rear windows are the same, then it is determined that the mean values ​​are different. After the VI decision and MR decision, VI-CFAR adaptively selects the appropriate CFAR method to calculate the detection threshold based on the decision results as shown in the table below.

[0119]

[0120] Where, α N / 2 and α N The threshold product factors corresponding to all reference cells and half of the reference cells in CA-CFAR, respectively:

[0121]

[0122] In the formula P fa This represents the probability of a false alarm, which is the probability of mistakenly detecting noise as a target when there is no target. N represents the number of cells in the entire reference window.

[0123] For a uniform environment, where the front and rear reference windows are uniform and have the same mean, the background is considered uniform across the front and rear reference windows. Therefore, option 1 is applicable, employing the CA-CFAR approach. The background power level is estimated using the sampled values ​​within all reference windows, thus obtaining the detection threshold. This is essentially the calculation method for CA-CFAR. For clutter-edge environments, when the reference cells of one side of the reference window belong to two different clutter regions with varying power levels, one side of the reference window is uniform while the other is non-uniform. Since the unit to be detected is in the same clutter region as the uniform side reference window, option 3 or 4 is applied to obtain a single-sided CA-CFAR. The mean of the sampled values ​​from the uniform side reference window is used as the power level estimate to avoid the influence of clutter sampled values ​​from other levels on the detection threshold. When the two reference windows belong to or are close to belonging to two different power levels of clutter (i.e., the number of reference cells occupied by the two clutter regions varies slightly with the window length on one side, and the number is small), the front and rear reference windows are uniform, but the mean values ​​do not belong to the same power level. In this case, the front and rear reference windows are considered to belong to two clutters with different average powers, and selection number 2 applies. At this time, the idea of ​​GO-CFAR is used to control the false alarm probability, and the side with the larger mean value is selected as the background power level estimate, thus obtaining the detection threshold. Since in reality, α CA,N / 2 It must be greater than α under the same parameters. GO,N / 2 Therefore, the ability to control the probability of false alarms is further improved.

[0124] For multi-target environments, numbers 3 and 4 represent two different scenarios. Numbers 3 and 4 are applicable when one window is uniform while the other is non-uniform, indicating that only one side has interfering targets or clutter edges. In this case, using the mean of the uniform side reference window as the power level estimate theoretically achieves detection performance similar to CA-CFAR with half the number of reference cells in a uniform environment, largely ensuring that it is not affected by the high power sampling values ​​of the non-uniform side reference window. When both reference windows are non-uniform, indicating that both reference windows may contain interfering targets or clutter edges, number 5 is applicable. In this case, the SO-CFAR approach is adopted, selecting the smaller mean of one side as the background power level estimate, and due to α... CA,N / 2 It should be less than α under the same parameters. SO,N / 2 Therefore, this may further increase the probability of successful detection.

[0125] Step 3: Use the saliency model to perform CFAR detection on the inshore area obtained in Step 1;

[0126] CFAR detection using a saliency model is a method that combines saliency feature extraction with constant false alarm rate (CFAR) detection techniques. This method is particularly suitable for target detection in complex backgrounds, such as coastal port environments, especially for ship targets in synthetic aperture radar (SAR) images. This approach can more accurately distinguish targets from the background, thereby improving detection accuracy and reducing false alarms.

[0127] The specific steps of step 3 are as follows:

[0128] Step 3-1: Perform superpixel segmentation using the SLIC algorithm;

[0129] Superpixel segmentation is a method in image processing that divides an image into multiple small regions with similar features; these small regions are called "superpixels." When using the SLIC algorithm for superpixel segmentation, cluster centers must first be initialized in each grid region of the image to ensure that the initial centers are uniformly distributed throughout the image. The grid spacing B is:

[0130]

[0131] Where N is the total number of pixels in the image, and K is the desired number of superpixels;

[0132] Simultaneously, each pixel is represented by a feature representation (x, y, l, a, b), where (x, y) represents the pixel's position coordinates, and (l, a, b) represents the color value in the Lab color space. Here, l is the brightness, representing the grayscale value from black to white, a represents the color value from green to red, and b represents the color value from blue to yellow. This feature representation combines the spatial location and color information of the pixel, thus considering not only color similarity but also spatial proximity when calculating distances, thereby better preserving the image structure.

[0133] Then, the distance D between each pixel and the cluster center is calculated. The distance metric takes into account both positional and color similarity, and the calculation formula is as follows:

[0134]

[0135] Where, d c d is the Euclidean distance between the pixel and the cluster center in the Lab color space. s is the spatial distance between a pixel and the cluster center, and m is a parameter that balances color and spatial similarity. A larger m emphasizes color and ignores spatial distance.

[0136] Each pixel is assigned to the nearest cluster center, and then the position and color of each cluster center are updated to the average of all its pixels until the cluster centers no longer change significantly or the predetermined number of iterations is reached. Each small region generated by the clustering is a superpixel S.

[0137] Step 3-2: Generate a saliency map and perform land-sea segmentation;

[0138] For each superpixel S generated in step 3-1 i Feature extraction is performed. First, the color histogram of each superpixel S is obtained by calculating the color histogram in the Lab color space. i Color feature F color A color histogram is a statistical representation of color distribution. It captures the frequency and distribution of colors within a superpixel region. For a superpixel region S... i We calculate its Lab color histogram H. L (S i ), H a (S i ), H b (S i For each superpixel, the color histogram is normalized to eliminate the influence of varying superpixel sizes. Normalization typically involves dividing each histogram value by the total number of pixels |S|. i |, respectively obtain H′ L (S i ), H′ a (Si ), H′ b (S i ), color feature vector F color (S i Then it is H′ L (S i ), H′ a (S i ), H′ b (S i ) connection.

[0139]

[0140] F color (S i )=[H′ L (S i ), H′ a (S i ), H′ b (S i (37)

[0141] Here, δ is the Dirac delta function, used to calculate the degree of matching between pixel value p and color values ​​L, a, b in the histogram.

[0142] Secondly, the LBP algorithm is used to obtain the S of each superpixel. i Texture features F texture For superpixel S i The difference LBP(p) between the center pixel and each neighboring pixel is calculated, and then the LBP values ​​of the entire superpixel region are statistically analyzed to generate an LBP histogram H. LBP (S i This is used to describe the distribution of texture patterns in the region. Then, the LBP histogram H... LBP (S i Normalization is performed to obtain H′ LBP (S i This eliminates the influence of different superpixel region sizes, allowing LBP features from different superpixels to be compared on the same scale. Then F... texture Equal to H′ LBP (S i ).

[0143]

[0144] Among them, g c It is the grayscale value of the center pixel, g iis the gray value of the i-th pixel in the neighborhood, s(x) is the sign function, v is the possible value of the LBP mode, and δ is the Dirac delta function, which is used to count the number of times each LBP mode appears in the superpixel region.

[0145] Then, the superpixel region S is calculated. i Spatial location features F spatial For each superpixel region S i Calculate the centroid location (C) of this region. x (S i ), C y (S i The centroid position is then normalized by dividing it by the width and height of the image, yielding (C′). x (S i ), C′ y (S i Then F spatial For [C′ x (S i ), C′ y (S i )).

[0146]

[0147] in, and They represent superpixels S respectively i The centroid of the image is located on the x-axis and y-axis, where x(p) and y(p) are the coordinates of pixel p in the image.

[0148] Finally, for the obtained superpixel features F color F texture F spatial As shown in formula (18), Z-score standardization is performed on each feature, and the mean and standard deviation are used to standardize each feature. The value of each feature is scaled to the range of [0, 1] to maintain the relative proportion of the features. After processing, F′ is obtained. color F′ texture F′ spatial .

[0149]

[0150] Where μ is the mean, σ is the standard deviation, F is the extracted feature value, and F′ is the standardized feature value;

[0151] The significance score is calculated using formula (19). Different weights are assigned to each standardized feature, and then a weighted sum is calculated. The resulting comprehensive significance score S is then calculated. superpixelEach pixel in the superpixel is mapped to form a complete saliency map. The saliency map is then post-processed, either by smoothing or thresholding, to further optimize the object detection performance.

[0152] S superpixel =ω color ·F′ color +ω texture ·F′ texture +ω spatial ·F′ spatial (43)

[0153] Where ω color ω texture ω spatial F′ represents the weights of color, texture, and spatial location features, respectively. color F′ texture F′ spatial S represents the normalized feature values ​​of color, texture, and spatial location, respectively. superpixel It is the saliency score of the superpixel.

[0154] By utilizing the spatial location features of the saliency map, coastal areas with higher saliency scores are separated from sea surface areas to ensure that CFAR detection is performed only on sea surface areas.

[0155] For the generated saliency map, the image is binarized using the Otsu algorithm. Because the saliency score in the saliency map is not always a clear 0 or 1 value, but rather a continuous value between 0 and 1, the Otsu algorithm determines a threshold T and binarizes these continuous values, labeling regions with higher scores as foreground and regions with lower scores as background. The Otsu algorithm is an adaptive threshold selection method that determines the optimal binarization threshold T for the image by maximizing the inter-class variance. As shown in formula (20), the inter-class variance at each possible threshold T is calculated. Find the variance between classes The largest f is the optimal threshold T. max Based on the selected optimal threshold T max will significantly Figure 2 The data is converted into foreground and background, with areas scoring above a threshold representing land and areas scoring below a threshold representing sea, thus generating a binary image.

[0156]

[0157] in, Let be the inter-class variance, μT be the mean significance of all pixels, μb be the mean significance of background pixels, and W be the mean significance of background pixels. b The proportion of foreground pixels; S superpixel [S i [For Superpixel S]i The significance score.

[0158] For the generated binary image, the Canny edge detection algorithm is used to further clarify the boundary between the ocean and land regions in the binary image and find the sea-land dividing line. The Canny edge detection algorithm is an effective edge detection method that identifies edges by finding significant changes in the image gradient. First, the image is smoothed by a Gaussian filter to filter out high-frequency noise and retain the main features of the image. Then, the gradient of the image is calculated using the Sobel operator to obtain the gradient magnitude map and direction map. Because edges usually correspond to areas of rapid change in image gray values, and the Sobel operator is a commonly used discrete differential operator, its core idea is to use a convolution kernel (i.e., a matrix) to perform convolution operations on the image in order to highlight areas of large gray value changes in the image, and can calculate the gradient of the image in the horizontal x and vertical y directions. As shown in formula (22), the Sobel operator calculates the gradient G in the horizontal direction. x In the matrix, -1 and +1 are symmetrical, representing the difference between the left and right sides; -2 and +2 increase the weight of the central column, emphasizing the horizontal edge. Its core idea is to obtain the local gradient of the image by subtracting the values ​​of adjacent pixels from the value of the central pixel. Similarly, as shown in formula (23), the Sobel operator calculates the gradient G in the vertical direction. y The top and bottom rows of the matrix are [-1,-2,-1] and [1,2,1], respectively. They are also symmetrical and are used to calculate the vertical edges. The difference weights in the center row also enhance the detection effect of vertical edges. Finally, the gradient magnitude G and direction θ are obtained according to formula (24).

[0159]

[0160] Next, non-maximum suppression is performed to extract single-pixel-wide edge lines from wide edges. For each pixel, its neighboring pixels in the gradient direction θ are found. The gradient magnitude G of the pixel is compared with the gradient magnitudes of its two neighboring pixels. If the gradient magnitude G of the pixel is a local maximum, the pixel is retained; otherwise, it is set to 0 to suppress the pixel. Finally, a double-threshold detection and edge-connection step is used to further enhance edge accuracy. Based on the histogram of the gradient magnitude G, a high threshold and a low threshold are determined. The high threshold is set to 80% of the gradient magnitude, while the low threshold can be set to 50% of the high threshold. Then, edges are divided into strong edges (the portion above the high threshold) and weak edges (the portion between the low and high thresholds). Strong edges are always retained, while weak edges are only retained when connected to strong edges; others are suppressed. At this point, we obtain accurate land-sea segmentation lines in the binary image.

[0161] Finally, the detected land areas are masked using region filling technology, with all their pixel values ​​set to black to ensure that the land is completely invisible in the image. This operation ensures that subsequent detection algorithms only process the sea surface, thus eliminating noise and interference that land areas may cause.

[0162] Step 3-3: Use the VI-CFAR from step 2 to perform target detection in the inshore area that has been shielded from land interference by the above processing.

Claims

1. An adaptive CFAR detection method based on scene classification, characterized in that... Includes the following steps: Step 1: Use the K-means clustering algorithm to classify the scene in the input SAR image; By clustering, SAR images are divided into three datasets: inland, coastal, and sea areas, which refer to the land area accounting for 100%, 0-100%, and 0% of the image, respectively. After obtaining the three types of images, inland images are filtered out and no target detection is performed. Target detection is performed on sea area images in step 2 and on coastal images in step 3. Step 2: Use VI-CFAR to detect targets in the sea area classified in Step 1; The CFAR strategy adopted by VI-CFAR selects different mean-based CFAR strategies based on VI and MR values. Among them, the cell-averaged constant false alarm rate (CA-CFAR) averages the data of the neighboring reference cells around the cell to be detected as a background clutter power estimate to obtain the detection threshold, which is suitable for the case of average background clutter. The cell-minimum selection constant false alarm rate (SO-CFAR) selects the smaller of the sums of the front and rear half-windows and then averages them as the background clutter estimate to prevent the background estimate from being too large and thus avoid missing the target. The cell-maximum constant false alarm rate (GO-CFAR) selects the reference cells in the half-window with the larger clutter power and averages them as the background clutter estimate to improve the false alarm rate increase problem at the clutter edge. Step 3: Use a saliency model to perform CFAR detection on the coastal area obtained in Step 1; Step 3-1: Perform superpixel segmentation using the SLIC algorithm; Step 3-2: Generate a saliency map and perform land-sea segmentation; Step 3-2-1: Extract features from each superpixel generated in Step 3-1; Step 3-2-2: Calculate the saliency score; map it to each pixel in the superpixel; form the complete saliency map; Step 3-2-3: Binarize the generated saliency map using the Otsu algorithm; Step 3-2-4: Use the Canny edge detection algorithm to further find the land-sea dividing line in the binary image; Step 3-2-5: Use region filling technology to mask the detected land areas; Step 3-3: Use the VI-CFAR from step 2 to perform target detection in the inshore area that has been shielded from land interference.

2. The adaptive CFAR detection method based on scene classification according to claim 1, characterized in that: The specific steps of step 1 are as follows: Step 1-1: Extract image features using a pre-trained deep learning network; Using MobileNetV2 pre-trained on the ImageNet dataset as the feature extraction model, the input SAR image X is processed to extract its feature vector f. The formula for extracting the feature vector is as follows: f i =MobileNetV2(X i ) (1) Among them, X i f represents the input data for the i-th image. i Image X extracted using the MobileNetV2 model i eigenvectors; Step 1-2: Cluster the feature vectors into K categories using the K-means algorithm; The extracted feature vector f is input into the K-means algorithm. At the same time, the feature centers of different categories are calculated according to formula (2). The K-means algorithm calculates the Euclidean distance d between each feature vector f and the center of each category through formula (3), and uses the Euclidean distance d as a similarity measure to calculate the distance between samples and assign the image to the closest category. Among them, C k c represents the number of all feature vectors in the k-th category. k It is the center vector of the kth category; Where M represents the dimension of the feature vector; f i,j f represents the feature vector of the i-th data point i The value in the j-th dimension; c k,j c represents the center vector of the k-th cluster. k The value in the j-th dimension; d(f i ,c k f represents the feature vector of the i-th image. i With the center vector c of the kth cluster k The Euclidean distance between them; In K-means clustering, to determine the optimal number of clusters K, the silhouette coefficient is used to evaluate the clustering performance of different K values. The formula for calculating the silhouette coefficient is as follows: Where a is the average distance within the same cluster, b is the average distance to the nearest cluster, max is the maximum value, and finally the K value with the highest silhouette coefficient S is selected as the optimal number of clusters; By calculating the silhouette coefficient, the clustering effect is optimized to ensure that the sum of squared distances between each data point and the center of its category is minimized, thereby achieving the best clustering effect. Experiments were conducted on the SARDet-100K dataset, and the optimized K value was 3, which correctly divided the dataset into three categories: inland, coastal, and sea area.

3. The adaptive CFAR detection method based on scene classification according to claim 1, characterized in that: In step 2, the VI algorithm first calculates the VI and MR values ​​of the reference window. VI represents the variable exponent, used to determine whether the sampled values ​​of the reference window are uniform, and MR represents the ratio of the relative average value of the reference window, used to determine whether the average power of the reference window before and after is consistent. The VI and MR values ​​are calculated as follows: In the formula, σ 2 μ represents the variance of the sample values ​​within the reference window. 2 for The square of x, where n is the number of half-window reference units, and x i This represents the value of the i-th sample in the reference window. This represents the mean of all samples in the reference window; This represents the mean of the samples within the front window. Let A represent the mean of the samples within the back window, and B represent the mean of the samples within the front window. After obtaining the VI and MR values, the VI and MR values ​​are respectively compared with the VI decision threshold K. VI and MR decision threshold K MR The comparison and judgment of clutter background type is based on the following criteria: if VI <K VI If the reference window is uniform, then it is not uniform; otherwise, it is not uniform. If the mean values ​​of the front and rear windows are the same, then it is determined that the mean values ​​are different. After the VI decision and MR decision, VI-CFAR adaptively selects the appropriate CFAR method to calculate the detection threshold based on the decision results as shown in the table below. Where, α N / 2 and α N The threshold product factors corresponding to all reference cells and half of the reference cells in CA-CFAR, respectively: In the formula P fa This represents the probability of a false alarm, which is the probability of mistakenly detecting noise as a target when there is no target. N represents the number of cells in the entire reference window.

4. The adaptive CFAR detection method based on scene classification according to claim 3, characterized in that: In step 2, for a uniform environment, the front and rear reference windows are uniform and have the same mean, so the background of the front and rear reference windows is considered to be the same. Option 1 is applied, and the background power level is estimated using the sampled values ​​within all reference windows to obtain the detection threshold. For a clutter edge environment, when the reference cells of one side of the reference window belong to two different power level clutter regions, one side of the reference window is uniform while the other is non-uniform. Since the unit to be detected is in the same clutter region as the uniform side reference window, option 3 or 4 is applied to obtain a single-sided CA-CFAR. The mean of the sampled values ​​of the uniform side reference window is used as the power level estimate to avoid the influence of clutter sampled values ​​from other levels on the detection threshold. When the two reference windows belong to or are close to two different power level clutter, the front and rear reference windows are uniform, but their mean values ​​are not at the same power level. It is considered that the front and rear reference windows belong to two different average power clutter regions, so option 2 is applied. The idea of ​​GO-CFAR is used to control the false alarm probability, and the side with the larger mean is selected as the background power level estimate to obtain the detection threshold. Since in reality, α... CA,N / 2 It must be greater than α under the same parameters. GO,N / 2 Therefore, the ability to control the probability of false alarms is further improved.

5. The adaptive CFAR detection method based on scene classification according to claim 3, characterized in that: For multi-target environments, numbers 3 and 4, and number 5 represent two different scenarios. Scenarios 3 and 4 are applicable when one window is uniform while the other is non-uniform, indicating that only one side has interfering targets or clutter edges. Using the mean of the uniform side reference window as the power level estimate theoretically achieves detection performance similar to CA-CFAR in a uniform environment where the number of reference cells is halved, largely ensuring that it is not affected by the high power sampling values ​​of the non-uniform side reference window. When both reference windows are non-uniform, indicating that both reference windows may contain interfering targets or clutter edges, number 5 is applicable. In this case, the SO-CFAR approach is adopted, selecting the smaller mean of one side as the background power level estimate. Furthermore, due to α... CA,N / 2 It should be less than α under the same parameters. SO,N / 2 This further increases the probability of successful detection.

6. The adaptive CFAR detection method based on scene classification according to claim 1, characterized in that: The specific steps of superpixel segmentation using the SLIC algorithm in step 3-1 are as follows: Superpixel segmentation is a method in image processing that divides an image into multiple small regions with similar features. These small regions are called "superpixels." When using the SLIC algorithm for superpixel segmentation, cluster centers need to be initialized in each grid region of the image first to ensure that the initial centers are uniformly distributed in the image. The grid spacing B is: Where P is the total number of pixels in the image, and K is the desired number of superpixels; Simultaneously, each pixel is represented by a feature representation (x,y,l,a,b), where (x,y) represents the pixel's position coordinates, and (l,a,b) represents the color value in the Lab color space, where l is the brightness, representing the grayscale value from black to white, a represents the color value from green to red, and b represents the color value from blue to yellow. The feature representation combines the spatial position information and color information of the pixel, and when calculating the distance, it considers not only the color similarity but also the spatial proximity, thereby better preserving the structure of the image. Then, the distance D between each pixel and the cluster center is calculated. The distance metric takes into account both positional and color similarity, and the calculation formula is as follows: Where, d c d is the Euclidean distance between the pixel and the cluster center in the Lab color space. s It is the spatial distance between the pixel and the cluster center, and m is a parameter that balances color and spatial similarity; Each pixel is assigned to the nearest cluster center, and then the position and color of each cluster center are updated to the average of all its pixels until the cluster centers no longer change significantly or the predetermined number of iterations is reached. Each small region generated by the clustering is a superpixel S.

7. The adaptive CFAR detection method based on scene classification according to claim 1, characterized in that: The steps in step 3-2, which involve generating a saliency map and performing land-sea segmentation, are as follows: For the i-th superpixel S generated in step 3-1 i Feature extraction is performed; firstly, the color histogram of each superpixel S is obtained by calculating the color histogram in the Lab color space. i Color feature F color A color histogram is a statistical representation of color distribution, capable of capturing the frequency and distribution of colors within a superpixel region. For a superpixel region S... i Calculate its Lab color histogram H L (S i H a (S i ) and H b (S i The color histogram of each superpixel is normalized to eliminate the influence of different superpixel sizes on the histogram. The normalization process involves dividing each value of the histogram by the total number of pixels |S. i |, respectively obtain H′ L (S i ),H′ a (S i ) and H′ b (S i ), color feature vector F color (S i Then it is H′ L (S i ),H′ a (S i ) and H′ b (S i () connection; F color (S i )=[H′ L (S i ),H′ a (S i ),H′ b (S i )] (13) Where δ is the Dirac delta function, used to calculate the degree of matching between pixel value p and color values ​​L, a, b in the histogram; Secondly, the LBP algorithm is used to obtain the S of each superpixel. i Texture features F texture For superpixel S i The difference LBP(p) between the center pixel and each neighboring pixel is calculated, and then the LBP values ​​of the entire superpixel region are statistically analyzed to generate an LBP histogram H. LBP (S i This is used to describe the distribution of texture patterns in the region; then the LBP histogram H is analyzed. LBP (S i Normalization is performed to obtain H′ LBP (S i This eliminates the influence of different superpixel region sizes, allowing LBP features of different superpixels to be compared on the same scale. Then F... texture Equal to H′ LBP (S i ); Among them, g c It is the grayscale value of the center pixel, g i is the gray value of the i-th pixel in the neighborhood, s(x) is the sign function, v is the possible value of the LBP mode, and δ is the Dirac delta function, which is used to count the number of times each LBP mode appears in the superpixel region. Then, the superpixel region S is calculated. i Spatial location features F spatial For each superpixel S i Calculate the centroid location (C) of this region. x (S i ),C y (S i The centroid position is then normalized by dividing it by the width and height of the image, yielding (C′). x (S i ),C′ y (S i Then F spatial For [C′ x (S i ),C′ y (S i )]; in, and They represent superpixels S respectively i The position of the centroid of the image on the x-axis and y-axis, where x(p) and y(p) are the coordinates of pixel p in the image; Finally, for the obtained superpixel features F color F texture and F spatial As shown in formula (18), Z-score standardization is performed on each feature, using the mean and standard deviation to standardize each feature. The value of each feature is scaled to the range [0,1] to maintain the relative proportion of the features. After processing, F′ is obtained. color F′ texture and F′ spatial ; Where μ is the mean, σ is the standard deviation, and F is the extracted feature value. ′ These are the standardized eigenvalues; The significance score is calculated using formula (19). Different weights are assigned to each standardized feature, and then a weighted sum is calculated. The resulting comprehensive significance score S is then calculated. superpixel Each pixel in the superpixel is mapped to form a complete saliency map. The saliency map is then post-processed, either by smoothing or thresholding, to further optimize the object detection performance. S superpixel =ω color ·F′ color +oh texture ·F′ exture +oh spatial ·F′ patial (19) Where S superpixel It is the saliency score of the superpixel, ω color ω texture ω sptial F′ represents the weights of color, texture, and spatial location features, respectively. color F′ texture F′ spatial These represent the standardized feature values ​​for color, texture, and spatial location, respectively. For the generated saliency map, the image is binarized using the Otsu algorithm. The Otsu algorithm determines a threshold T and binarizes continuous values, that is, regions with higher scores are marked as foreground and regions with lower scores are marked as background. The Otsu algorithm determines the optimal binarization threshold T of the image by maximizing the inter-class variance, as shown in formula (20). The inter-class variance under each possible threshold T is calculated. Find the variance between classes The largest T is the optimal threshold T. max Based on the selected optimal threshold T max The saliency map is binarized into foreground and background, and areas with scores above a threshold are land and areas below a threshold are sea, thus generating a binary image. in, For the inter-class variance, μ T μ is the saliency mean of all pixels. b W represents the saliency mean of the background pixels. b The proportion of foreground pixels; S superpixel [S i [For Superpixel S] i The significance score; For the generated binary image, the Canny edge detection algorithm is used to further clarify the boundary between the ocean and land regions in the binary image and find the sea-land dividing line; first, the image is smoothed by a Gaussian filter to filter out high-frequency noise and retain the main features of the image; then, the Sobel operator is used to calculate the gradient of the image to obtain the gradient magnitude map and direction map; because the edge usually corresponds to the region of rapid change of image gray value, and the Sobel operator is a discrete differential operator, the core idea of ​​which is to use a convolution kernel to perform convolution operation on the image in order to highlight the region of large gray value change in the image, and can calculate the gradient of the image in the horizontal x and vertical y directions; as shown in formula (22): The Sobel operator calculates the gradient G in the horizontal direction. x In the matrix, -1 and +1 are symmetrical, representing the difference between the left and right sides; -2 and +2 increase the weight of the central column. The local gradient of the image is obtained by subtracting the values ​​of the adjacent pixels from the value of the central pixel, as shown in formula (23). The Sobel operator calculates the gradient G in the vertical direction. y The upper and lower rows of the matrix are [-1,-2,-1] and [1,2,1] respectively, which are also symmetrical and used to calculate the vertical edges. The difference weight of the central row also increases the detection effect of the vertical edges. Finally, according to the calculation of formula (24): The gradient magnitude G and direction θ are obtained; Non-maximum suppression is performed. For each pixel, its neighboring pixels in the gradient direction θ are found. The gradient magnitude G of the pixel is compared with the gradient magnitudes of its two neighboring pixels. If the gradient magnitude G of the pixel is a local maximum, the pixel is retained; otherwise, it is set to 0 to suppress the pixel. Finally, a double threshold detection and edge connection step is used to further enhance the accuracy of the edges. Based on the histogram of the gradient magnitude G, a high threshold and a low threshold are determined. The high threshold is set to 80% of the gradient magnitude, and the low threshold is set to 50% of the high threshold. Then, the edges are divided into strong edges and weak edges. Strong edges are always retained, while weak edges are only retained when connected to strong edges, and the rest are suppressed. Thus, an accurate land-sea segmentation line is obtained in the binary image. Finally, the detected land areas are masked by using region filling technology, setting all their pixel values ​​to black to ensure that the land is completely invisible in the image. This ensures that subsequent detection algorithms only process the sea surface, thus eliminating noise and interference that the land areas may cause.

8. An electronic device, characterized in that, include: One or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code that can be invoked by a processor to execute the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Segmentation combination-based adaptive constant false alarm rate target detection method for SAR image

    CN101975940A

  • SAR image residential area detection method based on significance analysis and background prior

    CN110310263A