Abstract
In this paper, a deep learning-based method is proposed for crowd-counting problems. Specifically, by utilizing the convolution kernel density map, the ground truth is generated dynamically to enhance the feature-extracting ability of the generator model. Meanwhile, the “cross stage partial” module is integrated into congested scene recognition network (CSRNet) to obtain a lightweight network model. In addition, to compensate for the accuracy drop owing to the lightweight model, we take advantage of “structured knowledge transfer” to train the model in an end-to-end manner. The crowd-counting system solution for edge computing is also proposed and implemented on an embedded device equipped with a neural processing unit. Simulations demonstrate the performance improvement of the proposed solution in terms of model size, processing speed and accuracy. The performance on the Venice dataset shows that the mean absolute error (MAE) and the root mean squared error (RMSE) of our model drop by 32.63% and 39.18% compared with CSRNet. Meanwhile, the performance on the ShanghaiTech PartB dataset reveals that the MAE and the RMSE of our model are close to those of CSRNet.
Introduction
Crowd counting—the process of estimating the number of individuals in a scene through density maps—is a vital tool for public safety, urban planning, and traffic management. However, state-of-the-art models are typically computationally intensive "heavyweights" designed for high-end server GPUs. Deploying these models to edge devices, such as smart cameras or embedded controllers, presents significant challenges due to limited RAM and processing power. Furthermore, simply reducing model size often results in a substantial loss of accuracy, particularly in dense scenes with high occlusion. This paper presents a lightweight, high-performance crowd-counting system optimized for Neural Processing Unit (NPU) platforms.
Methodology
The proposed approach optimizes crowd counting through architectural innovation, improved training data generation, and knowledge distillation.
Lightweight CSRNet with CSP Modules
The standard Congested Scene Recognition Network (CSRNet) was redesigned by integrating Cross Stage Partial (CSP) modules. By splitting feature maps and merging them later, the CSP module reduces redundant gradient information, leading to a significant reduction in parameters without compromising feature extraction.
Dynamic Density Map Generation
Traditional crowd counting often relies on static ground truth labels with fixed-size dots. This research employs a Kernel-based Density Map Generation (KDMG) framework that dynamically generates labels to better account for perspective changes. An Efficient Channel Attention (ECA) module is added to the generator, allowing the model to focus more effectively on human heads across diverse environments.
Structured Knowledge Transfer (SKT)
To mitigate the accuracy loss inherent in model compression, a "Teacher-Student" training paradigm was adopted. A complex, pre-trained "Teacher" model guides the lightweight "Student" model during training, enabling the smaller network to mimic the sophisticated feature patterns of the larger one.
NPU Implementation
The system was deployed on the TB-RK3399ProD platform. Hardware-specific optimizations include using the Raster Graphic Acceleration (RGA) unit for image preprocessing and offloading neural inference to the NPU, ensuring high-speed performance on edge hardware.
Experimental Results
The model was evaluated on the Venice, Beijing-BRT, and ShanghaiTech Part B datasets.
- Model Efficiency: The proposed model contains only 3.56 million parameters, representing a 78% reduction compared to the original CSRNet (16.26M).
- Accuracy Improvements: On the Venice dataset, the model achieved a 32.63% reduction in Mean Absolute Error (MAE) and a 39.18% reduction in Root Mean Squared Error (RMSE) compared to the baseline CSRNet.
- Real-Time Performance: Inference times on the NPU platform ranged from 9 to 28 milliseconds, facilitating real-time video analysis.
- Environmental Robustness: The system demonstrated high accuracy even under challenging conditions such as heavy fog, shadows, and bright sunlight.
Conclusion
This research provides a novel embedded platform system for public safety applications. By combining architectural pruning via CSP modules with structured knowledge transfer and dynamic label generation, the authors achieved a lightweight model that maintains high precision. Future work will focus on extending the architecture to support multi-stream crowd counting and improving software portability for integration into broader multimedia frameworks.
Summary updated