An image target recognition method based on elliptical anchor frames

By using elliptical anchor boxes and a high-threshold intersection-union ratio (IoU) loss function (Ht-IoU), the YOLOv5 model is optimized, which solves the problem of insufficient accuracy of rectangular anchor boxes in elliptical target detection and improves the detection accuracy and model adaptability in high IoU threshold scenarios.

CN117036673BActive Publication Date: 2026-03-13SHENYANG INSTITUTE OF CHEMICAL TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-06
Publication Date
2026-03-13

Smart Images

  • Figure CN117036673B_ABST
    Figure CN117036673B_ABST
Patent Text Reader

Abstract

This invention discloses an image target recognition method based on elliptical anchor boxes. Compared to rectangular target detection methods, this elliptical anchor box-based method better adapts to elliptical targets. The elliptical anchor box better covers the target boundary and captures detailed information about the target shape, thereby improving the accuracy of target detection. This invention employs a special processing method for the loss function corresponding to the high-threshold intersection-union ratio (Ht-IoU) for elliptical targets when the IoU threshold is high. This results in high accuracy for the high-threshold Ht-IoU at high IoU thresholds, and the loss function is further adjusted to address the issue of imbalanced training samples. Therefore, this invention offers better recognition performance for elliptical target detection tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an image target recognition method, and more particularly to an image target recognition method based on an elliptical anchor frame. Background Technology

[0002] With the continuous development of society, the requirements for object detection are also increasing. Traditional manual detection methods are proving inadequate, requiring significant manpower and time investment, and exhibiting limitations in speed and accuracy. However, with the rapid development of technology, the emergence of deep learning-based object detection technology offers a more convenient and efficient solution. The application of deep learning technology enables computers to automatically identify targets in images, thereby reducing the need for manual intervention and greatly improving accuracy. Deep learning-based object detection methods have become mainstream in many fields, significantly reducing the burden on human resources.

[0003] In the past, object detection anchor boxes were generally rectangular. In the field of object detection, due to the wide variety of object types and shapes in different datasets, current deep learning-based object detectors usually use rectangular boxes to detect objects. However, if the object is circular or elliptical, rectangular anchor boxes are not the best choice. Summary of the Invention

[0004] The purpose of this invention is to provide an image target recognition method based on elliptical anchor boxes. This invention proposes an elliptical anchor box that, for a specific target, ensures that the target's shape features match the anchor box shape, allowing for better utilization of prior shape information to extract target features. Simultaneously, a high-threshold Intersection over Union (IoU) loss function, Ht-IoU, is proposed for the elliptical anchor box to adapt to applications requiring high accuracy with high IoU thresholds, such as medical image analysis, autonomous driving, and low-density target scenarios.

[0005] The objective of this invention is achieved through the following technical solution:

[0006] An image target recognition method based on elliptical anchor boxes, the method comprising the following steps:

[0007] (1) Elliptical anchor frame

[0008] Elliptical anchor frames are used in special scenarios where the detected targets include a large number of elliptical objects, such as face recognition, aerospace monitoring, traffic light recognition, and underwater creature monitoring. When changing the shape of the anchor frame, the corresponding IOU value calculation formula should also be modified accordingly. The formula for calculating the elliptical IOU value is shown below:

[0009]

[0010] Among them, S i S represents the intersection of the ground truth ellipse and the predicted ellipse. u This represents the union of the true and predicted elliptical boxes.

[0011] (2) High-threshold cross-union loss function

[0012] The loss function corresponding to the high threshold intersection-union ratio Ht-IoU consists of five parts: IOU loss, center point loss, aspect ratio loss, long radius loss, and short radius loss.

[0013] (3) Model Framework

[0014] Elliptical anchor boxes and high-threshold cross-union loss functions are applied to the backbone network and prediction part of the YOLOv5 model, respectively.

[0015] The image target recognition method based on elliptical anchor boxes mentioned above uses IOU loss. IOU value is an important metric in the IoU (Intersection over Union) series of loss functions, used to measure the degree of overlap between the predicted bounding box and the ground truth target box. It serves as the loss function for training the target detection model and as a benchmark for algorithm evaluation. The formula for the IoU loss function is shown below:

[0016] L IOU =1-IOU, (2).

[0017] The image target recognition method based on elliptical anchor boxes, as described above, includes a center point loss penalty term in the Ht-IoULoss method, the formula of which is as follows:

[0018]

[0019] Where, ρ(d, d gt ) represents the distance between the center point of the predicted box and the center point of the ground truth box, c is the diagonal of the rectangle formed by the major axis and minor axis of the minimum closure ellipse, and δ is the adjustment factor.

[0020] The image target recognition method based on elliptical anchor frames, wherein the aspect ratio loss makes the ratio of the major and minor radii of the predicted box more consistent with the aspect ratio of the real box, thereby further improving the model accuracy, the aspect ratio loss formula is as follows:

[0021] L v =α1v, (4)

[0022]

[0023]

[0024] Where v represents the consistency between the predicted bounding box and the ground truth bounding box in terms of their aspect ratios. and α1 represents the aspect ratio of the predicted bounding box and the ground truth bounding box, respectively, and α2 is the weighting coefficient.

[0025] The image target recognition method based on elliptical anchor boxes, wherein the long radius loss and short radius loss are calculated separately, and the differences in width and height between the predicted box and the ground truth box are calculated separately, are given by the following formulas:

[0026]

[0027]

[0028]

[0029]

[0030] Where, ρ(a, a) gt ) and ρ(b, b gt ) represent the differences between the long radius and short radius of the predicted bounding box and the ground truth bounding box, respectively. c and b c α1 and α2 represent the major and minor radii of the minimum bounding ellipse of the predicted and ground truth boxes, respectively. α3 is the weighting coefficient of the major radius loss term and α4 is the weighting coefficient of the minor radius loss term.

[0031] The advantages and effects of this invention are:

[0032] This invention's elliptical anchor box-based target detection method is better suited to elliptical targets compared to rectangular target detection methods. Using elliptical anchor boxes better covers the target boundary and captures detailed information about the target shape, thus improving the accuracy of target detection. In this method, the loss function corresponding to the high-threshold intersection-union ratio (Ht-IoU) for elliptical targets undergoes special processing when the IoU threshold is high. This ensures high accuracy for the high-threshold Ht-IoU at high IoU thresholds, and further adjustments are made to address the issue of imbalanced training samples. Therefore, this method exhibits better performance for elliptical target detection tasks. Attached Figure Description

[0033] Figure 1 This is a schematic diagram illustrating the cross-sectional comparison of the frame.

[0034] Figure 2 A schematic diagram of prediction frames with the same aspect ratio;

[0035] Figure 3 This is a diagram of the overall framework of the model of this invention. Detailed Implementation

[0036] The present invention will now be described in detail with reference to the embodiments shown in the accompanying drawings.

[0037] The present invention features an elliptical anchor frame.

[0038] In the field of object detection, due to the diverse types and shapes of objects in different datasets, current deep learning-based object detectors typically use rectangular anchor boxes for object detection. However, if the object is circular or elliptical, rectangular anchor boxes are not the best choice. The elliptical anchor boxes in this invention are designed for special scenarios where the detected targets include a large number of elliptical objects, such as face recognition, aerospace monitoring, traffic light recognition, and underwater creature monitoring. Along with changing the shape of the anchor box, the corresponding IOU value calculation formula should also be modified accordingly. The formula for calculating the elliptical IOU value is as follows:

[0039]

[0040] Among them, S i S represents the intersection of the ground truth ellipse and the predicted ellipse. u This represents the union of the true elliptic and the predicted elliptic.

[0041] The following proves that, under the same conditions, the IOU value of an elliptical bounding box does not increase compared to that of a rectangular bounding box. To simplify the calculation process, special rectangles and special ellipses are chosen: a square and a circle, respectively. Furthermore, to reduce calculations of overlap and intersection, relatively simple cases are selected. In the first case, the centers of the ground truth bounding box and the predicted bounding box coincide in the square, and the side length of the ground truth bounding box is twice that of the predicted bounding box. According to the rectangular IOU formula, its IOU value is 0.25. In the circular case, the centers of the ground truth bounding box and the predicted bounding box coincide, and the radius of the ground truth bounding box is twice that of the predicted bounding box. According to the circular IOU formula, its IOU value is 0.25. The second case is as follows... Figure 1 As shown, the square ground truth box and the predicted box have the same side length, and the distance between their centers is half the side length. According to the rectangular IOU formula, its IOU value is approximately 0.333. The circular ground truth box and the predicted box have the same radius, and the distance between their centers is the same as the radius. According to the circular IOU formula, its IOU value is approximately 0.243. This shows that the IOU algorithm for circular boxes itself does not improve IOU. However, mAP calculation is directly related to IOU; a decrease in IOU directly leads to a decrease in mAP. At the same negative sample threshold, a lower IOU will result in more negative samples and fewer ignored samples between positive and negative samples. Furthermore, due to the potential decrease in IOU, the IOU algorithm between circular boxes will not directly improve mAP; in the second case, it may even decrease mAP. See... Figure 1 Intersecting situations.

[0042] The results show that the IOU algorithm using elliptical anchor boxes does not inherently increase IOU. However, mAP calculation is closely related to IOU; if IOU decreases, mAP also decreases. Therefore, if using elliptical anchor boxes improves model performance, it's because elliptical anchor boxes extract target features more effectively.

[0043] The high threshold cross-union ratio loss function of this invention

[0044] The loss function corresponding to the high threshold intersection-union ratio Ht-IoU proposed in this invention consists of five parts: IOU loss, center point loss, length-to-short axis ratio loss, long radius loss, and short radius loss.

[0045] The IOU value is an important metric in the IoU (Intersection over Union) series of loss functions, used to measure the degree of overlap between the predicted bounding box and the ground truth bounding box. It serves as the loss function for training object detection models and as a benchmark for algorithm evaluation. In object detection, there are ground truth bounding boxes and predicted bounding boxes. The ratio of the intersection to the union of the ground truth bounding boxes and the predicted bounding boxes is the IOU value, and its formula is shown in Equation (1).

[0046] The formula for the loss function corresponding to the Intersection over Union (IoU) ratio is shown below:

[0047] L IOU =1-IOU, (2)

[0048] However, the IoU loss function has many problems:

[0049] (1) If the predicted bounding box and the ground truth bounding box do not intersect, then the IOU value cannot represent the distance between the two boxes.

[0050] (2) Even with the same level of precision, there may be different degrees of overlap, which cannot accurately reflect the magnitude of the overlap.

[0051] (3) When the ground truth box and the predicted box are in an inclusive relationship, the relative position between the two boxes cannot be accurately reflected.

[0052] To address the above issues, Ht-IoU Loss adds a centroid loss penalty term, the formula of which is shown below:

[0053]

[0054] Where, ρ(d, d gt ) represents the distance between the center point of the predicted box and the center point of the ground truth box, c is the diagonal of the rectangle formed by the major axis and minor axis of the minimum closure ellipse, and δ is the adjustment factor.

[0055] In formula (3), for L disAn adjustment factor δ is introduced in the distance calculation between the center point of the target box and the center point of the predicted box. The purpose of the adjustment factor is that when the IOU value is relatively large, the IOU itself can complete the target box regression task, which can reduce the constraint effect of the distance loss between the target box and the predicted box. Therefore, the adjustment factor δ is selected as follows: since the value range of IOU is [0, 1], δ = e -5IOU It is negatively correlated with IOU. The larger the IOU, the smaller the distance adjustment requirement between the target box and the predicted box in the target box regression. Therefore, this invention multiplies the target box distance loss by δ = e -5IOU This can be adjusted to control the importance of the loss function for the target box distance loss, and vice versa. Adding a center point penalty term to the loss result in better convergence performance and smaller target box regression loss error under the same training environment. However, there is still room for improvement in the loss function, and the ratio of the major to minor radius of the elliptical detection box is also an important geometric factor.

[0056] This invention, based on the aforementioned loss, adds a major-minor-radius ratio loss. This makes the ratio of the major and minor radii of the predicted bounding box more closely match the major-minor-radius ratio of the true bounding box, thereby further improving model accuracy. The major-minor-radius ratio loss formula is as follows:

[0057] L v =α1v, (4)

[0058]

[0059]

[0060] Where v represents the consistency between the predicted bounding box and the ground truth bounding box in terms of their aspect ratios. and α1 represents the aspect ratio of the predicted bounding box and the ground truth bounding box, respectively, and α2 is the weighting coefficient.

[0061] As can be seen from formula (6), when the IOU value is large, the value of the weight coefficient α1 will also increase, which will reduce the weight of the ratio of length to width, making the model pay more attention to the ratio of length to width of the predicted box.

[0062] In formula (4), v reflects the difference in aspect ratio between the predicted bounding box and the true bounding box, rather than the difference in the true values ​​of the long and short radii, which does not conform to actual needs. See below. Figure 2 As shown, the solid-lined boxes are the ground truth boxes, and the two dashed-lined boxes are the predicted boxes with their center points matching those of the ground truth boxes. They have a possibility of having the same v value, which leads to L... V The possibility of them being equal can prevent the model from reducing the difference between the true width and height values.

[0063] See Figure 2 Predicted frames with the same aspect ratio.

[0064] To address the aforementioned issues, this invention adds separate long-radius loss and short-radius loss to separately calculate the differences in width and height between the predicted bounding box and the ground truth bounding box. The calculation formulas for long-radius loss and short-radius loss are as follows:

[0065]

[0066]

[0067]

[0068]

[0069] Where, ρ(a, a) gt ) and ρ(b,b gt ) represent the differences between the long radius and short radius of the predicted bounding box and the ground truth bounding box, respectively. c and b c α1 and α2 represent the major and minor radii of the minimum bounding ellipse of the predicted and ground truth boxes, respectively. α3 is the weighting coefficient of the major radius loss term and α4 is the weighting coefficient of the minor radius loss term.

