Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2027, Vol. 61 Issue (1): 142-153, 176    DOI: 10.3785/j.issn.1008-973X.2027.01.014
Computer Technology     
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
Download: HTML     PDF(3611KB) HTML
Export: BibTeX | EndNote (RIS)      

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     
Received: 21 November 2025      Published: 25 November 2026
CLC:  TP 393  
Cite this article:

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.

URL:

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


多尺度聚合与上下文增强的轻量级人群计数方法

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


关键词: 人群计数,  特征提取,  尺度感知,  背景抑制,  剪枝 
Fig.1 Network architecture of lightweight crowd counting with multi-scale aggregation and context enhancement
Fig.2 Structure of adaptive kernel convolution
Fig.3 Structure of Block module
Fig.4 Schematic diagram of channel shuffle
Fig.5 Structure of global-local context module
Fig.6 Framework of layer pruning
方法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
Table 1 Experimental results of different methods on ShanghaiTech dataset
Fig.7 Visualizationl results on ShanghaiTech dataset
方法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
Table 2 Experimental results of different methods on UCF-QNRF dataset
Fig.8 Visualization results on UCF-QNRF dataset
方法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
Table 3 Experimental results of different methods on NWPU-Crowd dataset
Fig.9 Visualization results on NWPU-Crowd dataset
sMAERMSEsMAERMSE
164.3113.3362.6112.7
260.5106.2462.3111.2
Table 4 Performance comparison of proposed method under different stack quantities of 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
Table 5 Ablation results of module structure
Fig.10 Visualization of ablation results for different module structures
方法Part APart B
MAERMSEMAERMSE
Addition67.4117.09.817.2
Concat+Conv61.8109.58.715.5
Concat+Shuffle60.5106.28.014.0
Table 6 Ablation results of feature fusion method
方法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
Table 7 Ablation results of GLCM global and local branches
λ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
Table 8 Ablation experiment results of parameters$ {\lambda }_{1} $and$ {\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
Table 9 Ablation results of loss function
方法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
Table 10 Inference speed comparison results of each method on Part A dataset
模型Part APart BParams/106FLOPs/109
MAERMSEMAERMSE
剪枝模型60.8102.38.113.40.401.13
初始模型60.5106.28.014.00.481.61
Table 11 Pruning experiment results
[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] Yuanfeng LIAN,Shuyu FAN,Benzhe ZHANG,Sen WANG. Bio-inspired gait control integrating geometric constraint feature extraction and multi-reward cooperative optimization[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1862-1871.
[2] Jiuyuan HUO,Hao JIANG,Chen CHANG. Text detection of highway traffic sign based on improved EAST[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1881-1889.
[3] Jun LI,Binbin DING,Weijuan SHI,Lin YANG. Aerial image detection algorithm based on multiscale feature aggregation[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1890-1900.
[4] Xiaochun WU,Zining LI. Improved railway worker safety wear detection model based on YOLOv11n[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1901-1911.
[5] Kaijun WU,Yunqi ZHENG,Ding WEI,Haixiang YUAN. YOLOv8s based lightweight algorithm for small object detection in aerial imagery[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1912-1923.
[6] Yijie TANG,Mingen ZHONG,Bingan YUAN,Kang FAN,Jiawei TAN,Zhiqiang LIN. Road segmentation algorithm based on joint orthogonal feature fusion and large kernel separable attention[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(9): 1942-1952.
[7] Xinmiao YU,Nan XIA,Jiahong JIANG,Ziying HAO,Yunsheng BA. Low-light target detection based on multi-scale feature similarity matching[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(7): 1464-1474.
[8] Naizhou ZHANG,Yunchao ZHAO,Wei CAO,Xiaojian ZHANG. Image captioning generation based on multiple-view cross-modal feature fusion[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(6): 1205-1212.
[9] Tianhe YU,Wenlong WANG,Yong LIU,Zhuangzhuang YANG,Shanchong HOU. Improved algorithm for identifying occluded vehicles and pedestrians in foggy images[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(4): 738-750.
[10] Weiqun LUO,Jingwei LU,Jiadi WU,Yuying LIANG,Chuanpeng SHEN,Rui ZHU. Lightweight detection model for typical environmental terrain target in Tibetan Plateau[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(3): 594-603.
[11] Jianxin ZHANG,Xiaojun LI,Xinyu XU,Yikun LI. Multi-scale spatial-spectral feature collaborative network for hyperspectral image pansharpening[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(12): 2581-2591.
[12] Jiangang ZHANG,Xiao LI,Dandan FENG. Dynamic kernel perception for pavement distress detection in UAV inspection[J]. Journal of ZheJiang University (Engineering Science), 2026, 60(10): 2141-2152.
[13] Zhuguo ZHOU,Yujun LU,Liye LV. Improved YOLOv5s-based algorithm for printed circuit board defect detection[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(8): 1608-1616.
[14] Jiarui FU,Zhaofei LI,Hao ZHOU,Wei HUANG. Camouflaged object detection based on Convnextv2 and texture-edge guidance[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(8): 1718-1726.
[15] Xuanyun LIU,Ying YAN,Zhiyong YU,Fangwan HUANG. Topological design of brain-like reservoir based on scale-free network[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(7): 1385-1393.