Dense-stream YOLOv8n: a lightweight framework for real-time crowd monitoring in smart libraries
摘要
Crowd monitoring in the context of smart libraries is of great significance for resource optimization and service improvement. However, existing models struggle to achieve real-time performance and accuracy in high-density, enclosed environments.This study addresses these limitations in the following way: Firstly, pedestrian flow videos from the side view angle were collected at different time periods on the second floor of the library. The videos were frame-extracted into images and manually annotated, resulting in a high-quality dataset consisting of 5350 images (3745 for the training set, 1070 for the test set, and 535 for the validation set). Then, a lightweight convolutional data augmentation module DensityNet was designed to enhance the model’s feature extraction ability in crowded and occluded scenes. Subsequently, model pruning and knowledge distillation techniques were combined to reduce model complexity and enhance real-time detection, making it suitable for the computing requirements of edge devices. Finally, a region detection algorithm was designed to better adapt to the demand for crowd monitoring in high-density and view limited dynamic environments by extending the detection trigger time, providing an accurate and contactless solution for crowd flow monitoring in smart libraries. The experimental results show that the improved YOLOv8n model has an average accuracy in high-density scenes? mAP@0.5 ?Reaching 0.99, close to 0.991 of the original model, while mAP@0.5 At 0.95, it reached 0.861, an increase of 0.014 compared to the model before pruning; In terms of real-time performance, the frame rate (FPS) has significantly increased to 254, the computational load has decreased to 4.0 GFLOP, and the parameter count has been reduced to 2.04M, meeting the real-time detection needs of peak pedestrian flow environments in smart libraries. The model proposed by this research institute can be integrated into an intelligent library management system to achieve efficient crowd monitoring and resource optimization.