YOLOX-based Rotated Object Detection Method

Through the YOLOX-based rotation object detection method, the new rotation rectangle box description method and loss function optimization are adopted to solve the accuracy problem of rotation object detection, improve the detection performance and accuracy, and reduce the model size.

CN114494737BActive Publication Date: 2025-08-01NANJING UNIV OF POSTS & TELECOMM
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210105053.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2025-08-01
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

The existing rotation target detection methods have low accuracy when detecting rotating targets. Especially in scenarios such as remote sensing images and license plate recognition, conventional target detection methods are difficult to accurately mark target objects with rotation angles, resulting in serious background interference.

Method used

Using the YOLOX-based rotation object detection method, the new rotating rectangle box description method is used to select only two coordinate points and one parameter of the rectangle box to describe the position of the rectangle, and combined with the optimization of the loss function, the detection performance and accuracy are improved.

Benefits of technology

The performance and accuracy of rotation target detection have been improved, the size of the model is reduced, and significant improvements in detection accuracy have been made.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494737B_ABST
    Figure CN114494737B_ABST
Patent Text Reader

Abstract

The present invention provides a rotation target detection method based on YOLOX. The rotation target detection method mainly includes: Step 1, input an image, and read and perform related preprocessing on the target bounding boxes; Step 2, convert all the target bounding boxes in the image to present rectangular bounding boxes; Step 3, perform post-processing on the converted target bounding boxes to obtain the rectangular bounding boxes detected by the model. The rotation target detection method based on YOLOX in the present invention proposes a new description method for the rotated rectangular bounding box in the rotation target detection. Only two coordinate points of the rectangular bounding box are selected, and the specific position of the rectangle can be obtained through another parameter, which can improve the performance and accuracy of the rotation target detection and reduce the size of the corresponding model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a rotation target detection method based on YOLOX, belonging to the technical field of image rotation target detection. Background Art

[0002] Images are an important source for humans to understand the world and can convey richer, more vivid and specific information than other forms. With the continuous development of social economy and the accelerating pace of urbanization, the order of cities appears to be increasingly chaotic. As an important branch in the field of computer vision (CV), object detection is being widely applied in industrial inspection, road traffic, aerospace and other fields. For example, cameras are used to capture and process personnel information on the road in real time and store it, so as to reduce the intensity of criminal investigation work and the consumption of human capital. Therefore, this technology has important practical significance.

[0003] According to the direction of the target box, object detection can generally be divided into horizontal detection and rotation detection. Specifically, horizontal box detection is usually more suitable for general natural scene images. For scenarios such as remote sensing images, face recognition and license plate recognition, more accurate positioning is usually required, which requires an effective rotation target detection model.

[0004] The YOLO (You Only Look Once) series of algorithms are well-known one-stage detectors for detecting horizontal targets. This detector performs regression on the localization and classification of targets simultaneously. After the image passes through the YOLO backbone network, the positions and categories of each target object will be directly output. Finally, only corresponding algorithms are needed to remove overlapping boxes and perform other post-processing operations. A relatively representative network is YOLO v3, which has made some improvements on its predecessors YOLO v1 and YOLO v2, such as adding an anchor mechanism, mainly referring to the design of the Feature Pyramid Network (FPN), and can perform multi-scale detection on the input image.

[0005] SCRDet can be used to solve the problem of rotation detection. This model regresses five parameters, namely the coordinates of the center point, width, height, and rotation angle, to describe the rotated bounding box. To more accurately predict the rotated box, SCRDet adds an IoU constant factor to the smooth L1 loss function. Due to the inherent periodicity of the angle, the loss discontinuity caused by the sudden exchange of the width and height of the target, and the different units of coordinates and angles, simply considering the coordinates and angles in the five-parameter system will lead to problems such as unstable training and performance degradation. Another rotation object detector, RSDet, uses an eight-parameter regression method that can use the same unit coordinates to alleviate this problem and further solve the problem of inconsistent parameter regression. In the P-RSDet model, object detection at any angle can be achieved by predicting the center point and regressing a polar radius and two polar angles. In addition, to express the geometric constraint relationship between the polar radius and polar angles, this model uses a polar ring area loss function to improve the prediction accuracy. P-RSDet achieves better performance with a simpler model and fewer regression parameters.

[0006] This patent focuses on solving the problem of detecting objects rotated by a certain angle. In some specific scenarios, such as satellite remote sensing image detection, the objects in the image generally have a rotation angle. If conventional object detection methods are used to detect the objects in the image at this time, the accuracy will be relatively low. If a smaller rectangular box can be used to mark these objects, the detection model will be more focused on the target object, thus solving the problem of low accuracy caused by the background around the target.

