Rethinking Object Detection in Retail Stores

Yuanqiang Cai, Longyin Wen, Libo Zhang, Dawei Du, Weiqiang Wang

Abstract

Traditional object detection frameworks, which rely on single-instance bounding boxes, often fail in dense retail environments due to extreme occlusion and the limitations of Non-Maximum Suppression (NMS). This paper introduces Locount, a novel task that shifts the focus from individual instance detection to localizing groups of identical items and predicting their count. To support this task, we present the Locount dataset—a large-scale benchmark with over 1.9 million instances—and CLCNet, a cascaded network that approaches counting as a coarse-to-fine classification problem.

Introduction: The Challenge of Dense Retail Scenes

In retail and warehouse settings, products are frequently stacked or packed so tightly that individual boundaries become indistinguishable. For example, in a stack of twenty plates, only the rims might be visible. This density poses two significant hurdles for standard detectors:

  1. Annotation Complexity: Drawing accurate individual boxes for dozens of highly overlapping items is nearly impossible for human annotators.
  2. Algorithmic Bottlenecks: Standard detectors use NMS to remove redundant boxes. In dense stacks, NMS often erroneously deletes valid detections of identical, overlapping items.
Overview of the Locount dataset showcasing the variety of retail goods and the challenge of dense packing.

To address these issues, the authors propose the Locount (Localization and Counting) task. Instead of individual boxes, the goal is to identify a group of identical items with a single minimum enclosing bounding box and simultaneously determine the number of instances within that group.

The Locount Dataset

The authors introduce a massive new dataset to benchmark this task. Collected from 28 diverse environments (stores and apartments), the Locount dataset consists of 50,394 high-resolution images. It contains over 1.9 million annotated instances across 140 categories, ranging from food and clothing to household appliances. Unlike previous datasets that focus on isolated items or single-class detection, Locount specifically targets multi-class detection on crowded, real-world shelves.

Methodology: CLCNet

The proposed Cascaded Localization and Counting Network (CLCNet) is built upon the Cascade R-CNN architecture. It introduces a specialized counting branch alongside the standard classification and regression heads.

Count-Classification vs. Regression

A key insight of this work is that treating counting as a regression task (predicting a continuous value) is less effective than treating it as a multi-class classification task. By assigning counts to discrete bins, the network can more accurately "lock onto" integer values.

Example of group bounding boxes and instance counts for stacked mugs, illustrating the Locount task.

Coarse-to-Fine Multi-Stage Counting

CLCNet leverages the multi-stage nature of cascaded architectures to refine count predictions progressively. Using a digital base representation (e.g., base-10), the initial stages of the network predict the most significant digits of the count, while subsequent stages refine the prediction for the remaining digits. This "coarse-to-fine" strategy allows the model to handle the high variance in group sizes, which can range from a single item to over 50.

Key Results and Evaluation

The performance is measured using $AP^{lc}$ (Average Precision for Locount), which requires a detection to satisfy both an IoU threshold for localization and an accuracy threshold for the count.

  • Baseline Performance: The best-performing model, a 2-stage CLCNet using base-10 classification, achieved an $AP^{lc}$ of 43.5%.
  • Classification Advantage: Ablation studies confirmed that classification-based counting consistently outperformed regression-based methods (43.5% vs 42.6%).
  • Comparison: Standard detectors like Faster R-CNN, when adapted to the Locount metric, only reached 40.9% AP, highlighting the necessity of dedicated counting heads.

Limitations and Future Directions

Despite its success, CLCNet faces challenges in two areas:

  1. Small Objects: Accuracy drops significantly for tiny commodities ($AP^{lc}_{SS}$ of 23.6%).
  2. Large Groups: The network struggles to count accurately when a single box contains more than 10 items ($AP^{lc}_{LN}$ of 21.1%).

Future research should focus on enhancing feature extraction for small-scale items and developing more robust counting mechanisms for extremely dense groups.

Summary updated

BibTeX
@inproceedings{cai2021rethinking,
  author = {Yuanqiang Cai and Longyin Wen and Libo Zhang and Dawei Du and Weiqiang Wang},
  title = {{Rethinking Object Detection in Retail Stores}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i2.16178},
}
Figure