Journal of Computer Applications ›› 2024, Vol. 44 ›› Issue (9): 2886-2892.DOI: 10.11772/j.issn.1001-9081.2023091269

• Multimedia computing and computer simulation • Previous Articles     Next Articles

Crowd counting method based on dual attention mechanism

Zhiqiang ZHAO1,2(), Peihong MA1, Xinhong HEI1,2   

  1. 1.School of Computer Science and Engineering,Xi’an University of Technology,Xi’an Shaanxi 710048,China
    2.Shaanxi Key Laboratory of Network Computing and Security Technology (Xi’an University of Technology),Xi’an Shaanxi 710048,China
  • Received:2023-09-18 Revised:2023-12-12 Accepted:2023-12-15 Online:2024-03-21 Published:2024-09-10
  • Contact: Zhiqiang ZHAO
  • About author:MA Peihong, born in 1998, M. S. candidate. Her research interests include computer vision.
    HEI Xinhong, born in 1976, Ph. D., professor. His research interests include machine learning.
  • Supported by:
    National Natural Science Foundation of China(61976177);Key R&D Program of Shaanxi Province(2023-YBGY-222)

基于双重注意力机制的人群计数方法

赵志强1,2(), 马培红1, 黑新宏1,2   

  1. 1.西安理工大学 计算机科学与工程学院,西安 710048
    2.陕西省网络计算与安全技术重点实验室(西安理工大学),西安 710048
  • 通讯作者: 赵志强
  • 作者简介:马培红(1998—),女,河南郑州人,硕士研究生,主要研究方向:计算机视觉
    黑新宏(1976—),男,陕西延安人,教授,博士,CCF杰出会员,主要研究方向:机器学习。
  • 基金资助:
    国家自然科学基金资助项目(61976177);陕西省重点研发计划项目(2023-YBGY-222)

Abstract:

In response to challenges such as scale variation, background interference, and partial occlusion in crowd counting within complex scenes, a DA-DCCNN (Dual Attention based Dilated Contextual Convolutional Neural Network) was proposed. Firstly, the convolutional layers from VGG16 were utilized as feature extractors to obtain abstract and deep-level feature maps of the crowd image. Subsequently, by employing dilated convolutions, a Dilated Context Module (DCM) was constructed to connect features obtained from different layers. The Spatial Attention Module (SAM) and Channel Attention Module (CAM) were introduced to acquire contextual information. Finally, a loss function was formulated by combining the Euclidean distance and cross entropy to measure the disparity between the predicted attention map and the ground truth attention map. Experimental results on three publicly available datasets — ShanghaiTech, UCF_CC_50 and UCF-QNRF demonstrate that DA-DCCNN can effectively capture multi-scale features in the image and enhance the perception of important regions and channels within the image, achieving the optimal Mean Absolute Error (MAE). The feature fusion network based on dual attention mechanism can efficiently recognize spatial structures and local features in images so that by using the generated density maps, the crowd regions can be predicted and counted more accurately.

Key words: dilated convolution, contextual feature, dual attention mechanism, density map, crowd counting

摘要:

针对复杂场景下人群计数问题中的尺度变化、背景干扰和部分遮挡等问题,在空洞卷积操作的基础上,提出一种基于双重注意力机制的空洞上下文卷积神经网络(DA-DCCNN)。首先,将VGG16中的卷积层作为特征提取器,获取人群图像抽象、深层的特征图;其次,利用空洞卷积构造空洞上下文模块(DCM)对不同层获取的特征进行连接,并引入空间注意力模块(SAM)和通道注意力模块(CAM)获取上下文信息;最后,组合欧氏距离和交叉熵构造损失函数,对网络预测注意力图和真实注意力图之间的差异进行度量。在ShanghaiTech、UCF_CC_50和UCF-QNRF 3个公开数据集上的实验结果表明,DA-DCCNN在有效获取图像的多尺度特征的同时,增强了对图像中重要区域和通道的感知能力,平均绝对误差(MAE)取得了相对最优的结果。基于双重注意力机制的特征融合网络能有效感知图像中的空间结构和局部特征,从而使得生成的密度图能更准确地对人群区域进行预测和计数。

关键词: 空洞卷积, 上下文特征, 双重注意力机制, 密度图, 人群计数

CLC Number: