500万参数小模型实现弱监督人群计数,精度媲美大模型。
TCFormer: A 5M-Parameter Transformer with Density-Guided Aggregation for Weakly-Supervised Crowd Counting
- 用轻量级Transformer提取特征,全局感知能力强且内存占用低。
- 引入密度加权聚合模块,无需标注即可自适应调整区域特征。
- 结合密度分类损失,在图像级标签下实现高精度计数,适合边缘设备。
人群计数通常依赖繁琐的点级标注和计算量大的骨干网络,限制了其在资源受限环境中的可扩展性和部署能力。为此,本文提出TCFormer,一个仅含500万参数的超轻量级、弱监督的Transformer型人群计数框架,性能表现优异。首先,采用高效视觉变压器作为特征提取器,其全局上下文感知能力可在极小内存开销下生成语义有意义的人群特征。其次,为弥补空间监督缺失,设计了可学习的密度加权平均模块,根据预测密度分数动态重加权局部标记,使网络能基于密度特性自适应调节区域特征,无需额外标注。此外,引入密度级别分类损失,将人群密度划分为不同等级,从而正则化训练过程并增强模型在不同密度下的分类能力。因此,尽管TCFormer仅使用图像级全局计数进行弱监督训练,通过计数与密度级别损失的联合优化,仍可实现高估测精度。在ShanghaiTech A/B、UCF-QNRF和NWPU四个基准数据集上的大量实验表明,该方法在参数效率与计数精度之间取得更优平衡,是边缘设备上人群计数任务的良好解决方案。
原文摘要 · Abstract (English)
Crowd counting typically relies on labor-intensive point-level annotations and computationally intensive backbones, restricting its scalability and deployment in resource-constrained environments. To address these challenges, this paper proposes the TCFormer, a tiny, ultra-lightweight, weakly-supervised transformer-based crowd counting framework with only 5 million parameters that achieves competitive performance. Firstly, a powerful yet efficient vision transformer is adopted as the feature extractor, the global context-aware capabilities of which provides semantic meaningful crowd features with a minimal memory footprint. Secondly, to compensate for the lack of spatial supervision, we design a feature aggregation mechanism termed the Learnable Density-Weighted Averaging module. This module dynamically re-weights local tokens according to predicted density scores, enabling the network to adaptively modulate regional features based on their specific density characteristics without the need for additional annotations. Furthermore, this paper introduces a density-level classification loss, which discretizes crowd density into distinct grades, thereby regularizing the training process and enhancing the model's classification power across varying levels of crowd density. Therefore, although TCformer is trained under a weakly-supervised paradigm utilizing only image-level global counts, the joint optimization of count and density-level losses enables the framework to achieve high estimation accuracy. Extensive experiments on four benchmarks including ShanghaiTech A/B, UCF-QNRF, and NWPU datasets demonstrate that our approach strikes a superior trade-off between parameter efficiency and counting accuracy and can be a good solution for crowd counting tasks in edge devices.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。