Regression loss function calculation method and system for optimizing remote sensing directional small target detection

Through the optimized regression loss function calculation method, the dynamic constraint factor and RS_IoU calculation method are used to focus on the shape and scale characteristics of small targets in remote sensing images, which solves the problem of low small target detection accuracy in traditional methods and significantly improves the detection precision and accuracy.

CN118658076APending Publication Date: 2024-09-17HUBEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410844554.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

The traditional remote sensing directional small target detection method has the problem of low detection accuracy when dealing with small targets, especially the inaccurate positioning of the bounding box of small targets, and the existing loss function fails to effectively pay attention to the shape and scale characteristics of the target, resulting in It is difficult for the model to accurately learn and predict the bounding boxes of small objects.

Method used

An optimized regression loss function calculation method is designed. Multi-scale and diverse remote sensing image data sets are obtained through data preprocessing and data augmentation technology, dynamic constraint factors and target scale factors are calculated, and the RS_IoU calculation method is introduced to replace the traditional The IoU loss function focuses on the shape and scale characteristics of the target itself, thereby training high-precision model parameters.

Benefits of technology

It significantly improves the precision and accuracy of directional small target detection, enhances the network's ability to identify small targets, and improves the model's robustness and generalization capabilities, especially in the positioning of small targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118658076A
    Figure CN118658076A
Patent Text Reader

Abstract

The invention belongs to the field of remote sensing directional target detection, and discloses a regression loss function calculation method and system for optimizing remote sensing directional small target detection. And the sensitivity of the directional target detection model to the shape of the target in the remote sensing image is improved, so that the detection precision of the directional small target is improved. Compared with other methods for enhancing feature fusion and an attention mechanism, the method has the advantages that the precision of directional small target detection in the remote sensing image can be greatly improved under the conditions that the model parameter quantity is not increased and the model reasoning speed is not influenced, and the method has universality and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of remote sensing directional target detection, and in particular relates to a regression loss function calculation method and system for optimizing remote sensing directional small target detection. Background Art

[0002] Recently, deep learning-based oriented target detectors have shown convincing oriented target detection performance in remote sensing images. However, the presence of a large number of small oriented targets in remote sensing images has brought great challenges to this field. Since existing remote sensing target detection boxes usually only consider the geometric relationship between the true box and the predicted box, while ignoring the shape of the box itself, and there are a large number of bounding boxes with long and short sides in the field of remote sensing detection, the differences in the shapes and scales of the bounding boxes will lead to differences in their IoU values, especially when identifying small targets. This difference is more significant. The traditional oriented IoU loss function does not optimize the target characteristics in remote sensing images, resulting in low detection accuracy of oriented small targets. Therefore, constraining the regression loss of the oriented target detection model based on the shape and scale of the target itself and designing a bounding box regression method that focuses on the shape and scale of the target itself will help improve the training effect of remote sensing oriented target detection, especially for the positioning of small targets. Summary of the invention

[0003] In view of the problems existing in the prior art, the present invention provides a regression loss function calculation method and system for optimizing remote sensing directional small target detection.

[0004] The present invention is implemented as follows: a regression loss function calculation method for optimizing remote sensing directional small target detection, the method comprising:

[0005] Step 1, data preprocessing, is to preprocess the original remote sensing image dataset, use data augmentation technology to obtain a multi-scale and diversified remote sensing image dataset, and use the cross-validation method to divide it into a training set and a test set;

[0006] Step 2, small target ratio acquisition, its purpose is to obtain the ratio of the number of small targets in the data set;

[0007] Step 3, data input, its purpose is to input the data set divided in step 1 into the directional target detection network in batches;

[0008] Step 4, prediction result acquisition, its purpose is to obtain the prediction results of the oriented target detection network for the oriented bounding box A1(x1,y1), B(x2,y2), C1(x3,y3), D1(x4,y4), which represent the coordinates of the four corner points of the predicted bounding box respectively;

[0009] Step 5: Dynamic constraint factor calculation. The purpose is to calculate the dynamic constraint factor w based on the width and height of the current real bounding box and the small target ratio obtained in step 2. ratio ,h ratio , where w ratio ,h ratio are the long side constraint factor and the wide side constraint factor respectively;

[0010] Step 6, RS_IoU calculation, its purpose is to use the dynamic constraint factor w ratio ,h ratio Calculate the target scale factor d ratio , through d ratio By constraining the IoU, we obtain a bounding box IoU calculation method that focuses on the shape and scale of the target itself, and name it RS_IoU;

[0011] Step 7, regression loss replacement, its purpose is to replace the IoU loss calculation method in the original loss function with the bounding box RS_IoU that focuses on the shape and scale of the target itself, and obtain model parameters with high accuracy in directional small target detection after training.

[0012] Furthermore, the small target ratio is calculated in step 2, including: the required data set includes small, medium and large targets, and the small targets account for the majority; the target ratio definition standard of the data set is based on the object definition standard of the general data set COCO in the field of object detection, a small target refers to a target smaller than 32×32 pixels, a medium target refers to a target between 32×32 and 96×96 pixels, and a large target refers to a target larger than 96×96 pixels. The calculation method for obtaining the small target ratio is shown in the following formula:

[0013]

[0014]

[0015] Furthermore, in step 3, the data set is input into the directional target detection network in batches. The target detection network is a visual detection model with convolution as the main backbone, including feature extraction, multi-scale feature fusion, detection classification head and detection regression head. During the training process, the data set is trained in batches.

[0016] Furthermore, the prediction result of the target frame obtained by the directional target detection network in step 4 is represented by four corner points, namely A1 (x1, y1), B1 (x2, y2), C1 (x3, y3), and D1 (x4, y4). , characterized in that:

[0017] The remote sensing image batch data is first subjected to feature extraction through a backbone network mainly composed of convolutional modules;

[0018] Multi-scale feature fusion is performed through three feature layers with different resolutions to fuse the shallow and deep semantic features;

[0019] Output the prediction result of the target bounding box through the detection regression head

[0020] A1(x1,y1), B1(x2,y2), C1(x3,y3), D1(x4,y4).

[0021] Furthermore, the dynamic constraint factor calculation in step 5 obtains the long edge constraint factor w ratio and the broadside constraint factor h ratio The calculation formula is as follows:

[0022]

[0023] where w B ,h B is the width and height of the target's true bounding box, and ratio is the small target ratio obtained in step 2.

[0024] Further, the target scale factor d is calculated in step 6 ratio , d ratio The calculation formula is as follows:

[0025]

[0026] Among them, w radio ,h radio are the long side constraint factor and wide side constraint factor calculated in step 5, respectively, A Represents the x coordinates of the four corner points of the predicted bounding box (x1, x2, x3, x4), x B Represents the x-coordinates of the four corner points of the true bounding box (x′1, x′2, x′3, x′4), y A Represents the y coordinates of the four corner points of the predicted bounding box (y1, y2, y3, y4), B The y coordinates of the four corner points of the true bounding box (y′1, y′2, y′3, y′4), w and h are the width and height of the minimum enclosing rectangle between the predicted bounding box and the true editing box, respectively.

[0027] Furthermore, in step 6, the RS_IoU of the bounding box of the target shape and scale is focused on, and the calculation formula of RS_IoU is as follows:

[0028] RS_IoU=IoU-2×d ratio

[0029]

[0030] Where A and B represent the predicted bounding box and the true bounding box respectively. Intersection is to calculate the intersection of two oriented bounding boxes, Union is to calculate the joint area of ​​two oriented bounding boxes, and IoU represents the intersection of the predicted bounding box and the true bounding box. ratio The target scale factor calculated in step 6.

[0031] Furthermore, in step 7, the regression loss is replaced by replacing the IoU loss calculation method in the original regression loss function with the RS_IoU calculation method, which is characterized in that the regression loss of the bounding box is optimized to the RS_IoU loss that focuses on the shape and scale of the target itself without changing the classification loss calculation method of the target detection network. The optimized regression loss is shown in the following formula:

