Please wait a minute...
浙江大学学报(工学版)  2027, Vol. 61 Issue (1): 142-153, 176    DOI: 10.3785/j.issn.1008-973X.2027.01.014
计算机技术     
多尺度聚合与上下文增强的轻量级人群计数方法
张振海(),鲍盛成,李哲远
兰州交通大学 自动化与电气工程学院,甘肃 兰州 730070
Lightweight crowd counting method with multi-scale aggregation and context enhancement
Zhenhai Zhang(),Shengcheng Bao,Zheyuan Li
School of Automation and Electrical Engineering, Lanzhou Jiaotong University, Lanzhou 730070, China
 全文: PDF(3611 KB)   HTML
摘要:

针对人群计数任务中的多尺度变化、背景干扰以及模型复杂度高等挑战,提出多尺度聚合与上下文增强的轻量级人群计数方法. 为实现高效的特征表示,以轻量级卷积神经网络为基础构建浅层特征提取网络,设计多尺度特征融合模块,通过连续小卷积核堆叠的多分支结构提取不同感受野的特征信息. 使用通道混洗交叉融合多尺度特征,缓解尺度变化的影响. 构建全局-局部上下文模块,全局分支获取整体上下文信息,局部分支补充人群的特征信息,降低背景干扰的影响. 对训练完成后的模型进行剪枝,进一步降低模型复杂度. 在3个公开数据集上的实验结果表明,该方法能够在保持计数精度的同时减小模型规模并提升推理速度. 所提方法可以有效平衡精度与效率,适用于复杂环境的人群计数任务.

关键词: 人群计数;  特征提取;  尺度感知;  背景抑制;  剪枝    
Abstract:

A lightweight crowd counting method with multi-scale aggregation and context enhancement was proposed to address the challenges of multi-scale variations, background interference, and high model complexity in crowd counting tasks. To achieve efficient feature representation, a shallow feature extraction network was constructed based on a lightweight convolutional neural network, and a multi-scale feature fusion module was designed to extract feature information from different receptive fields through a multi-branch structure with stacked small-kernel convolutions. Channel shuffle was used to cross-fuse multi-scale features to mitigate the impact of scale variations. A global-local context module was constructed, where the global branch obtained overall context information and the local branch supplemented crowd feature information, thereby reducing the impact of background interference. Pruning was applied to the trained model to further reduce model complexity. Experimental results on three public datasets show that the method can reduce model size and improve inference speed while maintaining counting accuracy. The proposed method can effectively balance accuracy and efficiency and is suitable for crowd counting tasks in complex environments.

Key words: crowd counting    feature extraction    scale awareness    background suppression    pruning
收稿日期: 2025-11-21 出版日期: 2026-11-25
CLC:  TP 393  
基金资助: 中央引导地方科技发展资金资助项目(24ZYQA044);甘肃省重点研发计划资助项目(22YF7GA141);甘肃省自然科学基金重点资助项目(25JRRA804).
作者简介: 张振海(1983—),男,教授,博士,从事图像处理和故障诊断研究. orcid.org/0000-0002-4177-1747. E-mail:764411629@qq.com
服务  
把本文推荐给朋友
加入引用管理器
E-mail Alert
作者相关文章  
张振海
鲍盛成
李哲远

引用本文:

张振海,鲍盛成,李哲远. 多尺度聚合与上下文增强的轻量级人群计数方法[J]. 浙江大学学报(工学版), 2027, 61(1): 142-153, 176.

Zhenhai Zhang,Shengcheng Bao,Zheyuan Li. Lightweight crowd counting method with multi-scale aggregation and context enhancement. Journal of ZheJiang University (Engineering Science), 2027, 61(1): 142-153, 176.

链接本文:

https://www.zjujournals.com/eng/CN/10.3785/j.issn.1008-973X.2027.01.014    或    https://www.zjujournals.com/eng/CN/Y2027/V61/I1/142

