# Real-Time Monitoring Method for Traffic Surveillance Scenarios Based on Enhanced YOLOv7
## 1 Introduction  
As artificial intelligence continues to evolve, the necessity for reliable, timely, and robust traffic monitoring methods has become increasingly apparent in the perception layer of intelligent transportation systems (ITS). These methods can assist in alleviating traffic congestion and preventing accidents [1]. While some researchers focus on vehicle target detection and depth estimation using on-board monitoring [2], our study emphasizes perception methods based on roadside monitoring, which more closely aligns with the development of integrated traffic solutions. The accurate detection of vehicle targets in surveillance video has emerged as a pivotal research area within the field of intelligent transportation systems. Nevertheless, a number of practical limitations impede the advancement of object detection methods for traffic surveillance. These challenges include variations in object scale within traffic scenes, different viewpoints of surveillance cameras, occlusion between different vehicle targets, the effects of weather and lighting conditions, and the computational limitations of edge devices. In large-scale traffic monitoring systems, both straight lanes and intersections are monitored. The varying positions of vehicle targets within these scenes, along with the complex backgrounds influenced by weather and lighting conditions, may adversely impact the effectiveness of traffic object detection. To address these challenges, current research focuseson several key strategies: improving feature pyramids [3], introducing attention mechanisms, modifying loss functions [4], and incorporating small object detection layers [5]. Another challenge in detecting traffic in surveillance video is the computational limitations of roadside units (RSUs). The high costs of installing, maintaining, and managing RSUs limit their widespread use. As a result, each RSU covers a large service area, which makes deploying large models impractical [6]. Reducing the computational load of models often leads to a decrease in model accuracy, which affects detection performance. Common approaches to address this issue include replacing the backbone network with lightweight alternatives [7], using lightweight feature extraction structures [8], or reducing the width and depth of the network [9]. The majority of mainstream object detection algorithms proposed in recent years increase the depth and width of the network by superimposing different modules in the network as a means of improving the detection accuracy of the model in the face of varying difficult scenarios. In this paper, we seek to strike a balance between model accuracy and computational efficiency. To this end, we propose a model that addresses the aforementioned challenges and improves the performance of traffic object detection in large-scale traffic surveillance systems. The main contributions of this research are as follows:  
1. We have embedded the CBAM module into the YOLOv7 network structure. The spatial and channel attention mechanisms within the module enable the network to extract the distinctive features of vehicle targets and effectively eliminate the interference from complex backgrounds. 2. In terms of the loss function, we have replaced YOLOv7's CIoU with WIoUv3. CIoU incorporates the aspect ratio similarity of the bounding boxes into the penalty term. However, in large-scale traffic monitoring systems, the same vehicle can have different aspect ratios from different angles and states of motion, which can reduce the accuracy of the model when using CIoU. WIoUv3 avoids this problem and addresses the imbalance between easy and hard samples. 3. Considering the computational limitations of edge devices in ITS, we proposed CLAN to reduce redundant computations. This module replaces the ELAN module in the YOLOv7 backbone network, reducing computational load and model size without compromising model accuracy. The remainder of the paper is organized as follows: Section 2 presents a review of pertinent studies.