A fast detection method for remote sensing target quadrilateral based on deep learning

Through the improved YOLOX model and quadrilateral box labeling technology, the problem of insufficient real-time and object orientation accuracy in remote sensing image object detection is solved, and the rapid and accurate detection of remote sensing targets is achieved, which is suitable for application scenarios with high real-time requirements.

CN114299011BActive Publication Date: 2025-08-29HANGZHOU DIANZI UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111617324.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-08-29
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The existing remote sensing image object detection algorithm based on deep learning has shortcomings in real-time and object orientation accuracy, especially in tasks such as military reconnaissance and disaster monitoring, and it is difficult to meet the speed requirements and the outline of irregular objects cannot be accurately described.

Method used

The rapid detection method of remote sensing target quadrilateral box improved based on the YOLOX model is adopted. Through quadrilateral box annotation, data enhancement, feature fusion and affine matrix regression, the precise description of the object contour is achieved, and the training process is optimized by SimOTA strategy to improve detection speed and accuracy.

Benefits of technology

It realizes fast and accurate detection of remote sensing targets, can describe object profiles in real time, improves detection speed and accuracy, and is suitable for application scenarios with high real-time requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114299011B_ABST
    Figure CN114299011B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for rapid detection of remote sensing target quadrilateral boxes based on deep learning. The method has accurate prediction results, performs quadrilateral box regression on the target, and accurately describes the target outline. For image feature extraction, a deep neural network that integrates multi-layer features is used, which is beneficial for target detection in remote sensing scenes with many small targets. The training process is optimized, and the SimOTA strategy is adopted in the process of allocating positive and negative samples, which improves the model's balanced prediction ability for targets of different sizes. The results are threshold filtered to screen out interfering targets and improve recognition accuracy. The detection speed is fast, reaching the level of real-time detection, and has practical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a method for rapid detection of quadrilateral frames of remote sensing targets based on deep learning. Background Art

[0002] Remote sensing refers to non-contact, long-distance detection technology. It is a science and technology that acquires information about an object without making contact with it and analyzes it to obtain relevant information. Because remote sensing can provide large-scale, dynamic observations, unrestricted by geographic location, weather, or human factors, and continuously provides a variety of ground-based information at different spatial and temporal scales, it is widely used in resource exploration, surveying and mapping, military command, environmental monitoring, urban planning, and other fields, playing a vital role. For example, the use of remote sensing imagery for urban planning, weather monitoring and forecasting, and natural disaster assessment has become an integral part of our daily lives.

[0003] Object detection in high-resolution optical remote sensing images (Aerial Images) is a key technology for analyzing massive amounts of remote sensing image data, with important applications in military and civilian fields such as search and rescue, reconnaissance, national land planning, and geological disaster monitoring. This technology is particularly urgent for accurately mapping cities in two or three dimensions, detecting damage caused by natural disasters (such as earthquakes, tsunamis, floods, and fires), and detecting target changes. In recent years, deep learning-based object detection algorithms have made breakthrough progress in natural image recognition tasks. However, due to the unique perspective of remote sensing imaging, the direct application of deep learning technology to remote sensing image object detection faces the severe challenge of variable target orientation.

[0004] Early algorithms based on handcrafted features were gradually replaced by deep learning-based methods due to their complex feature design and poor performance. However, existing deep learning-based object detection algorithms for remote sensing images often use multi-stage algorithms, which are relatively slow and still have significant drawbacks for applications with high real-time requirements, such as military reconnaissance and weapon guidance. Based on the form of the detection frame, existing remote sensing target detection can be roughly divided into horizontal detection and rotation detection. Rotational detection is more accurate in locating the object's orientation than horizontal detection, but the regressed frame still cannot accurately describe the object's contour when used for irregular objects.

[0005] With the development of space technology, especially the development and mutual penetration of geographic information system and global positioning system technology, remote sensing target detection has received increasing attention, technical means have been significantly developed, and applications have become more extensive. Correspondingly, the following issues have become increasingly prominent:

[0006] (1) Some remote sensing target detection tasks have high real-time requirements. Applications such as military reconnaissance and disaster monitoring have high requirements for detection speed. Existing remote sensing image target detection algorithms cannot meet the requirements of these tasks.

[0007] (2) Remote sensing image target detection requires high object orientation accuracy. Existing remote sensing image target detection algorithms based on deep learning mostly detect horizontal boxes or rotated rectangular boxes of objects, which cannot accurately describe the outline of objects. Summary of the Invention

[0008] In order to meet the real-time accuracy requirements of remote sensing target detection and achieve fast and accurate regression of the object's orientation, the present invention proposes a remote sensing target quadrilateral fast detection method based on deep learning.

[0009] In order to achieve this object, the technical solution of the present invention includes the following steps:

[0010] Step 1: Collect satellite remote sensing images, mark the object categories to be detected with quadrilateral boxes, and establish a satellite remote sensing image target detection dataset.

[0011] Step 2: Use the satellite remote sensing image target detection dataset to train the designed remote sensing target quadrilateral box fast detection model.

[0012] Step 3: Deploy the model to the corresponding equipment and perform real-time detection on the collected satellite remote sensing images.

[0013] In step 1 above, a satellite remote sensing image target detection dataset is established. The specific implementation steps are as follows:

[0014] 1-1. Data Collection: First, collect satellite remote sensing images containing the objects to be predicted, and make the number of types of objects to be predicted in the collected images as balanced as possible.

[0015] 1-2. Data labeling: Use rolabelImg to manually label the collected images with quadrilateral boxes to mark the objects you want to predict.

[0016] 1-3. Data preprocessing: Cut the labeled large-pixel high-resolution images into 640x640 images that can be input into the model, and adjust the annotation files accordingly.

[0017] 1-4. Dataset Division and Data Storage: Save the annotated data to a .txt file. Key information saved includes the coordinates of the four clockwise endpoints of the bounding box (x1, y1), (x2, y2), (x3, y3), (x4, y4) and the target category ID. Split the training set into a test set and a training set at a ratio of 1:9, and save the absolute addresses of all images, line by line, to separate .txt files. The test set serves as the validation set.

[0018] In step 2, the satellite remote sensing image target detection dataset is used to train the remote sensing target quadrilateral fast detection model. Multiple rounds of training are required. The number of training times is set according to the actual situation. The specific implementation is as follows:

[0019] The remote sensing target quadrilateral fast detection model is improved based on the YOLOX model;

[0020] 2-1. Data loading, data enhancement (Pipeline). The annotations loaded during the data loading process are the coordinates of the four endpoints of the target box arranged clockwise and the target category ID. If you want to ensure that the trained model has sufficient generalization, you need to ensure that there is enough data for training. When there is only limited data or in order to achieve better generalization, you need to perform data enhancement on the limited data. The data enhancement methods include random affine transformation, color jittering, contrast transformation, noise perturbation, and Mosaic data enhancement. When the data for each round of training is loaded, the loaded images will be shuffled, and then the above-mentioned data enhancement will be performed, and then input into the model for training. The data enhancement parameters used in each round of training are different.

[0021] 2-2. Network Backbone. The remote sensing target quadrilateral fast detection model uses CSP-darknet as the backbone to extract features. The training set data first passes through the Focus module, which is downsampled by segmentation to obtain the original Figure 2 The input is one-tenth the size of the original image, and then passes through multiple CBS, CSP, and SPP modules to complete the feature extraction.

[0022] 2-3. Feature Fusion (Neck). The remote sensing target quadrilateral bounding box rapid detection model uses the same FPN structure as YOLOX for feature fusion. FPN transfers and fuses high-level feature information from top to bottom through upsampling, generating feature maps with three channel sizes of 20x20, 40x40, and 80x80 for subsequent target prediction.

[0023] 2-4. Network Output (Head). The remote sensing target quadrilateral fast detection model outputs prediction tensors of sizes HxHxC, HxHx1, and HxHx4 in each channel through a decoupling method, representing the target category, target foreground and background prediction, and target horizontal box representation, respectively. HxH represents the feature map size, with values ​​of 20x20, 40x40, and 80x80, respectively, and C represents the type of object. The four parameters of the target horizontal box representation represent the center point and length and width of the box relative to the anchor box, respectively. Ultimately, 8400 predicted targets are obtained. The improved remote sensing target quadrilateral fast detection model outputs the target box parameters as the six parameters of the affine matrix of the target box relative to the anchor box: a, b, c, d, e, f. The four point coordinates obtained by matrix multiplication with the four vertex coordinates of the corresponding anchor box are the four vertex coordinates of the quadrilateral box.

[0024] 2-5. Positive and negative sample allocation. The remote sensing target quadrilateral rapid detection model first performs an initial screening based on the relative coordinate positions of the anchor center point and the target box, and then uses YOLOX's SimOTA strategy to allocate positive and negative samples.

[0025] First, for each anchor box, find all target boxes whose center points fall within the anchor box. Then, for each target box, set a square with a side length of 4 based on the target box center point and select all anchor boxes within the square. Anchor box and target box pairs that meet both of these conditions are considered the initial screening results. Based on the initial screening results, extract the network-predicted candidate detection box positions, foreground and background object scores, and category scores. The loss function is then calculated based on the target box. For each target box, select the 10 candidate boxes with the largest IOU. Finally, assign a prediction box to each target box based on the principle of minimizing the total loss.

[0026] 2-6. Loss Function. The loss function of the remote sensing target quadrilateral fast detection model consists of three parts: foreground-background loss, classification loss, and box regression loss. The foreground-background loss and classification loss use cross-entropy loss, and the box regression loss uses L1 loss of affine matrix parameters.

[0027] The cross entropy loss calculation formula is as follows:

[0028]

[0029] The meanings of the parameters are as follows:

[0030] M: the number of categories;

[0031] y ic : Sign function (0 or 1), if the true category of sample i is equal to c, it takes 1, otherwise it takes 0;

[0032] p ic: The predicted probability that the observed sample i belongs to category c;

[0033] The L1 loss calculation formula for affine parameters is as follows:

[0034]

[0035] The parameters are defined as follows:

[0036] N: total number of target boxes;

[0037] M i : The total number of prediction boxes assigned to the i-th target box;

[0038] x ij : Six parameters of the j-th prediction box of target box i;

[0039] Six parameters of target box i;

[0040] The total loss is calculated as follows:

[0041] Loss = λ obj Loss obj +λ cls Loss cls +λ box Loss box

[0042] The parameters are defined as follows:

[0043] Loss obj : Foreground background loss;

[0044] λ obj : foreground background loss weight;

[0045] Loss cls : classification loss;

[0046] λ cls : classification loss weight;

[0047] λ box : box regression loss weight;

[0048] 2-7. Model Validation. After each round of model training, the images in the validation set are tested to verify the model training effect.

[0049] After the set number of training rounds, select the model weights with the best verification results as the parameters for subsequent deployment.

[0050] In step 3, the model is deployed on the corresponding device to perform real-time detection on the collected satellite remote sensing images, which is achieved as follows:

[0051] 3-1. Deployment:

[0052] Convert the trained remote sensing target quadrilateral fast detection model into the format of the corresponding deployment framework and deploy it on the corresponding device.

[0053] 3-2. Testing:

[0054] Images captured in real time by remote sensing equipment are fed into a rapid detection model for remote sensing target quadrilateral boxes for prediction. Each predicted box has a confidence score, with a confidence score above 0.3 considered a suspected target. NMS (Non-Maximum Suppression) filtering is then performed. Specifically, when the intersection-of-union ratio of two predicted boxes exceeds a threshold, they are considered to represent the same target. Multiple predicted boxes are often present for the same target, and the box with the highest confidence score is selected as the final prediction. Its coordinate information and category information are then output.

[0055] The present invention has the following advantages and effects compared to the prior art:

[0056] 1. The prediction results are accurate, and the quadrilateral box regression of the target is performed to accurately describe the outline of the target;

[0057] 2. For image feature extraction, a deep neural network that integrates multiple layers of features is used, which is beneficial for target detection in remote sensing scenes with many small targets;

[0058] 3. Optimize the training process and adopt the SimOTA strategy in the process of allocating positive and negative samples, which improves the model's ability to predict objects of different sizes in a balanced manner;

[0059] 4. Perform threshold filtering on the results to screen out interference targets and improve recognition accuracy.

[0060] 5. The detection speed is fast, reaching the level of real-time detection, and has practical application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 Flowchart of the present invention as a whole;

[0062] Figure 2 Schematic diagram of the dataset annotation;

[0063] Figure 3 Schematic diagram of cutting large-size images;

[0064] Figure 4 This deep learning model training flow chart;

[0065] Figure 5 The overall network structure diagram of this model;

[0066] Figure 6 Schematic diagram of the affine matrix of the anchor box generating the quadrilateral box;

[0067] Figure 7 Schematic diagram of two quadrilateral IOUs;

[0068] Figure 8 Flowchart of model deployment to specific devices;

[0069] Figure 9 This model detects the effect diagram on the public dataset;

[0070] Figure 10 Comparison chart of similar model detection indicators. Specific implementation methods

[0071] In order to meet the real-time accuracy requirements of remote sensing target detection and achieve fast and accurate regression of the object's orientation, the present invention proposes a remote sensing target quadrilateral fast detection method based on deep learning.

[0072] like Figure 1 As shown, in order to achieve this purpose, the technical solution of the present invention includes the following steps:

[0073] Step 1: Collect satellite remote sensing images, mark the object categories to be detected with quadrilateral boxes, and establish a satellite remote sensing image target detection dataset.

[0074] Step 2: Use the satellite remote sensing image target detection dataset to train the designed remote sensing target quadrilateral box fast detection model.

[0075] Step 3: Deploy the model to the corresponding equipment and perform real-time detection on the collected satellite remote sensing images.

[0076] In step 1 above, a satellite remote sensing image target detection dataset is established. The specific implementation steps are as follows:

[0077] 1-1. Data Collection: First, satellite remote sensing images containing the objects to be predicted are collected, and the number of types of objects to be predicted in the collected images is made as balanced as possible. The data source of the present invention is the open source DOTA dataset, which is large and contains rich objects.

[0078] 1-2. Data labeling: Use rolabelImg to manually label the collected images with quadrilaterals and mark the objects you want to predict, such as Figure 2 shown.

[0079] 1-3. Data preprocessing: Cut the labeled large pixel high-resolution images into 640x640 images that can be input into the model, and adjust the annotation files accordingly, such as Figure 3 shown.

[0080] 1-4. Dataset Division and Data Storage: Save the annotated data to a .txt file. Key information saved includes the coordinates of the four clockwise endpoints of the target bounding box (x1, y1), (x2, y2), (x3, y3), (x4, y4) and the target category ID. Split the training set into a test set and a training set at a ratio of 1:9 and save the absolute addresses of all images, line by line, to separate .txt files. The test set can also serve as the validation set.

[0081] In step 2, the satellite remote sensing image target detection dataset is used to train the remote sensing target quadrilateral fast detection model, such as Figure 4 As shown, multiple rounds of training are required. The number of training rounds is set according to the actual situation. The specific implementation is as follows:

[0082] The remote sensing target quadrilateral fast detection model is improved based on the YOLOX model. Its structure is as follows Figure 5 YOLOX is an improvement on YOLOv3-spp by adding a decoupling head and SimOTA for positive and negative sample allocation. As one of the most advanced single-stage object detection models to date, testing on public datasets with the same number of parameters demonstrates not only competitive speed but also state-of-the-art detection performance.

[0083] 2-1. Data loading, data enhancement (Pipeline). The annotations loaded during the data loading process are the coordinates of the four endpoints of the target box arranged clockwise and the target category ID. If you want to ensure that the trained model has sufficient generalization, you need to ensure that there is enough data for training. When there is only limited data or in order to achieve better generalization, you need to perform data enhancement on the limited data. The data enhancement methods include random affine transformation, color jittering, contrast transformation, noise perturbation, and Mosaic data enhancement. When the data for each round of training is loaded, the loaded images will be shuffled, and then the above-mentioned data enhancement will be performed, and then input into the model for training. The data enhancement parameters used in each round of training are different.

[0084] 2-2. Network Backbone. The remote sensing target quadrilateral fast detection model uses CSP-darknet as the backbone to extract features. The training set data first passes through the Focus module, which is downsampled by segmentation to obtain the original Figure 2The input is one-tenth the size of the input, and then passes through the CBS module, CSP1_1 module, CBS module, and CSP1_3 module in sequence to obtain the first-stage features, and then passes through the CBS module and CSP1_3 module to obtain the second-stage features, and finally passes through the CBS module, SPP module, and CSP2_1 module to complete the extraction of all features.

[0085] 2-3. Feature Fusion (Neck). The remote sensing target quadrilateral bounding box rapid detection model uses the same FPN structure as YOLOX for feature fusion. FPN transfers and fuses high-level feature information from top to bottom through upsampling, generating feature maps with three channel sizes of 20x20, 40x40, and 80x80 for subsequent target prediction.

[0086] 2-4. Network output (Head). The remote sensing target quadrilateral fast detection model outputs prediction tensors of sizes HxHxC, HxHx1, and HxHx4 in each channel through the decoupling method, respectively representing the target category, target foreground and background prediction, and target horizontal box representation, where HxH represents the feature map size, with values ​​of 20x20, 40x40, and 80x80, respectively. C represents the type of object, and the four parameters of the target horizontal box representation represent the center point and length and width of the box relative to the anchor box, respectively. Finally, 8400 predicted targets are obtained. The improved remote sensing target quadrilateral fast detection model outputs the target box parameters as the 6 parameters of the affine matrix of the target box relative to the anchor box, a, b, c, d, e, f, as shown in the following example: Figure 6 As shown, the four-point coordinates obtained by matrix multiplication with the four vertex coordinates of the corresponding anchor box are the four vertex coordinates of the quadrilateral box.

[0087] 2-5. Positive and negative sample allocation. The remote sensing target quadrilateral rapid detection model first performs an initial screening based on the relative coordinate positions of the anchor center point and the target box, and then uses YOLOX's SimOTA strategy to allocate positive and negative samples.

[0088] First, for each anchor frame, find all target frames whose center points fall within the range of the anchor frame. Then, for each target frame, set a square with a side length of 4 based on the center point of the target frame, and select all anchor frames within the square. The anchor frame target frame pair that meets the above two conditions is the initial screening result. Based on the initial screening results, extract the candidate detection frame position, foreground background target score and category score predicted by the network, and calculate the Loss function in combination with the target frame. For each target frame, select 10 candidate frames with the largest IOU. The calculation method of quadrilateral IOU is as follows Figure 7 As shown in Figure 2, S2 is the overlapping area of ​​the two quadrilaterals, and S1+S2+S3 is the union area of ​​the two quadrilaterals. Finally, a prediction box is assigned to each target box based on the principle of minimizing the total loss.

[0089] 2-6. Loss Function. The loss function of the remote sensing target quadrilateral fast detection model consists of three parts: foreground-background loss, classification loss, and box regression loss. The foreground-background loss and classification loss use cross-entropy loss, and the box regression loss uses L1 loss of affine matrix parameters.

[0090] The cross entropy loss calculation formula is as follows:

[0091]

[0092] The meanings of the parameters are as follows:

[0093] M: the number of categories;

[0094] y ic : Sign function (0 or 1), if the true category of sample i is equal to c, it takes 1, otherwise it takes 0;

[0095] p ic : The predicted probability that the observed sample i belongs to category c;

[0096] The L1loss calculation formula for affine parameters is as follows:

[0097]

[0098] The parameters are defined as follows:

[0099] N: total number of target boxes;

[0100] M i : The total number of prediction boxes assigned to the i-th target box;

[0101] x ij : Six parameters of the j-th prediction box of target box i;

[0102] Six parameters of target box i;

[0103] The total loss is calculated as follows:

[0104] Loss = λ obj Loss obj +λ cls Loss cls +λ box Loss box

[0105] The parameters are defined as follows:

[0106] Loss obj : Foreground background loss;

[0107] λ obj: foreground background loss weight;

[0108] Loss cls : classification loss;

[0109] λ cls : classification loss weight;

[0110] λ box : box regression loss weight;

[0111] 2-7. Model Validation. After each round of model training, the images in the validation set are tested to verify the model training effect.

[0112] After the set number of training rounds, select the model weights with the best verification results as the parameters for subsequent deployment.

[0113] In step 3, the model is deployed on the corresponding equipment to perform real-time detection on the collected satellite remote sensing images. The specific process is as follows: Figure 8 As shown, the implementation is as follows:

[0114] 3-1. Deployment: Convert the trained remote sensing target quadrilateral rapid detection model into the format of the corresponding deployment framework and deploy it on the corresponding device.

[0115] 3-2. Detection: Images captured in real time by remote sensing equipment are fed into the remote sensing target quadrilateral rapid detection model for prediction. Each predicted box is assigned a confidence score, with a confidence score above 0.3 considered a suspected target. NMS (Non-Maximum Suppression) filtering is then performed. When the intersection-of-union ratio of two predicted boxes exceeds a threshold, they are considered to represent the same target. Multiple predicted boxes are often present for the same target, and the box with the highest confidence score is selected as the final prediction. Its coordinate information and category information are then output.

[0116] The effect of this embodiment can be further illustrated by the following experiment:

[0117] The experimental environment and conditions of the present invention are as follows:

[0118] CPU: Core i7 i7-8700K Hexa-core 3.70GHz

[0119] GPU: NVIDIA GeForce RTX 30708G

[0120] Memory: 32G

[0121] Software environment: CUDA11.2 torch1.9.1

[0122] Operating system: Ubuntu 16.04LTS

[0123] The image data used in the experiments and training are from the public DOTA dataset. To compare the accuracy and speed of the model, we compared it with several commonly used YOLO-based rotated rectangle detection models, including YOLOv5-KLD, YOLOv5-GWD, YOLOv5_DOTA_OBB(CSL), yolov3-polygon, and rotate-yolov4. The validation set from the DOTA dataset was sliced ​​into 640x640 pixels.

[0124] The experimental results are measured using five sets of parameters, and the formula is as follows:

[0125] There are two main aspects for model performance evaluation: recognition accuracy and recognition efficiency. In this paper, the recognition accuracy of the model is evaluated by the intersection-over-union (mIOU), precision (P), recall (R), and F1 score, while the recognition efficiency of the model is evaluated by the frame rate (fps).

[0126] Where: T P For true examples, that is, samples whose predicted value is 1 and whose true value is also 1, F P It is a false positive example, that is, a sample predicted to be 1 but the true value is 0, F N A false negative is a sample predicted as 0 but actually 1. The intersection-over-union (IOU) is the overlap ratio between the model's predicted box (DT) and the original labeled box (GT), that is, the ratio of their intersection to their union. The ideal situation is complete overlap, with a ratio of 1. This article uses the frame rate (fps) to evaluate the algorithm's processing speed. n is the total number of images processed, T is the total time consumed, and the result is the number of images processed per second by the algorithm, measured in frames per second (f / s).

[0127] Accuracy:

[0128] Intersection-over-Union Ratio:

[0129] Frame rate:

[0130] The detection indicators of each model are shown in Table 1. From Table 1, we can see that compared with the models of the same type, this model achieves higher regression accuracy when the AP indicators are similar, which proves the effectiveness of this method. Figure 10 A comparison chart of similar model detection indicators.

[0131] Table 1

[0132] Model mAP / % mIOU / % Frame rate f / s This model 72.348 76.699 34.652 YOLOv5-KLD 72.628 75.266 32.969 YOLOv5-GWD 74.953 73.424 31.235 YOLOv5_DOTA_OBB(CSL) 72.532 74.653 33.763 YOLOv3-polygon 62.953 64.424 27.108 rotate-YOLOv4 66.846 70.564 30.512

[0133] The model recognition results are as follows Figure 9 shown.

Claims

1. A method for rapid detection of remote sensing target quadrilateral frames based on deep learning, characterized in that: The following steps are involved: Step 1: Collect satellite remote sensing images, mark the object categories to be detected with quadrilateral boxes, and establish a satellite remote sensing image target detection dataset; Step 2: Use the satellite remote sensing image target detection dataset to train the designed remote sensing target quadrilateral fast detection model; Step 3: Deploy the model to the corresponding equipment and perform real-time detection on the collected satellite remote sensing images; The specific implementation steps of step 1 are as follows: 1-1. Data collection: First, collect satellite remote sensing images containing the objects to be predicted, and make the number of types of objects to be predicted in the collected images as balanced as possible; 1-2. Data labeling: Use rolabelImg to manually label the collected images with quadrilateral boxes to mark the objects you want to predict; 1-3. Data preprocessing: Cut the annotated large-pixel high-resolution images into 640x640 images that can be input into the model, and adjust the annotation files accordingly; 1-4. Dataset division and data storage. The annotated results are saved as .txt files. The key information saved includes the coordinates of the four endpoints of the target box arranged clockwise (x1, y1), (x2, y2), (x3, y3), (x4, y4) and the target category ID. The test set and training set are divided into a ratio of 1:9 and the absolute addresses of all images are saved line by line in different .txt files. The test set serves as the validation set; In step 2, the satellite remote sensing image target detection dataset is used to train the remote sensing target quadrilateral fast detection model. Multiple rounds of training are required, and the number of training times is set according to the actual situation. The specific implementation is as follows: The remote sensing target quadrilateral fast detection model is improved based on the YOLOX model; 2-1. Data loading and data augmentation: The annotations loaded during data loading are the coordinates of the four endpoints of the target box, arranged clockwise, and the target category ID. To ensure sufficient generalization of the trained model, sufficient data must be available for training. When limited data is available or to achieve better generalization, data augmentation is required. Data augmentation methods include random affine transformation, color jittering, contrast transformation, noise perturbation, and mosaic data augmentation. When loading the data for each round of training, the loaded images will be shuffled, and then the above data augmentation will be performed before inputting into the model for training. The data augmentation parameters used in each round of training are different. 2-2. The network-based remote sensing target quadrilateral fast detection model uses CSP-darknet as the backbone to extract features. The training set data first passes through the Focus module, which downsamples the image to half the size of the original image through segmentation. It then passes through the CBS module, CSP1_1 module, CBS module, and CSP1_3 module to obtain first-stage features. It then passes through the CBS module and CSP1_3 module to obtain second-stage features. Finally, it passes through the CBS module, SPP module, and CSP2_1 module to complete the extraction of all features. 2-3. Feature fusion; The remote sensing target quadrilateral fast detection model uses the same FPN structure as YOLOX for feature fusion. FPN transfers and fuses high-level feature information from top to bottom through upsampling, obtaining feature maps with three channel scales of 20x20, 40x40, and 80x80 for subsequent target prediction. 2-4. Network output; The remote sensing target quadrilateral fast detection model outputs prediction tensors of sizes HxHxC, HxHx1, and HxHx4 in each channel through the decoupling method, respectively representing the target category, target foreground and background prediction, and target horizontal box representation, where HxH represents the feature map size, with values ​​of 20x20, 40x40, and 80x80, respectively, and C represents the type of object. The four parameters of the target horizontal box representation represent the center point and length and width of the box relative to the anchor box, respectively, and finally 8400 predicted targets are obtained; the improved remote sensing target quadrilateral fast detection model, the output target box parameters are the 6 parameters of the affine matrix of the target box relative to the anchor box, a, b, c, d, e, f, and the four point coordinates obtained by matrix multiplication with the four vertex coordinates of the corresponding anchor box are the four vertex coordinates of the quadrilateral box; 2-5. Positive and negative sample allocation; The remote sensing target quadrilateral fast detection model first performs an initial screening based on the relative position of the coordinates of the anchor center point and the target box, and then uses YOLOX's SimOTA strategy to allocate positive and negative samples; First, for each anchor frame, find all target frames whose center points fall within the anchor frame range. Then, for each target frame, set a square with a side length of 4 based on the target frame center point, and select all anchor frames within the square. The anchor frame and target frame pairs that meet the above two conditions are the initial screening results. Based on the initial screening results, extract the candidate detection frame positions, foreground and background object scores, and category scores predicted by the network, and calculate the loss function based on the target frame. For each target box, select 10 candidate boxes with the largest IOU; finally, assign a prediction box to each target box based on the principle of minimum total loss; 2-6. Loss function; The loss function of the remote sensing target quadrilateral fast detection model consists of three parts: foreground-background loss, classification loss, and box regression loss. The foreground-background loss and classification loss use cross entropy loss, and the box regression loss uses L1 loss of affine matrix parameters. The cross entropy loss calculation formula is as follows: The meanings of the parameters are as follows: M: the number of categories; y ic : Sign function (0 or 1), if the true category of sample i is equal to c, it takes 1, otherwise it takes 0; p ic : The predicted probability that the observed sample i belongs to category c; The L1 loss calculation formula for affine parameters is as follows: The parameters are defined as follows: N: total number of target boxes; M i : The total number of prediction boxes assigned to the i-th target box; x ij : The six parameters of the j-th prediction box of target box i; Six parameters of target box i; The total loss is calculated as follows: Loss=λ obj Loss obj +λ cls Loss cls +λ box Loss box The parameters are defined as follows: Loss obj :foreground background loss; λ obj :foreground background loss weight; Loss cls : classification loss; λ cls : classification loss weight; λ box : box regression loss weight; 2-7. Model Validation: After each round of model training, test the images in the validation set to verify the model training effect; 2-8. After the set number of training rounds, select the model weights with the best verification results as the parameters for subsequent deployment; In step 3, the model is deployed on the corresponding device to perform real-time detection on the collected satellite remote sensing images, as follows: 3-1. Deployment: Convert the trained remote sensing target quadrilateral fast detection model into the format of the corresponding deployment framework and deploy it on the corresponding device; 3-2. Testing: The images collected by remote sensing equipment in real time are input into the remote sensing target quadrilateral fast detection model for prediction. Each predicted frame has a confidence level. A confidence level higher than 0.3 is preset as a suspected target. NMS (Non-Maximum Suppression) filtering is performed. That is, when the intersection-union ratio of two predicted frames is greater than a threshold, the two predicted frames are considered to be the same target. There are usually multiple predicted frames for the same target. The frame with the highest confidence level is selected as the final result. Its coordinate information and category information are output.

Citation Information

Patent Citations

  • Automatic welding and defect detection method based on self-learning

    CN110636715A