Abstract
Crowd counting and localization are pivotal for urban management and safety. Traditional methods often struggle with either providing precise locations (density-map based) or scaling to dense crowds (detection-based). We present the Point quEry Transformer (PET), a novel framework that treats crowd counting as a dynamic point-querying process. By employing an adaptive Point-Query Quadtree, PET efficiently manages varying crowd densities, achieving state-of-the-art results across multiple benchmarks while maintaining computational efficiency.
Introduction
Crowd counting has traditionally been approached through two main paradigms: density map estimation and localization/detection. Density map models predict a continuous heat map, which is excellent for counting but lacks individual instance data. Localization models attempt to detect each person, but often fail in congested scenarios where bounding boxes overlap or point-based methods require heavy post-processing.
The "query dilemma" in transformer-based detection—balancing the number of queries against computational cost—is particularly acute in crowd scenes. PET addresses this by reimagining crowd counting as a decomposable point querying process, allowing for dynamic query allocation based on local density.
Methodology
The PET architecture introduces several key innovations to handle the complexities of dense crowd scenes.
Point-Query Quadtree
At the heart of PET is the Point-Query Quadtree. Instead of a fixed set of queries, the model starts with a sparse grid. A "Quadtree Splitter" evaluates each region; if high density is detected, a query is split into four sub-queries. This adaptive mechanism ensures that high-density areas receive more computational focus, while sparse areas remain efficient.
Progressive Rectangle Window Attention
To manage the high computational cost of global attention on high-resolution images, PET utilizes window-based attention. Uniquely, it uses rectangular windows to leverage the "perspective prior" common in crowd photography, where people are typically distributed more densely along the horizontal axis.
Unified Learning Paradigm
PET's interpretable query-to-point mapping allows it to be applied across various learning scenarios, including fully-supervised counting, partial annotation learning, and point annotation refinement, where the model corrects noisy human-placed dots.
Experiments and Results
PET was evaluated on major benchmarks including ShanghaiTech (Part A & B), UCF-QNRF, JHU-Crowd++, and NWPU-Crowd.
Performance Benchmarks
PET achieved state-of-the-art (SOTA) performance across the board:
- ShanghaiTech Part A: Reached a Mean Absolute Error (MAE) of 49.34, outperforming previous SOTA models like P2PNet (52.74).
- NWPU-Crowd: Topped the leaderboard with an MAE of 74.4 and a superior localization F1-measure of 0.742.
Efficiency
Despite its high accuracy, PET is remarkably lightweight. With only 20.9M parameters, it is significantly smaller than competitors like CLTR (43.4M) and maintains a fast inference speed of approximately 0.097 seconds per image.
Discussion and Conclusion
The Point-Query Quadtree effectively solves the scalability issues inherent in standard transformers for dense object detection. By incorporating inductive biases like the horizontal perspective prior, PET achieves a balance between accuracy and efficiency. While highly effective, the model can occasionally miss very large foreground heads due to its optimization for dense, small-scale instances. Future work may explore more sophisticated feature encoding for queries and extend this quadtree logic to other domains like medical imaging or satellite surveillance.
Summary updated