[0032] Loss reg =1-RS_IoU

[0033] Among them, Loss reg is the regression loss, and RS_IoU is the IoU of the shape and scale of the target itself calculated in step 6.

[0034] Another object of the present invention is to provide a regression loss function calculation system for optimizing remote sensing directional small target detection that implements the regression loss function calculation method for optimizing remote sensing directional small target detection, the system comprising:

[0035] The data preprocessing module is used to preprocess the original remote sensing image dataset, obtain a multi-scale and diversified remote sensing image dataset using data augmentation technology, and divide it into a training set and a test set using a cross-validation method;

[0036] A small target ratio acquisition module, connected to the data preprocessing module, is used to obtain the ratio of the number of small targets in the data set;

[0037] A data input module is connected to the data preprocessing module and is used to input the data sets divided by the data preprocessing module into the directional target detection network in batches;

[0038] The prediction result acquisition module is connected to the data input module to obtain the prediction results A1(x1, y1), B1(x2, y2), C1(x3, y3), and D1(x4, y4) of the oriented target detection network for the oriented bounding box, which respectively represent the coordinates of the four corner points of the predicted bounding box;

[0039] The dynamic constraint factor calculation module is connected to the small target ratio acquisition module to calculate the dynamic constraint factor w according to the width and height of the current real bounding box and the small target ratio ratio obtained by the small target ratio acquisition module. ratio ,h ratio , where wratio ,h ratio They are the long side constraint factor and the wide side constraint factor respectively;

[0040] The RS_IoU calculation module is connected to the dynamic constraint factor calculation module, through the dynamic constraint factor w ratio ,h ratio Calculate the target scale factor d ratio , through d ratio By constraining the IoU, we obtain a bounding box IoU calculation method that focuses on the shape and scale of the target itself, and name it RS_IoU;

[0041] The regression loss replacement module is connected to the RS_IoU calculation module. By replacing the IoU loss calculation method in the original loss function with the bounding box RS_IoU that focuses on the shape and scale of the target itself, the model parameters with high accuracy in detecting directional small targets are obtained after training.

[0042] Another object of the present invention is to provide a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the regression loss function calculation method for optimizing remote sensing directional small target detection.

[0043] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0044] First, during the training of the remote sensing directional target detection network, the IoU is dynamically adjusted according to the shape and size of the target, which enhances the network's ability to recognize small targets. This method can enhance the robustness of parameter learning without increasing the number of network parameters. The present invention only slightly increases the computational complexity during the training phase, and does not increase the processing time when inferring model parameters, while greatly improving the detection accuracy of small targets.

[0045] The present invention constrains the regression loss of the directional target detection model according to the shape and scale of the target itself, and designs a bounding box regression method that focuses on the shape and scale of the target itself, which helps to improve the training effect of remote sensing directional target detection, especially for the positioning of small targets.

[0046] Second, the present invention solves the technical problems existing in the prior art in remote sensing directional small target detection, mainly including the following aspects:

[0047] 1) Small target detection accuracy problem: Traditional remote sensing directional small target detection methods have low accuracy when dealing with small targets, especially the problem of inaccurate bounding box positioning of small targets.

[0048] 2) Insufficient dataset problem: The datasets used by traditional methods lack diversity and quantity, and cannot fully cover remote sensing image data of different scales and diversity, resulting in poor model generalization ability.

[0049] 3) Improper loss function design: The loss function used in traditional methods lacks attention to the shape and scale characteristics of small objects, making it difficult for the model to accurately learn and predict the bounding box of small objects.

[0050] The significant technical advances of the present invention are mainly reflected in the following aspects:

[0051] 1) Application of data preprocessing and data augmentation techniques: Data preprocessing and data augmentation techniques are used to obtain multi-scale and diverse remote sensing image datasets, which improves the model's ability to detect targets of different scales and diversity.

[0052] 2) Calculation of dynamic constraint factors: Dynamic constraint factors are introduced to calculate the constraint factors according to the actual scale and shape of the target, which more accurately constrains the position and scale of the bounding box.

[0053] 3) Introduction of RS_IoU calculation method: Through the RS_IoU calculation method, the IoU is constrained in combination with the dynamic constraint factor, which better reflects the shape and scale characteristics of the target and improves the accuracy of bounding box prediction.

[0054] 4) Improvement of loss function: By replacing the original IoU loss calculation method with RS_IoU, the loss function can better focus on the shape and scale characteristics of the target, so that the trained model parameters have higher directional small target detection accuracy.

[0055] In summary, the present invention solves the technical problems existing in the traditional method by optimizing the regression loss function calculation method of remote sensing directional small target detection, significantly improves the precision and accuracy of directional small target detection, and has important technical progress significance. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 is a calculation flow chart of the regression loss function provided by an embodiment of the present invention;

[0057] Figure 2 is a visual comparison diagram of the detection results provided by an embodiment of the present invention;

[0058] Figure 3 It is a structural diagram of a regression loss function calculation system for optimizing remote sensing directional small target detection provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0060] The following are two specific embodiments of the present invention:

[0061] Example 1: Building detection in aerial images

[0062] 1) Data preprocessing: First, the aerial image data is preprocessed, including cropping, rotation, scaling and other operations, to obtain multi-scale and diverse building targets.

[0063] 2) Small target ratio acquisition: Count the number of building targets in the data set and calculate their ratio in the entire data set.

[0064] 3) Data input: The preprocessed dataset is input into the directional building detection network in batches for model training and testing.

[0065] 4) Obtaining prediction results: The directional building detection network predicts the bounding box of the building and obtains the coordinates of the four corner points of the predicted bounding box.

[0066] 5) Dynamic constraint factor calculation: According to the width and height of the predicted bounding box and the small object ratio, the dynamic constraint factors are calculated, including the long side constraint factor and the wide side constraint factor.

[0067] 6) RS_IoU calculation: The target scale factor is calculated through the dynamic constraint factor, and the RS_IoU calculation method is applied to constrain the IoU to obtain the bounding box IoU that focuses on the shape and scale of the building itself.

[0068] 7) Regression loss replacement: RS_IoU replaces the original IoU loss calculation method and trains the model parameters with high accuracy for directional building detection.

[0069] Example 2: Crop Detection in Farmland

[0070] 1) Data preprocessing: Preprocess farmland remote sensing images, including operations such as object segmentation and contrast enhancement, to obtain multi-scale and diversified crop targets.

[0071] 2) Small target ratio acquisition: Count the number of crop targets in the data set and calculate their ratio in the entire data set.

[0072] 3) Data input: The preprocessed dataset is input into the directional crop detection network in batches for model training and testing.

[0073] 4) Obtaining prediction results: The directional crop detection network predicts the bounding box of the crop and obtains the coordinates of the four corner points of the predicted bounding box.

[0074] 5) Dynamic constraint factor calculation: According to the width and height of the predicted bounding box and the small object ratio, the dynamic constraint factors are calculated, including the long side constraint factor and the wide side constraint factor.

[0075] 6) RS_IoU calculation: The target scale factor is calculated through the dynamic constraint factor, and the RS_IoU calculation method is applied to constrain the IoU to obtain the bounding box IoU that focuses on the shape and scale of the crop itself.

[0076] 7) Regression loss replacement: RS_IoU is used to replace the original IoU loss calculation method, and the model parameters with high directional crop detection accuracy are trained.

[0077] like Figure 1 As shown, the present invention provides a technical solution for calculating a regression loss function for optimizing remote sensing directional small target detection: a method for calculating a regression loss function for optimizing remote sensing directional small target detection, comprising the following steps:

[0078] Step 1, data preprocessing, aims to preprocess the original remote sensing image dataset, use data augmentation technology to obtain a multi-scale and diversified remote sensing image dataset, and use the cross-validation method to divide it into two parts: a training set and a test set.

[0079] Step 2, small target ratio acquisition, aims to obtain the ratio of the number of small targets in the data set.

[0080] Step 3, data input, is to input the data set divided in step 1 into the directional target detection network in batches.

[0081] Step 4, prediction result acquisition, its purpose is to obtain the prediction results of the oriented target detection network for the oriented bounding box A1(x1,y1), B(x2,y2), C1(x3,y3), D1(x4,y4), which represent the coordinates of the four corner points of the predicted bounding box respectively.

[0082] Step 5: Dynamic constraint factor calculation. The purpose is to calculate the dynamic constraint factor w based on the width and height of the current real bounding box and the small target ratio obtained in step 2. ratio ,h ratio , where w ratio ,h ratio They are the long side constraint factor and the wide side constraint factor respectively.

[0083] Step 6, RS_IoU calculation, its purpose is to use the dynamic constraint factor w ratio ,h ratioCalculate the target scale factor d ratio , through d ratio By constraining the IoU, we obtain a bounding box IoU calculation method that focuses on the shape and scale of the target itself, and name it RS_IoU.

[0084] Step 7, regression loss replacement, its purpose is to replace the IoU loss calculation method in the original loss function with the bounding box RS_IoU that focuses on the shape and scale of the target itself, and obtain model parameters with high accuracy in directional small target detection after training.

[0085] In this embodiment, further, the small target ratio is calculated in step 2, which is characterized by including: the required data set includes small, medium and large targets, and the small target ratio is the majority. The target ratio definition standard of the data set is based on the object definition standard of the general data set COCO in the field of object detection. Small targets refer to those with less than 32×32 pixels, medium targets refer to those with 32×32-96×96 pixels, and large targets refer to those with more than 96×96 pixels. The calculation method for obtaining the small target ratio is shown in the following formula:

[0086]

[0087]

[0088] Where N is the total number of targets in the data set, k is the current target, and P k Represents the pixel value of the current object, small represents the number of small objects in the data set, medium represents the number of medium objects, and large represents the number of large objects.

[0089] Furthermore, in step 3, the data set is input into the directional target detection network in batches, characterized in that: the target detection network is a visual detection model with convolution as the main backbone, including feature extraction, multi-scale feature fusion, detection classification head and detection regression head. During the training process, the data set is trained in batches.

[0090] Furthermore, the prediction result of the target box obtained by the directional target detection network in step 4 is represented by four corner points, namely A1 (x1, y1), B1 (x2, y2), C1 (x3, y3), and D1 (x4, y4), which are characterized by:

[0091] The remote sensing image batch data is first subjected to feature extraction through a backbone network mainly composed of convolutional modules;

[0092] Multi-scale feature fusion is performed through three feature layers with different resolutions to fuse the shallow and deep semantic features;

[0093] The detection regression head outputs the prediction results of the target bounding box A1(x1, y1), B1(x2, y2), C1(x3, y3), D1(x4, y4).

[0094] Furthermore, the dynamic constraint factor calculation in step 5 is characterized in that: the obtained long edge constraint factor w ratio and the broadside constraint factor h ratio The calculation formula is as follows:

[0095]

[0096] where w B ,h B is the width and height of the target's true bounding box, and ratio is the small target ratio obtained in step 2.

[0097] Furthermore, in step 6, the target scaling factor d is calculated ratio , characterized in that: d ratio The calculation formula is as follows:

[0098]

[0099] Among them, w radio ,h radio are the long side constraint factor and wide side constraint factor calculated in step 5, respectively, A Represents the x coordinates of the four corner points of the predicted bounding box (x1, x2, x3, x4), x B Represents the x coordinates of the four corner points of the real bounding box (x'1, x'2, x'3, x'4), y A Represents the y coordinates of the four corner points of the predicted bounding box (y1, y2, y3, y4), B Represents the y coordinates of the four corner points of the true bounding box (y'1, y'2, y'3, y'4), w and h are the width and height of the minimum enclosing rectangle between the predicted bounding box and the true editing box, respectively.

[0100] Furthermore, in step 6, the RS_IoU of the bounding box of the target shape and scale is focused on, and the calculation formula of RS_IoU is as follows:

[0101] RS_IoU=IoU-2×d ratio

[0102]

[0103] Where A and B represent the predicted bounding box and the true bounding box respectively. Intersection is to calculate the intersection of two oriented bounding boxes, Union is to calculate the joint area of ​​two oriented bounding boxes, and IoU represents the intersection of the predicted bounding box and the true bounding box.ratio The target scale factor calculated in step 6.

[0104] Furthermore, the regression loss replacement in step 7 is characterized in that: the RS_IoU calculation method replaces the IoU loss calculation method in the original regression loss function, and is characterized in that, on the basis of not changing the classification loss calculation method of the target detection network, the regression loss of the bounding box is optimized to the RS_IoU loss that focuses on the shape and scale of the target itself. The optimized regression loss is shown in the following formula:

[0105] Loss reg =1-RS_IoU

[0106] Among them, Loss reg is the regression loss, and RS_IoU is the IoU of the shape and scale of the target itself calculated in step 6.

[0107] The experimental verification was completed on a Linux server, and the server operating system used was Ubuntu 22.04.2. In terms of hardware environment, the CPU is Intel Core i7-12700KF, and the GPU is NVIDIA GeForce RTX 3090 (24GB); in terms of software environment, the Python version is 3.9.13, the CUDA version is 11.7, and it is implemented based on the PyTorch 2.0.0 deep learning framework.

[0108] Figure 2 This is a comparison chart after the present invention optimizes the regression loss function of the YOLOv8 target detection model on the DOTAv1.0 dataset.

[0109] like Figure 3 As shown, an embodiment of the present invention provides a regression loss function calculation system for optimizing remote sensing directional small target detection that implements the regression loss function calculation method for optimizing remote sensing directional small target detection, and the system includes:

[0110] The data preprocessing module is used to preprocess the original remote sensing image dataset, obtain a multi-scale and diversified remote sensing image dataset using data augmentation technology, and divide it into a training set and a test set using a cross-validation method;

[0111] A small target ratio acquisition module, connected to the data preprocessing module, is used to obtain the ratio of the number of small targets in the data set;

[0112] A data input module is connected to the data preprocessing module and is used to input the data sets divided by the data preprocessing module into the directional target detection network in batches;

[0113] The prediction result acquisition module is connected to the data input module to obtain the prediction results A1(x1, y1), B1(x2, y2), C1(x3, y3), and D1(x4, y4) of the oriented target detection network for the oriented bounding box, which respectively represent the coordinates of the four corner points of the predicted bounding box;

[0114] The dynamic constraint factor calculation module is connected to the small target ratio acquisition module to calculate the dynamic constraint factor w according to the width and height of the current real bounding box and the small target ratio ratio obtained by the small target ratio acquisition module. ratio ,h ratio , where w ratio ,h ratio are the long side constraint factor and the wide side constraint factor respectively;

[0115] The RS_IoU calculation module is connected to the dynamic constraint factor calculation module, through the dynamic constraint factor w ratio ,h ratio Calculate the target scale factor d ratio , through d ratio By constraining the IoU, we obtain a bounding box IoU calculation method that focuses on the shape and scale of the target itself, and name it RS_IoU;

[0116] The regression loss replacement module is connected to the RS_IoU calculation module. By replacing the IoU loss calculation method in the original loss function with the bounding box RS_IoU that focuses on the shape and scale of the target itself, the model parameters with high accuracy in detecting directional small targets are obtained after training.

[0117] An embodiment of the present invention provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the regression loss function calculation method for optimizing remote sensing directional small target detection.

[0118] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0119] Table 1. The impact of adding RS_IOU loss function on the experimental results on the DOTAv1.0 dataset

[0120] method mAP / % Model parameters / M Detection speed / ms Baseline Network 78.05 3.21 5.44 Baseline Network + RS_IoU 80.25(+2.20) 3.21 5.44

[0121] As shown in Table 1, the baseline network selected is YOLOv8-n. After replacing the positioning loss of the baseline network with RS_IoU loss, the accuracy of the model is improved by 2.2. At the same time, the number of parameters and inference speed of the model have not changed, which shows the effectiveness of RS_IoU loss.

