Harbor district ship detection method based on superpixels and context features
Through the port area ship detection method based on superpixel and context characteristics, SLIC segmentation and truncating generalized gamma distribution to fit background clutter, the accuracy of ship detection in complex scenarios in port area is solved, and high-precision ship detection is achieved.
Patent Information
- Application Number
- CN202510514805.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-08
AI Technical Summary
The existing technology is difficult to accurately detect ships in complex port areas, especially nearshore ships and port areas buildings, and deep learning-based methods have difficulty in obtaining training samples, and the interpretability of neural network models is poor.
The detection method based on superpixel and context features is adopted, and the candidate target superpixels are obtained through SLIC segmentation, and the sea and land areas are determined in combination with the port area coastline. The background clutter is fitted by truncated generalized gamma distribution, and the matching degree between the neighboring background clutter distribution and typical background clutter in the ship's area of interest is measured by the Kullback-Leibler distance.
It realizes high-precision detection of multi-scale near-shore ships and offshore ships in complex scenarios of the port area, effectively avoiding the misidentification of port areas as ships, and improving the accuracy and speed of detection.
Smart Images

Figure CN120451492A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of ship detection, and in particular relates to a port ship detection method based on superpixels and context features. Background Art
[0002] Ships are essential means of transportation at sea, and accurately detecting their types is crucial for maritime traffic control, marine rescue, and military strategic deployment. While Synthetic Aperture Radar (SAR) imagery can currently be used to automatically detect ships in port areas, the complex composition of port facilities and the similar scattering characteristics of features such as docks, vehicles, and waiting halls make it difficult to effectively distinguish ship types based solely on scattering intensity. Furthermore, due to the complex terrain, shoreside buildings, and surrounding environment of nearshore areas, nearshore ships often blend seamlessly into the port terminals in SAR images, blurring their geometric features and making them difficult to extract. This presents a significant challenge for detecting ships in port areas.
[0003] Among the existing ship detection methods, the method based on constant false alarm rate (CFAR) for ship detection in SAR images is one of the most widely used methods. Its core idea is to construct a clutter distribution model based on the statistical distribution characteristics of sea clutter, adaptively calculate the detection threshold through the false alarm rate, and finally use the intensity difference between the target and background clutter to detect ship targets.
[0004] For example, literature 1 (Z.Li, C.Qu, Q.Zhou, C.Liu, S.Peng and J.Li, "Ship detection in harbor area in SAR images based on constructing an accurate sea-clutter model", Proceedings of the 2nd International Conference on Image, Vision and Computing (ICIVC), Chengdu, China, pp.13-19, June 2017) proposed a ship detection method based on accurate modeling of sea clutter in harbor areas. The simple linear iterative clustering (SLIC) method and Fisher model parameters were used to eliminate land masks and suspicious targets, and a model similarity fitting algorithm was used to achieve adaptive CFAR ship detection in harbor areas. Reference 2 (J.Ai, X.Yang, J.Song, Z.Dong, L.Jia and F.Zhou, "Anadaptively truncated clutter-statistics-based two-parameter CFAR detector inSAR imagery", IEEE J.Ocean.Eng., vol.43, no.1, pp.267-279, 2017) considers the impact of sidelobe noise and adjacent targets on ship detection performance in port SAR images, and proposes a two-parameter CFAR detector based on adaptive truncated clutter statistics. Reference 3 (W.Ao, F.Xu, Y.Li and H.Wang, "Detection and discrimination of ship targets in complex background from spaceborne ALOS-2SAR images", IEEE J.Sel.Top.Appl.Earth Observ.Remote Sens., vol.11, no.2, pp.536-550, 2018) proposed a multi-scale CFAR detector based on the generalized gamma distribution model. By constructing global, large-scale and small-scale CFAR detectors, the global information and local information are integrated to achieve ship detection in complex background.Reference 4 (M.Li, X.Cui and S.Chen, "Adaptive superpixel-level CFAR detector for SAR inshore dense ship detection", IEEE Geosci.Remote Sens.Lett., vol.19, pp.1-5, 2021) proposes a ship detection method based on superpixel-level CFAR. First, superpixel segmentation and unsupervised clustering methods are used for superpixel classification. Then, neighborhood clutter superpixels are selected through a non-local topological strategy. Finally, detection threshold estimation is performed to achieve ship detection. Although the CFAR-based ship detection method in Reference 4 can effectively separate ships from the background in simple sea scenes, this method has a high dependence on the setting of the sliding window size and the accurate modeling of background clutter. When ship targets of different sizes appear in the scene or the background clutter changes significantly, the detection results are prone to missed detections and false alarms.
[0005] Inspired by human visual mechanisms, saliency analysis methods have achieved significant success in optical remote sensing imagery and have been introduced to SAR imagery for ship detection. Leveraging the statistical dissimilarity of target and clutter superpixels, Reference 5 (T. Li, Z. Liu, L. Ran, and R. Xie, "Target detection by exploiting superpixel-level statistical dissimilarity for SAR imagery," IEEE Geosci. Remote Sens. Lett., vol. 15, no. 4, pp. 562-566, 2018) proposed a ship detection method that combines global and local contrast. This approach takes advantage of sparse SAR imaging to suppress sidelobes, noise, and clutter. Reference 6 (J.Ni, Y.Luo, D.Wang, J.Liangand Q.Zhang, "Saliency-based SAR target detection via convolutional sparse feature enhancement and Bayesian inference", IEEE Trans.Geosci.Remote Sens., vol.61, pp.1-15, 2023) proposed a saliency ship detection method based on convolutional sparse enhancement and Bayesian inference. Reference 7 (Z.Chen, Z.Ding, X.Zhang, X.Wang and Y.Zhou, "Inshore ship detectionbased on multi-modality saliency for synthetic aperture radar images", RemoteSens., vol.15, no.15, pp.3868, 2023) proposed a ship detection method based on multimodal saliency. First, a saliency map is constructed from four aspects: geographic location, spatial distribution, regional characteristics, and intensity characteristics. Then, ship target detection in complex nearshore scenes is achieved by fusing multimodal saliency maps. However, the structure of artificial facilities in port areas is complex, and the contrast between ships and background in SAR images is usually low. Detection methods based on saliency are prone to misidentifying land buildings as ships.
[0006] In recent years, deep learning-based ship detection methods have developed rapidly and achieved remarkable results. Reference 8 (C. Zhang, P. Liu, H. Wang and Y. Jin, "NPA2Net: A Nested Path Aggregation Attention Network for Oriented SAR Ship Detection", IEEE J. Sel. Top. Appl. EarthObserv. Remote Sens., vol. 17, pp. 9772-9789, 2024) proposed a nested path aggregation attention network, which improves ship detection performance by introducing a box-boundary perception vector and fusing multi-resolution features. This approach addresses the imbalance between nearshore and offshore ship samples in training scenarios. Reference 9 (Y. Tang, S. Wang, J. Wei, Y. Zhao, J. Lin, J. Yu and D. Li, "Scene-aware data augmentation for ship detection in SAR images", Int. J. Remote Sens., vol. 45, no. 10, pp. 3396-3411, 2024) proposed a ship detection method based on scene-aware data augmentation. However, the performance of neural network models often depends on the quality of training samples. Ports are important civilian and military facilities, and it is difficult to obtain a large number of port ship images for model training. Furthermore, neural network models have poor interpretability, making it difficult to accurately analyze the cause of detection errors. Summary of the Invention
[0007] The purpose of the present invention is to address the shortcomings of traditional constant false alarm rate-based methods and significance-based methods in accurately detecting ships, and to provide a port ship detection method based on superpixels and contextual features. It utilizes the different scattering characteristics and local stability of port objects, extracts the ship's region of interest through superpixel segmentation, and utilizes the contextual characteristics of port ships being surrounded to varying degrees by land and sea to identify ships through background clutter modeling and difference comparison, thereby avoiding misidentification of port buildings as ships, and ultimately achieving high-precision detection of multi-scale near-shore and offshore ships in complex port scenes in SAR images.
[0008] To achieve the above objectives, the technical solutions provided by the present invention are:
[0009] A method for detecting ships in a port area based on superpixels and contextual features, comprising:
[0010] Step 1: Perform SLIC segmentation on the input SAR image to obtain candidate target superpixels and port coastline;
[0011] Step 2: Determine the ocean, land, and coastal areas based on the port coastline, screen the target to be detected based on the calculated center coordinates of the candidate target superpixels, and extract the ship region of interest based on the connectivity of the target to be detected;
[0012] Step 3: Based on the ocean, land and coastal areas, the candidate target superpixels are removed to obtain different types of typical background clutter samples. The typical background clutter distribution is obtained by fitting them according to the truncated generalized gamma distribution. The contextual features of the ships in the port area are used to select the neighborhood background superpixels corresponding to the candidate targets in each of the ship's regions of interest and perform the same clutter fitting. The matching degree between the neighborhood clutter distribution corresponding to the ship's region of interest and the typical background clutter distribution is measured by the Kullback-Leibler distance to eliminate false alarms and obtain the ship detection result.
[0013] As a further limitation of the present invention, the step 1 comprises:
[0014] Step (11) performs SLIC segmentation on the input SAR image, specifically: performing SLIC segmentation on the input SAR image by fusing the spatial Euclidean distance and the generalized likelihood ratio distance; wherein the generalized likelihood ratio distance is calculated by formula (1):
[0015]
[0016] In formula (1), δ(i,j) represents the generalized likelihood ratio distance between pixel i and pixel j, and M represents the local pixel block μ i or local pixel block μ j The number of pixels in the SAR image, L represents the number of views, Represents the local pixel block μ i The average intensity, Represents the local pixel block μ j The average intensity of
[0017] Step (12) The SAR image is segmented by SLIC to obtain a superpixel set, where the average intensity value of each superpixel is defined as:
[0018]
[0019] In formula (2), Represents super pixel SP i The average intensity value, SP i represents the i-th superpixel in the candidate target superpixel, and the superpixel set is represented as {SP i},i∈{1,2,…,N}, Indicates SP i The number of pixels within, Li represents the set of all pixels in the SAR image with the label pixel i, and I(x,y) represents the intensity value of the pixel (x,y) in the SAR image.
[0020] Step (13) obtains candidate target superpixels and background superpixels through an unsupervised clustering method, extracts local stability features based on the intensity standard deviation of the pixel block, calculates the intensity features and local stability characteristics of the superpixels by weighted calculation to obtain a fused feature map, adaptively sets the threshold to obtain the land-sea segmentation result, and performs boundary tracking based on the land-sea segmentation result to obtain the port coastline.
[0021] As a further limitation of the present invention, the step 2 comprises:
[0022] Step (21) calculates the regional average intensity value based on the land-sea segmentation result, takes the area with higher intensity value as the land area U, and takes the area with lower intensity value as the ocean area P; calculates the coastal area radius r according to the scene scale, and draws a circle point by point along the port area coastline to determine the coastal area Q;
[0023] Step (22) determines the distribution area R of the ship in the port area, which is expressed as R = P∨Q; by statistically averaging the coordinates of all pixel points in the superpixel, if the center point of the coordinate is located in the distribution area R of the ship in the port area, it is retained; otherwise, it is removed, thereby screening out the target to be detected;
[0024] Step (23) merges superpixels based on the connectivity of the retained superpixel set, and extracts the ship region of interest by calculating the minimum bounding box of the connected superpixels.
[0025] As a further limitation of the present invention, the step three comprises:
[0026] Step (31) uses the statistical distribution characteristics of the background clutter in the neighborhood of the ship's region of interest as contextual features for ship identification, wherein the nearest K superpixels are selected from the background superpixel set according to the Euclidean distance, expressed as:
[0027] K=γ·N i Formula (3)
[0028] In formula (3), γ represents the scale factor, N i represents the number of superpixels in the region of interest of the i-th ship;
[0029] For each ship region of interest, the neighboring superpixels are selected as the neighborhood background clutter, and the corresponding truncated generalized gamma distribution is obtained by fitting calculation.
[0030] Step (32) removes the candidate target superpixels from the ocean, land, and coastal areas to obtain three typical background clutter samples, and uses the truncated generalized gamma distribution model to fit the typical background clutter samples to obtain the typical background clutter sample distribution; wherein the density function f in the generalized gamma distribution model is x (x) is expressed as:
[0031]
[0032] In formula (4), σ represents the scale parameter, v represents the energy parameter, κ represents the shape parameter, Γ(·) represents the Gamma function, and x represents the specific value of the random variable that obeys the generalized gamma distribution;
[0033] The corresponding cumulative distribution function F x The expression of (x) is:
[0034]
[0035] In formula (5), f x (t) represents the probability density function of the generalized gamma distribution;
[0036] Assume that the background clutter samples obey the generalized gamma distribution, and the sample set X containing the samples is expressed as X={x1,x2,…,x m}; According to the mean and standard deviation of the clutter samples, the upper and lower truncation thresholds are adaptively set, and the samples with intensity values outside the upper and lower truncation thresholds are truncate by discarding them; the sample set after truncation Expressed as
[0037]
[0038] Truncated sample set The probability density function of Expressed as:
[0039]
[0040] In formula (6), μ represents the mean of the clutter samples, σ represents the standard deviation of the clutter samples, t1 represents the lower cutoff depth, and t2 represents the upper cutoff depth;
[0041] Step (33) measures the matching degree between the neighborhood background clutter distribution of the area of interest of the ship to be detected and the three typical background clutter distributions by using the Kullback-Leibler distance. If the matching degree with the land clutter distribution is the highest, the false alarm is eliminated. Otherwise, it indicates that the target to be detected is in the port waters, so it is retained. The calculation expression of the Kullback-Leibler distance is:
[0042]
[0043] In formula (7), Represents the probability distribution P at the sample point The probability value on Represents the probability distribution Q at the sample point The probability value on .
[0044] The advantages of the present invention are:
[0045] 1. The present invention utilizes the different scattering characteristics and local stability of port objects to extract the region of interest of ships through superpixel segmentation. It also uses the contextual characteristics of ships in the port area being surrounded by land and sea to varying degrees to identify ships through background clutter modeling and difference comparison, thereby avoiding misidentification of port buildings as ships. Ultimately, it achieves high-precision detection of multi-scale nearshore and offshore ships in complex port scenes in SAR images.
[0046] 2. The present invention uses the SLIC method that integrates spatial Euclidean distance and generalized likelihood ratio distance for superpixel segmentation, effectively retaining the outline of ship targets and the sea-land boundary of the port area, and realizing the clustering of similar pixels and the extraction of candidate target superpixels.
[0047] 3. The present invention uses local stability features and superpixel segmentation results to obtain three typical background areas: ocean, land and coastal zone, to extract the area of interest of ships in the port area, effectively narrow the detection range, and improve the speed of ship detection.
[0048] 4. The present invention utilizes the contextual features of ships in the port area and adopts the truncated generalized gamma distribution to model the background clutter in the neighborhood of the ship's area of interest. Ship identification is achieved by calculating the similarity of statistical distributions, alleviating the inaccurate background clutter fitting caused by coherent speckle noise and outliers in the shadow area, and effectively avoiding the problem of difficulty in distinguishing between artificial buildings in the port area and ships due to the similar scattering characteristics.
[0049] 5. Compared with the existing threshold segmentation methods OTSU and MSER methods, the present invention can not only achieve land and sea segmentation through the superpixel segmentation method SLIC and the unsupervised clustering method Kmeans, but also extract the ship's region of interest for pre-screening by calculating the center coordinates and average intensity values of superpixels; in addition, compared with the existing false alarm identification achieved by calculating the fluctuation value of the candidate target, the present invention achieves false alarm identification through background clutter fitting and Kullback-Leibler distance matching; the present invention also performs land and sea segmentation based on superpixel segmentation and local stability, and performs ship identification based on background clutter fitting, thereby achieving high-precision detection of nearshore and offshore ships at multiple scales.
[0050] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments with reference to the accompanying drawings, in which:
[0052] Figure 1 : Flowchart of a method for detecting ships in a port area based on superpixels and contextual features provided by the present invention;
[0053] Figure 2 :The present invention provides a flow chart of a port ship detection based on superpixels and context features;
[0054] Figure 3 :The present invention provides a flow chart of step one for performing land-sea segmentation on a SAR image by SLIC segmentation;
[0055] Figure 4 : Extraction flow chart of the ship region of interest extraction module in step 2 provided by the present invention;
[0056] Figure 5 : A ship identification flow chart of the ship identification module in step three provided by the present invention;
[0057] Figure 6 : Illustration of the detection results of a port ship detection method based on superpixels and context features provided by the present invention;
[0058] Figure 7 : Comparison results of four detection methods in complex port scenarios provided by the present invention;
[0059] Figure 8 : Performance comparison table of four detection methods provided by the present invention. DETAILED DESCRIPTION
[0060] The following describes in detail embodiments of the present invention. The embodiments are exemplary and intended to explain the present invention, but are not to be construed as limiting the present invention.
[0061] Since ships are mainly made of metal materials and have a large number of dihedral and trihedral reflectors, they appear as bright block objects in SAR images. Although the port buildings and ships in SAR images appear similar, they exist in different contexts. Offshore ships are surrounded by water, while nearshore ships are surrounded by the ocean on one side and the port land on the other side, while port buildings are only located in the land area. Based on the above characteristics presented by SAR images, the embodiment of the present invention utilizes the scattering characteristics and local stability differences of port objects to provide a port ship detection method based on superpixels and context features, including steps one to three, please refer to Figure 1 and Figure 2 In the first step, candidate target superpixels are extracted through superpixel segmentation, and the ocean, land and coastal areas are confirmed; in the second step, the spatial distribution characteristics of ships in the port area are used to extract the ship interest area; in the third step, the context feature differences between ships and buildings in the port area are used to identify ships through background clutter modeling.
[0062] Please continue reading Figure 1 and Figure 2 The embodiment of the present invention proposes a method for detecting ships in a port area based on superpixels and context features, which specifically includes the following steps:
[0063] Step 1: The sea-land segmentation module performs SLIC segmentation on the input SAR image in sequence. Based on the strong scattering characteristics of ship targets, the strong scattering targets are marked as candidate target superpixels, and other pixels in the SAR image are marked as background superpixels, thereby obtaining candidate target superpixels and background superpixels; local stability features are extracted from the SAR image, and the port coastline is determined based on the superpixel segmentation results and local stability features.
[0064] Since port ship docking locations are primarily classified as offshore or nearshore, effective segmentation of the ocean and land is essential for practical port ship detection. SLIC segmentation is a classic superpixel generation algorithm that clusters pixels based on their similarity and proximity. In optical images, the traditional SLIC algorithm uses distance in the CIELAB color space to measure pixel similarity.
[0065] In actual ship detection, for SAR images, due to inherent multiplicative noise and only single-channel information, the similarity between pixels is usually measured by the generalized likelihood ratio distance of local pixel blocks. In this embodiment of the present invention, it is assumed that the local pixel block μ i and local pixel block μ j Denote the pixel blocks centered on pixel i and pixel j respectively, then the generalized likelihood ratio distance δ(i, j) between pixel i and pixel j is calculated by formula (1):
[0066]
[0067] In formula (1), δ(i, j) represents the generalized likelihood ratio distance between pixel i and pixel j, and M represents the local pixel block μ i or local pixel block μ j The number of pixels in the SAR image, L represents the number of views, Represents the local pixel block μ i The average intensity, Represents the local pixel block μ j The average intensity.
[0068] The above formula (1) is the improved part of the superpixel segmentation algorithm SLIC. The port coastline is subsequently extracted based on the superpixels obtained by SLIC segmentation.
[0069] After the SAR image is segmented by SLIC based on generalized likelihood ratio distance, the label map L and superpixel set {SP i},i∈{1,2,…,N}, where N represents the number of superpixel labels. Assuming the original SAR image is I, the average intensity value of each superpixel is defined as:
[0070]
[0071] In formula (2), Represents super pixel SP i The average intensity value, SP i represents the i-th superpixel in the candidate target superpixel, and the superpixel set is represented as {SP i},i∈{1,2,…,N}, Indicates SP i The number of pixels within, L i represents the set of all pixels in the SAR image with the label pixel i, and I(x,y) represents the intensity value of the pixel (x,y) in the SAR image.
[0072] Then, the candidate target superpixels and background superpixels are obtained through unsupervised clustering method, the local stability features are extracted according to the intensity standard deviation of the pixel blocks, the intensity features and local stability characteristics of the superpixels are weightedly calculated to obtain the fused feature map, the threshold is adaptively set to obtain the land and sea segmentation result, and the boundary is tracked based on the land and sea segmentation result to obtain the port coastline.
[0073] The present embodiment further refines the classification based on superpixel intensity features using the Kmeans method, classifying superpixels into strong scattering targets, vegetation areas, water areas, or other weak scattering targets between strong scattering targets and vegetation areas. Water areas have the lowest scattering intensity and appear as stable black areas in SAR images, allowing for water area extraction via threshold segmentation. However, due to the influence of coastal vegetation and topography in the port area, some land areas at the land-sea boundary also appear as low scattering intensity in SAR images, making them easily missegmented as ocean areas. Specifically, the present embodiment distinguishes between water areas and land areas at the land-sea boundary (forests, beaches, etc.). These two areas exhibit low scattering intensity and appear consistent in SAR images. Their geographical locations are both adjacent to the main water area, making them prone to misidentification during port area ship detection. Furthermore, the surface of the actual port water area is very stable with minimal intensity variation. However, due to the complex surrounding environment of land areas at the land-sea boundary, surrounded by man-made structures, vegetation, and water areas, they exhibit low stability. Therefore, the present embodiment further distinguishes between water areas and land areas at the land-sea boundary by integrating stability features.
[0074] Considering that port waters are usually protected by breakwaters and exhibit low sea conditions and high stability, while the land area at the sea-land boundary has a complex context and is surrounded by man-made buildings, vegetation, and the ocean, showing obvious instability, extracting local stability features from SAR images and weighted fusion with superpixel intensity features can effectively avoid incorrect segmentation caused by terrain changes and improve the accuracy of the port coastline. The calculation method of feature fusion is expressed as follows: In the formula, ζ represents the fusion feature value, represents the average intensity value of the superpixel to which the pixel to be calculated belongs, β represents the weight factor, and σ represents the local stability eigenvalue.
[0075] See also Figure 3 The sea-land segmentation flow chart shown in the figure is as follows: Figure 3 (a) is the original SAR image, where the upper left and lower right areas of the image are the port area, and the rest are water areas. Figure 3 (b) is the local stability feature map corresponding to the original SAR image. It can be seen from the figure that the port water area and the interior of a small number of buildings are highly stable; while the land area is unstable due to complex buildings and terrain. Figure 3 (c) is the result of superpixel segmentation. The size of the superpixel is adaptively set according to the actual scene scale. It can be seen from the figure that the generated superpixel well preserves the ship outline and the sea-land boundary. Figure 3 (d) is the extraction result of the port coastline, where the red line segment represents the coastline. Based on the superpixel information and the local stability characteristics of the image, Figure 3 Both coastlines are extracted correctly.
[0076] Step 2: The ship region of interest extraction module draws a circle point by point along the port coastline to determine the ocean, land and coastal areas. The ocean and land areas are further distinguished based on the differences in the scattering characteristics of the port objects. Then, the center coordinates of the obtained candidate target superpixels are calculated to screen the targets to be detected. Combined with the prior knowledge of the spatial distribution of ships in the port area, the ship region of interest is extracted from the union of the ocean area and the coastal area according to the connectivity of the targets to be detected.
[0077] Based on the strong scattering characteristics of ship targets, according to the superpixel segmentation results, the strong scattering targets are marked as candidate target superpixels, and the others are marked as background superpixels. Based on the land and sea segmentation results, the average intensity value of the region is calculated, and the area with higher intensity value is regarded as the land area U, and the area with lower intensity value is regarded as the ocean area P; the radius r of the coastal zone area is calculated according to the scene scale, and the coastal zone area Q is determined by drawing a circle point by point along the port coastline. The extraction steps of the ocean area and the land area in the embodiment of the present invention are actually as follows: the port coastline divides the SAR image into two types of areas, calculates the average intensity value of the area, and the area with higher intensity value is regarded as the land area, and the area with lower intensity value is regarded as the ocean area.
[0078] Since the ships in the port area are located on the sea surface or docked at the pier, the ship distribution area R = P ∨ Q is determined in the port area. By statistically averaging the coordinates of all pixels within the superpixel, if the center point of the coordinate is within the port ship distribution area R, it is retained; otherwise, it is removed to screen out the targets to be detected. Superpixels are merged based on the connectivity of the retained superpixel set, and the ship region of interest is extracted by calculating the minimum bounding box of the connected superpixels. In practical applications, it is preferred to first determine the potential distribution area, then calculate the coordinates of the center point of each superpixel, retain the superpixels within the distribution area, and finally merge adjacent superpixels based on connectivity to obtain the ship region of interest.
[0079] See also Figure 4 The flowchart of extracting the ship region of interest is shown in the figure. Figure 4 (a) is the superpixel classification result, where the white area represents the candidate target superpixel and the other areas represent the background superpixel. It can be seen from the figure that the ship target and a small number of port buildings are marked. Figure 4 (b) is the background area segmentation result, where the blue area represents the ocean, the green area represents the land, and the yellow area represents the coastal zone. Figure 4 (c) is the extraction result of the ship region of interest, where the red rectangular box represents the ship region of interest. It can be seen in the figure that all real ship targets are covered, and land buildings are eliminated as much as possible, effectively narrowing the detection range.
[0080] Step 3: Based on the ocean, land, and coastal regions, candidate target superpixels are removed to obtain different types of typical background clutter samples. The ship identification module performs fitting based on the truncated generalized gamma distribution to obtain the typical background clutter distribution. The statistical distribution characteristics of the background clutter in the neighborhood of the ship's region of interest are used as contextual features for ship identification. The neighborhood background superpixels corresponding to the candidate target are sequentially selected for each ship's region of interest and the same clutter fitting is performed. The matching degree between the neighborhood clutter distribution corresponding to the ship's region of interest and the typical background clutter distribution is measured using the Kullback-Leibler distance to eliminate false alarms and obtain ship detection results. Preferably, the ship identification module in this embodiment of the present invention further selects neighborhood superpixels for each ship's region of interest as neighborhood background clutter and obtains the corresponding truncated generalized gamma distribution through fitting calculation. In practical applications, the embodiment of the present invention first performs background clutter fitting on the ocean, land, and coastal areas in the image to obtain three typical distribution models; then, the neighborhood superpixels of each ship region of interest are selected as the background and the same clutter fitting is performed to obtain the corresponding distribution model; finally, the matching degree of the background clutter distribution model corresponding to the currently detected ship region of interest is compared with the three typical background clutter distribution models. If the matching degree with the land is the highest, it is eliminated; otherwise, it is retained.
[0081] Inspired by the CFAR detector, the statistical distribution characteristics of the background clutter in the neighborhood of the ship's region of interest can be used as context features for ship identification. Figure 5 The neighborhood background superpixel shown in (a) is first selected from the background superpixel set based on the Euclidean distance K = γ·N i superpixels, where γ represents the scale factor, N i represents the number of superpixels in the region of interest of the i-th ship.
[0082] To prevent abnormal clutter caused by factors such as signal attenuation, object occlusion, and coherent speckle noise from affecting parameter estimation accuracy, the present invention removes candidate target superpixels from the ocean, land, and coastal regions to obtain three typical background clutter samples. These samples are then fitted with a truncated generalized gamma distribution model to obtain a typical background clutter sample distribution. The probability density function (PDF) of the generalized gamma distribution is as follows:
[0083]
[0084] In formula (3), σ represents the scale parameter, v represents the energy parameter, κ represents the shape parameter, Γ(·) represents the Gamma function, and x represents the specific value of the random variable that obeys the generalized Gamma distribution. The corresponding cumulative distribution function (CDF) is as follows:
[0085]
[0086] In formula (4), f x (t) represents the probability density function of the generalized gamma distribution.
[0087] Assuming that the background clutter samples obey the generalized gamma distribution, the sample set X containing the samples is expressed as X={x1,x2,…,x m}, adaptively set the upper and lower truncation thresholds according to the mean and standard deviation of the clutter samples, and perform truncation by discarding samples whose intensity values are outside the upper and lower truncation threshold ranges; preferably, the truncated sample set is a subset of the original sample set, and the specific truncation method includes: setting two thresholds T1 and T2, and discarding samples in the original sample set whose intensity values are outside the range of (T1, T2). The truncated sample set Expressed as
[0088] The truncated sample set The probability density function of Expressed as:
[0089]
[0090] In formula (5), μ represents the mean of the clutter samples, σ represents the standard deviation of the clutter samples, t1 represents the lower cutoff depth, and t2 represents the upper cutoff depth.
[0091] The parameters of the truncated generalized gamma distribution are estimated for the background clutter in the ocean area, land area and coastal area after removing the candidate target superpixels, and three typical background models are obtained. Figure 5 As shown in (b), the parameters of the neighborhood background superpixels of the ship's region of interest are estimated to obtain the background clutter model of the ship's region of interest.
[0092] The Kullback-Leibler distance is used to measure the matching degree between the distribution of the neighborhood background clutter of the ship's interest region and the three typical background clutter distributions. If the matching degree with the clutter distribution in the land background is the highest (the highest matching degree is preferred), it is treated as a false alarm and eliminated. Otherwise, it indicates that the target to be detected is in the port waters and is therefore retained. The calculation expression of the Kullback-Leibler distance is:
[0093]
[0094] In formula (6), Represents the probability distribution P at the sample point The probability value on Represents the probability distribution Q at the sample point The probability value on .
[0095] The above-disclosed method for detecting port ships based on superpixels and contextual features in the embodiment of the present invention realizes the detection of nearshore and offshore ships of different sizes in the port area under complex port background, multiple interference targets, and blurred geometric features, effectively reducing missed detections and false alarms.
[0096] The embodiments of the present invention use SAR images with typical complex port scenes in the public synthetic aperture radar ship detection dataset (SSDD) for experiments. The image size is about 300 pixels × 300 pixels, the resolution is 1 meter to 15 meters, and a total of 41 real ship targets are included.
[0097] The results of the ship detection in the port area according to the embodiment of the present invention are as follows: Figure 6 As shown, Figure 6 (a)- Figure 6 (d) is the original SAR image, where Figure 6 (a) and Figure 6 (b) This is a nearshore scene in the port area. There are a large number of strongly scattering hydraulic structures in the port area, and ships are densely arranged. The outlines of the ships on the nearshore side are integrated with the port coast and are difficult to distinguish. Figure 6 (c) and Figure 6 (d) belongs to the offshore port scene, where ships are located against a simple sea surface background and are sparsely distributed. Figure 6 (e) and Figure 6 (h) shows the extraction results of the port area coastline, where the red line segment represents the coastline. Figure 6 (e) Figure 6 (g) and Figure 6 The coastlines in (h) are all detected correctly. Figure 6 The coastline in (f) deviates on one side and curves toward the ocean. Figure 6 (i)- Figure 6 (l) Shows the superpixel extraction results of candidate targets. It can be seen in the figure that all ship targets and some strong scattering targets on land are covered, and the detection range is greatly reduced. Figure 6 (m)- Figure 6 (p) shows the final detection results, where the green rectangle represents the detected ship. The figure shows that the proposed method can achieve accurate detection in both nearshore and offshore scenarios and at various scales.
[0098] The comparison results of the four detection methods in the complex port area of the embodiment of the present invention are as follows: Figure 7As shown in the figure, the comparison methods are SLIC-CFAR, TS-LNCFAR, and a saliency detection method based on global and local contrast (SGL). Green rectangles indicate correctly detected ships, red rectangles indicate false alarms, and blue rectangles indicate missed detections. The experimental data includes both near-shore and offshore scenes and ships of different sizes. To ensure fairness, all methods performed the same land-sea segmentation step before testing. For the CFAR-based method, the pfa was set to 0.01. Figure 7 (a) is the detection result of SLIC-CFAR. Due to the influence of outliers on parameter estimation, the ship breaks in the middle. Figure 7 (b) is the detection result of TS-LNCFAR, with 1 false alarm and 4 missed detections. This is because the fixed window size cannot adapt to ship targets of different sizes. When the window size is small, the leakage of adjacent target pixels leads to overestimation of the local threshold. Figure 7 (c) is the detection result of SGL. All ships are detected correctly, but there are 3 false alarms. This is because the SGL method ignores the contextual features of the target and highlights all objects with strong scattering characteristics. Figure 7 (d) is the detection result of the proposed method. It can be seen that all ships are detected correctly with only one false alarm, which has the best detection effect compared with other methods.
[0099] Figure 8 The following is a performance comparison table of four detection methods: SLIC-CFAR, TS-LNCFAR, SGL, and the method proposed in the embodiment of the present invention. TS-LNCFAR had 19 missed detections and a recall rate of only 53.66%. SGL detected 21 false alarms with a precision rate of 64.41%. SLIC-CFAR detected 8 false alarms and 5 missed detections, with a precision rate and recall rate of 81.82% and 87.8% respectively. The detection performance was better than TS-LNCFAR and SGL, but not the best. The method proposed in the embodiment of the present invention had a precision rate of 92.86%, a recall rate of 95.12%, and a quality factor (FoM) of 0.886. All of the above indicators are higher than the three comparison methods.
[0100] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present invention, and these modifications or replacements should all be included in the scope of protection of the present invention.
Claims
1. A method for detecting ships in port areas based on superpixels and contextual features, characterized in that: include: Step 1: Perform SLIC segmentation on the input SAR image to obtain candidate target superpixels and port coastline; Step 2: Determine the ocean, land, and coastal areas based on the port coastline, screen the target to be detected based on the calculated center coordinates of the candidate target superpixels, and extract the ship region of interest based on the connectivity of the target to be detected; Step 3: Based on the ocean, land and coastal areas, the candidate target superpixels are removed to obtain different types of typical background clutter samples. The typical background clutter distribution is obtained by fitting them according to the truncated generalized gamma distribution. The contextual features of the ships in the port area are used to select the neighborhood background superpixels corresponding to the candidate targets in each of the ship's regions of interest and perform the same clutter fitting. The matching degree between the neighborhood clutter distribution corresponding to the ship's region of interest and the typical background clutter distribution is measured by the Kullback-Leibler distance to eliminate false alarms and obtain the ship detection result.
2. The method for detecting ships in a port area based on superpixels and context features according to claim 1, characterized in that: The step one comprises: Step (11) performs SLIC segmentation on the input SAR image, specifically: performing SLIC segmentation on the input SAR image by fusing the spatial Euclidean distance and the generalized likelihood ratio distance; wherein the generalized likelihood ratio distance is calculated by formula (1): In formula (1), δ(i, j) represents the generalized likelihood ratio distance between pixel i and pixel j, and M represents the local pixel block μ i Or the number of pixels in a local pixel block, L represents the number of views of the SAR image, Represents the local pixel block μ i The average intensity, Represents the local pixel block μ j The average intensity of Step (12) The SAR image is segmented by SLIC to obtain a superpixel set; wherein the average intensity value of each superpixel is defined as: In formula (2), Represents super pixel SP i The average intensity value, SP i represents the i-th superpixel in the candidate target superpixel, and the superpixel set is represented as {SP i }, i∈{1, 2, …, N}, Indicates SP i The number of pixels within, L i represents the set of all pixels in the SAR image with the label pixel i, and I(x, y) represents the intensity value of the pixel (x, y) in the SAR image; Step (13) obtains candidate target superpixels and background superpixels through an unsupervised clustering method, extracts local stability features based on the intensity standard deviation of the pixel block, calculates the intensity features and local stability characteristics of the superpixels by weighted calculation to obtain a fused feature map, adaptively sets the threshold to obtain the land-sea segmentation result, and performs boundary tracking based on the land-sea segmentation result to obtain the port coastline.
3. The method for detecting ships in a port area based on superpixels and context features according to claim 1, characterized in that: The second step includes: Step (21) calculates the regional average intensity value based on the land-sea segmentation result, takes the area with higher intensity value as the land area U, and takes the area with lower intensity value as the ocean area P; calculates the coastal area radius r according to the scene scale, and draws a circle point by point along the port area coastline to determine the coastal area Q; Step (22) determines the distribution area R of the ship in the port area, which is expressed as R = P∨Q; by statistically averaging the coordinates of all pixel points in the superpixel, if the center point of the coordinate is located in the distribution area R of the ship in the port area, it is retained; otherwise, it is removed, thereby screening out the target to be detected; Step (23) merges superpixels based on the connectivity of the retained superpixel set, and extracts the ship region of interest by calculating the minimum bounding box of the connected superpixels.
4. The method for detecting ships in a port area based on superpixels and context features according to claim 1, characterized in that: The step three includes: Step (31) uses the statistical distribution characteristics of the background clutter in the neighborhood of the ship's region of interest as contextual features for ship identification, wherein the nearest K superpixels are selected from the background superpixel set according to the Euclidean distance, expressed as: K = γ·N i Formula (3) In formula (3), γ represents the scale factor, N i represents the number of superpixels in the region of interest of the i-th ship; For each ship region of interest, the neighboring superpixels are selected as the neighborhood background clutter, and the corresponding truncated generalized gamma distribution is obtained by fitting calculation. Step (32) removes the candidate target superpixels from the ocean, land, and coastal areas to obtain three typical background clutter samples, and uses the truncated generalized gamma distribution model to fit the typical background clutter samples to obtain the typical background clutter sample distribution; wherein the density function f in the generalized gamma distribution model is x (x) is expressed as: In formula (4), σ represents the scale parameter, v represents the energy parameter, k represents the shape parameter, Γ(·) represents the Gamma function, and x represents the specific value of the random variable that obeys the generalized gamma distribution; The corresponding cumulative distribution function F x The expression of (x) is: In formula (5), f x (t) represents the probability density function of the generalized gamma distribution; Assume that the background clutter samples obey the generalized gamma distribution, and the sample set X containing the samples is expressed as X = {x1, x2, ..., x m The upper and lower truncation thresholds are adaptively set according to the mean and standard deviation of the clutter samples, and truncation is performed by discarding samples whose intensity values are outside the upper and lower truncation threshold ranges; Truncated sample set Expressed as Truncated sample set The probability density function of Expressed as: In formula (6), μ represents the mean of the clutter samples, σ represents the standard deviation of the clutter samples, t1 represents the lower cutoff depth, and t2 represents the upper cutoff depth; Step (33) measures the matching degree between the neighborhood background clutter distribution of the area of interest of the ship to be detected and the three typical background clutter distributions by using the Kullback-Leibler distance. If the matching degree with the land clutter distribution is the highest, the false alarm is eliminated. Otherwise, it indicates that the target to be detected is in the port waters, so it is retained. The calculation expression of the Kullback-Leibler distance is: In formula (7), Represents the probability distribution P at the sample point The probability value on Represents the probability distribution Q at the sample point The probability value on .