SAR image ship target detection method and device
By using Gaussian heat map and pixel covariance matrix to automatically determine the labeling frame in SAR image ship target detection, combined with the overall labeling frame, the problems of high manual labeling cost and overfitting are solved, and the detection efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202410852877.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the existing technology, in ship target detection in SAR images, the components of the ship target sample need to be manually labeled during CNN model training, which results in high labeling cost, low efficiency and prone to over-fitting, which affects the accuracy of the detection results.
The method based on Gaussian heat map and pixel covariance matrix is used to automatically determine the component labeling frame, combined with the overall labeling frame, to reduce the dependence on manual labeling, and optimize the model structure parameters through a composite loss function to improve model generalization.
It reduces the labeling cost, improves the efficiency and accuracy of target detection, avoids over-fitting, and enhances the generalization ability of the model.
Smart Images

Figure CN118397256B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method and device for detecting ship targets in SAR images. Background Art
[0002] With the rapid development of the global digital information age, remote sensing technology plays an increasingly important role in military, civilian and other fields. Synthetic Aperture Radar (SAR), as a type of remote sensing technology, has shown unique advantages in various fields with its all-weather and all-day monitoring capabilities. Therefore, it is crucial to improve the target detection performance in SAR images.
[0003] In recent years, academia and industry have proposed a variety of solutions to the problem of ship target detection in SAR images. Among them, methods based on Convolutional Neural Networks (CNN) have been widely studied and applied to target detection tasks in natural images due to their advantages in automatic feature learning. However, despite its excellent performance in target detection in natural images, CNN directly applied to ship target detection tasks in SAR images faces great challenges. The reason is that the unique overhead viewing angle and coherent imaging characteristics of SAR images make their image features and expressions very different from natural images, and these factors will interfere with the accurate detection of ship targets. In response to these challenges of SAR images, researchers have proposed a variety of improvement methods.
[0004] However, when training CNN, it is usually necessary to manually annotate the parts of ship target samples in SAR image samples, which not only increases the annotation cost, is tedious and time-consuming, and relies on a large amount of manual input, which is inefficient and may cause annotation errors. Moreover, due to the limitation of annotation cost and access restrictions, there are some small samples, which will cause serious overfitting when training CNN with small samples, resulting in poor generalization of CNN. Summary of the invention
[0005] The present invention provides a SAR image ship target detection method and device to solve the existing defects.
[0006] The present invention provides a SAR image ship target detection method, comprising:
[0007] Acquire the SAR image to be detected;
[0008] Inputting the SAR image to be detected into a ship target detection model to obtain a target detection result output by the ship target detection model;
[0009] The ship target detection model is obtained by training based on SAR image samples with annotation boxes; the annotation boxes include component annotation boxes and overall annotation boxes, and the component annotation boxes are determined by applying the overall annotation box based on the following steps:
[0010] Determine a Gaussian heat map of a target area where a ship target sample is located in the SAR image sample, determine a maximum eigenvector in a pixel covariance matrix of the target area based on the Gaussian heat map, and determine a principal axis direction of the ship target sample based on the maximum eigenvector;
[0011] The component annotation box is determined based on the main axis direction, the overall annotation box and the position confidence in the Gaussian heat map.
[0012] According to a SAR image ship target detection method provided by the present invention, the component annotation frame is determined based on the main axis direction, the overall annotation frame and the position confidence in the Gaussian heat map, including:
[0013] Determine a target frame edge on the overall annotation frame that has a small acute angle with the main axis direction, and determine a target point on a line connecting the midpoint of the target frame edge and the center point of the overall annotation frame that corresponds to the smallest difference between the position confidence and a preset threshold in the Gaussian heat map, and a symmetrical point of the target point about the center point of the overall annotation frame;
[0014] The component annotation box is determined based on the target point, the symmetric point and the vertices of the overall annotation box.
[0015] According to a SAR image ship target detection method provided by the present invention, the component annotation box includes a first annotation box and a second annotation box;
[0016] The determining the component annotation box based on the target point, the symmetric point and the vertex of the overall annotation box includes:
[0017] Determine the target point and the symmetric point as a vertex of the first annotation box and the second annotation box respectively;
[0018] Based on the vertices of the overall annotation box, determining the diagonal points of the vertices of the first annotation box and the second annotation box;
[0019] The center point of the first annotation box, the center point of the second annotation box and the center point of the overall annotation box are all on a straight line.
[0020] According to a SAR image ship target detection method provided by the present invention, the step of determining a Gaussian heat map of a target area where a ship target sample in the SAR image sample is located specifically includes:
[0021] Determining a maximum likelihood parameter of a non-standardized Gaussian distribution based on the grayscale value of each pixel in the target area;
[0022] Performing center standardization on the non-standardized Gaussian distribution to obtain a standardized Gaussian distribution;
[0023] Based on the standardized Gaussian distribution, the position confidence of each pixel in the target area is calculated, and based on the position confidence of each pixel in the target area, the Gaussian heat map is determined.
[0024] According to a SAR image ship target detection method provided by the present invention, the ship target detection model is trained based on the following steps:
[0025] Inputting the SAR image sample into an initial target detection model to obtain a candidate anchor box in the SAR image sample output by the initial target detection model and a predicted probability and position vector of the candidate anchor box;
[0026] Determine a candidate anchor frame belonging to the ship target sample in the candidate anchor frame, as well as an overall anchor frame and a component anchor frame in the candidate anchor frame, and determine a component anchor frame matching the overall anchor frame based on a position-dependent intersection-and-union ratio between the overall anchor frame and the component anchor frame, and the Gaussian heat map;
[0027] Determine the center point connection line of the component anchor frame, calculate the vertical distance from the center point of the whole anchor frame to the center point connection line, and construct a spatial position constraint item based on the vertical distance;
[0028] Based on the spatial position constraint term, the classification error and the positioning error, a composite loss function is calculated, and based on the composite loss function, structural parameters of the initial target detection model are iteratively optimized to obtain the ship target detection model;
[0029] The classification error is determined based on the prediction probability of the candidate anchor box, and the positioning error is determined based on the position vector of the candidate anchor box and the position vector of the annotation box.
[0030] According to a SAR image ship target detection method provided by the present invention, the determining of a component anchor frame matching the overall anchor frame based on the position-dependent intersection-and-union ratio between the overall anchor frame and the component-type anchor frame and the Gaussian heat map comprises:
[0031] Based on the position-dependent intersection-over-union ratio, the component class anchor boxes are screened to obtain a target anchor box;
[0032] Mapping the overall anchor frame and the component anchor frame to the Gaussian heat map, and calculating the pixel value of the center point of the target anchor frame on the Gaussian heat map;
[0033] Based on the pixel value of the center point of the target anchor frame on the Gaussian heat map, the target anchor frame is screened to obtain the component anchor frame.
[0034] According to a SAR image ship target detection method provided by the present invention, the classification error is determined based on the prediction probability by applying a cross entropy loss function or a Focal Loss; the positioning error is determined based on the position vector of the alternative anchor box and the position vector of the annotation box by applying a smooth L1 loss function.
[0035] The present invention also provides a SAR image ship target detection device, comprising:
[0036] An image acquisition module is used to acquire the SAR image to be detected;
[0037] A target detection module, used for inputting the SAR image to be detected into a ship target detection model to obtain a target detection result output by the ship target detection model;
[0038] The ship target detection model is obtained by training based on SAR image samples with annotation boxes; the annotation boxes include component annotation boxes and overall annotation boxes;
[0039] It also includes a component automatic labeling module, which is used to apply the overall labeling frame to determine the component labeling frame based on the following steps:
[0040] Determine a Gaussian heat map of a target area where a ship target sample is located in the SAR image sample, determine a maximum eigenvector in a pixel covariance matrix of the target area based on the Gaussian heat map, and determine a principal axis direction of the ship target sample based on the maximum eigenvector;
[0041] The component annotation box is determined based on the main axis direction, the overall annotation box and the position confidence in the Gaussian heat map.
[0042] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the SAR image ship target detection method as described in any one of the above is implemented.
[0043] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the SAR image ship target detection method as described in any one of the above is implemented.
[0044] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for detecting ship targets in SAR images as described in any one of the above is implemented.
[0045] The present invention provides a SAR image ship target detection method and device. The method first obtains a SAR image to be detected; then the SAR image to be detected is input into a ship target detection model to obtain a target detection result output by the ship target detection model. The ship target detection model is trained based on a SAR image sample with a labeling frame. The adopted labeling frame includes a component labeling frame and an overall labeling frame. Compared with the traditional overall object labeling, it provides more detailed component information and helps to improve the performance of target detection. The adopted component labeling frame uses the overall labeling frame and is automatically obtained in combination with the Gaussian heat map of the target area where the ship target sample in the SAR image sample is located, which can reduce the manual dependence in the traditional manual labeling process, make the target detection process more efficient and accurate, and reduce the labeling cost. Furthermore, the overfitting phenomenon in the model training process can be avoided, so that the trained ship target detection model has stronger generalization. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 It is a flow chart of the method for detecting ship targets in SAR images provided by the present invention;
[0048] Figure 2 It is a schematic diagram of a Gaussian heat map of a target area in the SAR image ship target detection method provided by the present invention;
[0049] Figure 3 It is a schematic diagram of the relationship between the center point distance between the overall anchor frame and the component anchor frame and the value of PIOU in the SAR image ship target detection method provided by the present invention;
[0050] Figure 4 It is a schematic diagram of calculating the vertical distance in the SAR image ship target detection method provided by the present invention;
[0051] Figure 5 It is a schematic diagram of the process of determining a component anchor frame in the SAR image ship target detection method provided by the present invention;
[0052] Figure 6It is a flow chart of a training method for a ship target detection model in the SAR image ship target detection method provided by the present invention;
[0053] Figure 7 It is a structural schematic diagram of the SAR image ship target detection device provided by the present invention;
[0054] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] The term "first" or "second" in the specification and claims of the present invention may include one or more of the features explicitly or implicitly. In the description of the invention, unless otherwise specified, "plurality" means two or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the objects connected before and after are in an "or" relationship.
[0057] In the prior art, when training a CNN for detecting ship targets in SAR images, the components of the ship target samples in the SAR image samples are manually labeled, which not only increases the labeling cost, is cumbersome and time-consuming, and relies on a large amount of manual input, which is inefficient, but also may cause labeling errors. Moreover, due to the limitation of labeling cost and access restrictions, there are some small samples objectively, which will cause serious overfitting when training CNN with small samples, resulting in poor generalization of CNN, which in turn affects the accuracy of the detection results of ship targets in SAR images.
[0058] Figure 1 FIG. 1 is a flow chart of a method for detecting ship targets in a SAR image provided in an embodiment of the present invention. Figure 1 As shown, the method includes:
[0059] S1, obtaining the SAR image to be detected;
[0060] S2, inputting the SAR image to be detected into a ship target detection model to obtain a target detection result output by the ship target detection model;
[0061] The ship target detection model is obtained by training based on SAR image samples with annotation boxes; the annotation boxes include component annotation boxes and overall annotation boxes, and the component annotation boxes are determined by applying the overall annotation box based on the following steps:
[0062] Determine a Gaussian heat map of a target area where a ship target sample is located in the SAR image sample, determine a maximum eigenvector in a pixel covariance matrix of the target area based on the Gaussian heat map, and determine a principal axis direction of the ship target sample based on the maximum eigenvector;
[0063] The component annotation box is determined based on the main axis direction, the overall annotation box and the position confidence in the Gaussian heat map.
[0064] Specifically, the SAR image ship target detection method provided in the embodiment of the present invention is executed by a SAR image ship target detection device, which can be configured in a computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, a tablet, etc., which is not specifically limited here.
[0065] First, step S1 is executed to obtain a SAR image to be detected. The SAR image to be detected is an image acquired by SAR acquisition. The SAR image to be detected may contain one or more ship targets, which is determined by actual conditions.
[0066] The SAR image ship target detection device can be connected to the SAR, and the SAR can transmit the collected SAR image to be detected to the SAR image ship target detection device.
[0067] Then, step S2 is executed to introduce a ship target detection model, input the SAR image to be detected into the ship target detection model, extract features of the SAR image to be detected by the ship target detection model, obtain a feature map, and obtain a target detection result by the feature map. The target detection result may include an overall detection frame of the ship target contained in the SAR image to be detected and a component detection frame of the ship target. The overall detection frame may correspond to the ship target contained in the SAR image to be detected, and the component detection frame may correspond to the component covering the ship target.
[0068] The ship target detection model can be a YOLO series model, or a deep learning model such as a Fully Convolutional Network (FCN), a Feature Pyramid Network (FPN) or U-net. If the ship target detection model is FPN, feature maps of multiple scales can be obtained by extracting features from the SAR image to be detected, and feature maps of different scales are used to detect ship targets of different sizes. Furthermore, through the feature maps of each scale, the overall detection frame of the ship targets of different sizes contained in the SAR image to be detected and the component detection frame of the ship target can be obtained. Here, the number of scales of the feature map can be set as needed, for example, it can be set to 5, or it can be other numbers, which are not specifically limited here.
[0069] It can be understood that the parts of the ship target may include a head and a tail, so the part detection frame may include a head detection frame and a tail detection frame.
[0070] The ship target detection model can be obtained by training the initial target detection model using SAR image samples with labeled boxes. The structure of the initial target detection model is the same as that of the ship target detection model, and the only difference is that the structural parameters are different. The structural parameters of the initial target detection model can be obtained by initialization. By training the initial target detection model, the structural parameters of the initial target detection model can be iteratively updated to finally obtain the ship target detection model.
[0071] The SAR image samples may include multiple SAR image samples, and the multiple SAR image samples may constitute a SAR image sample set for training the initial target detection model. Here, each SAR image sample may be taken from a SAR dataset, and the SAR dataset may include a SSDD SAR dataset and / or a HRSID dataset.
[0072] Each SAR image sample may include one or more ship target samples, and each ship target sample in each SAR image sample carries a labeling box, which may include a component labeling box and an overall labeling box, and the component labeling box may include a head labeling box and a tail labeling box.
[0073] The position information and category information of each ship target sample in each SAR image sample are written into a label file, and the position information of each ship target sample can be represented by the position information of the overall annotation box of each ship target sample.
[0074] It can be seen that the overall annotation box of each ship target sample in each SAR image sample can be known, or manually annotated, or automatically annotated through a Gaussian heat map, and the area within the overall annotation box is the target area where the ship target sample is located. The embodiment of the present invention focuses on automatically determining the component annotation box of each ship target sample in each SAR image sample, and adding the position information of the component annotation box to the label file.
[0075] In an embodiment of the present invention, the ship target samples in the SAR image sample set can be divided into a training set and a test set according to a preset ratio. The training set is used to train the initial target detection model, and the test set is used to test the trained model. If the test passes, the trained model is used as the ship target detection model. If the test fails, the trained model continues to be trained until the test passes.
[0076] The preset ratio can be set as needed, for example, it can be 7:3, or other ratios, which are not specifically limited here.
[0077] Here, for each ship target sample in each SAR image sample, the component annotation box of the ship target sample can be an overall annotation box applying the ship target sample, and is obtained through the following steps:
[0078] First, determine the Gaussian heat map of the target area where the ship target sample is located in the SAR image sample. Here, the two-dimensional Gaussian distribution can be calculated according to the grayscale characteristics of the target area to determine the orientation-sensitive Gaussian heat map of the target area. The Gaussian heat map can be used to simulate the importance of each pixel in the target area to ensure that the center point of the ship target sample in the target area has the highest confidence, and the confidence of other pixels in the target area except the center point gradually decreases according to the two-dimensional Gaussian distribution law.
[0079] Afterwards, the Gaussian heat map is used in combination with the single value decomposition (SVD) algorithm to determine the maximum eigenvector in the pixel covariance matrix of the target area. The direction of the maximum eigenvector can be used as the principal axis direction of the ship target sample.
[0080] After that, the component annotation box of the ship target sample can be determined by using the main axis direction of the ship target sample, the overall annotation box and the position confidence in the Gaussian heat map. There are two constraints between the overall annotation box and the component annotation box. The first is that the center point of the overall annotation box and the center point of the component annotation box are on a straight line, and the direction of the straight line can be the main axis direction of the ship target sample; the second is that the component annotation box and the overall annotation box have common vertices.
[0081] Furthermore, since each position point in the Gaussian heat map corresponds to a confidence level, namely, position confidence level, the main axis direction of the ship target sample and the position confidence level in the Gaussian heat map can be combined to determine a vertex on the component annotation box of the ship target sample, which is different from the vertices of the overall annotation box.
[0082] Combining the above two constraints, the vertex on the component annotation box of the ship target sample that is diagonally opposite to the determined vertex, that is, the diagonal point of the determined vertex, can be determined.
[0083] By determining a vertex and its diagonal point on the component annotation box of the ship target sample, the component annotation box of the ship target sample can be obtained.
[0084] When training the initial target detection model, the ship target sample can be input into the initial target detection model to obtain the output result of the initial target detection model, and then the loss function is calculated according to the output result and the annotation box carried by the ship target sample, and finally the structural parameters of the initial target detection model are updated according to the loss function; the above input process and calculation process are iteratively executed until the loss function converges or reaches a preset number of iterations, and the ship target detection model is obtained. Among them, the preset number of iterations can be set as needed and is not specifically limited here.
[0085] The SAR image ship target detection method provided in the embodiment of the present invention first obtains the SAR image to be detected; then the SAR image to be detected is input into the ship target detection model to obtain the target detection result output by the ship target detection model. The ship target detection model is trained based on SAR image samples with annotation boxes. The adopted annotation boxes include component annotation boxes and overall annotation boxes. Compared with the traditional overall object annotation, more detailed component information is provided, which helps to improve the performance of target detection. The adopted component annotation box uses the overall annotation box and is automatically obtained in combination with the Gaussian heat map of the target area where the ship target sample in the SAR image sample is located, which can reduce the manual dependence in the traditional manual annotation process, make the target detection process more efficient and accurate, and reduce the annotation cost. Furthermore, the overfitting phenomenon in the model training process can be avoided, so that the trained ship target detection model has stronger generalization.
[0086] On the basis of the above embodiment, the determining of the component labeling frame based on the main axis direction, the overall labeling frame and the position confidence in the Gaussian heat map includes:
[0087] Determine a target frame edge on the overall annotation frame that has a small acute angle with the main axis direction, and determine a target point on a line connecting the midpoint of the target frame edge and the center point of the overall annotation frame that corresponds to the smallest difference between the position confidence and a preset threshold in the Gaussian heat map, and a symmetrical point of the target point about the center point of the overall annotation frame;
[0088] The component annotation box is determined based on the target point, the symmetric point and the vertices of the overall annotation box.
[0089] Specifically, when determining the component annotation frame, the main axis direction can be used to determine the target frame edge with the smallest acute angle between the overall annotation frame and the main axis direction. Both the overall annotation frame and the component annotation frame are rectangular frames, and the adjacent frame edges on the rectangular frame are perpendicular to each other. The rectangular frame includes two frame edges in the horizontal direction and two frame edges in the vertical direction. Here, the acute angle between the frame edges of the overall annotation frame in each direction and the main axis direction can be calculated respectively, and then the frame edge on the overall annotation frame with the smallest acute angle can be selected as the target frame edge.
[0090] After that, the line expression of the midpoint of the target box edge and the center point of the overall annotation box can be determined. On the line connecting the midpoint of the target box edge and the center point of the overall annotation box, the target point corresponding to the smallest difference between the position confidence in the Gaussian heat map and the preset threshold can be determined. The preset threshold can be set as needed, for example, it can be 0.5. Thus, the target point corresponding to the position confidence in the Gaussian heat map closest to the preset threshold can be determined on the line. Furthermore, the symmetric point of the target point about the center point of the overall annotation box can be determined on the line.
[0091] After that, the component annotation box can be determined using the target point, the symmetric point and the vertices of the overall annotation box. For example, since the component annotation box includes the head annotation box and the tail annotation box, the target point can be used as the vertex of one annotation box and the symmetric point as the vertex of the other annotation box. At the same time, using the vertices of the overall annotation box and combining the above constraints, the vertices of the two annotation boxes can be determined, and then the required component annotation box can be determined.
[0092] In the embodiment of the present invention, the component annotation box can be quickly and automatically determined by means of the position confidence in the Gaussian heat map.
[0093] On the basis of the above embodiment, the component annotation box includes a first annotation box and a second annotation box;
[0094] The determining the component annotation box based on the target point, the symmetric point and the vertex of the overall annotation box includes:
[0095] Determine the target point and the symmetric point as a vertex of the first annotation box and the second annotation box respectively;
[0096] Based on the vertices of the overall annotation box, determining the diagonal points of the vertices of the first annotation box and the second annotation box;
[0097] The center point of the first annotation box, the center point of the second annotation box and the center point of the overall annotation box are all on a straight line.
[0098] Specifically, in the embodiment of the present invention, two annotation boxes in the component annotation box can be distinguished as a first annotation box and a second annotation box. After the positions of the first annotation box and the second annotation box are determined, the head annotation box and the tail annotation box can be determined according to the main axis direction of the ship target sample. For example, the annotation boxes sorted along the main axis direction can be used as the tail annotation box and the head annotation box in sequence.
[0099] When determining the component annotation box, the target point can be determined as a vertex of the first annotation box, and the symmetrical point can be determined as a vertex of the second annotation box.
[0100] After that, one vertex of the overall annotation box is selected as the diagonal point of the vertex of the first annotation box, and another vertex of the overall annotation box is selected as the diagonal point of the vertex of the second annotation box, thereby determining the first annotation box and the second annotation box. The selection of the vertex of the overall annotation box can be achieved by the constraint that the center point of the first annotation box, the center point of the second annotation box and the center point of the overall annotation box are all on a straight line.
[0101] For example, Figure 2 As shown in the figure, it is the Gaussian heat map of the target area. EFGH are the vertices of the overall annotation box, EFGH is the target area, B is the center point of the overall annotation box, the vector v starting from B is the main axis direction of the ship target sample, the acute angles between the box edges EF and HG and the main axis direction are both β, and the acute angles between the box edges EH and FG and the main axis direction are both α. If α≥β, the box edges EF and HG are taken as the target box edges. Figure 2 Only the case where the box edge EF is used as the target box edge is shown in the figure, A is the midpoint of the target box edge, and C on AB is the target point whose position confidence is closest to the preset threshold in the Gaussian heat map. D is the symmetric point of C on AB about B. Therefore, C can be used as a vertex of the first annotation box, H as the diagonal point of C, D as a vertex of the second annotation box, and F as the diagonal point of D. Finally, ICJH are the vertices of the first annotation box, and AFKD are the vertices of the second annotation box.
[0102] In the embodiment of the present invention, by means of the position constraint between the overall annotation frame and the component annotation frames, the position of each component annotation frame can be made more accurate.
[0103] On the basis of the above embodiment, determining the Gaussian heat map of the target area where the ship target sample in the SAR image sample is located specifically includes:
[0104] Determining a maximum likelihood parameter of a non-standardized Gaussian distribution based on the grayscale value of each pixel in the target area;
[0105] Performing center standardization on the non-standardized Gaussian distribution to obtain a standardized Gaussian distribution;
[0106] Based on the standardized Gaussian distribution, the position confidence of each pixel in the target area is calculated, and based on the position confidence of each pixel in the target area, the Gaussian heat map is determined.
[0107] Specifically, when determining the Gaussian heat map, the grayscale value of each pixel in the target area can be used to determine the maximum likelihood parameter of the non-standardized Gaussian distribution. The maximum likelihood parameter can include the mean vector of the non-standardized Gaussian distribution and the covariance matrix .
[0108] Unnormalized Gaussian distribution It can be expressed as:
[0109]
[0110] in, Represents pixel The coordinate vector of is the mean vector, is the covariance matrix, represents the determinant of the covariance matrix.
[0111] Mean vector and the covariance matrix It can be calculated by the following formula:
[0112]
[0113] in, Represents pixel The gray value of .
[0114] After that, the non-standardized Gaussian distribution is center-normalized to obtain the standardized Gaussian distribution, and then the standardized Gaussian distribution is used to calculate the position confidence of each pixel in the target area. The calculation formula of the position confidence can be expressed as:
[0115]
[0116] in, Pixel is the position confidence, and k is the adjustment factor parameter, which is used to adjust the decay speed from the center point to the edge of the Gaussian function.
[0117] Finally, the Gaussian heat map is determined using the position confidence of each pixel in the target area.
[0118] Since ship targets usually occupy a small pixel ratio in SAR images, the low foreground ratio leads to insufficient extraction of useful feature information in SAR images other than the location of ship targets, and existing algorithms and technologies are difficult to accurately locate and classify; in complex ocean and coastal backgrounds, common background objects may be similar to ships in shape and size, and the existing algorithm and technology are prone to false detection during the training process. Therefore, to date, the accuracy and robustness of SAR image ship target detection still rely on mining more useful information in limited SAR images and improving the training optimization method of the detection network.
[0119] Based on the above embodiment, the ship target detection model is trained based on the following steps:
[0120] Inputting the SAR image sample into an initial target detection model to obtain a candidate anchor box in the SAR image sample output by the initial target detection model and a predicted probability and position vector of the candidate anchor box;
[0121] Determine a candidate anchor frame belonging to the ship target sample in the candidate anchor frame, as well as an overall anchor frame and a component anchor frame in the candidate anchor frame, and determine a component anchor frame matching the overall anchor frame based on a position-dependent intersection-and-union ratio between the overall anchor frame and the component anchor frame, and the Gaussian heat map;
[0122] Determine the center point connection line of the component anchor frame, calculate the vertical distance from the center point of the whole anchor frame to the center point connection line, and construct a spatial position constraint item based on the vertical distance;
[0123] Based on the spatial position constraint term, the classification error and the positioning error, a composite loss function is calculated, and based on the composite loss function, structural parameters of the initial target detection model are iteratively optimized to obtain the ship target detection model;
[0124] The classification error is determined based on the prediction probability of the candidate anchor box, and the positioning error is determined based on the position vector of the candidate anchor box and the position vector of the annotation box.
[0125] Specifically, when training the initial target detection model, the SAR image sample can be first input into the initial target detection model, and the output result of the initial target detection model includes the candidate anchor boxes in the SAR image sample and the predicted probability and position vector of the candidate anchor boxes. The candidate anchor boxes include multiple ones, and each candidate anchor box corresponds to a predicted probability and a position vector.
[0126] After that, according to the prediction probability of each candidate anchor frame, the candidate anchor frame belonging to the ship target sample can be determined as the candidate anchor frame, and the candidate anchor frame can be used as the positive label of the ship target sample, and the candidate anchor frames except the candidate anchor frame can be used as the negative label of the ship target sample. For example, if the prediction probability of a candidate anchor frame is greater than the specified probability, it can be determined that the candidate anchor frame belongs to the ship target sample, and then the candidate anchor frame is the candidate anchor frame. Among them, the specified probability can be set as needed and is not specifically limited here.
[0127] The candidate anchor frames can include overall anchor frames and component anchor frames. ,in, is an alternative anchor box, is the overall anchor frame, Anchor box for component classes.
[0128] After that, the Position Intersection Over Union (PIoU) between the overall anchor box and the component class anchor box can be calculated. The PIoU refers to the ratio of the overlapping area between the area in the overall anchor box and the area in the component class anchor box to the minimum area between the area in the overall anchor box and the area in the component class anchor box. That is:
[0129]
[0130] Among them, A represents the area within the overall anchor box, and B represents the area within the component anchor box. represents the overlapping area between A and B, is the area of A, is the area of B, is the minimum area between A and B.
[0131] When the area within the overall anchor box and the area within the component class anchor box partially overlap, PIoU < 1; when the component class anchor box is contained in the overall anchor box, PIoU = 1.
[0132] like Figure 3 As shown, the relationship between the center point distance between the overall anchor box and the component class anchor box and the value of PIOU. Figure 3 In the example, the inflection point is the case where the component anchor box is contained in the overall anchor box and some of the box edges overlap.
[0133] Slightly different from the general IoU, the contributions of the two anchor boxes in IoU are equal, and the size difference of the two anchor boxes will not affect the final IoU, but because the aspect ratio range of the component class anchor box is large, if it is calculated in the IOU way, some component class anchor boxes with a large difference from the actual aspect ratio may be retained, affecting the training and optimization of the model. Therefore, PIoU mainly focuses on the degree of overlap between the area within the component class anchor box and the area within the overall anchor box, thereby effectively avoiding matching errors caused by shape differences and reducing the possibility of mismatch.
[0134] By using the position dependency intersection-union ratio between the overall anchor frame and the component anchor frame, combined with the Gaussian heat map, the component anchor frame can be screened to obtain the component anchor frame that matches the overall anchor frame. The component anchor frame can include a head anchor frame and a tail anchor frame.
[0135] After that, the center point connection line of the head anchor frame and the tail anchor frame can be determined, and the vertical distance from the center point of the whole anchor frame to the center point connection line can be calculated. Here, the vertical projection point from the center point of the whole anchor frame to the center point connection line can be determined first, and then the distance between the center point of the whole anchor frame and the vertical projection point can be calculated, and the distance is determined as the vertical distance.
[0136] like Figure 4 As shown, is the coordinate of the center point of the overall anchor frame, is the center point coordinate of the head anchor frame, is the center point coordinate of the tail anchor box, is the center point coordinate of the vertical projection point.
[0137] Using this vertical distance to construct the spatial position constraint, we have:
[0138]
[0139] in, is the spatial position constraint of the i-th overall anchor box, is the vertical distance corresponding to the i-th overall anchor box.
[0140] Finally, the classification error can be optimized by using the spatial distance constraint term, and the composite loss function can be determined by combining the optimization result and the positioning error. That is,
[0141]
[0142] Among them, L is the composite loss function, N cls is the number of overall anchor boxes in the classification task, N reg is the number of overall anchor boxes in the positioning task, is the classification error corresponding to the i-th overall anchor box, is the positioning error corresponding to the i-th overall anchor frame, is the predicted probability of the i-th overall anchor box, is the label probability corresponding to the i-th overall anchor box, It means that the i-th overall anchor box can correctly predict the existence of the ship target sample. It means that the i-th overall anchor box cannot correctly predict the existence of the ship target sample. represents the position vector of the i-th overall anchor box, Represents the position vector of the i-th overall annotation box. is a weighting coefficient used to balance the importance of classification error and localization error.
[0143] In the composite loss function, Iverson brackets are used to determine the number of overall anchor boxes involved in the calculation of positioning error. The positioning error of the overall anchor frame is calculated only when .
[0144] Afterwards, the structural parameters of the initial target detection model are iteratively optimized using the composite loss function. When the preset number of iterations is reached or the composite loss function converges, the ship target detection model is obtained.
[0145] In the embodiment of the present invention, a composite loss function including classification error and positioning error is introduced, which can improve the accuracy and efficiency of ship target detection in a complex environment by using the trained ship target detection model. Moreover, in the composite loss function, the weights of different anchor frames are adjusted by the spatial distance constraint term, so that the overall anchor frame corresponding to a smaller vertical distance has a higher weight, which can enhance the effectiveness of the composite loss function, improve the spatial accuracy of the prediction frame and the performance of the ship target detection model.
[0146] On the basis of the above embodiment, the determining of the component anchor frame matching the overall anchor frame based on the position-dependent intersection-over-union ratio between the overall anchor frame and the component class anchor frame and the Gaussian heat map includes:
[0147] Based on the position-dependent intersection-and-union ratio, the component class anchor boxes are screened to obtain a target anchor box;
[0148] Mapping the overall anchor frame and the component anchor frame to the Gaussian heat map, and calculating the pixel value of the center point of the target anchor frame on the Gaussian heat map;
[0149] Based on the pixel value of the center point of the target anchor frame on the Gaussian heat map, the target anchor frame is screened to obtain the component anchor frame.
[0150] Specifically, when determining the component anchor frame that matches the overall anchor frame, the position-dependent intersection-and-union ratio can be used to first screen the component class anchor frames to obtain the target anchor frame. For example, the position-dependent intersection-and-union ratio of the overall anchor frame and each component class anchor frame can be compared with the intersection-and-union ratio threshold, and the component class anchor frame whose position-dependent intersection-and-union ratio is greater than the intersection-and-union ratio threshold is selected as the target anchor frame. The intersection-and-union ratio threshold can be set as needed, for example, it can be 0.3, or it can be other values, which are not specifically limited here.
[0151] Simultaneously, the overall anchor box and the component class anchor box can be mapped to the Gaussian heat map according to the downsampling ratio of the initial target detection model, and the pixel value of the center point of the target anchor box on the Gaussian heat map can be calculated.
[0152] The target anchor frame is screened by using the pixel value of the center point of the target anchor frame on the Gaussian heat map to obtain the component anchor frame. The pixel value can be compared with the specified pixel value, and the target anchor frame with a pixel value greater than the specified pixel value is used as the component anchor frame.
[0153] like Figure 5 As shown in , when determining the component anchor box, for the SAR image sample, the candidate anchor box is determined, and the component class anchor box is screened by using the position-dependent intersection-over-union ratio to obtain the target anchor box with PIoU>0.3, as shown in Figure 5 (a) in the figure.
[0154] Determine the Gaussian heat map of the target area where the ship target sample is located in the SAR image sample, and map the overall anchor frame and the component class anchor frame to the Gaussian heat map, such as Figure 5 (b) in the figure.
[0155] Finally, the pixel value of the center point of the target anchor box on the Gaussian heat map is calculated. The center points of the target anchor box are , , , , the pixel value of the center point of the target anchor box on the Gaussian heat map can be obtained by determining the vertical coordinate of the center point of the target anchor box on the Gaussian Curve.
[0156] By comparing the pixel value of the center point of the target anchor frame on the Gaussian heat map with the specified pixel value, the target anchor frame with a pixel value greater than the specified pixel value is used as the component anchor frame. At this time, each ship target sample in the SAR image sample corresponds to one overall anchor frame and two component anchor frames.
[0157] Based on the above embodiment, the classification error is determined based on the prediction probability by applying a cross entropy loss function or a Focal Loss; the positioning error is determined based on the position vector of the candidate anchor box and the position vector of the label box by applying a smooth L1 loss function.
[0158] Specifically, different loss functions are used to calculate the classification error according to the structure of the initial target detection model. If the initial target detection model is a two-stage backbone network, the cross entropy loss is used as ,If the initial target detection model is a single-stage backbone network, Focal Loss is used to adapt to the needs of different detection tasks.
[0159] For positioning error Regardless of whether the initial target detection model is a two-stage backbone network or a single-stage backbone network, the smooth L1 loss function is used to calculate the positioning loss, and its calculation formula is:
[0160]
[0161] In the classification task, a spatial distance constraint term is introduced. The smaller the vertical distance from the center point of the overall anchor box to the line connecting the center points of the head anchor box and the tail anchor box, the closer the value of the spatial distance constraint term is to 1, and the higher the weight of the corresponding anchor box in the composite loss function, thereby improving the confidence of those anchor boxes that are closely related to the position of the parts.
[0162] like Figure 6 , which is a flow chart of a method for training a ship target detection model in a SAR image ship target detection method provided in an embodiment of the present invention.
[0163] First, obtain the SAR dataset;
[0164] Then, a Gaussian heat map of the target area where the ship target samples in the SAR data set are located is generated to achieve automatic labeling of the components of the ship target samples.
[0165] Afterwards, the overall annotation box and the component annotation box are obtained, and the SAR image sample set is constructed by combining the SAR images in the SAR dataset.
[0166] Thereafter, each SAR image sample in the SAR image sample set is input into the initial target detection model to obtain a candidate anchor frame in the SAR image sample and a predicted probability and a position vector of the candidate anchor frame.
[0167] Combined with the Gaussian heat map, the component anchor frame that matches the overall anchor frame is determined to achieve component anchor frame relationship modeling.
[0168] After that, the spatial position constraint term is introduced, the composite loss function is constructed, and the structural parameters of the initial target detection model are iteratively optimized to obtain the ship target detection model.
[0169] like Figure 7 As shown, based on the above embodiment, an embodiment of the present invention provides a SAR image ship target detection device, including:
[0170] An image acquisition module 71 is used to acquire a SAR image to be detected;
[0171] A target detection module 72, configured to input the SAR image to be detected into a ship target detection model to obtain a target detection result output by the ship target detection model;
[0172] The ship target detection model is obtained by training based on SAR image samples with annotation boxes; the annotation boxes include component annotation boxes and overall annotation boxes;
[0173] The component automatic labeling module 73 is further included, which is used to determine the component labeling frame based on the following steps using the overall labeling frame:
[0174] Determine a Gaussian heat map of a target area where a ship target sample is located in the SAR image sample, determine a maximum eigenvector in a pixel covariance matrix of the target area based on the Gaussian heat map, and determine a principal axis direction of the ship target sample based on the maximum eigenvector;
[0175] The component annotation box is determined based on the main axis direction, the overall annotation box and the position confidence in the Gaussian heat map.
[0176] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the component annotation frame determination module is specifically used for:
[0177] Determine a target frame edge on the overall annotation frame that has a small acute angle with the main axis direction, and determine a target point on a line connecting the midpoint of the target frame edge and the center point of the overall annotation frame that corresponds to the smallest difference between the position confidence and a preset threshold in the Gaussian heat map, and a symmetrical point of the target point about the center point of the overall annotation frame;
[0178] The component annotation box is determined based on the target point, the symmetric point and the vertices of the overall annotation box.
[0179] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the component annotation box includes a first annotation box and a second annotation box;
[0180] The component annotation frame determination module is also specifically used for:
[0181] Determine the target point and the symmetric point as a vertex of the first annotation box and the second annotation box respectively;
[0182] Based on the vertices of the overall annotation box, determining the diagonal points of the vertices of the first annotation box and the second annotation box;
[0183] The center point of the first annotation box, the center point of the second annotation box and the center point of the overall annotation box are all on a straight line.
[0184] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the component annotation frame determination module is further specifically used for:
[0185] Determining a maximum likelihood parameter of a non-standardized Gaussian distribution based on the grayscale value of each pixel in the target area;
[0186] Performing center standardization on the non-standardized Gaussian distribution to obtain a standardized Gaussian distribution;
[0187] Based on the standardized Gaussian distribution, the position confidence of each pixel in the target area is calculated, and based on the position confidence of each pixel in the target area, the Gaussian heat map is determined.
[0188] On the basis of the above-mentioned embodiment, the SAR image ship target detection device provided in the embodiment of the present invention further includes a model training module for:
[0189] Inputting the SAR image sample into an initial target detection model to obtain a candidate anchor box in the SAR image sample output by the initial target detection model and a predicted probability and position vector of the candidate anchor box;
[0190] Determine a candidate anchor frame belonging to the ship target sample in the candidate anchor frame, as well as an overall anchor frame and a component anchor frame in the candidate anchor frame, and determine a component anchor frame matching the overall anchor frame based on a position-dependent intersection-and-union ratio between the overall anchor frame and the component anchor frame, and the Gaussian heat map;
[0191] Determine the center point connection line of the component anchor frame, calculate the vertical distance from the center point of the whole anchor frame to the center point connection line, and construct a spatial position constraint item based on the vertical distance;
[0192] Based on the spatial position constraint term, the classification error and the positioning error, a composite loss function is calculated, and based on the composite loss function, structural parameters of the initial target detection model are iteratively optimized to obtain the ship target detection model;
[0193] The classification error is determined based on the prediction probability of the candidate anchor box, and the positioning error is determined based on the position vector of the candidate anchor box and the position vector of the annotation box.
[0194] On the basis of the above-mentioned embodiment, in the SAR image ship target detection device provided in the embodiment of the present invention, the model training module is specifically used for:
[0195] Based on the position-dependent intersection-and-union ratio, the component class anchor boxes are screened to obtain a target anchor box;
[0196] Mapping the overall anchor frame and the component anchor frame to the Gaussian heat map, and calculating the pixel value of the center point of the target anchor frame on the Gaussian heat map;
[0197] Based on the pixel value of the center point of the target anchor frame on the Gaussian heat map, the target anchor frame is screened to obtain the component anchor frame.
[0198] On the basis of the above embodiments, in the SAR image ship target detection device provided in the embodiments of the present invention, the classification error is determined based on the prediction probability by applying the cross entropy loss function or the Focal Loss; the positioning error is determined based on the position vector of the alternative anchor box and the position vector of the annotation box by applying the smooth L1 loss function.
[0199] Specifically, the functions of each module in the SAR image ship target detection device provided in the embodiment of the present invention correspond one-to-one to the operating procedures of each step in the above method embodiment, and the effects achieved are also consistent. Please refer to the above embodiment for details, which will not be repeated in the embodiment of the present invention.
[0200] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8 As shown, the electronic device may include: a processor (Processor) 810, a communication interface (Communications Interface) 820, a memory (Memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the SAR image ship target detection method provided in the above embodiments.
[0201] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0202] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the SAR image ship target detection method provided in the above embodiments. It can be understood that the computer-readable storage medium can be a non-transitory computer-readable storage medium or a transient computer-readable storage medium, which is not specifically limited here.
[0203] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the SAR image ship target detection method provided in the above embodiments.
[0204] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0205] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0206] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting ship targets in SAR images, characterized in that: include: Acquire the SAR image to be detected; Inputting the SAR image to be detected into a ship target detection model to obtain a target detection result output by the ship target detection model; The ship target detection model is obtained by training based on SAR image samples with annotation boxes; the annotation boxes include component annotation boxes and overall annotation boxes, and the component annotation boxes are determined by applying the overall annotation box based on the following steps: Determine a Gaussian heat map of a target area where a ship target sample is located in the SAR image sample, determine a maximum eigenvector in a pixel covariance matrix of the target area based on the Gaussian heat map, and determine a principal axis direction of the ship target sample based on the maximum eigenvector; Determine the component annotation box based on the main axis direction, the overall annotation box, and the position confidence in the Gaussian heat map; The determining the component annotation frame based on the main axis direction, the overall annotation frame and the position confidence in the Gaussian heat map includes: Determine a target frame edge on the overall annotation frame that has a small acute angle with the main axis direction, and determine a target point on a line connecting the midpoint of the target frame edge and the center point of the overall annotation frame that corresponds to the smallest difference between the position confidence and a preset threshold in the Gaussian heat map, and a symmetrical point of the target point about the center point of the overall annotation frame; Determine the component annotation box based on the target point, the symmetric point and the vertices of the overall annotation box; The component annotation frame includes a first annotation frame and a second annotation frame; The determining the component annotation box based on the target point, the symmetric point and the vertex of the overall annotation box includes: Determine the target point and the symmetric point as a vertex of the first annotation box and the second annotation box respectively; Based on the vertices of the overall annotation box, determining the diagonal points of the vertices of the first annotation box and the second annotation box; The center point of the first annotation box, the center point of the second annotation box and the center point of the overall annotation box are all on a straight line.
2. The SAR image ship target detection method according to claim 1, characterized in that: The determining of the Gaussian thermal map of the target area where the ship target sample in the SAR image sample is located specifically includes: Determining a maximum likelihood parameter of a non-standardized Gaussian distribution based on the grayscale value of each pixel in the target area; Performing center standardization on the non-standardized Gaussian distribution to obtain a standardized Gaussian distribution; Based on the standardized Gaussian distribution, the position confidence of each pixel in the target area is calculated, and based on the position confidence of each pixel in the target area, the Gaussian heat map is determined.
3. The SAR image ship target detection method according to any one of claims 1-2, characterized in that: The ship target detection model is trained based on the following steps: Inputting the SAR image sample into an initial target detection model to obtain a candidate anchor box in the SAR image sample output by the initial target detection model and a predicted probability and position vector of the candidate anchor box; Determine a candidate anchor frame belonging to the ship target sample in the candidate anchor frame, as well as an overall anchor frame and a component anchor frame in the candidate anchor frame, and determine a component anchor frame matching the overall anchor frame based on a position-dependent intersection-and-union ratio between the overall anchor frame and the component anchor frame, and the Gaussian heat map; Determine the center point connection line of the component anchor frame, calculate the vertical distance from the center point of the whole anchor frame to the center point connection line, and construct a spatial position constraint item based on the vertical distance; Based on the spatial position constraint term, the classification error and the positioning error, a composite loss function is calculated, and based on the composite loss function, structural parameters of the initial target detection model are iteratively optimized to obtain the ship target detection model; The classification error is determined based on the prediction probability of the candidate anchor box, and the positioning error is determined based on the position vector of the candidate anchor box and the position vector of the annotation box.
4. The SAR image ship target detection method according to claim 3, characterized in that: The determining of a component anchor frame matching the overall anchor frame based on the position-dependent intersection-and-union ratio between the overall anchor frame and the component class anchor frame and the Gaussian heat map includes: Based on the position-dependent intersection-over-union ratio, the component class anchor boxes are screened to obtain a target anchor box; Mapping the overall anchor frame and the component anchor frame to the Gaussian heat map, and calculating the pixel value of the center point of the target anchor frame on the Gaussian heat map; Based on the pixel value of the center point of the target anchor frame on the Gaussian heat map, the target anchor frame is screened to obtain the component anchor frame.
5. The SAR image ship target detection method according to claim 3, characterized in that: The classification error is determined based on the prediction probability by applying a cross entropy loss function or a focal loss; the positioning error is determined based on the position vector of the candidate anchor box and the position vector of the label box by applying a smooth L1 loss function.
6. A SAR image ship target detection device, characterized in that: include: An image acquisition module is used to acquire the SAR image to be detected; A target detection module, used for inputting the SAR image to be detected into a ship target detection model to obtain a target detection result output by the ship target detection model; The ship target detection model is obtained by training based on SAR image samples with annotation boxes; the annotation boxes include component annotation boxes and overall annotation boxes; It also includes a component automatic labeling module, which is used to apply the overall labeling frame to determine the component labeling frame based on the following steps: Determine a Gaussian heat map of a target area where a ship target sample is located in the SAR image sample, determine a maximum eigenvector in a pixel covariance matrix of the target area based on the Gaussian heat map, and determine a principal axis direction of the ship target sample based on the maximum eigenvector; Determine the component annotation box based on the main axis direction, the overall annotation box, and the position confidence in the Gaussian heat map; The determining the component annotation frame based on the main axis direction, the overall annotation frame and the position confidence in the Gaussian heat map includes: Determine a target frame edge on the overall annotation frame that has a small acute angle with the main axis direction, and determine a target point on a line connecting the midpoint of the target frame edge and the center point of the overall annotation frame that corresponds to the smallest difference between the position confidence and a preset threshold in the Gaussian heat map, and a symmetrical point of the target point about the center point of the overall annotation frame; Determine the component annotation box based on the target point, the symmetric point and the vertices of the overall annotation box; The component annotation frame includes a first annotation frame and a second annotation frame; The determining the component annotation box based on the target point, the symmetric point and the vertex of the overall annotation box includes: Determine the target point and the symmetric point as a vertex of the first annotation box and the second annotation box respectively; Based on the vertices of the overall annotation box, determining the diagonal points of the vertices of the first annotation box and the second annotation box; The center point of the first annotation box, the center point of the second annotation box and the center point of the overall annotation box are all on a straight line.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the SAR image ship target detection method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the SAR image ship target detection method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Optical remote sensing picture ship detection method based on component matching and distance constraint
CN110751077A
Remote sensing image ship detection and identification method
CN115641510A
Cited By
Marine target unsupervised learning detection method based on auxiliary generation network
CN120339587A
