# An Improved CrowdDet Algorithm for Traffic Congestion Detection in Expressway Scenarios
## 3 Methodology
### Traffic Congestion Detection Based on IBCDet  
[PERSON] [38] proposed that the primary indicator of traffic congestion is the decrease in traffic capacity, which can be quantified by a reduction in vehicle speed. When traffic congestion occurs, the decrease in vehicle speed has a dynamic process of propagation from the front to the back, and this dynamic process is the occurrence of traffic congestion. In this study, this paper use the reduction in vehicle speed as a key feature point to identify the occurrence of traffic congestion. To be more specific, this paper adopt the vehicle running speed threshold division method to detect the status of traffic congestion.  
Due to the use of vehicle speed thresholds for traffic congestion detection in this paper, the first step is to obtain speed information based on the detected number of vehicles. Currently, traffic monitoring systems used for speed measurement primarily rely on sensors. Although these sensors are widely used, they are complex to install, expensive in terms of equipment cost, and require frequent maintenance. Therefore, developing an economical speed measurement method is necessary in the field of traffic. Given that existing traffic systems are typically connected to video cameras and image processing techniques facilitate video analysis, this paper employs machine learning methods for speed estimation. Specifically, the IBCDet algorithm combined with DeepSort technology [39] is used to track the detected vehicles, as illustrated by the vehicle running trajectory diagram in Figure 6. Then, using the Euclidean distance, the distance traveled by the tracked vehicles between two consecutive frames is calculated based on the centroid points. The calculated distance is divided by the time difference between the frames to estimate the speed. The specific equation is shown in Equation (4):  
\[V=\frac{\sqrt{((x_{2}-x_{1})^{2}+(y_{2}-y_{1})^{2})}}{t_{2}-t_{1}} \tag{4}\]  
where the vehicle is located at position \((x_{1},y_{1})\) at time \(t_{1}\) and at position \((x_{2},y_{2})\) at time \(t_{2}\).  
The above equation calculates the speed of a single vehicle at a given moment. In order to more accurately reflect the speed of the vehicles in the video, we will calculate the average speed of all vehicles at a specific time, as shown in Equation (5).  
\[V_{s}=\frac{\sum_{i=1}^{N}V_{i}}{N} \tag{5}\]  
where \(N\) is the number of vehicles detected by the IBCDet algorithm in the video, and \(V_{i}\) represents the speed of the \(i\)-th vehicle. Reflecting on this equation, the higher the vehicle detection rate, the higher the accuracy of \(V_{s}\) to some extent.  
Figure 6: Vehicle running trajectory schematic diagram.  
After obtaining the vehicle speeds, this paper primarily classifies the average vehicle speed \(V_{s}\) based on the LoS for expressways in the Chinese _Technical Standards for Highway Engineering_[40]. By observing the changes in average vehicle speed, the entire process of vehicle congestion is divided into five traffic states: stable state, congestion formation state, severe congestion state, mild congestion state, and congestion dissipation state. This study establishes a correlation between the changes in \(V_{s}\) and the five states of traffic congestion, providing clear criteria for their identification. This enables a more accurate assessment of the extent and dynamics of traffic congestion. The specific discrimination criteria are presented in Table 1. It should be noted that the specific speed thresholds may slightly vary across different regions and road sections. The discrimination criteria provided in this study are universal and derived from experimental observations. Although the scenarios and durations of expressway congestion can vary, the proposed method in this paper is applicable to most scenarios, allowing for an accurate classification of the entire process of traffic congestion formation and dissipation.