Method for improving detection precision of weak supervision directed ship in SAR (Synthetic Aperture Radar) image
By constructing a CNN two-stage ship detection network and an angle correction network in SAR images, using horizontal bounding boxes to annotate data, predicting ship orientations and correcting bounding box angles, the problem of high-cost data annotation in directional ship detection is solved and improved Improve detection accuracy and efficiency.
Patent Information
- Application Number
- CN202410616306.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-30
AI Technical Summary
At this stage, the directional ship detection method in SAR images is limited by the high cost of directional annotation data, resulting in insufficient detection accuracy. In particular, the production cost of annotation data based on full supervision mode is too high, which limits the application of directional ship detection. develop.
By constructing a CNN two-stage ship detection network, combining the geometric mapping relationship between the directional bounding box and the horizontal bounding box, training the backbone network, pyramid network and region proposal network, building an angle correction network to predict the ship orientation, and through the detection head network Perform secondary refinement to reduce detection costs and improve detection accuracy.
It effectively reduces the cost of weakly supervised directional ship detection in SAR images, improves detection accuracy, breaks through the problem of insufficient directional annotation data, and achieves efficient ship detection under low-cost conditions.
Smart Images

Figure CN118570632A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of directed ship detection in Synthetic Aperture Radar (SAR) images, and in particular relates to a method for improving the accuracy of weakly supervised directed ship detection in SAR images. Background Art
[0002] Compared with other remote sensing sensors, SAR has the advantage of high-resolution imaging monitoring around the clock and in all weather conditions. In addition, its strong penetration ability enables it to penetrate clouds, ignore interference from rain and snow, and observe targets through ground vegetation and even the surface soil. In recent years, with the rapid development of SAR imaging technology, the quality and quantity of SAR image products have continued to improve, and they are now widely used in civil and military fields, especially in sea monitoring. Sea surface monitoring has very important practical value and strategic significance for applications such as military early warning, maritime navigation, and resolving territorial disputes, and ship detection in SAR images is one of the essential tasks in sea surface monitoring. This task requires uninterrupted detection of the movements and quantity changes of ships on the sea surface, so ship detection methods have become a research hotspot in SAR image processing.
[0003] Early SAR image ship detection methods followed the traditional target recognition technology route, requiring researchers to manually design and extract features, and then determine whether it is a ship target based on these features. The rapid rise of deep learning technology, especially the Convolutional Neural Networks (CNN) technology widely used in computer vision, has brought SAR image ship detection into a new stage of development. Compared with early methods, CNN-based ship detection methods do not require manual feature design, greatly simplifying the design process and achieving detection performance levels that are superior to traditional methods. At present, in order to meet the needs of ship hull measurement and trajectory prediction in ship detection, CNN-based ship detection methods mainly target directed ship detection, that is, the detection results contain directed bounding boxes that fit the ship closely.
[0004] Compared with the horizontal bounding box ship detection method, the oriented ship detection method not only has the angle in the detection result, but also detects the length and width of the ship, so the detection is more difficult. The oriented ship detection method can not only meet the higher-level ship monitoring tasks, but also solve the problem of overlapping detection of densely adjacent ships and the problem of land interference of docked ships. Although the CNN-based oriented ship detection method is more practical, for this type of method in the current fully supervised mode, the high cost of producing oriented ship annotation data limits its development. For a ship, the cost of annotating its oriented bounding box is about 1.4 times that of annotating its horizontal bounding box. Therefore, most of the ship detection data sets widely recognized by the academic community are in the form of horizontal bounding box annotations. The lack of oriented annotation data limits the further development of oriented ship detection methods. Summary of the invention
[0005] Aiming at the problem that the cost of directional ship annotation data in existing SAR images is too high and directional ship detection is limited, the main purpose of the present invention is to propose a method for improving the accuracy of weakly supervised directional ship detection in SAR images. The method first uses the geometric mapping relationship between the directional bounding box and the horizontal bounding box, and uses the data annotated by the horizontal bounding box to train the backbone network, pyramid network, region proposal network and detection head network in the two-stage CNN ship detection network, so that it has the ability to predict the angle of the ship bounding box; secondly, an angle correction network including a ship orientation prediction branch is built and embedded in the two-stage CNN ship detection network, and the orientation of the ship is extracted based on the SAR image ship slice by mining the characteristics of the ship target in the SAR image, and the obtained orientation is used to train the ship orientation prediction branch; finally, the orientation predicted by the branch is used to correct the inaccurate angle of the bounding box predicted by the region proposal network, and then after secondary refinement, the accurate directional bounding box of the ship is detected by the detection head network, thereby reducing the cost of weakly supervised directional ship detection in SAR images and improving the detection accuracy.
[0006] The present invention discloses a method for improving the accuracy of weakly supervised directional ship detection in SAR images, comprising the following steps:
[0007] Step 1: Construct a CNN two-stage ship detection network model, which includes, in order of network forward propagation: a backbone network for feature extraction, a feature pyramid network for hierarchical prediction, a region proposal network for candidate box prediction, and a detection head network for outputting directed bounding boxes and ship identification results.
[0008] Step 2: Build an angle correction network with three branches and embed it after the region proposal network in the model described in step 1.
[0009] The angle correction network includes a feature pooling layer, three independent branches, and two fully connected layers shared by these branches. The feature pooling layer is used to pool the required features from the feature map output by the feature pyramid network in step 1. The pooled features are subjected to two shared fully connected layers for intra-feature interaction to enhance the feature representation ability of the ship. The interactive features are processed by three independent branches, which are responsible for predicting the center coordinates and size of the ship's oriented bounding box, the angle α of the ship's bounding box, and the angle α of the ship's bounding box. p With the ship's orientation O p , the three independent branches are all composed of fully connected layers. The center coordinate is the position of the center of the bounding box in the input image, expressed as (x p ,y p ); the size of the bounding box is described by its width and height, expressed as (w p ,h p ).
[0010] Step 3: Load the SAR ship dataset and horizontal bounding box annotations, and perform model training in the model built in steps 1 and 2.
[0011] The SAR ship dataset consists of square SAR images, including four polarization modes: horizontal transmission and horizontal reception, vertical transmission and vertical reception, horizontal transmission and vertical reception, and vertical transmission and horizontal reception. The horizontal bounding box annotation contains the coordinates of the upper left corner and lower right corner of the horizontal bounding box of each ship target in the SAR image, which are expressed as (x 1 ,y 1 ) and (x 2 ,y 2 ). The SAR images in the dataset are sequentially processed through the backbone network, feature pyramid network and region proposal network described in step 1, and the parameters are obtained as (x 1p ,y 1p ,x 2p ,y 2p ) of the preliminary detected horizontal candidate box, where (x 1p ,y 1p ) and (x 2p ,y 2p ) are the position coordinates of the upper left end point and the lower right end point of the horizontal candidate box in the SAR image respectively. The region proposal network is trained by annotating the horizontal candidate box with the loaded horizontal bounding box and calculating the loss.
[0012] Step 4: Use the orientation output by the angle correction network to correct the angle of the oriented bounding box to the correct range.
[0013] The SAR images in the dataset are forward propagated in the model built in step 2. The angle correction network uses the feature pooling layer to extract features from the feature map according to the horizontal candidate box described in step 3. After passing through the angle correction network described in step 2, its output is (x p ,y p ,w p ,h p ,α p ,O p ), using O p To α p The specific process is as follows:
[0014] α t =|α p
[0015] α=O p ×α t
[0016] where α t is α p The absolute value of α is the corrected ship bounding box angle. α and the other four parameters (x p ,y p ,w p ,h p ) are used as the output of the angle correction network to obtain five parameters (x, y, w, h, α) describing the corrected oriented bounding box, where x = x p , y=y p , w=w p , h=h p , respectively represent the horizontal coordinate, vertical coordinate, width and height of the corrected directional bounding box on the input SAR image.
[0017] Step 5: Extract supervision information for training the orientation branch of the angle correction network. According to the horizontal bounding box annotation loaded in step 3, cut out the ship target slice from the SAR image and cut it into square slices with the short side as the side length. Determine the ship orientation according to the grayscale value of the two diagonal areas of the target slice.
[0018] Specifically, extract the horizontal rectangular slice of the ship target with a size of m×n according to the loaded horizontal bounding box annotation, where m and n are the width and height of the horizontal bounding box in the annotation loaded in step 3. Take s=min(m,n), where min() takes the minimum value operation, crop the slice to obtain a new slice with a side length of s, the new slice has the same center coordinates as the original slice, and the gray value matrix of the new slice is A.
[0019] The sum of the grayscale values of the main diagonal area S1 is obtained, which is expressed as follows:
[0020]
[0021] Among them A i,j is the gray value at position (i, j) in A. The sum of the gray values of the sub-diagonal area S2 is calculated as follows:
[0022]
[0023] The extracted ship orientation is represented as O. According to the 90-degree definition of the long side of the bounding box in directional detection, when the ship bounding box angle is α∈[0,90), the ship orientation O is +1. On the contrary, when the ship angle is α∈[-90,0), the ship orientation O is -1. The ship orientation determination principle is as follows:
[0024]
[0025] Step 6: Train the angle correction network. Use the ship orientation O in step 5 to train the orientation prediction branch of the angle correction network. And map the directed bounding box output by the angle correction network in step 4 to a horizontal bounding box through geometric relationships, with the parameters (x 1 ′,y 1 ′,x 2 ′,y 2 ′), where (x 1 ′,y 1 ′) and (x 2 ′,y 2 ′) respectively obtain the coordinates of the upper left endpoint and the lower right endpoint of the horizontal bounding box on the SAR image for the mapping, and calculate the loss with the horizontal bounding box annotation loaded in step 3, completing the branch training responsible for predicting the center coordinates and length and width of the ship bounding box.
[0026] The geometric mapping process is as follows:
[0027]
[0028] Where (x, y, w, h, α) is the oriented bounding box parameters after correction described in step 4.
[0029] Step 7: Train the detection head network. Pool features from the feature map using the directed bounding box output by the angle correction network described in step 4, and output a more refined directed bounding box after processing by the detection head network. The directed bounding box is converted into a horizontal bounding box through the geometric mapping process described in step 6, and the loss is calculated with the horizontal bounding box annotation loaded in step 4 to complete the detection head network training.
[0030] It also includes step eight: using the network trained in step seven to perform directed detection of ships, which can break through the limitation of insufficient SAR image directional ship annotation data on directed ship detection, reduce detection costs, improve detection accuracy, and solve related engineering problems.
[0031] Beneficial effects:
[0032] 1. The present invention discloses a method for improving the accuracy of weakly supervised directed ship detection in SAR images. The method adopts horizontal bounding box to annotate data and utilizes the morphological characteristics of ships in SAR images to collaboratively train a directed ship detection network in a weakly supervised manner. This method breaks through the limitation of insufficient SAR image directional ship annotation data on the directed ship detection method and reduces the detection cost.
[0033] 2. The present invention discloses a method for improving the accuracy of weakly supervised directional ship detection in SAR images. A ship orientation extraction mechanism is used to directly extract the orientation of the ship from the SAR image, which is used to coordinately train an angle correction network with the loaded horizontal bounding box annotations. The mechanism can extract the ship orientation without introducing other data, and then used for directed bounding box angle correction.
[0034] 3. The present invention discloses a method for improving the accuracy of weakly supervised directional ship detection in SAR images, which adopts an angle correction network to correct the angle of the ship bounding box to the correct range through the orientation predicted by the network. The network can correct the angle symmetry error caused by mapping the directed bounding box to a horizontal bounding box, thereby improving the network's detection accuracy of the ship angle. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Schematic diagram of the structure of a dual-stage ship detection network in an embodiment of the present invention;
[0036] Figure 2 Schematic diagram of the structure of the angle correction network in an embodiment of the present invention;
[0037] Figure 3 A schematic diagram of directional bounding box angle correction in an embodiment of the present invention;
[0038] Figure 4 A schematic diagram of mapping a directional bounding box to a horizontal bounding box used in an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The present invention will be described in detail below with reference to the accompanying drawings and embodiments. The technical problems solved by the technical solution of the present invention and the beneficial effects are also described. It should be noted that the described embodiments are only intended to facilitate the understanding of the present invention and do not have any limiting effect on it.
[0040] This embodiment discloses a method for improving the accuracy of weakly supervised directed ship detection in SAR images, and performs ship detection at a port. The specific implementation steps are as follows:
[0041] Step 1: This embodiment collects 10 images of the port acquired by SAR, each image has a size of 10240×10240 pixels, including four polarization modes: HH, VV, HV and VH, namely, horizontal transmission and horizontal reception, vertical transmission and vertical reception, horizontal transmission and vertical reception, and vertical transmission and horizontal reception. The SAR image is expanded according to the polarization channel to obtain 40 single-channel SAR images. Each SAR image is cropped into SAR image slices of 1024×1024 pixels in step size of 256 pixels. With the help of optical remote sensing images acquired at the same time and place, the ships in each SAR image slice are annotated with horizontal bounding boxes. The annotation format is the coordinates of the upper left end point and the lower right end point of the bounding box in the slice (x 1 ,y 1 ) and (x 2 ,y 2 ). Afterwards, in this embodiment, a training data set is constructed by SAR slices of 1024×1024 pixel size and corresponding horizontal bounding box annotations.
[0042] Step 2: Build Figure 1 The two-stage ship detection network shown in the figure includes, in the order of network forward propagation: a backbone network ResNet-50 network for feature extraction, a feature pyramid network for hierarchical prediction, a region proposal network for region proposal prediction, and a detection head network for outputting directed bounding boxes and ship discrimination results. The reserved position is where the angle correction network is inserted. Whether it is training the network or using the trained network for ship detection, the structure of the network does not change.
[0043] Step 3: Build Figure 2 The angle correction network shown in the figure contains a feature pooling layer, three independent branches and two fully connected layers shared by these branches. The three independent branches are responsible for predicting the center coordinates and size of the ship's oriented bounding box, the angle α of the ship's bounding box, and the p and the direction of the ship O p , the three independent branches are all composed of fully connected layers. The center coordinate is the position of the center of the bounding box in the input image, expressed as (x p ,y p ); the size of the bounding box is its width and height, expressed as (w p ,h p ). Insert the constructed angle correction network into the corresponding position of the ship detection network constructed in step 2 to complete the construction of the entire network structure.
[0044] Step 4: Load the SAR images and horizontal bounding box annotations in the ship detection training dataset constructed in step 1, and copy the single-channel SAR image twice to form a three-channel image to meet the input requirements of the ResNet-50 network. The SAR images in the dataset are sequentially passed through the backbone network, feature pyramid network, and region proposal network in step 2 to obtain the parameters (x 1p ,y 1p ,x 2p ,y 2p ) horizontal candidate box, where (x 1p ,y 1p ) and (x 2p ,y 2p ) are the position coordinates of the upper left end point and the lower right end point of the preliminary detected horizontal candidate box in the SAR image. The candidate box and the loaded horizontal bounding box are marked (x 1 ,y 1 ,x 2 ,y 2 ) Compute the loss to train the region proposal network.
[0045] Step 5: The SAR images in the training data set are forward propagated in the model built in step 3. The parameters of the angle correction network are as follows: (x 1p ,y 1p ,x 2p ,y 2p ) horizontal candidate box uses the feature pooling layer to extract features from the feature map. After the shared fully connected layer, the total output of the three prediction branches is (x p ,y p ,w p ,h p ,α p ,O p ), using the predicted ship heading O p Angle α p The specific process is as follows:
[0046] α t =|α p |
[0047] α=O p ×α t
[0048] Where α is the corrected ship bounding box angle, and the network output (x p ,y p ,w p ,h p ) are used as the output of the angle correction network, that is, the directed bounding box of the correct angle, expressed as (x, y, w, h, α), where x = x p, y=y p , h=h p , w=w p , respectively represent the horizontal coordinate, vertical coordinate, width and height of the corrected directional bounding box on the input SAR image. Figure 3 Demonstrates the oriented bounding box correction process.
[0049] Step 6: Extract a horizontal rectangular slice of the ship target with a size of m×n according to the loaded horizontal bounding box annotation, where m and n are the width and height of the horizontal bounding box annotation in step 1. Take s=min(m,n), where min() takes the minimum value operation, crop the slice to obtain a new slice with a side length of s, the new slice has the same center coordinates as the original slice, and the grayscale value matrix of the new slice is A.
[0050] The sum of the grayscale values of the main diagonal area S1 is obtained, which is expressed as follows:
[0051]
[0052] Among them A i,j is the gray value at position (i, j) in A.
[0053] The sum of the grayscale values of the sub-diagonal area S2 is obtained, which is expressed as follows:
[0054]
[0055] The extracted ship orientation is represented as O. According to the 90-degree definition of the long side of the bounding box in directional detection, when the angle of the ship bounding box is α∈[0,90), the ship orientation O is +1. On the contrary, when the ship angle is α∈[-90,0), the ship orientation O is -1. The ship orientation determination principle is as follows:
[0056]
[0057] Step 7: Use the ship orientation O in step 6 to train the orientation prediction branch of the angle correction network. At the same time, the directed bounding box in step 5 is mapped into a parameter (x 1 ′,y 1 ′,x 2 ′,y 2 ′), and calculate the loss with the horizontal bounding box annotation in the training data set loaded in step 4, complete the prediction branch of the center coordinates and length and width and the prediction branch of the angle, and the geometric mapping process is as follows Figure 4 As shown, it means as follows:
[0058]
[0059] Where (x, y, w, h, α) are the parameters of the oriented bounding box after correction in step 5.
[0060] Step 8: The detection head network extracts the rotation features from the feature map based on the corrected directed bounding box, and refines a more accurate directed bounding box based on this. The new directed bounding box is converted into a horizontal bounding box through the geometric mapping process described in step 7, and then compared with the horizontal bounding box annotation (x 1 ,y 1 ,x 2 ,y 2 ) performs loss calculation and completes the training of the detection head network.
[0061] Step 9: Repeat steps 4 to 7 to train the entire network, traverse all SAR images in the training data set 15 times with a batch size of 2 to complete the training of the entire network.
[0062] Step 10: Use SAR to collect an image of 10240×10240 pixels at the port, and divide the image into four images of 10240×10240 pixels according to the four polarization channels of HH, VV, HV and VH. Then, each SAR image is cropped into SAR image slices of 1024×1024 pixels with a step size of 256 pixels.
[0063] Each slice channel is copied twice to form a three-channel image and sent to the trained network, which passes through the backbone network, feature pyramid network, region proposal network and angle correction network in turn to obtain the output (x p ,y p ,w p ,h p ,α p ,O p ), which are the lateral coordinates, longitudinal coordinates, width, height, angle and orientation of the ship's oriented bounding box in the SAR image, and then use O according to the correction process in step 5. p Correction α p , obtain the corrected directed bounding box, which is then predicted by the detection head network at two levels, and then the final ship detection result is output, which includes the confidence score and directed bounding box of each ship.
[0064] The merged slices are the size before cropping, and the ship detection results are merged. The ship detection result with the highest confidence score is retained for the overlapping position. The detection results in the four polarization channel data are then merged. The ship detection result with the highest confidence score is retained for the overlapping position. This result is the ship detection result at the port at the time of SAR image acquisition.
[0065] This embodiment provides a method for improving the accuracy of weakly supervised directional ship detection in SAR images. It can train a directed ship detection network by using only low-cost horizontal bounding box annotation data, based on the geometric mapping relationship between the horizontal bounding box and the directed bounding box, and making full use of the gray value distribution of ship targets in the SAR image. The network can be used to perform ship detection on sea scenes such as ports, obtain directed bounding box detection results of ships, and improve the accuracy of weakly supervised directional ship detection in SAR images.
[0066] The specific description above further illustrates the purpose, technical solutions and beneficial effects of the invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for improving the accuracy of weakly supervised directed ship detection in SAR images, characterized by: The following steps are included: Step 1: Construct a CNN two-stage ship detection network model, which includes, in order of network forward propagation: a backbone network for feature extraction, a feature pyramid network for hierarchical prediction, a region proposal network for candidate box prediction, and a detection head network for outputting directed bounding boxes and ship identification results; Step 2: Build an angle correction network with three branches and embed it into the region proposal network in the model described in step 1; Step 3: Load the SAR ship dataset and horizontal bounding box annotations, and perform model training in the model built in steps 1 and 2; Step 4: Use the orientation output by the angle correction network to correct the angle of the oriented bounding box to the correct range; Step 5: extract the supervision information for training the orientation branch of the angle correction network; according to the horizontal bounding box annotation loaded in step 3, cut out the ship target slice from the SAR image, and cut it into a square slice with the short side as the side length, and determine the ship orientation according to the grayscale value of the two diagonal areas of the target slice; Step 6, training the angle correction network; using the ship orientation O in step 5 to train the orientation prediction branch of the angle correction network; and mapping the directed bounding box output by the angle correction network in step 4 to a horizontal bounding box through a geometric relationship, whose parameters are (x1′, y1′, x2′, y2′), where (x1′, y1′) and (x2′, y2′) are the coordinates of the upper left endpoint and the lower right endpoint of the horizontal bounding box obtained by the mapping on the SAR image, respectively, and the loss is calculated with the horizontal bounding box annotation loaded in step 3, completing the branch training responsible for predicting the center coordinates and length and width of the ship bounding box; The geometric mapping process is as follows: Where (x, y, w, h, α) is the oriented bounding box parameters after correction described in step 4; Step 7, training the detection head network; pooling features from the feature map according to the directed bounding box output by the angle correction network described in step 4, and outputting a more refined directed bounding box after processing by the detection head network; the directed bounding box obtains a horizontal bounding box through the geometric mapping process described in step 6, and the loss calculation is performed with the horizontal bounding box annotation loaded in step 4 to complete the detection head network training.
2. A method for improving the accuracy of weakly supervised directed ship detection in SAR images as claimed in claim 1, characterized in that: It also includes step eight, using the network trained in step seven to perform directed detection of ships, which can break through the limitation of insufficient SAR image directional ship annotation data on directed ship detection, reduce detection costs, improve detection accuracy, and solve related engineering problems.
3. A method for improving the accuracy of weakly supervised directed ship detection in SAR images as claimed in claim 1, characterized in that: The implementation method of step 2 is: The angle correction network includes a feature pooling layer, three independent branches, and two fully connected layers shared by these branches; The feature pooling layer is used to pool the required features from the feature graph output by the feature pyramid network in step 1. The pooled features are subjected to two shared fully connected layers for intra-feature interaction to enhance the representation capability of the features for the ship. The interactive features are processed by three independent branches, which are responsible for predicting the center coordinates and size of the directed bounding box of the ship, the angle α of the bounding box of the ship, and the relative position of the bounding box. p With the ship's orientation O p , the three independent branches are all composed of fully connected layers; the center coordinate is the position of the center of the bounding box in the input image, expressed as (x p ,y p ); the size of the bounding box is described by its width and height, expressed as (w p ,h p ).
4. A method for improving the accuracy of weakly supervised directed ship detection in SAR images as claimed in claim 3, characterized in that: The implementation method of step three is: The SAR ship dataset consists of square SAR images, including four polarization modes: horizontal transmission and horizontal reception, vertical transmission and vertical reception, horizontal transmission and vertical reception, and vertical transmission and horizontal reception; the horizontal bounding box marks the coordinates of the upper left corner endpoint and the lower right corner endpoint of the horizontal bounding box of each ship target in the SAR image, which are expressed as (x1, y1) and (x2, y2) respectively; the SAR images in the dataset are sequentially passed through the backbone network, feature pyramid network and region proposal network described in step 1, and the parameters are obtained as (x1, y1, y2, x2 ... 1p ,y 1p ,x 2p ,y 2p ) of the preliminary detected horizontal candidate box, where (x 1p ,y 1p ) and (x 2p ,y 2p ) are respectively the position coordinates of the upper left endpoint and the lower right endpoint of the horizontal candidate box in the SAR image; the region proposal network is trained by annotating the horizontal candidate box with the loaded horizontal bounding box and calculating the loss.
5. A method for improving the accuracy of weakly supervised directed ship detection in SAR images as claimed in claim 4, characterized in that: The implementation method of step 4 is: The SAR images in the dataset are forward propagated in the model built in step 2. The angle correction network uses the feature pooling layer to extract features from the feature map according to the horizontal candidate box described in step 3. After passing through the angle correction network described in step 2, its output is (x p ,y p ,w p ,h p ,α p ,O p ), using O p To α p The specific process is as follows: α t =|α p | α=O p ×α t where α t is α p The absolute value of α is the corrected ship bounding box angle; α and the other four parameters (x p ,y p ,w p ,h p ) are used as the output of the angle correction network to obtain five parameters (x, y, w, h, α) describing the corrected oriented bounding box, where x = x p , y=y p , w=w p , h=h p , respectively represent the horizontal coordinate, vertical coordinate, width and height of the corrected directional bounding box on the input SAR image.
6. A method for improving the accuracy of weakly supervised directed ship detection in SAR images as claimed in claim 5, characterized in that: The implementation method of step five is: Specifically, extract a horizontal rectangular slice of the ship target with a size of m×n according to the loaded horizontal bounding box annotation, where m and n are the width and height of the horizontal bounding box in the annotation loaded in step 3; take s=min(m,n), where min() takes the minimum value operation, crop the slice to obtain a new slice with a side length of s, the new slice has the same center coordinates as the original slice, and the grayscale value matrix of the new slice is A; The sum of the grayscale values of the main diagonal area S1 is obtained, which is expressed as follows: Among them A i,j is the gray value at position (i, j) in A; calculate the sum of the gray values of the sub-diagonal area S2, the formula is as follows: The extracted ship orientation is represented as O. According to the 90-degree definition of the long side of the bounding box in directional detection, when the ship bounding box angle is α∈[0,90), the ship orientation O is +1. On the contrary, when the ship angle is α∈[-90,0), the ship orientation O is -1. The ship orientation determination principle is as follows:
