Anchor based and Anchor free

Time:2023-9-20

Difference between anchor-free and anchor-based


Anchor-free and anchor-based are two different target detection methods, the difference being whether or not a predefined anchor box is used to match a real target box. Anchor-based methods use anchor boxes of different sizes and shapes to regress and categorize targets, such as faster rcnn, retinanet, and yolo, etc. anchor-free, such as fcos, atss, and cornernet, etc. anchor-free methods are simpler and more flexible than anchor-based methods are simpler and more flexible, but may suffer from low recall or localization precision.

Anchor based and Anchor free


anchor-based
Deep learning target detection is often modeled as a problem of classifying and regressing some candidate regions. In a one-stage detector, these candidate regions are the anchors generated by the sliding window approach; in a two-stage detector, the candidate regions are the proposals generated by the RPN, but the RPN itself still classifies and regresses the anchors generated by the sliding window approach.


anchor-free
anchor-free is solving the detection problem by another means. It is also divided into two subproblems, namely, determining the center of the object and predicting the four borders. Predicting the center of the object incorporates the center prediction into the target of the category prediction, and also predicts a soft centerness score. the prediction of the four borders is more consistent, predicting the distance from the pixel point to the four edges of the ground truth box, although some trick is used to limit the range of the regress.


advantages and disadvantages

anchor-based

The advantage of anchor based is that it can produce a dense anchor box, which allows the network to directly perform target classification and bounding box regression, which improves target recall, especially for small target detection.

The disadvantage of anchor based is that it needs to set many hyperparameters, such as scale and aspect ratio, which are difficult to design and can affect the detection performance. Also, the anchor based approach produces many redundant frames, which increases the computation and memory consumption.

anchor-free

The advantage of anchor free is that it does not need to preset the anchor, and only needs to regress the target center point and width and height of feature maps of different scales, which reduces the time-consuming and arithmetic power. At the same time, the anchor free method can also avoid some missed detection or repeated detection problems caused by unreasonable anchor settings.

The disadvantage of anchor free is that since only one frame is predicted for each position, it may result in some overlapping or occluded regions not being detected. Also, the anchor free approach requires some special loss function or structure to improve the accuracy and stability.

Algorithm generalization for anchor-free classes

An approach based on the joint expression of multiple keypoints

  • CornerNet/CornerNet-lite: top-left corner point + bottom-right corner point

  • ExtremeNet: 4 extreme points up, down, left, right + center point

  • CenterNet:Keypoint Triplets for Object Detection: upper left corner point + lower right corner point + center point

  • RepPoints: 9 learned adaptive jump sampling points

  • FoveaBox: center point + upper left corner point + lower right corner point

  • PLN: 4 corner points + center point

Methods based on single-center point prediction

  • CenterNet:Objects as Points: Center+Width+Height

  • CSP: center point + height (the author preset the target aspect ratio to be fixed and calculated the width from the height)

  • FCOS: center point + 2 distances to the frame

Algorithm generalization for anchor-based classes

An anchor (also known as an anchor box) is a set of rectangular boxes clustered on the training set using methods such as k-means prior to training, representing the length and width scales of the main distribution of targets in the data set. The n candidate rectangular boxes are extracted by sliding these anchors on the feature map generated during inference for further classification and regression.

The anchor-based class of algorithms is represented by the fastRCNN, SSD, YoloV2/V3/V4, and so on.


Anchor based and Anchor free

The main steps of anchor-based class algorithm are: generating anchor box, determining positive and negative samples, regressing relative offsets, and categorizing target classes.

tendencies

YOLOv1anchor-free
YOLOv2-v6anchor-based
YOLOv7anchor-based、anchor-free
YOLOv8anchor-free

YOLOX is a new anchor free target detector that combines the advantages of the YOLO series with the simplicity of the anchor free mechanism, while introducing the SimOTA sample matching strategy and adaptive label smoothing techniques for efficient and highly accurate detection.

AnchorDet is a target detector that uses both anchor based and anchor free branches, which is able to fully utilize the advantages of both mechanisms to improve the detection of targets of different scales and shapes.

CenterNet is an anchor free target detector based on keypoint detection, which represents the target region as centroid and width-height and generates centroid heatmap and offset prediction by convolutional model.

The development prospect of anchor free network is very broad, with the continuous innovation and optimization of technology, anchor free network is expected to achieve better performance and efficiency in the field of target detection.

Recommended Today

uniapp and applet set tabBar and show and hide tabBar

(1) Set the tabBar: uni.setTabberItem({}); wx.setTabberItem({}); indexnumberisWhich item of the tabBar, counting from the left, is indexed from 0.textstringnoButton text on tabiconPathstringnoImage PathselectedIconPathstringnoImage path when selectedpagePathstringnoPage absolute pathvisiblebooleannotab Whether to display uni.setTabBarItem({ index: 0, text: ‘text’, iconPath: ‘/path/to/iconPath’, selectedIconPath: ‘/path/to/selectedIconPath’, pagePath: ‘pages/home/home’ }) wx.setTabBarItem({ index: 0, text: ‘text’, iconPath: ‘/path/to/iconPath’, selectedIconPath: ‘/path/to/selectedIconPath’, pagePath: ‘pages/home/home’ }) […]