[0007] One-stage object detection models similar to YOLO have some defects. For example, they cannot detect small objects well, which is caused by the fact that the model cannot converge quickly due to simultaneously regressing the object category and location. Therefore, for the problem of object detection of dense small objects, there is certain research value in how to improve the detection accuracy of the model.

[0008] In view of this, it is necessary to propose a rotation object detection method based on YOLOX to solve the above problems. Summary of the Invention

[0009] The purpose of the present invention is to provide a rotation object detection method based on YOLOX to improve the detection accuracy.

[0010] To achieve the above purpose, the present invention provides a rotation object detection method based on YOLOX, which mainly includes:

[0011] Step 1, input an image, and read and perform relevant preprocessing on the target box;

[0012] Step 2, convert all target boxes in the image to present rectangular boxes;

[0013] Step 3, post-process the converted target boxes to obtain the rectangular boxes detected by the model.

[0014] As a further improvement of the present invention, Step 2 specifically includes: respectively set the consecutive four vertex coordinates in the counterclockwise direction of the rectangular box as A, B, C, and D, with the horizontal direction from left to right of the image as the positive direction.

[0015] As a further improvement of the present invention, find an edge in the rectangular box, the counterclockwise direction of this edge in the rectangular box forms an acute angle with the positive direction, take the two vertices on this edge, let the vertex closer to the lower part of the image be A, and the other vertex be B, and their coordinates are set as (x1, y1) and (x2, y2) respectively. Finally, take the distance between this edge and the CD edge, that is, the length of BC or AD, and set it as h.

[0016] As a further improvement of the present invention, Step 3 specifically includes: after passing through convolutional layers of different sizes, three different detection heads will output feature maps of three sizes, and post-process them to obtain the rectangular boxes detected by the model.

[0017] As a further improvement of the present invention, adjust the size of the feature map to batch_size·(num_classes + 6)·ofm_w·ofm_h, where batch_size is the number of images input into the model, num_classes is the number of target categories, and ofm_w and ofm_h respectively represent the width and height of the feature map.

[0018] As a further improvement of the present invention, after performing a flatten operation on the three feature maps and connecting them, a feature map with a size of batch_size·(num_classes + 6)·n can be obtained; where n is the number of rectangular boxes, and threshold limitation and the NMS algorithm will be used for filtering the rectangular boxes in the post-processing operation.

[0019] As a further improvement of the present invention, looking at each tensor corresponding to the rectangular box separately, the size of each tensor is num_classes + 6, and the number 6 in it represents predicting 6 values for each rotated rectangular box, that is, the two coordinate points of the rectangular box, the height of the rectangle with the line segment connecting these two points as the base, and the confidence of this target, which are represented by x1, y1, x2, y2, h, and c respectively.

[0020] The beneficial effects of the present invention are as follows: The rotation target detection method based on YOLOX of the present invention proposes a new description method for the rotated rectangular box in the rotation target detection. Only two coordinate points of the rectangular box are selected, and the specific position of the rectangle can be obtained through another parameter, which can improve the performance and accuracy of the rotation target detection and reduce the size of the corresponding model. Through this description method, the loss function of the YOLOX model is further optimized, and the performance of the model can be improved. It is proved by experiments that the performance and accuracy of the rotation target detection method applying this rectangular box description method reach a certain balance, and there is a significant improvement in the detection accuracy. Description of the Drawings

[0021] Figure 1 It is the description of the rectangular box by the rotation target detection method based on YOLOX of the present invention.

[0022] Figure 2 It is the description of the tensor of the rectangular box by the rotation target detection method based on YOLOX of the present invention.

[0023] Figure 3 It is the detection flow chart of the YOLOX model in the present invention. Detailed Embodiments

[0024] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail below with reference to the drawings and specific embodiments.

[0025] The present invention discloses a rotation target detection method based on YOLOX, that is, in the rotation target detection, a new description method for the rotated rectangular box is proposed for the rotation target image. Only two coordinate points of the rectangular box are selected, and the specific position of the rectangle can be obtained through another parameter, which can improve the performance and accuracy of the rotation target detection and reduce the size of the corresponding model. Through this description method, the loss function of the YOLOX model is further optimized, and the performance of the model can be improved.

[0026] It is proved by experiments that the performance and accuracy of the rotation target detection method applying this rectangular box description method reach a certain balance, and there is a significant improvement in the detection accuracy.

[0027] The rotation target detection method based on YOLOX of the present invention first selects two coordinate points of the rectangular box, and then the specific position of the rectangle can be obtained by predicting the height of the rectangular box with the line segment connecting these two points as the base, thereby improving the performance and accuracy of the rotation target detection and reducing the size of the corresponding model. The change of this description method mainly affects two stages of the target detection algorithm, that is, the processing after reading the data set and the processing of the target box output by the model.

