A method for evaluating the impact of lighting on intersection safety using a random forest model
The method of evaluating the safety of illumination on intersections through a random forest model solves the problem of evaluating the impact of night lighting on safety, provides quantitative safety improvement measures, and improves the safety of intersections.
Patent Information
- Application Number
- CN202211740037.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-31
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-12-31
AI Technical Summary
The prior art lacks effective methods to evaluate the impact of lighting on intersection safety, resulting in frequent night traffic accidents and affecting driver safety.
A random forest model is used to analyze the vehicle speed changes in front and rear of the intersection entrance lane, and combine illumination and other traffic characteristic variables to establish a regression model to evaluate the impact of illumination on intersection safety.
The lighting value that meets the driver's safe driving can be calculated in different scenarios, improves the safety level of intersections, and provides quantitative safety improvement measures.
Smart Images

Figure CN116153108B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intersection safety, and in particular to a method for evaluating the impact of illumination on intersection safety using a random forest model. Background Art
[0002] Intersection safety has always been an important component in addressing local road safety challenges. Intersections can vary greatly in size, shape, number of entry lanes, and number of turn lanes. Signalized intersections are often the most heavily traveled intersection type and are complex to operate, with many factors contributing to potential safety issues. Maneuvers such as crossing and turning at intersections can cause vehicles to come into conflict with other vehicles, pedestrians, and cyclists. In urban areas, over 50% of crashes and over 30% of crashes in rural areas are attributed to intersections. According to the National Highway Traffic Safety Administration (NHTSA), over the past few years, intersection-related fatalities have averaged 25% of all traffic fatalities and approximately 50% of all traffic injuries.
[0003] The lighting of intersections is one of the key factors affecting safety at night. The International Commission on Illumination (CIE) revealed that more than half of the accidents occurred at night, indicating that the proportion of collisions at night is higher than during the day, and poor lighting levels can lead to serious safety problems and road traffic accidents. Under different traffic conditions, there is a statistically significant relationship between average road brightness and safety, and the accident rate decreases with increasing visibility levels. Therefore, maintaining appropriate illumination in the driving environment of intersections is crucial for driving safety. In summary, there is an urgent need for a method to evaluate the impact of illumination on intersection safety, which is of great significance for the design of intelligent lighting systems for intersections with real-time speed detection of drivers. Management agencies can also formulate quantifiable measures based on the evaluation method to improve the safety level of intersections. Summary of the Invention
[0004] Aiming at the existing problems at intersections, the present invention provides a method for evaluating the impact of illumination on intersection safety using a random forest model.
[0005] This paper proposes a method for evaluating the impact of illumination on intersection safety. The method uses the speed difference before and after entering the intersection entrance lane as the basis for calculating the driver's speed change. A random forest method is then used to develop a regression model consisting of output variables of vehicle speed change and input variables such as lighting characteristics. This method analyzes the impact of each characteristic variable on the driver's speed at the intersection and calculates the illumination value that satisfies the driver's safety in different scenarios.
[0006] The technical solution of the present invention is:
[0007] A method for evaluating the impact of lighting on intersection safety using a random forest model includes the following steps:
[0008] 1. Design experimental steps;
[0009] Field trials were conducted during the night hours of typical workdays (e.g., Tuesday, Wednesday, and Thursday). The selected intersections were designed to be as similar in size and environmental conditions as possible and all signalized. Each intersection had a center line, a separation for motor vehicles and non-motor vehicles, and a dedicated left-turn lane. The speed limit at all intersections was 50 km / h. The width of the entryways was measured using a laser rangefinder.
[0010] Initial traffic data collection was performed using drones to capture specific video footage, with surveys conducted for equal durations at each intersection. GPS was used to identify parameters such as the aircraft's altitude and charge level. Current methods only utilize vehicle and other traffic data on level, two-way roads.
[0011] In addition, when shooting videos, the illumination of each intersection must also be recorded. The machine is placed on the ground to measure the illumination around the sidewalks, and the illumination is measured at regular intervals at night. Each intersection records a total of 12 points in a time period (the recording points are the starting point, middle point, and end point of the four sidewalks). Finally, the 12 illumination values around the sidewalks are averaged to calculate the illumination of the intersection recorded during the corresponding time period. The illumination calculation expression is as follows:
[0012]
[0013] 2. Process data;
[0014] To examine the impact of lighting on vehicle speed changes when a driver passes through an intersection, we first screened the drone-collected data. A valid event was defined as a driver passing through the intersection entrance without any other interference. The vehicle selection criteria for video processing included:
[0015] 1) All selected vehicles are not affected by other interactions (such as other vehicles or pedestrians).
[0016] 2) Vehicles that pass through the intersection freely (excluding vehicles that stop at a red light).
[0017] 3) There are no turning vehicles involved in the dataset.
[0018] After video data recognition, Tracker software processes the video to obtain vehicle trajectory and speed data during the green light periods before and after the intersection entrance. This software can automatically track only one vehicle at a time. Each vehicle is considered a particle and captured at 24 frames per second. Tracker calculates the actual coordinates and speed by converting pixel coordinates to pixel speed. The software then retrieves the vehicle's parameters: t (time), x (horizontal axis), y (vertical axis), and v (speed).
[0019] 3. Analyze variables and data;
[0020] This invention uses speed variation as a dependent variable to measure the safety of drivers at intersections. Speed variation measures the characteristic changes in the speed of the same vehicle and is a useful method for assessing safety. Greater speed variation indicates a higher accident rate. A driver's speed variation before and after the intersection entrance lane is smaller, indicating safe driving. The formula for calculating speed variation is:
[0021] ΔV=V s -V o , (2)
[0022] Where V s is the average vehicle speed in the intersection starting area (5 meters long in this study); V o Indicates the initial speed. The calculated value is the average speed before the vehicle starts to pass through the intersection (i.e., 60 to 40 meters away from the starting intersection line).
[0023] The independent variables used in the present invention include illuminance, initial velocity (V0), left-turn traffic flow (LeftV), right-turn traffic flow (right tv), straight-through traffic flow (StraightV), total traffic flow (TotalV), the ratio of straight-through to right-turn traffic flow (RatioSR), and the number of entrance lanes (NumLane). The illumination of the intersection is calculated according to formula (1). Then, the illumination value at a specific time point is calculated using linear interpolation. Linear interpolation is a method of curve fitting using linear polynomials to construct new data points within a set of known discrete data points. In this experiment, all traffic flows, including left-turn, right-turn, straight-through and total traffic flows, are counted once every fixed time period. Similarly, traffic flows at random time points are obtained by linear interpolation.
[0024] 4. Establish models and determine evaluation indicators;
[0025] This paper uses a random forest (RF) model to simulate the impact of traffic factors such as intersection lights on driver speed changes. Each decision tree in the model is randomly sampled from the dataset and trained, and the results of each decision tree are finally integrated. Compared with linear models, random forest regression models can capture nonlinear interactions between features and targets and quickly analyze the correlation between each data feature and the label data. It is well suited for tabular data with numerical features or categorical features with fewer than a few hundred categories.
[0026] The RF algorithm can perform regression modeling based on a set of decision trees and is operated in conjunction with bagging (guided aggregation algorithm) and bootstrapping (self-help method). The RF algorithm process of the present invention is as follows:
[0027] 41) Bootstrapping: Each base classifier is a simple decision tree. Each tree is constructed by selecting a random set of observations from the training dataset. All base models are independently constructed using different subsamples of the dataset. The selected data samples (approximately two-thirds of the time) are called bootstrap samples, and the remaining data samples (approximately one-third of the time) are called out-of-bag samples.
[0028] 42) Training: The RF model generates a forest of decision trees, where each tree contains a random subset of all features (i.e., some features in Illuminance, V0, LeftV, Righttv, StraightV, TotalV, RatioSR, and NumLane), and the best split is obtained by building decision trees as described above.
[0029] 43) Testing / Vote: Predictions for new / test samples can be made by averaging the predictions of all decision trees or by taking a majority vote. The final regression result of the RF algorithm in this invention is obtained by averaging the outputs of all decision trees built on the bootstrapped samples.
[0030] RF can calculate the mean squared error (MSE) of OOB samples. A lower error rate can eliminate the need for test validation (such as cross-validation). In RF regression models, the mean of squared residuals (MSE) and percent variance explained are used as evaluation metrics to verify the accuracy of the model.
[0031] The mean square error is calculated as follows:
[0032]
[0033] in, Represents the predicted data after substituting the OOB data of the i-th tree, y i is the true data of the ith tree. The percent variance explained (% VarEplained) is calculated as follows:
[0034]
[0035] Where, The calculation is performed with n as the divisor; the value of %VarExplained can be used to represent the accuracy of the RF model. The larger the value, the higher the model accuracy.
[0036] Importantly, RF can calculate the importance of feature variables by calculating the increase in prediction error when the (OOB) data for that variable are permuted while all other variables remain unchanged. The obvious advantages of random forest analysis compared to other models include: there is no possibility of overfitting, and the generalization error generated when multiple trees are grown is limited; it alleviates the problem of multicollinearity by reducing the possibility of selecting highly correlated features in variable sampling. In the RF algorithm, the contribution of highly correlated features is retained, so that it does not have too much impact on the top-ranked influential features. Unlike other classifiers such as SVM, the random process in RF can maintain high performance in the presence of many noisy features.
[0037] 5. Training models and analyzing results;
[0038] Identify valid vehicle tracking segments from drone videos. Analyze using one dependent variable (e.g., speed change) and eight independent variables (e.g., initial velocity, illumination, etc.).
[0039] The random forest algorithm was developed in R (64 3.3.3) software. The dataset was randomly divided into two parts, where 70% of the dataset was defined as training data and the remaining 30% was used as test data. The model requires two main parameters: the number of decision trees (n tree ) and the number of variables in each tree (m try ). m try The larger the value, the greater the strength of each tree and the correlation between trees. Therefore, in RF analysis, it is important to select a suitable m try The value is crucial. For regression problems, the recommended number of features / input variables is 0.5 / 1 / 2 times 1 / 3 of the total number.
[0040] The goodness of fit (percent variance explained) of the RF test data was analyzed, and the importance of each variable in the final model was calculated to represent its contribution to the predicted response. To further quantitatively explore the quantitative relationship between illumination and intersection safety, two-dimensional kernel density plots were displayed on all selected data sets to study the speed changes for different illumination levels, initial speeds, and straight-line traffic flows. A two-dimensional kernel density plot is a smoothed color density representation of a scatter plot, a non-parametric technique based on the probability density function of kernel density estimation. The goal of density estimation is to take a finite sample of data and infer the underlying probability density function of all locations, including places where there are no data points. In kernel density estimation, the contribution of each data point is smoothed from a single point to a neighboring area. These smoothed density plots show the average trend of the scatter plot.
[0041] The present invention works by using drones to capture specific video footage of each intersection for initial traffic data collection. Using vehicle speed change as a safety assessment metric, the speed difference before and after a vehicle passes through the intersection's entry lane is calculated. A random forest (RF) model is then developed to perform regression analysis on variables such as vehicle speed change, illumination, initial velocity, left-turn traffic flow, right-turn traffic flow, through-traffic flow, total traffic flow, the ratio of through-traffic to right-turn traffic flow, and the number of entry lanes.
[0042] Advantages of this invention: It analyzes the impact of characteristic variables on a driver's speed at an intersection and calculates illumination levels that meet safe driving requirements in different scenarios. This provides valuable insights into the design of intelligent intersection lighting systems based on real-time driver speed detection. This method can be used by regulatory agencies to develop quantifiable measures to improve intersection safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1(a)-Figure 1(d) Figures 1(a) and 1(b) show the geometric shapes of four intersections according to the present invention (vertical views taken during the day), wherein Figure 1(a) shows the Huangshan-Xinglong Street intersection, Figure 1(b) shows the Leshan-Xinglong Street intersection, Figure 1(c) shows the Taishan-Aoti Street intersection, and Figure 1(d) shows the Huangshan-Mengdu Street intersection.
[0044] Figure 2 This is a screenshot of the drone shooting interface of the present invention;
[0045] Figure 3 This is the video processing process of the Tracker software of the present invention;
[0046] Figure 4 It is a schematic diagram of calculating the vehicle speed change of the present invention;
[0047] Figure 5 This is the flow chart of the RF algorithm regression modeling of the present invention;
[0048] Figure 6This is a speed change distribution diagram under different illumination conditions of the present invention;
[0049] Figure 7(a)-Figure 7(b) 7(a) is a distribution diagram of speed changes with illumination in low-speed scenarios; FIG. 7(b) is a distribution diagram of speed changes with illumination in high-speed scenarios;
[0050] Figure 8(a)-Figure 8(b) 8(a) is a distribution diagram of speed changes with illumination in a low traffic flow scenario; FIG8(b) is a distribution diagram of speed changes with illumination in a high traffic flow scenario. DETAILED DESCRIPTION
[0051] The technical solution of the present invention is further described below with reference to the accompanying drawings.
[0052] The method of the present invention for evaluating the effect of illumination on intersection safety using a random forest model comprises the following steps:
[0053] 1. Design experimental steps;
[0054] Field tests were conducted from November 10 to December 18, 2017, on typical weekdays (Tuesday, Wednesday, and Thursday) between 5:30 PM and 7:30 PM. Data were collected at four intersections in Jianye District, Nanjing, Jiangsu Province, China (Huangshan-Xinglong Street Intersection, Leshan-Xinglong Street Intersection, Taishan-Aoti Street Intersection, and Huangshan-Mengdu Street Intersection). Figure 1 shows a vertical view of four signalized intersections in the city during the day. All four intersections are similar in size and signalized. Each intersection is required to have a center line, a separation for motor vehicles and non-motor vehicles, and a dedicated left-turn lane. The speed limit at all intersections is 50 km / h. The entrance lane widths were measured using a laser rangefinder. Table 1 lists the number of lanes and entrance widths at these four intersections.
[0055] Table 1 Number and width of lanes at intersection entrances
[0056]
[0057] A drone (DJI Phantom 3Advanced) was used to obtain specific videos for initial traffic data collection, and a two-hour survey was conducted at each intersection. Figure 2 Screenshot of the drone's operating interface. GPS is used to identify parameters such as the aircraft's altitude and charge level. Current methods only use vehicle and other traffic data on horizontal, two-way roads.
[0058] In addition, when shooting the video, the illumination of the four intersections must be recorded at the same time. This time, an illuminance meter (Konica Minolta, T-10A) is used to measure the illumination in lux. The machine is placed on the ground to measure the illumination around the sidewalk, and the illumination is measured once every fixed time period at night. Each intersection records a total of 12 points in a time period (this time is 15 minutes) (the recording points are the starting point, middle, and end point of the four sidewalks). Finally, the 12 illumination values around the sidewalk are averaged to calculate the illumination of the intersection recorded in the corresponding time period. The illumination calculation expression is as follows:
[0059]
[0060] 2. Process data;
[0061] To examine the impact of lighting on vehicle speed changes when a driver passes through an intersection, we first screened the drone-collected data. A valid event was defined as a driver passing through the intersection entrance without any other interference. The vehicle selection criteria for video processing included:
[0062] 1) All selected vehicles are not affected by other interactions (such as other vehicles or pedestrians).
[0063] 2) Vehicles that pass through the intersection freely (excluding vehicles that stop at a red light).
[0064] 3) There are no turning vehicles involved in the dataset.
[0065] After video data recognition, the Tracker software is used to process the video to obtain the trajectory data and speed data of the vehicle during the green light period before and after the intersection entrance, such as Figure 3 As shown in the figure, this software can only automatically track one vehicle at a time. Each vehicle is considered a particle and captured at 24 frames per second. Tracker calculates the actual coordinates and velocity by converting pixel coordinates to pixel velocity. The software then retrieves the parameters t (time), x (horizontal axis), y (vertical axis), and v (velocity) for each vehicle.
[0066] 3. Analyze variables and data;
[0067] This invention uses speed variation as a dependent variable to measure driver safety at intersections. Speed variation measures the characteristic changes in speed of the same vehicle and is a useful method for assessing safety. Greater speed variation indicates a higher accident rate. A driver's speed variation before and after the intersection entrance lane is minimal, indicating safe driving. Figure 4 The calculation process of the vehicle speed change in this study is shown. The speed change is calculated as:
[0068] ΔV=V s -V o , (2)
[0069] Where V s is the average vehicle speed in the initial area of the intersection (5 meters in length in this study); V o Indicates the initial speed. The calculated value is the average speed before the vehicle starts to pass through the intersection (i.e., 60 to 40 meters away from the starting intersection line).
[0070] The independent variables used in the present invention include illuminance, initial velocity (V0), left-turn traffic flow (LeftV), right-turn traffic flow (right tv), straight-through traffic flow (StraightV), total traffic flow (TotalV), the ratio of straight-through to right-turn traffic flow (RatioSR), and the number of entrance lanes (NumLane). The illuminance at the intersection is calculated according to formula (1). The illuminance is recorded every 15 minutes at night, and the illuminance value at a specific time point is calculated using linear interpolation. Linear interpolation is a method of curve fitting using linear polynomials to construct new data points within a set of known discrete data points. In this experiment, all traffic flows, including left-turn, right-turn, straight-through and total traffic flows, are counted every 5 minutes. Similarly, traffic flows at random time points are obtained by linear interpolation.
[0071] 4. Establish models and determine evaluation indicators;
[0072] This paper uses a random forest (RF) model to simulate the impact of traffic factors such as intersection lights on driver speed changes. Each decision tree in the model is randomly sampled from the dataset and trained, and the results of each decision tree are finally integrated. Compared with linear models, random forest regression models can capture nonlinear interactions between features and targets and quickly analyze the correlation between each data feature and the label data. It is well suited for tabular data with numerical features or categorical features with fewer than a few hundred categories.
[0073] The RF algorithm can perform regression modeling based on a set of decision trees and operate in combination with bagging (guided aggregation algorithm) and bootstrapping (self-help method). Figure 5 As shown, the RF algorithm process of the present invention is as follows:
[0074] 1) Bootstrapping: Each base classifier is a simple decision tree. Each tree is constructed by selecting a random set of observations from the training dataset. All base models are independently constructed using different subsamples of the dataset. The selected data samples (approximately two-thirds of the time) are called bootstrap samples, and the remaining data samples (approximately one-third of the time) are called out-of-bag samples.
[0075] 2) Training: The RF model generates a forest of decision trees, where each tree contains a random subset of all features (i.e., some features in Illuminance, V0, LeftV, Righttv, StraightV, TotalV, RatioSR and NumLane), and the best split is obtained by building decision trees as described above.
[0076] 3) Testing / Vote: Predictions for new / test samples can be made by averaging the predictions of all decision trees or by taking a majority vote. The final regression result of the RF algorithm in this invention is obtained by averaging the outputs of all decision trees built on the bootstrapped samples.
[0077] RF can calculate the mean squared error (MSE) of OOB samples. A lower error rate can eliminate the need for test validation (such as cross-validation). In RF regression models, the mean of squared residuals (MSE) and percent variance explained are used as evaluation metrics to verify the accuracy of the model.
[0078] The mean square error is calculated as follows:
[0079]
[0080] in, Represents the predicted data after substituting the OOB data of the i-th tree, y i is the true data of the ith tree. The percent variance explained (% VarExplained) is calculated as follows:
[0081]
[0082] Where, The calculation is performed with n as the divisor; the value of %VarExplained can be used to represent the accuracy of the RF model. The larger the value, the higher the model accuracy.
[0083] Importantly, RF can calculate the importance of feature variables by calculating the increase in prediction error when the (OOB) data for that variable are permuted while all other variables remain unchanged. The obvious advantages of random forest analysis compared to other models include: there is no possibility of overfitting, and the generalization error generated when multiple trees are grown is limited; it alleviates the problem of multicollinearity by reducing the possibility of selecting highly correlated features in variable sampling. In the RF algorithm, the contribution of highly correlated features is retained, so that it does not have too much impact on the top-ranked influential features. Unlike other classifiers such as SVM, the random process in RF can maintain high performance in the presence of many noisy features.
[0084] 5. Training models and analyzing results;
[0085] A total of 213 valid vehicle tracking segments were identified from the drone videos. Analysis was performed using one dependent variable (e.g., velocity change) and eight independent variables (e.g., initial velocity, illumination, etc.). Table 2 summarizes the specific characteristics of all variables in the dataset selected for this study.
[0086] Table 2 Variable characteristics table
[0087]
[0088] The random forest algorithm was developed in R (64 3.3.3) software. The dataset was randomly divided into two parts, where 70% of the dataset was defined as training data and the remaining 30% was used as test data. The model requires two main parameters: the number of decision trees (n tree ) and the number of variables in each tree (m try ). m try The larger the value, the greater the strength of each tree and the correlation between trees. Therefore, in RF analysis, it is important to select a suitable m try For regression problems, the recommended features / input variables are 0.5 / 1 / 2 times of the total 1 / 3 (equal to 2 / 3 / 6 in this study), n tree The values of are 200 / 300 / 500. In order to avoid the overfitting problem when applying RF analysis on small data sets, the recommended values of these two parameters are tested. Finally, in the present invention, m is set to try =3 and n tree =500 to meet the requirements of minimum OOB error and maximum “explained percentage variance”.
[0089] The RF analysis results showed a goodness of fit (percent variance explained) of 86.44% for the test data, indicating a high degree of accuracy for the regression model. The importance of each variable in the final model was calculated, indicating its contribution to the predicted response, as shown in Table 3. As can be seen from the table, initial speed, illumination, and through traffic flow were the three most important variables in the final model, with RF importances of 23.47, 20.43, and 13.29, respectively. This indicates that in this study, initial speed before starting to pass through the intersection had the greatest impact on vehicle speed changes, followed by illumination and through traffic flow.
[0090] Table 3 Importance level of each feature RF
[0091]
[0092] To further quantitatively explore the relationship between illumination and intersection safety, two-dimensional kernel density plots are displayed for all selected data sets, examining how speed changes with varying illumination levels, initial speeds, and straight-line traffic flow. A two-dimensional kernel density plot is a smoothed color density representation of a scatter plot, a nonparametric technique based on kernel density estimation of the probability density function. The goal of density estimation is to take a limited sample of data and infer the underlying probability density function for all locations, including those with no data points. In kernel density estimation, the contribution of each data point is smoothed from a single point to a neighboring region. These smoothed density plots reveal the average trend of the scatter plot.
[0093] (1)Illumination
[0094] The two-dimensional kernel density map describes the distribution of speed changes at different illumination values, such as Figure 6 As shown in the figure, it is clear that when the illuminance is between 40 and 50 lux, speed variations are stably clustered around zero. Drivers can maintain safe visibility and maintain their speed through the intersection during the green light period when the lighting range is between 40 and 50 lux. We can also observe two completely different trends in the speed variation distribution on either side of the illuminance variation. When the illuminance is below 30 lux, and especially below 10 lux, the speed variation is widely distributed between 0 and 20 km / h. This indicates that under these lighting conditions, drivers may not clearly see the intersection and may adopt varying degrees of deceleration to pass the intersection. When the illuminance is above 60 lux, there are 16 cases where the speed variation exceeds 5 km / h. This means that this lighting meets the driver's visibility requirements, and drivers may actively accelerate at the intersection. Therefore, this study strongly recommends setting the intersection illumination between 40 and 50 lux to balance driving safety and energy efficiency.
[0095] (2) Initial velocity
[0096] The relationship between speed change and illuminance at different initial speeds was studied. As shown in Table 2, the mean initial speed is 42.49 km / h and the median is 40 km / h. Therefore, in this study, an initial speed of less than 40 km / h is defined as a low-speed scenario, and an initial speed greater than 40 km / h is defined as a high-speed scenario. Figures 7(a) and 7(b) are two-dimensional kernel density plots of the distribution of speed with illuminance changes under low and high speed conditions, respectively. It can be seen from the figure that low initial speed tends to increase with high illuminance (above 50 lux), while high initial speed tends to decrease with illuminance (below 40 lux). This shows that high speed requires higher illuminance (above 40 lux) than low speed. At the same time, it is concluded that an illuminance of 40 to 50 lux is the best choice for drivers arriving at intersections at low and high initial speeds.
[0097] (3) Through traffic flow
[0098] The distribution of speed changes as a function of illumination under different through-traffic conditions was studied, as shown in Figure 8. In this study, traffic flows below 400 / h were defined as low-traffic scenarios, while traffic flows above 400 / h were defined as high-traffic scenarios. The results show that the speed variation distribution characteristics under different illumination levels in high-traffic scenarios are less pronounced than in low-traffic scenarios. The effect of lighting on intersection speed changes may be relatively insignificant. This may be due to vehicle following behavior in high-traffic scenarios.
Claims
1. A method for evaluating the impact of lighting on intersection safety using a random forest model, comprising the following steps: Step 1: Design the experimental steps; Field tests were conducted during a typical weekday night. The selected intersections were as similar in size and environmental conditions as possible and all were signalized. Each intersection had a center line, a separation for motor vehicles and non-motor vehicles, and a dedicated left-turn lane. The speed limit at all intersections was 50 km / h. The width of the entrance aisles was measured using a laser rangefinder. Drone video was used to capture initial traffic data, and surveys were conducted for the same length of time at each intersection. GPS was used to identify the aircraft's flight altitude and charge level parameters. In addition, when shooting videos, the illumination of each intersection must also be recorded. The device is placed on the ground to measure the illumination around the sidewalks. The illumination is measured at regular intervals at night. Each intersection records 12 points in a time period. The recording points are the starting point, middle point, and end point of the four sidewalks. Finally, the 12 illumination values around the sidewalks are averaged to calculate the illumination of the intersection recorded during the corresponding time period. The illumination calculation expression is as follows: Step 2: Process the data. In order to investigate the influence of lighting on the change of vehicle speed when the driver passes through the intersection, the data collected by the drone was first screened; A valid event is defined as a driver passing through the entrance of the intersection without other interference; the criteria for vehicle selection in video processing include: 1) All selected vehicles are not affected by other interactions; 2) Vehicles that are free to pass through the intersection, excluding vehicles that stop at a red light; 3) There are no turning vehicles involved in the dataset; After video data recognition, Tracker software is used to process the video to obtain vehicle trajectory and speed data during the green light period before and after the intersection entrance. Using this software, only one vehicle can be automatically tracked at a time. Each vehicle is considered a particle and captured at 24 frames per second. Tracker calculates the actual coordinates and speed values by converting pixel coordinates into pixel speed. The software then retrieves the parameters of each vehicle: time t, horizontal axis x, vertical axis y, and speed v. Step 3: Analyze variables and data; Speed variation is used as the dependent variable to measure the safety of drivers at intersections. Speed variation measures the characteristic changes in the speed of the same vehicle and is a useful method for assessing safety. The greater the speed variation, the higher the accident rate. A driver's speed variation before and after the intersection entrance lane is small, indicating safe driving. The speed variation calculation formula is: ΔV=V s -V o , (2) Where V s is the average speed of the vehicles in the intersection starting area; V o Indicates the initial speed, which is the average speed before the vehicle starts to pass through the intersection; The independent variables include illuminance, initial velocity V0, left-turn traffic volume LeftV, right-turn traffic volume right tv, straight traffic volume StraightV, total traffic volume TotalV, the ratio of straight-turn to right-turn traffic volume RatioSR, and the number of entrance lanes Numlane. The illumination of the intersection is calculated according to formula (1). Then, the illumination value at a specific time point is calculated using linear interpolation. Linear interpolation is a method of curve fitting using linear polynomials to construct new data points within a set of known discrete data points. All traffic flows, including left-turn, right-turn, straight-turn, and total traffic flows, are counted once every fixed time period. Similarly, traffic flows at random time points are obtained through linear interpolation. Step 4: Establish the model and determine the evaluation indicators; A random forest model (RF) is used to simulate the impact of intersection light traffic factors on driver speed changes. Each decision tree in the model is randomly sampled from the dataset and trained, and the results of each decision tree are finally integrated. Compared with linear models, random forest regression models can capture nonlinear interactions between features and targets and quickly analyze the correlation between each data feature and the label data. They are also well-suited for tabular data with numerical features or categorical features with fewer than a few hundred categories. The RF algorithm can perform regression modeling based on a set of decision trees and is combined with the guided aggregation algorithm bagging and bootstrapping technology to operate; the RF algorithm process is as follows: 41) Bootstrapping: Each base classifier is a simple decision tree; each tree is built by selecting a random set of observations from the training dataset; all base models are independently built using different subsamples of the dataset; the selected data samples are called bootstrap samples, and the remaining data samples are called out-of-bag samples (OOB); 42) Training: The RF model generates a forest of decision trees, where each tree contains a random subset of all features, i.e., some features in Illuminance, V0, LeftV, Righttv, StraightV, TotalV, RatioSR, and NumLane, and the best split is obtained by building a decision tree in the same way as in step 41; 43) Testing / Vote: Predictions for new / test samples can be made by averaging the predictions of all decision trees or by taking majority vote on the decision trees. The final regression result of the RF algorithm is obtained by averaging the outputs of all decision trees built on the bootstrapped samples. RF can calculate the mean squared error (MSE) of OOB samples; a lower error rate can eliminate the need for testing and validation; in the RF regression model, in order to verify the accuracy of the model, the mean of squared residuals, MSE, and percent variance explained are used as evaluation indicators; The mean square error is calculated as follows: in, Represents the predicted data after substituting the OOB sample of the i-th tree, y i is the true data of the ith tree; the percent variance explained, %VarExplained is calculated as follows: Where, The calculation is performed with n as the divisor; the value of %VarExplained can be used to represent the accuracy of the RF model. The larger the value, the higher the model accuracy. Step 5: Train the model and analyze the results; Identify valid vehicle tracking segments from drone videos; use one dependent variable and eight independent variables for analysis; The random forest algorithm was developed in R (64 3.3.3) software. The dataset was randomly divided into two parts, where 70% of the dataset was defined as training data and the remaining 30% was used as test data. The random forest model requires two main parameters: the number of decision trees n and the number of test trees n. tree and the number of variables in each tree m try ;m try The larger the value, the greater the strength of each tree and the correlation between trees; therefore, in RF analysis, choosing a suitable m try The value of m is crucial; for regression problems, try The value of is 0.5 / 1 / 2 times of 1 / 3 of the total number of input variables; The goodness of fit of the RF test data was analyzed, and the importance of each variable in the final model was calculated to indicate its contribution to the predicted response. To further explore the quantitative relationship between illumination and intersection safety, two-dimensional kernel density plots were displayed on all selected data sets to study the speed changes for different illumination levels, initial speeds, and straight-line traffic flows. The two-dimensional kernel density plot is a smoothed color density representation of the scatter plot, a non-parametric technique based on the probability density function of kernel density estimation. The goal of density estimation is to take a finite data sample and infer the underlying probability density function of all places, including places where there are no data points. In kernel density estimation, the contribution of each data point is smoothed from a single point to a neighboring area. These smoothed density plots show the average trend of the scatter plot.
2. The method for evaluating the impact of illumination on intersection safety using a random forest model according to claim 1, wherein: A typical workday as described in step 1 is Tuesday, Wednesday, or Thursday.
3. The method for evaluating the impact of illumination on intersection safety using a random forest model according to claim 1, wherein: The length of the starting intersection area of the intersection described in step 3 is 5 meters; V o Indicates the initial speed, and the calculated value is the average speed of the vehicles 60 to 40 meters before the starting intersection line.
4. The method for evaluating the impact of illumination on intersection safety using a random forest model according to claim 1, wherein: The guide samples described in step 41) account for two-thirds of the data samples, and the outer bag samples account for one-third of the data samples.
Citation Information
Patent Citations
Safety early warning method and device based on traffic intersection identification and electronic equipment
CN111985373A
Method and device for calculating safe vehicle speed at tunnel exit
CN115063986A