[0070] As can be seen from formulas (7) and (8), when the IOU value is large, in order to improve the model's attention to the difference between the long and short radii of the predicted box and the ground truth box and improve the accuracy of the high IOU threshold mAP, this invention introduces weight coefficients α2 and α3 to adjust the weights of width loss and height loss, so as to further improve the optimization effect of the loss function.

[0071] The high threshold intersection-union ratio Ht-IoU and its corresponding loss function formula proposed in this invention are as follows:

[0072]

[0073]

[0074] Furthermore, many datasets suffer from imbalanced training samples, which allows for further adjustments to the loss function, as shown in the following formula:

[0075] L F_Ht-IoU =IOU γ L Ht-IoU (13)

[0076] Where γ is the suppression weight.

[0077] As can be seen from formula (13), L F_Ht-IoU The value is in L Ht-IoU An additional suppression weight γ is added to the existing L-values ​​for high-quality samples. Ht-IoUThe smaller the loss, the closer the Intersection over Union (IOU) value is to 1, the less suppressed it is. Low-quality samples have a lower L... Ht-IoU The greater the loss, the further the Intersection over Union (IOU) value is from 1, the greater the degree of suppression. This approach relatively increases the weight of high-quality samples and decreases the weight of low-quality samples, effectively solving the problem of imbalanced training samples.

[0078] Model framework of this invention

[0079] This invention takes YOLOv5 as an example, and the overall model framework is as follows: Figure 3 As shown. In object detection tasks, anchor boxes are used to generate candidate boxes and match them with ground truth bounding boxes for object localization and classification. Anchor boxes are typically generated during the feature extraction phase of the model, such as the backbone network of YOLOv5, and multiple sets of anchor boxes are generated for different scales and aspect ratios. In object detection tasks, the IOU loss function is used to measure the degree of matching between the predicted bounding box and the ground truth bounding box, and it is used in the prediction part of the YOLOv5 model. These loss functions update the model parameters through the backpropagation algorithm, enabling the model to more accurately predict the location and category of the target. The elliptical anchor boxes and high-threshold IOU loss function proposed in this invention can be applied to the backbone network and prediction part of the YOLOv5 model, respectively, and the same applies to other models.

Claims

1. An image target recognition method based on an elliptical anchor frame, characterized in that, The method Includes the following processes: (1) Elliptical anchor frame Elliptical anchor frames are used in special scenarios where the detected targets include a large number of elliptical objects, such as face recognition, aerospace monitoring, traffic light recognition, and underwater creature monitoring. When changing the shape of the anchor frame, the corresponding IOU value calculation formula should also be modified accordingly. The formula for calculating the elliptical IOU value is shown below: ; in, This represents the intersection of the true and predicted elliptical boxes. This represents the union of the true and predicted elliptical boxes. (2) High threshold intersection-union ratio loss function The loss function corresponding to the high threshold intersection-union ratio Ht-IoU consists of five parts: IOU loss, center point loss, aspect ratio loss, long radius loss, and short radius loss. (3) Model framework Elliptical anchor boxes and high-threshold intersection-over-union loss functions are applied to the backbone network and prediction part of the YOLOv5 model, respectively. The IOU loss, where the IOU value is an important metric in the IoU series of loss functions, is used to measure the degree of overlap between the predicted bounding box and the ground truth bounding box, serving as a loss function for training the object detection model and a benchmark for algorithm evaluation; the formula for the IoU loss function is shown below: ; The Ht-IoU Loss adds a center point loss penalty term, the formula of which is shown below: ; in, This represents the distance between the center point of the predicted bounding box and the center point of the ground truth bounding box. Let be the diagonal of the rectangle formed by the major and minor axes of the smallest closure ellipse. It is a regulatory factor; The aforementioned aspect ratio loss makes the ratio of the major and minor radii of the predicted bounding box more closely match the ratio of the major and minor diameters of the actual bounding box, thereby further improving the model accuracy. The aspect ratio loss formula is as follows: ; in, It refers to the consistency of the aspect ratio between the predicted bounding box and the ground truth bounding box. and These represent the aspect ratios of the predicted bounding box and the ground truth bounding box, respectively. These are the weighting coefficients; The long-radius loss and short-radius loss are calculated separately for the differences in width and height between the predicted bounding box and the ground truth bounding box. The formulas for calculating the long-radius loss and short-radius loss are as follows: ; in, and These represent the differences between the long radius and short radius of the predicted bounding box and the ground truth bounding box, respectively. and Let represent the major and minor radii of the minimum bounding ellipse between the predicted and ground truth bounding boxes. These are the weighting coefficients for the long-radius loss term. It is the weighting coefficient of the short radius loss term.

Citation Information

Patent Citations

  • Target detection method

    CN113657225A

  • Unmanned aerial vehicle detection method and system based on improved Center Net detection network

    CN115661692A