| Crowd counting is widely used in the fields of public security,video surveillance and smart city construction,which has important and positive significance for controlling the number of people in specific places,directing public transport,preventing the spread of the epidemic and ensuring social stability.With the development of deep learning,a number of deep learning-based crowd counting networks have emerged.However,due to the problems of chaotic foreground and uneven scale variation in crowd images,the performance of crowd counting algorithms are still faced with great challenges.This paper proposes some corresponding solutions to the above problems and effectively improves the performance of the algorithm.The research content is summarized as follows:(1)To solve the problem of background interference in complex scenes,a crowd counting algorithm based on multiple attention mechanism is proposed.Firstly,a top-down feature fusion path is constructed using pyramid split attention to generate feature maps with both high-level semantics and spatial details.Then,the channel attention module is used to make full use of different levels of effective information,which can not only enhance the expressive ability of detailed edge information in the low-level feature map,but also improve the weight of semantic information used to distinguish the head and background in the high-level feature map.Next,positional attention module can convert the context information with wider coverage into local features,so that more feature information can be retained,and guide the network to allocate more weight values to pedestrian features and less weight values to background information,so as to weaken the spatial background information.Finally,the transpose convolution is used to restore the resolution of the feature map to achieve the purpose of generating high quality density map.Experimental results show that the above strategies can effectively reduce background interference and count error.(2)To tackle the problem of scale variation,a pyramid network crowd counting algorithm based on multi-scale perception is proposed.Firstly,the feature pyramid network is used to capture the global crowd information,and the high-level features are aggregated by the feature pyramid network.Then,a multi-scale module is designed for channel splicing and fusion of the feature information of different scales obtained by each branch,which obtain the feature information of multiple scales.This module can effectively improve the perception ability of the network at different scales.Next,the channel attention model is applied in the feature map to obtain channel information and selectively emphasize the important channels related to crowd information in the feature map.Finally,a loss function is designed for the model,which improves the anti-interference ability of the network and the performance of counting.Experimental results exhibit that these strategies can capture multi-scale information effectively and diminish counting errors. |