[0028] Such asFigure 1 As shown, first, after reading the target boxes in the input image and performing related preprocessing, all the target boxes in the image are transformed and described using a new description method. The four consecutive vertex coordinates of the rectangle in the counterclockwise direction are set as A, B, C, and D respectively, with the horizontal direction from left to right in the image as the positive direction. Then, find an edge in the rectangle such that the counterclockwise direction of this edge in the rectangle forms an acute angle with the positive direction. Take the two vertices on this edge. Without loss of generality, let the vertex closer to the bottom of the image be A and the other vertex be B, with coordinates set as (x1, y1) and (x2, y2) respectively. Finally, take the distance between this edge and the CD edge, that is, the length of BC or AD, and set it as h, thus completing the description of the rectangle. The five parameters taken are x1, y1, x2, y2, and h.

[0029] Combined with Figure 2 and Figure 3 , the detection process of the YOLOX model is mainly divided into three steps: preprocessing, input into the network for calculation, and postprocessing. After applying the above improved description method for rotated boxes, the detection head of the model also needs to be improved. After passing through convolutional layers of different sizes, three different detection heads will output three sizes of feature maps (Output Feature Map, OFM). By performing postprocessing on them, the rectangle boxes detected by the model can be obtained. Adjust the size of the OFM to batch_size·(num_classes + 6)·ofm_w·ofm_h, where batch_size is the number of images input into the model, num_classes is the number of target categories, and ofm_w and ofm_h represent the width and height of the OFM respectively. After flattening and connecting the three OFMs, a feature map with a size of batch_size·(num_classes + 6)·n can be obtained, where n is the number of rectangle boxes. In the postprocessing operation, threshold limitation and the NMS algorithm are used to filter the rectangle boxes. Looking at each tensor corresponding to a rectangle box separately, the size of each tensor is num_classes + 6, where the number 6 represents predicting 6 values for each rotated rectangle box, namely the two coordinate points of the rectangle box, the height of the rectangle with the line segment connecting these two points as the base, and the confidence of this target, represented by x1, y1, x2, y2, h, and c respectively.

[0030] In summary, the rotation object detection method of the present invention based on YOLOX proposes a new description method for the rotated rectangular box in the rotation object detection. Only two coordinate points of the rectangular box are selected, and the specific position of the rectangle can be obtained through another parameter, which can improve the performance and accuracy of the rotation object detection and reduce the size of the corresponding model. Through this description method, the loss function of the YOLOX model is further optimized, and the performance of the model can be improved. Experiments have proved that the performance and accuracy of the rotation object detection method applying this rectangular box description method reach a certain balance, and there is a significant improvement in the detection accuracy.

[0031] The above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A rotation target detection method based on YOLOX, characterized in that: The described rotating object detection method includes: Step 1: Input an image, read the target bounding boxes, and perform related preprocessing. Step 2: Convert all the target bounding boxes in the image to present rectangular boxes. Step 3: Post-process the converted target bounding boxes to obtain the rectangular boxes detected by the model. Step 2 specifically includes: Set the consecutive four vertex coordinates in the counterclockwise direction of the rectangular box as A, B, C, and D respectively, with the horizontal direction from left to right in the image as the positive direction; Find a side in the rectangular box, the angle between this side and the positive direction in the counterclockwise direction in the rectangular box is an acute angle, take the two vertices on this side, set the vertex closer to the bottom of the image as A, and the other vertex as B, with the coordinates set as (x1, y1) and (x2, y2) respectively. Finally, take the distance between this side and the CD side, that is, the length of BC or AD, and set it as h. Step 3 specifically includes: After passing through convolutional layers of different sizes, three different detection heads will output feature maps of three sizes, and post-processing them can obtain the rectangular boxes detected by the model; Adjust the size of the feature map to batch_size·(num_classes + 6)·ofm_w·ofm_h, where batch_size is the number of images input into the model, num_classes is the number of target categories, and ofm_w and ofm_h respectively represent the width and height of the feature map; After flattening and connecting the three feature maps, a feature map with a size of batch_size·(num_classes + 6)·n can be obtained; where n is the number of rectangular boxes, and in the post-processing operation, threshold limitation and the NMS algorithm will be used to filter the rectangular boxes; Looking at each tensor corresponding to the rectangular box separately, the size of each tensor is num_classes + 6, and the number 6 in it represents predicting 6 values for each rotated rectangular box, that is, the two coordinate points of the rectangular box, the height of the rectangle with the line segment connecting these two points as the base, and the confidence in this target, represented by x1, y1, x2, y2, h, and c respectively.

Citation Information

Patent Citations

  • Image text recognition method and device, electronic equipment and computer storage medium

    CN111563502A