图1  多尺度聚合与上下文增强的轻量级人群计数网络结构图
图2  自适应核卷积结构图
图3  Block模块结构图
图4  通道混洗示意图
图5  全局-局部上下文模块结构图
图6  层剪枝框架
方法Part APart BParams/106
MAERMSEMAERMSE
CSRNet[10]68.2115.010.616.016.26
BL[11]62.8101.87.712.721.50
NoiseCC[12]61.999.67.411.320.02
DBCC-Net[9]60.194.07.512.538.00
DM-Count[20]59.795.77.411.821.50
MSIANet[4]55.699.26.611.0—
ZIP-S[23]55.188.95.99.233.60
SACCN[6]52.484.36.510.7—
MobileCount[14]89.4146.09.015.43.34
C-CNN[24]88.1141.714.922.10.07
LigMSANet[25]76.6121.410.917.50.63
文献[26]71.5108.611.320.01.69
LSANet[15]66.1110.28.613.90.20
文献[27]63.4106.37.311.20.15
LMSNet[16]62.9108.48.213.50.73
本研究60.8102.38.113.40.40
表1  各方法在ShanghaiTech数据集上的实验结果
图7  ShanghaiTech数据集可视化结果
方法MAERMSEParams/106
CSRNet[10]120.3208.516.26
CAN[8]107.0183.018.10
MSIANet[4]94.8184.6—
DBCC-Net[9]90.9156.338.00
BL[11]88.7154.821.50
DM-Count[20]85.6148.321.50
P2PNet[5]85.3154.518.34
SACCN[6]77.2125.0—
LIMM[28]76.4125.330.00
MCNN[7]277.0426.00.13
C-CNN[24]224.2331.00.07
MobileCount[14]131.1222.63.34
LSANet[15]112.3186.90.20
LMSNet[16]110.7178.70.73
文献[27]104.1172.20.15
文献[26]100.4182.61.69
本研究92.6162.80.40
表2  各方法在UCF-QNRF数据集上的实验结果
图8  UCF-QNRF数据集可视化结果
方法MAERMSEParams/106
CSRNet[10]121.3387.816.26
CAN[8]106.3386.518.10
BL[11]105.4454.221.50
NoiseCC[12]96.9534.220.02
DM-Count[20]88.4388.621.50
APGCC[29]71.7284.418.68
SACCN[6]65.3356.7—
MCNN[7]277.0714.60.13
SANet[30]190.6491.40.91
文献[27]102.5388.60.15
文献[26]97.2394.11.69
本研究95.4354.60.40
表3  各方法在NWPU-Crowd数据集上的实验结果
图9  NWPU-Crowd数据集可视化结果
sMAERMSEsMAERMSE
164.3113.3362.6112.7
260.5106.2462.3111.2
表4  不同堆叠数量s下所提方法的性能对比
方法Params/106Part APart B
MAERMSEMAERMSE
BaseNet0.1981.0133.210.118.5
BaseNet+2MFFC0.4567.3113.38.916.1
BaseNet+GLCM0.2275.2128.49.316.4
BaseNet+2MFFC+GLCM0.4860.5106.28.014.0
表5  模块结构的消融实验结果
图10  模块结构的消融实验结果可视化
方法Part APart B
MAERMSEMAERMSE
Addition67.4117.09.817.2
Concat+Conv61.8109.58.715.5
Concat+Shuffle60.5106.28.014.0
表6  特征融合方式的消融实验结果
方法Params/106Part APart B
MAERMSEMAERMSE
BaseNet0.4567.3113.38.916.1
+Global0.4762.9108.48.314.8
+Local0.4664.8110.18.515.3
GLCM0.4860.5106.28.014.0
表7  GLCM全局和局部分支的消融实验结果
λ1λ2Part APart B
MAERMSEMAERMSE
0.10.162.3110.68.315.3
0.10.0561.4108.38.214.5
0.10.0160.5106.28.014.0
0.050.0160.9105.78.114.2
0.010.0162.1108.88.315.1
表8  参数$ {\boldsymbol{\lambda }}_{{1}} $和$ {\boldsymbol{\lambda }}_{{2}} $的消融实验结果
损失函数Part APart B
LcLotLtvMAERMSEMAERMSE
√——72.9126.79.816.9
√—√67.3118.28.915.4
√√—63.2114.58.314.6
√√√60.5106.28.014.0
表9  损失函数消融实验结果
方法FLOPs/109Params/106InputFPSt/msMAERMSE
CSRNet[10]108.3416.26384×38422.7843.968.2115.0
CAN[8]114.8318.101024×7687.62131.362.3100.0
MCNN[7]24.810.131280×72041.1524.366.1105.1
MoblieCount[20]7.263.341920×108025.1939.789.4146.0
LigMSANet[26]1.300.63400×40022.5744.376.6121.4
LSANet[15]6.340.201280×72031.4531.866.1110.2
本研究1.130.40256×25632.5730.760.8102.3
表10  各方法在Part A数据集上的推理速度实验对比结果
模型Part APart BParams/106FLOPs/109
MAERMSEMAERMSE
剪枝模型60.8102.38.113.40.401.13
初始模型60.5106.28.014.00.481.61
表11  剪枝实验结果
1 Zhou B, Tang X, Wang X. Learning collective crowd behaviors with dynamic pedestrian-agents. International Journal of Computer Vision, 2015, 111 (1): 50- 68.
doi: 10.1007/s11263-014-0735-3
2 余鹰, 朱慧琳, 钱进, 等. 基于深度学习的人群计数研究综述. 计算机研究与发展, 2021, 58 (12): 2724- 2747.
Yu Ying, Zhu Huilin, Qian Jin, et al. Survey on deep learning based crowd counting. Journal of Computer Research and Development, 2021, 58 (12): 2724- 2747.
doi: 10.7544/issn1000-1239.2021.20200699
3 Khan M A, Menouar H, Hamila R. Revisiting crowd counting: state-of-the-art, trends, and future perspectives. Image and Vision Computing, 2023, 129, 104597.
doi: 10.1016/j.imavis.2022.104597
4 张世辉, 赵维勃, 王磊, 等. MSIANet: 多尺度交互注意力人群计数网络. 电子与信息学报, 2023, 45 (6): 2236- 2245.
Zhang Shihui, Zhao Weibo, Wang Lei, et al. MSIANet: multi-scale interactive attention crowd counting network. Journal of Electronics and Information Technology, 2023, 45 (6): 2236- 2245.
doi: 10.11999/jeit220644
5 Song Q, Wang C, Jiang Z, et al. Rethinking counting and localization in crowds: a purely point-based framework [C]//Proceedings of the IEEE/CVF International Conference on Computer Vision. Montreal. IEEE, 2021: 3345–3354.
6 Gong S, Yao Z, Zuo W, et al. Spatially adaptive pyramid feature fusion for scale-aware crowd counting. Pattern Recognition, 2025, 168, 111832.
doi: 10.1016/j.patcog.2025.111832
7 Zhang Y, Zhou D, Chen S, et al. Single-image crowd counting via multi-column convolutional neural network [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2016: 589–597.
8 Liu W, Salzmann M, Fua P. Context-aware crowd counting [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Long Beach: IEEE, 2019: 5094–5103.
9 杨天乐, 李玲霞, 张为. 基于自注意力机制的双分支密集人群计数算法. 浙江大学学报(工学版), 2023, 57 (10): 1955- 1965.
Yang Tianle, Li Lingxia, Zhang Wei. Dual-branch crowd counting algorithm based onself-attention mechanism. Journal of Zhejiang University (Engineering Science), 2023, 57 (10): 1955- 1965.
doi: 10.3785/j.issn.1008-973X.2023.10.005
10 Li Y, Zhang X, Chen D. CSRNet: dilated convolutional neural networks for understanding the highly congested scenes [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City. IEEE, 2018: 1091–1100.
11 Ma Z, Wei X, Hong X, et al. Bayesian loss for crowd count estimation with point supervision [C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Seoul: IEEE, 2019: 6141–6150.
12 Wan J, Chan A B. Modeling noisy annotations for crowd counting [C]// Proceedings of the 34th International Conference on Neural Information Processing Systems. Vancouver: ACM, 2020: 3386–3396.
13 Liu Y, Hu Y, Cao G, et al. SENet: super-resolution enhancement network for crowd counting. Pattern Recognition, 2025, 162, 111420.
doi: 10.1016/j.patcog.2025.111420
14 Wang P, Gao C, Wang Y, et al. MobileCount: an efficient encoder-decoder framework for real-time crowd counting. Neurocomputing, 2020, 407, 292- 299.
doi: 10.1016/j.neucom.2020.05.056
15 Zhu F, Yan H, Chen X, et al. Real-time crowd counting via lightweight scale-aware network. Neurocomputing, 2022, 472, 54- 67.
doi: 10.1016/j.neucom.2021.11.099
16 Xi M, Yan H. Lightweight multi-scale network with attention for accurate and efficient crowd counting. The Visual Computer: International Journal of Computer Graphics, 2023, 40 (6): 4553- 4566.
17 Ma N, Zhang X, Zheng H T, et al. ShuffleNet V2: practical guidelines for efficient CNN architecture design [C]// Proceedings of the European Conference on Computer Vision. Munich: Springer, 2018: 122–138.
18 Zhang X, Song Y, Song T, et al. AKConv: convolutional kernel with arbitrary sampled shapes and arbitrary number of parameters [PP/OL]. arXiv (2023-11-20)[2026-01-26]. https://arxiv.org/abs/2311.11587v1.
19 Ho J, Kalchbrenner N, Weissenborn D, et al. Axial attention in multidimensional transformers [PP/OL]. arXiv (2019-12-20)[2026-01-26]. https://doi.org/10.48550/arXiv.1912.12180.
20 Wang B, Liu H, Samaras D, et al. Distribution matching for crowd counting [C]// Proceedings of the 34th International Conference on Neural Information Processing Systems. Vancouver: ACM, 2020: 10322–10333.
21 Idrees H, Tayyab M, Athrey K, et al. Composition loss for counting, density map estimation and localization in dense crowds [C]// Proceedings of the European Conference on Computer Vision. Munich: Springer, 2018: 544–559.
22 Wang Q, Gao J, Lin W, et al. NWPU-crowd: a large-scale benchmark for crowd counting and localization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021, 43 (6): 2141- 2149.
doi: 10.1109/tpami.2020.3013269
23 Ma Y, Sanchez V, Guha T. ZIP: scalable crowd counting via zero-inflated Poisson modeling [PP/OL]. V3. arXiv (2025-07-31)[2026-01-26]. https://doi.org/10.48550/arXiv.2506.19955.
24 Shi X, Li X, Wu C, et al. A real-time deep network for crowd counting [C]// Proceedings of the ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing. Barcelona: IEEE, 2020: 2328–2332.
25 Jiang G, Wu R, Huo Z, et al. LigMSANet: lightweight multi-scale adaptive convolutional neural network for dense crowd counting. Expert Systems with Applications, 2022, 197, 116662.
doi: 10.1016/j.eswa.2022.116662
26 Chen Y, Zhao H, Gao M, et al. A weakly supervised hybrid lightweight network for efficient crowd counting. Electronics, 2024, 13 (4): 723.
doi: 10.3390/electronics13040723
27 Zhao Z, Wen Y, Yang S, et al. Real-time crowd counting for embedded systems with lightweight architecture. Vicinagearth, 2025, 2 (1): 13.
doi: 10.1007/s44336-025-00025-w
28 Pan T, Jia X. Local information matters: a rethink of crowd counting [PP/OL]. arXiv (2025-08-23)[2026-01-26]. https://doi.org/10.48550/arXiv.2508.16970.
29 Chen I H, Chen W T, Liu Y W, et al. Improving point-based crowd counting and Localization based on Auxiliary point guidance [C]// European Conference on Computer Vision. Cham: Springer, 2025: 428–444.
[1] 火久元,姜灏,常琛. 基于改进EAST的高速公路交通标识文本检测[J]. 浙江大学学报(工学版), 2026, 60(9): 1881-1889.
[2] 李珺,丁彬彬,史维娟,杨琳. 基于多尺度特征聚合的航拍图像检测算法[J]. 浙江大学学报(工学版), 2026, 60(9): 1890-1900.
[3] 武晓春,李梓宁. 基于YOLOv11n的改进铁路工人安全穿戴检测模型[J]. 浙江大学学报(工学版), 2026, 60(9): 1901-1911.
[4] 邬开俊,郑云琦,魏鼎,袁海翔. 基于YOLOv8s的轻量化航拍图像小目标检测算法[J]. 浙江大学学报(工学版), 2026, 60(9): 1912-1923.
[5] 汤毅杰,钟铭恩,袁彬淦,范康,谭佳威,林志强. 联合正交特征融合与大核可分离注意力的道路分割算法[J]. 浙江大学学报(工学版), 2026, 60(9): 1942-1952.
[6] 万伟国,钟凯晨,张迎梅,姚丽,包书鸿,龚大伟. 基于空间自适应Transformer的人脸素描图像生成[J]. 浙江大学学报(工学版), 2026, 60(9): 1953-1961.
[7] 连远锋,范树玉,张本哲,王森. 融合几何约束特征提取与多奖励协同优化的仿生步态控制[J]. 浙江大学学报(工学版), 2026, 60(9): 1862-1871.
[8] 于鑫淼,夏楠,江佳鸿,郝子莹,把云胜. 基于多尺度特征相似性匹配的低照度目标检测[J]. 浙江大学学报(工学版), 2026, 60(7): 1464-1474.
[9] 张乃洲,赵云超,曹薇,张啸剑. 基于多视图跨模态特征融合的图像描述生成[J]. 浙江大学学报(工学版), 2026, 60(6): 1205-1212.
[10] 于天河,王文龙,刘镛,杨壮壮,侯善冲. 改进的有雾图像中被遮挡车辆及行人识别算法[J]. 浙江大学学报(工学版), 2026, 60(4): 738-750.
[11] 雒伟群,陆敬蔚,吴佳缔,梁钰迎,申传鹏,朱睿. 藏区高原典型环境地形目标的轻量化检测模型[J]. 浙江大学学报(工学版), 2026, 60(3): 594-603.
[12] 张剑鑫,李小军,徐欣钰,李轶鲲. 多尺度空谱特征协同的高光谱图像全色锐化网络[J]. 浙江大学学报(工学版), 2026, 60(12): 2581-2591.
[13] 张建刚,李肖,冯丹丹. 基于动态核感知的无人机视角路面病害检测方法[J]. 浙江大学学报(工学版), 2026, 60(10): 2141-2152.
[14] 周著国,鲁玉军,吕利叶. 基于改进YOLOv5s的印刷电路板缺陷检测算法[J]. 浙江大学学报(工学版), 2025, 59(8): 1608-1616.
[15] 付家瑞,李兆飞,周豪,黄惟. 基于Convnextv2与纹理边缘引导的伪装目标检测[J]. 浙江大学学报(工学版), 2025, 59(8): 1718-1726.