[0122] Table 2. Comparison of mAP of different directional object detectors on the DOTAv1.0 dataset

[0123]

[0124] As shown in Table 2, it is not feasible to make a fair comparison due to the different image resolutions, network architectures, training strategies, and multiple technologies used by the detectors. In terms of small target detection performance, the optimized directional detection network shows the best detection accuracy for small targets such as small vehicles (SV) and ships (SH). In terms of overall performance, the mean average precision (mAP) of the optimized directional detection network reached 80.25%, showing the best detection effect.

[0125] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A method for calculating a regression loss function for optimizing remote sensing directional small target detection, characterized in that: The method includes: Step 1, data preprocessing, is to preprocess the original remote sensing image dataset, use data augmentation technology to obtain a multi-scale and diversified remote sensing image dataset, and use the cross-validation method to divide it into a training set and a test set; Step 2, small target ratio acquisition, its purpose is to obtain the ratio of the number of small targets in the data set; Step 3, data input, its purpose is to input the data set divided in step 1 into the directional target detection network in batches; Step 4, prediction result acquisition, the purpose of which is to obtain the prediction results A1(x1, y1), B1(x2, y2), C1(x3, y3), D1(x4, y4) of the oriented target detection network for the oriented bounding box, which respectively represent the coordinates of the four corner points of the predicted bounding box; Step 5: Dynamic constraint factor calculation. The purpose is to calculate the dynamic constraint factor w based on the width and height of the current real bounding box and the small target ratio obtained in step 2. ratio ,h ratio , where w ratio ,h ratio They are the long side constraint factor and the wide side constraint factor respectively; Step 6, RS_IoU calculation, its purpose is to use the dynamic constraint factor w ratio ,h ratio Calculate the target scale factor d ratio , through d ratio By constraining the IoU, we obtain a bounding box IoU calculation method that focuses on the shape and scale of the target itself, and name it RS_IoU; Step 7, regression loss replacement, its purpose is to replace the IoU loss calculation method in the original loss function with the bounding box RS_IoU that focuses on the shape and scale of the target itself, and obtain model parameters with high accuracy in directional small target detection after training.

2. The method for calculating the regression loss function for optimizing remote sensing directional small target detection according to claim 1, characterized in that: The calculation of the small target ratio in step 2 includes: the required data set includes small, medium and large targets, and the small targets account for the majority; the target ratio definition standard of the data set is based on the object definition standard of the general data set COCO in the field of object detection. Small targets refer to targets smaller than 32×32 pixels, medium targets refer to targets between 32×32 and 96×96 pixels, and large targets refer to targets larger than 96×96 pixels. The calculation method for obtaining the small target ratio is shown in the following formula:

3. The method for calculating the regression loss function for optimizing remote sensing directional small target detection according to claim 1, characterized in that: In step 3, the data set is input into the directional target detection network in batches. The target detection network is a visual detection model with convolution as the main backbone, including feature extraction, multi-scale feature fusion, detection classification head and detection regression head. During the training process, the data set is trained in batches.

4. The method for calculating the regression loss function for optimizing remote sensing directional small target detection according to claim 1, characterized in that: The prediction result of the target frame obtained by the directional target detection network in step 4 is represented by four corner points, namely A1 (x1, y1), B1 (x2, y2), C1 (x3, y3), and D1 (x4, y4), which is characterized by: The remote sensing image batch data is first subjected to feature extraction through a backbone network mainly composed of convolutional modules; Multi-scale feature fusion is performed through three feature layers with different resolutions to fuse the shallow and deep semantic features; Output the prediction result of the target bounding box through the detection regression head A1(x1,y1), B1(x2,y2), C1(x3,y3), D1(x4,y4).

5. The method for calculating the regression loss function for optimizing remote sensing directional small target detection according to claim 1, characterized in that: The dynamic constraint factor calculation in step 5 obtains the long edge constraint factor w ratio and the broadside constraint factor h ratio The calculation formula is as follows: where w B ,h B is the width and height of the target's true bounding box, and ratio is the small target ratio obtained in step 2.

6. The method for calculating the regression loss function for optimizing remote sensing directional small target detection according to claim 1, characterized in that: The target scale factor d is calculated in step 6 ratio , d ratio The calculation formula is as follows: Among them, w radio ,h radio are the long side constraint factor and wide side constraint factor calculated in step 5, respectively, A Represents the x coordinates of the four corner points of the predicted bounding box (x1, x2, x3, x4), x B Represents the x coordinates of the four corner points of the real bounding box (x'1, x'2, x'3, x'4), y A Represents the y coordinates of the four corner points of the predicted bounding box (y1, y2, y3, y4), B Represents the y coordinates of the four corner points of the true bounding box (y'1, y'2, y'3, y'4), w and h are the width and height of the minimum enclosing rectangle between the predicted bounding box and the true editing box, respectively.

7. The method for calculating the regression loss function for optimizing remote sensing directional small target detection according to claim 1, characterized in that: In step 6, the RS_IoU of the bounding box of the target's shape and scale is considered, and the calculation formula of RS_IoU is as follows: RS_IoU=IoU-2×d ratio Where A and B represent the predicted bounding box and the true bounding box respectively. Intersection is to calculate the intersection of two oriented bounding boxes, Union is to calculate the joint area of ​​two oriented bounding boxes, and IoU represents the intersection of the predicted bounding box and the true bounding box. ratio The target scale factor calculated in step 6.

8. The method for calculating the regression loss function for optimizing remote sensing directional small target detection according to claim 1, characterized in that: In step 7, the regression loss is replaced by replacing the IoU loss calculation method in the original regression loss function with the RS_IoU calculation method. The method is characterized in that the regression loss of the bounding box is optimized to the RS_IoU loss that focuses on the shape and scale of the target itself without changing the classification loss calculation method of the target detection network. The optimized regression loss is shown in the following formula: Loss reg =1-RS_IoU Among them, Loss reg is the regression loss, and RS_IoU is the IoU of the shape and scale of the target itself calculated in step 6.

9. A system for calculating the regression loss function for optimizing remote sensing directional small target detection, which implements the method for calculating the regression loss function for optimizing remote sensing directional small target detection as claimed in any one of claims 1 to 8, characterized in that: The system includes: The data preprocessing module is used to preprocess the original remote sensing image dataset, obtain a multi-scale and diversified remote sensing image dataset using data augmentation technology, and divide it into a training set and a test set using a cross-validation method; A small target ratio acquisition module is connected to the data preprocessing module to obtain the ratio of the number of small targets in the data set; A data input module is connected to the data preprocessing module and is used to input the data sets divided by the data preprocessing module into the directional target detection network in batches; The prediction result acquisition module is connected to the data input module to obtain the prediction results of the directional target detection network for the directional bounding box, A1(x1,y1), B1(x2,y2), C1(x3,y3), and D1(x4,y4), which respectively represent the coordinates of the four corner points of the predicted bounding box; The dynamic constraint factor calculation module is connected to the small target ratio acquisition module to calculate the dynamic constraint factor w according to the width and height of the current real bounding box and the small target ratio ratio obtained by the small target ratio acquisition module. ratio ,h ratio , where w ratio ,h ratio They are the long side constraint factor and the wide side constraint factor respectively; The RS_IoU calculation module is connected to the dynamic constraint factor calculation module, through the dynamic constraint factor w ratio ,h ratio Calculate the target scale factor d ratio , through d ratio By constraining the IoU, we obtain a bounding box IoU calculation method that focuses on the shape and scale of the target itself, and name it RS_IoU; The regression loss replacement module is connected to the RS_IoU calculation module. By replacing the IoU loss calculation method in the original loss function with the bounding box RS_IoU that focuses on the shape and scale of the target itself, the model parameters with high accuracy in detecting directional small targets are obtained after training.

10. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the regression loss function calculation method for optimizing remote sensing directional small target detection as described in any one of claims 1-8.