[论文解读] CLIP-EBC: CLIP Can Count Accurately through Enhanced Blockwise Classification
该论文提出CLIP-EBC,首个完全基于CLIP的群体计数模型,通过将计数任务重新表述为使用整数值区间的增强分块分类,生成密度图。通过用离散整数区间替代连续区间区间,并利用CLIP的视觉-文本对齐能力,CLIP-EBC实现了最先进性能,在ShanghaiTech Part A和Part B上的平均绝对误差(MAE)分别降低至55.0和6.3,相较于先前方法最高提升达76.9%。
We propose CLIP-EBC, the first fully CLIP-based model for accurate crowd density estimation. While the CLIP model has demonstrated remarkable success in addressing recognition tasks such as zero-shot image classification, its potential for counting has been largely unexplored due to the inherent challenges in transforming a regression problem, such as counting, into a recognition task. In this work, we investigate and enhance CLIP's ability to count, focusing specifically on the task of estimating crowd sizes from images. Existing classification-based crowd-counting frameworks have significant limitations, including the quantization of count values into bordering real-valued bins and the sole focus on classification errors. These practices result in label ambiguity near the shared borders and inaccurate prediction of count values. Hence, directly applying CLIP within these frameworks may yield suboptimal performance. To address these challenges, we first propose the Enhanced Blockwise Classification (EBC) framework. Unlike previous methods, EBC utilizes integer-valued bins, effectively reducing ambiguity near bin boundaries. Additionally, it incorporates a regression loss based on density maps to improve the prediction of count values. Within our backbone-agnostic EBC framework, we then introduce CLIP-EBC to fully leverage CLIP's recognition capabilities for this task. Extensive experiments demonstrate the effectiveness of EBC and the competitive performance of CLIP-EBC. Specifically, our EBC framework can improve existing classification-based methods by up to 44.5% on the UCF-QNRF dataset, and CLIP-EBC achieves state-of-the-art performance on the NWPU-Crowd test set, with an MAE of 58.2 and an RMSE of 268.5, representing improvements of 8.6% and 13.3% over the previous best method, STEERER. The code and weights are available at https://github.com/Yiming-M/CLIP-EBC.
研究动机与目标
- 解决现有基于分类的群体计数方法因使用连续区间区间而性能不足的问题,此类方法在决策边界学习方面表现较差。
- 通过将计数任务重新表述为分块分类,弥合CLIP(一种识别模型)与计数(一种回归任务)之间的差距。
- 通过使用整数值区间而非连续区间,提升模型的鲁棒性与泛化能力,减少在区间边界附近的误分类。
- 实现基于CLIP的密度图生成,利用CLIP预训练的视觉与文本编码器,且无需微调文本编码器。
- 证明EBC框架不仅能增强基于CLIP的模型,还能作为即插即用模块显著提升现有基于回归的模型性能。
提出的方法
- 提出增强分块分类(EBC)框架,使用离散整数值区间替代连续区间区间进行计数分类。
- 通过移除CLIP图像编码器中的全局平均池化层,并将线性投影替换为1×1卷积,以保留空间分辨率,支持分块预测。
- 使用冻结的CLIP文本编码器为每个整数区间(如“1人”、“2人”等)生成文本嵌入,并通过余弦相似度与图像特征进行比较。
- 通过在每个区间的局部图像特征与文本嵌入之间的余弦相似度上应用Softmax,生成概率图。
- 通过将每个区间的计数值乘以其对应的概率得分,并在空间位置上进行平均,构建预测密度图。
- 使用混合损失函数DACE进行模型优化,该函数结合分类损失与计数回归损失,并通过可学习权重λ平衡两项损失。
实验结果
研究问题
- RQ1尽管CLIP是为识别任务预训练的,能否有效适配以实现精确的群体计数?
- RQ2与连续区间区间相比,使用整数值区间是否能提升分块群体计数中的分类性能与决策边界学习能力?
- RQ3当作为即插即用模块应用时,EBC框架能否显著提升现有基于回归的群体计数模型的性能?
- RQ4作为完全基于CLIP的模型,CLIP-EBC能否生成高质量密度图,并在基准数据集上实现最先进性能?
- RQ5在分类与回归组件之间选择不同的损失权重(λ)如何影响最终模型性能?
主要发现
- CLIP-EBC在ShanghaiTech Part A上的平均绝对误差(MAE)为55.0,在Part B上为6.3,创下新的最先进性能记录。
- EBC框架可使现有模型性能最高提升76.9%,且在不同主干网络(VGG16、ResNet101、MobileNetV2、DenseNet201)上均表现出一致提升。
- 将连续区间区间替换为整数值区间后,MAE从基线分块方法的140.6降低至88.3,改善率达37.1%,证明了离散化区间的有效性。
- 最优损失权重λ = 1.0时性能最佳(MAE = 77.9),而更高值如λ = 2.0会降低泛化能力。
- EBC框架具有模型无关性,在多种主干网络上均能提升性能,表明其在CLIP之外也具有广泛适用性。
- 可视化结果表明,CLIP-EBC在从稀疏到高度密集的各类人群密度场景中均表现出良好泛化能力,生成准确且平滑的密度图。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。