Abstract
Local counting tasks, such as estimating the number of individuals in a crowd or cells in a microscopic image, are fundamentally numerical problems. While regression is the theoretically ideal framework for such tasks, classification-based models often demonstrate superior performance in practice. This paper identifies the root cause of this paradox: "noisy" ground truth data generated from imprecise human annotations. We propose Discrete-Constrained (DC) Regression, a hybrid methodology that combines the error-tolerance of classification with the numerical precision of regression. Our approach achieves state-of-the-art results across multiple benchmarks, including crowd counting and age estimation.
Introduction
In computer vision, "local counting" refers to predicting the number of objects within small image patches. Because counts are ordered and continuous—particularly when accounting for partial objects at patch boundaries—regression should naturally outperform classification. However, recent empirical evidence suggests the opposite.
The authors investigate this discrepancy and discover that the failure of regression is not a theoretical flaw but a practical one linked to ground truth (GT) labels. Most counting datasets utilize "dot annotations" convolved with Gaussian kernels to create density maps. If an annotator places a dot slightly off-center, the resulting local count becomes imprecise. Standard regression models attempt to minimize the distance to these noisy targets, leading to overfitting on annotation errors. Classification, by contrast, provides a "buffer"; as long as the noise does not push a sample into a different discrete bin, the model remains stable.
Methodology
To bridge the gap between these two paradigms, we introduce Discrete-Constrained (DC) Regression. This framework is built on three core components designed to handle label noise while preserving numerical relationships.
1. Discrete-Constrained Loss ($L_{dc}$)
Instead of forcing the model to converge on an exact, potentially erroneous continuous value, DC-Regression partitions the target space into discrete intervals (bins). The loss function penalizes the model only if its prediction falls outside the correct interval. This allows the model to ignore small-scale annotation noise while still understanding the ordered nature of the data (e.g., knowing that a count of 5.1 is closer to 5.2 than to 10.0).
2. Global Count Loss ($L_{gc}$)
Discretization can lead to "quantization errors," where the sum of local patch predictions does not equal the total image count. To mitigate this, we implement a selective global loss ($L_{bias}^{\lambda}$). This regularizer identifies patches that contribute to systematic over- or under-estimation and applies a correction, ensuring that the aggregate count remains accurate across the entire image.
3. Log-Spaced Intervals
Through synthetic experimentation, the authors observed that counting errors are heteroscedastic—the variance of the error increases as the number of objects increases. To account for this, DC-Regression utilizes log-spaced intervals. By using wider bins for higher counts, the model becomes more robust in high-density areas where annotation noise is most prevalent.
Experimental Evaluation
The proposed method was evaluated across diverse domains to test its robustness and generality:
- Synthetic Cell Dataset: Used to isolate variables like annotation bias and kernel size.
- Crowd Counting: Tested on major benchmarks including ShanghaiTech (Part A & B), JHU-CROWD++, and UCF-QNRF.
- Age Estimation: Evaluated on MegaAge and MegaAge-Asian, treating age as an ordered count to demonstrate the framework's versatility.
Key Insights
- The Impact of Label Noise: The study provides empirical proof that regression's typical underperformance is a direct result of label noise. In synthetic environments with perfect labels, regression outperforms classification; however, in real-world noisy settings, the roles are reversed. DC-Regression exploits the fact that as long as the prediction error exceeds the label noise, the gradient direction remains reliable.
- Numerical Awareness: Unlike pure classification, which treats labels as independent categories, DC-Regression maintains the numerical distance between values. This allows for the application of global constraints that are impossible in a standard classification framework.
Results
DC-Regression consistently outperformed both standard regression and pure classification models:
- Crowd Counting: On ShanghaiTech Part A, DC-Regression achieved a Mean Absolute Error (MAE) of 60.3, compared to 65.4 for standard regression and 64.6 for classification.
- State-of-the-Art Integration: When integrated into the S-DCNet architecture, the model set new records. On the UCF-QNRF dataset, the MAE was reduced from 104.4 to 84.8.
- Age Estimation: The method achieved an MAE of 2.80 on the MegaAge-Asian dataset, outperforming specialized age-estimation models.
Conclusion and Future Work
Discrete-Constrained Regression effectively addresses the sensitivity of regression models to imprecise annotations. While the method introduces new hyperparameters—specifically the number of intervals ($N$) and the global loss threshold ($\lambda$)—it provides a significantly more robust framework for local counting. Future research will explore automated interval sizing to let models learn optimal bin widths based on dataset-specific noise levels, as well as applying the DC framework to other noisy regression tasks like monocular depth estimation.
Summary updated