CornerNet: Detecting Objects as Paired Keypoints

Hei Law, Jia Deng

Introduction

Object detection has traditionally relied on the concept of anchor boxes—pre-defined candidate rectangles that the network refines to fit objects. While successful, this approach introduces significant complexity and inefficiency. CornerNet proposes a paradigm shift: instead of predicting boxes directly, it detects objects as pairs of keypoints—the top-left and bottom-right corners. This anchor-free approach simplifies the detection pipeline and achieved state-of-the-art results upon its release.

The Problem with Anchor Boxes

Dominant detectors often require over 100,000 anchor boxes to ensure sufficient coverage of potential object locations and scales. This leads to two primary issues:

  1. Class Imbalance: Only a tiny fraction of these anchors overlap with ground truth objects, creating a massive imbalance between positive and negative samples that complicates training.
  2. Hyperparameter Sensitivity: Designers must manually tune the number, scales, and aspect ratios of anchors, which is often an ad-hoc process that doesn't generalize well across different datasets.

The CornerNet Architecture

CornerNet treats object detection as a bottom-up keypoint estimation task. It utilizes a single convolutional neural network—specifically an Hourglass Network—to predict two sets of heatmaps: one for top-left corners and one for bottom-right corners.

The CornerNet pipeline uses a ConvNet to produce heatmaps and embeddings, which are then grouped to form bounding boxes.

To turn these independent corner detections into object boxes, the network predicts associative embeddings. Each detected corner is assigned a 1D embedding vector; corners belonging to the same object are trained to have similar embeddings, allowing the system to group them accurately during post-processing.

Key Technical Innovations

Corner Pooling

Detecting a corner is inherently difficult because the corner itself often lacks local visual evidence (for example, the corner of a circular object is in empty space). To solve this, the authors introduced Corner Pooling. This layer "looks" horizontally and vertically to find the boundaries of an object. The intersection of these boundaries defines the corner location.

Corner pooling determines the location of a top-left corner by finding the maximum values along horizontal and vertical directions.

Modified Focal Loss and Offsets

The training process uses a modified Focal Loss that accounts for "soft" ground truth. Instead of penalizing all non-exact detections equally, it uses a Gaussian bump around the ground truth corner to reduce the penalty for detections that are close enough to produce a high-IoU box. Additionally, the model predicts local offsets to compensate for the spatial precision lost during the network's downsampling process.

Results and Insights

CornerNet was evaluated on the MS COCO dataset, achieving 42.1% AP. This performance surpassed all existing one-stage detectors at the time and remained competitive with slower two-stage models.

Key takeaways from the research include:

  • Geometric Inductive Bias: Corner pooling provides a significant +2.0% AP boost, proving that building geometric definitions directly into the architecture is more effective than relying on the network to learn them from scratch.
  • Localization is the Bottleneck: Error analysis showed that with perfect corner heatmaps, the AP would reach 74%. This indicates that the associative embedding method for grouping is highly robust, and future improvements should focus on better corner localization.
  • Scale Sensitivity: The method is particularly strong for medium and large objects, as the corner pooling mechanism can effectively aggregate information across large spatial distances.

Conclusion and Future Work

CornerNet demonstrates that anchor-free object detection is not only possible but highly effective. By rethinking boxes as pairs of keypoints, it eliminates the need for complex anchor tuning. While the current inference speed (approximately 244ms per image) is not yet real-time, the success of this keypoint-based approach has paved the way for a new generation of efficient, anchor-free detectors.

Summary updated

BibTeX
@inproceedings{law2018cornernet,
  author = {Hei Law and Jia Deng},
  title = {{CornerNet: Detecting Objects as Paired Keypoints}},
  booktitle = {European Conference on Computer Vision},
  year = {2018},
  doi = {10.1007/978-3-030-01264-9\_45},
}
Figure