Urban interchange ramp and ramp green wave setting method based on reinforcement learning and multivariate video data analysis
Through reinforcement learning and multi-dimensional video data analysis, the intelligent adjustment of the up and down ramp signal lights of the interchange solves the problem of traditional signal control being difficult to adapt to traffic changes, and achieves the dynamic balance of ramp traffic flow and the improvement of traffic efficiency.
Patent Information
- Application Number
- CN202410629343.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-09-06
AI Technical Summary
Traditional fixed-sequence signal control is difficult to adapt to different time periods and changes in traffic flow, resulting in unbalanced traffic distribution on the upper and lower ramps of urban interchanges and affecting traffic efficiency.
Using methods based on reinforcement learning and multivariate video data analysis, ramp traffic information is obtained through camera video streams, and target detection and tracking algorithms are used to calculate traffic flow and speed. The Q-learning algorithm is combined with the Q-learning algorithm to intelligently adjust the signal phase and dynamically adjust the signal status.
It realizes the intelligent adjustment of traffic flow distribution on the upper and lower ramps of the interchange, reduces traffic congestion, improves traffic efficiency, and provides a more intelligent and efficient traffic management solution.
Smart Images

Figure CN118609387A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis. Background Art
[0002] By the end of 2023, the number of motor vehicles owned by Chinese citizens will exceed 435 million. In an urban environment with tight land resources, the road traffic load has reached its limit. The construction of urban overpasses has alleviated the congestion of urban trunk roads, but the unreasonable sharing of traffic flow between ground roads and overpasses may make the congestion worse. During the morning and evening commuting peaks, the on- and off-ramps where the ground roads meet the overpasses are most likely to cause traffic jams, which in turn affects the traffic flow of the entire area. Adjusting the traffic flow of the on- and off-ramps in a reasonable way has become one of the important directions to alleviate the congestion of overpasses.
[0003] In the field of smart transportation, controlling the phase cycle of traffic lights through vehicle data is the main method to solve urban road congestion. Traditional fixed-time signal control is often difficult to adapt to changes in different time periods and traffic flows, and reinforcement learning provides a new design idea for signal control. It is based on traffic state parameters such as driving speed, congestion index, and waiting time, and the intelligent agent dynamically adjusts the state of the signal to minimize traffic congestion time. However, factors such as the complexity of the environmental state and the lag in data acquisition will affect the judgment of the intelligent agent, and thus affect the effectiveness of the signal light phase control decision. Summary of the invention
[0004] In order to overcome the shortcomings of the above technologies, the present invention provides a method for setting green waves on and off ramps of urban interchanges based on reinforcement learning and multivariate video data analysis, which can intelligently adjust ramp traffic lights according to traffic conditions to avoid serious imbalance in the distribution of on- and off-ramp traffic at the interchange.
[0005] The technical solution adopted by the present invention to overcome the technical problems is:
[0006] A method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis comprises the following steps:
[0007] a) Obtain the video stream information of the cameras around the on- and off-ramps of the interchange, and obtain the monitoring image set F of the ramp diversion area split , ramp area monitoring image set F ramp , Bridge underpass area monitoring image set F road , Monitoring image set F of the traffic area on the overpass overpass ;
[0008] b) Monitoring image set F of ramp diversion area splitPerform ramp diversion area division to obtain accurate ramp diversion area image set X split ;
[0009] c) Monitoring image set F of ramp area ramp Perform ramp area division to obtain an accurate ramp area image set X ramp ;
[0010] d) Monitoring image set F of the underpass area road Divide the underbridge traffic area and obtain an accurate underbridge traffic area image set X road ;
[0011] e) Monitoring image set F of the traffic area on the overpass overpass Divide the traffic area on the overpass and obtain an accurate image set X of the traffic area on the overpass overpass ;
[0012] f) Based on the accurate ramp diversion area image set X split , accurate ramp area image set X ramp , accurate image set of underpass area road , accurate image set X of the traffic area on the overpass overpass Calculate the number of vehicles passing through the ramp diversion area within time step p Number of vehicles passing through the ramp area Number of vehicles passing through the underpass Number of vehicles passing through the traffic area on the overpass Average speed of vehicles passing through the ramp diversion area Average speed of vehicles passing through the ramp area Average speed of vehicles passing through the underpass The average speed of vehicles passing through the traffic area on the overpass
[0013] g) Based on the number of vehicles in the ramp diversion area Number of vehicles passing through the ramp area Number of vehicles passing through the underpass Number of vehicles passing through the traffic area on the overpass Average speed of vehicles passing through the ramp diversion area Average speed of vehicles passing through the ramp area Average speed of vehicles passing through the underpass The average speed of vehicles passing through the traffic area on the overpass The ramp signal light phase action is calculated and the ramp signal light performs the phase action.
[0014] Further, step a) comprises the following steps:
[0015] a-1) The video stream of the camera used to shoot the ramp diversion area of the on-ramp and off-ramp of the interchange is obtained, and the video stream is framed to obtain a ramp diversion area monitoring image set consisting of t frames of ramp diversion area monitoring images. Among them, F i split is the monitoring image of the ramp diversion area in the i-th frame, i∈{1,...,t};
[0016] a-2) The video stream of the camera used to shoot the ramp area of the on-ramp and off-ramp of the interchange is obtained, and the video stream is framed to obtain a ramp area monitoring image set F consisting of t frames of ramp area monitoring images. ramp , Among them, F i ramp is the i-th frame ramp area monitoring image, i∈{1,...,t};
[0017] a-3) The video stream of the camera used to shoot the underpass area of the interchange on and off ramps is obtained, and the video stream is framed to obtain a set of underpass area monitoring images F consisting of t frames of underpass area monitoring images. road , Among them, F i road is the monitoring image of the underpass area in the i-th frame, i∈{1,...,t};
[0018] a-4) The video stream of the camera used to shoot the traffic area on the overpass at the on-ramp and off-ramp of the overpass is obtained, and the video stream is framed to obtain a set of monitoring images of the traffic area on the overpass consisting of t frames of monitoring images of the traffic area on the overpass overpass , Among them, F i overpass is the monitoring image of the traffic area on the overpass in the i-th frame, i∈{1,...,t}.
[0019] Furthermore, in step b), the ramp diversion area monitoring image F of the i-th frame is manually marked. i split The ramp diversion area in the image is cut out by using the OPENCV slice operation to obtain an accurate ramp diversion area image. Accurate ramp diversion area image set The actual length of the ramp diversion area is measured accurately to obtain the true length S split .
[0020] Furthermore, in step c), the ramp area monitoring image F of the i-th frame is manually marked. i rampThe ramp area in the image is cut out by OPENCV slicing operation to obtain an accurate image of the ramp area. Accurate ramp area image set Actually measure the exact length of the ramp area and get the true length S ramp .
[0021] Furthermore, in step d), the i-th frame of the underbridge traffic area monitoring image F is manually marked. i road The image of the marked under-bridge traffic area is cut out using the OPENCV slicing operation to obtain an accurate under-bridge traffic area image. Accurate image set of underpass areas The actual length of the underpass is measured accurately to obtain the true length S road .
[0022] Furthermore, in step e), the monitoring image F of the traffic area on the overpass is manually marked. i overpass The image of the overpass on the overpass is cut out by using the OPENCV slice operation to obtain an accurate image of the overpass on the overpass Accurate image set of traffic areas on overpasses The actual length S is obtained by measuring the exact length of the traffic area on the overpass. overpass .
[0023] Further, step f) comprises the following steps:
[0024] f-1) Accurate ramp diversion area image through YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n1}, n1 is the detected accurate ramp diversion area image The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle;
[0025] f-2) Accurate ramp area image through YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n2}, n2 is the detected accurate ramp area image The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle;
[0026] f-3) Accurate image of the underpass area using the YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n3}, n3 is the detected accurate image of the underbridge passage area The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle;
[0027] f-4) Accurate image of the traffic area on the overpass through the YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle , where j∈{1,2,...,n4}, n4 is the detected accurate image of the traffic area on the overpass The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle;
[0028] f-5) Through the formula Compute accurate ramp diversion images The center point of the jth motor vehicle The motion trajectory generated by the center point of the j-th motor vehicle in the ramp diversion area image with t frames of accuracy is solved according to the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle. , motion trajectory The start time is Movement trajectory The end time is
[0029] f-6) Through the formula
[0030] Calculate accurate ramp area image The center point of the jth motor vehicle The motion trajectory generated by the center point of the jth motor vehicle in the ramp area image with t frames is solved according to the maximum intersection-and-union ratio of the rectangular target detection frame of the jth motor vehicle.
[0031] , motion trajectory The start time is Movement trajectory The end time is f-7) Through the formula
[0032] Calculate accurate image of underpass area The center point of the jth motor vehicle The motion trajectory generated by the center point of the j-th motor vehicle in the t-frame accurate underbridge traffic area image is solved based on the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle.
[0033] , motion trajectory The start time is Movement trajectory The end time is f-8) Through the formula
[0034]
[0035] Calculate accurate traffic zone image on overpass The center point of the jth motor vehicle According to the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle, the motion trajectory generated by the center point of the j-th motor vehicle in the t-frame accurate image of the traffic area on the overpass is solved. , motion trajectory The start time is Movement trajectory The end time is f-9) Set the accurate ramp diversion area image set X splitThe accurate ramp diversion area image in the first frame is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. The center point of the j-th motor vehicle The ramp diversion area image that is accurate in the trip start area and in the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the ramp diversion area image in the i-th frame is i,split Add 1;
[0036] f-10) Set the accurate ramp area image set X ramp The accurate ramp area image in the first frame is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. The center point of the j-th motor vehicle The ramp area image that is accurate in the trip start area and in the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate ramp area image in the i-th frame i,ramp Add 1;
[0037] f-11) The accurate image of the underpass area is collected as X road The accurate image of the underbridge passage area in the image is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the journey, and the area in front of the direction of vehicle flow is the end area of the journey. If the accurate image of the underbridge passage area in the first frame The center point of the j-th motor vehicle The image of the underpass area within the trip start area and accurate at the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate underbridge traffic area image in the i-th frame i,road Add 1;
[0038] f-12) The accurate image set X of the traffic area on the overpass overpass The accurate image of the traffic area on the overpass is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. If the accurate image of the traffic area on the overpass in the first frame The center point of the j-th motor vehicle The image of the traffic area on the overpass that is accurate in the i-th frame and is within the starting area of the trip The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate image of the overpass on the i-th frame i,overpass Add 1;
[0039] f-13) Set the time step to T, and use the formula Calculate the time step p, and count the number of cars passing through all the accurate ramp diversion area images within the time step p as car_num i,split Sum the number of vehicles passing through the ramp diversion area The car count car_num of all accurate ramp area images within time step p i,ramp Sum the number of cars passing through the ramp area The car count car_num of all accurate underbridge traffic area images within time step p i,road Sum the number of vehicles passing through the underpass area The car count car_num of all accurate images of the overpass traffic area within time step p i,overpass Sum the number of vehicles passing through the traffic area on the overpass f-14) by formula Calculate the speed of the jth motor vehicle passing through the ramp diversion area By formula Calculate the average speed of vehicles passing through the ramp diversion area within time step p f-15) through the formula Calculate the speed of the jth motor vehicle passing through the ramp area By formula Calculate the average speed of motor vehicles passing through the ramp area within time step p
[0040] f-16) through the formula Calculate the speed of the jth motor vehicle passing through the underpass area By formula Calculate the average speed of motor vehicles passing through the underpass area within time step p
[0041] f-17) through the formula Calculate the speed of the jth motor vehicle passing through the traffic area on the overpass By formula Calculate the average speed of motor vehicles passing through the traffic area on the overpass within time step p
[0042] In step f-13), the value of T is 30s, 60s or 300s.
[0043] Further, step g) comprises the following steps:
[0044] g-1) Establish the environment s consisting of the number of vehicles passing through the ramp area and the average speed within the time step p p ,
[0045]
[0046] g-2) The action of controlling the signal light is defined as a q , q∈{1,2}, a1 means to keep the current ramp signal phase action, a2 means to change the current ramp signal phase action;
[0047] g-3) Through the formula Calculate the reward function r p , where λ1 and λ2 are both variable parameters, The speed limit for the ramp area;
[0048] g-4) Establish the value function Q(s) of the Q-learning algorithm p ,a q ), use the sarsa algorithm to train the value function Q(s p ,a q ), and get the final value function Q * (s p ,a q );
[0049] g-5) Through the formula π * = argmaxQ * (s p ,a q ) calculates the current environment s p Play the highest value action a q ;
[0050] g-6) Ramp signal lights follow action a q Perform phase actions.
[0051] Preferably, λ1=0.26, λ2=0.05,
[0052] The beneficial effects of the present invention are: obtaining motor vehicle information at the ramp diversion, in the ramp, under the overpass, and on the overpass through the real-time monitoring screen of the intersection; using the target detection algorithm and the target tracking algorithm to calculate the traffic volume and the speed of the vehicle passing through, and comprehensively evaluate the vehicle passing conditions at the intersection; finally, obtaining the best signal control scheme through the Q-learing reinforcement learning algorithm. This new invention patent can calculate the real-time vehicle passing parameters in different areas of the overpass ramp, and intelligently adjust the ramp traffic lights according to the traffic conditions to avoid the serious imbalance of the distribution of the vehicle flow on and off the overpass, thereby improving traffic efficiency, reducing congestion, and improving the traffic environment, providing a more intelligent and efficient solution for urban traffic management. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0054] The following is combined with Figure 1 The present invention is further described.
[0055] A method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis comprises the following steps:
[0056] a) Obtain the video stream information of the cameras around the on- and off-ramps of the interchange, and obtain the monitoring image set F of the ramp diversion area split , ramp area monitoring image set F ramp , Bridge underpass area monitoring image set F road , Monitoring image set F of the traffic area on the overpass overpass .
[0057] b) Monitoring image set F of ramp diversion area split Perform ramp diversion area division to obtain accurate ramp diversion area image set X split .
[0058] c) Monitoring image set F of ramp area ramp Perform ramp area division to obtain an accurate ramp area image set X ramp .
[0059] d) Monitoring image set F of the underpass area road Divide the underbridge traffic area and obtain an accurate underbridge traffic area image set X road .
[0060] e) Monitoring image set F of the traffic area on the overpass overpass Divide the traffic area on the overpass and obtain an accurate image set X of the traffic area on the overpass overpass .
[0061] f) Based on the accurate ramp diversion area image set Xsplit , accurate ramp area image set X ramp , accurate image set of underpass area road , accurate image set X of the traffic area on the overpass overpass Calculate the number of vehicles passing through the ramp diversion area within time step p Number of vehicles passing through the ramp area Number of vehicles passing through the underpass Number of vehicles passing through the traffic area on the overpass Average speed of vehicles passing through the ramp diversion area Average speed of vehicles passing through the ramp area Average speed of vehicles passing through the underpass The average speed of vehicles passing through the traffic area on the overpass
[0062] g) Based on the number of vehicles in the ramp diversion area Number of vehicles passing through the ramp area Number of vehicles passing through the underpass Number of vehicles passing through the traffic area on the overpass Average speed of vehicles passing through the ramp diversion area Average speed of vehicles passing through the ramp area Average speed of vehicles passing through the underpass The average speed of vehicles passing through the traffic area on the overpass The ramp signal light phase action is calculated and the ramp signal light performs the phase action.
[0063] Computer vision technology is used to extract real-time traffic data such as the number of vehicles in the area, the total number of vehicles passing through the area, and the average speed in the area from the camera videos at the on- and off-ramps. A reinforcement learning algorithm is then used to intelligently control the traffic lights at the on- and off-ramps to achieve reasonable congestion relief.
[0064] In one embodiment of the present invention, step a) comprises the following steps:
[0065] a-1) The video stream of the camera used to shoot the ramp diversion area of the upper and lower ramps of the interchange is obtained, and the video stream is framed to obtain a ramp diversion area monitoring image set F consisting of t frames of ramp diversion area monitoring images split , Among them, F i split is the monitoring image of the ramp diversion area in the i-th frame, i∈{1,...,t}.
[0066] a-2) The video stream of the camera used to shoot the ramp area of the on-ramp and off-ramp of the interchange is obtained, and the video stream is framed to obtain a ramp area monitoring image set F consisting of t frames of ramp area monitoring images. ramp , Among them, F i ramp is the i-th frame ramp area monitoring image, i∈{1,...,t}.
[0067] a-3) The video stream of the camera used to shoot the underpass area of the interchange on and off ramps is obtained, and the video stream is framed to obtain a set of underpass area monitoring images F consisting of t frames of underpass area monitoring images. road , Among them, F i road is the monitoring image of the underpass area of the i-th frame, i∈{1,...,t}.
[0068] a-4) The video stream of the camera used to shoot the traffic area on the overpass at the on-ramp and off-ramp of the overpass is obtained, and the video stream is framed to obtain a set of monitoring images of the traffic area on the overpass consisting of t frames of monitoring images of the traffic area on the overpass overpass , Among them, F i overpass is the monitoring image of the traffic area on the overpass in the i-th frame, i∈{1,...,t}.
[0069] In one embodiment of the present invention, in step b), the i-th frame of ramp diversion area monitoring image F is manually marked. i split The ramp diversion area in the image is cut out by using the OPENCV slice operation to obtain an accurate ramp diversion area image. Accurate ramp diversion area image set The actual length of the ramp diversion area is measured accurately to obtain the true length S split .
[0070] In one embodiment of the present invention, in step c), the ramp area monitoring image F of the i-th frame is manually marked. i ramp The ramp area in the image is cut out by OPENCV slicing operation to obtain the accurate ramp area image X i ramp , accurate ramp area image set Actually measure the exact length of the ramp area and get the true length S ramp .
[0071] In one embodiment of the present invention, in step d), the i-th frame of the underbridge traffic area monitoring image F is manually marked. i road The image of the marked under-bridge traffic area is cut out using the OPENCV slicing operation to obtain an accurate under-bridge traffic area image. Accurate image set of underpass areas The actual length of the underpass is measured accurately to obtain the true length S road .
[0072] In one embodiment of the present invention, in step e), the i-th frame of the monitoring image F of the traffic area on the overpass is manually marked. i overpass The image of the overpass on the overpass is cut out by using the OPENCV slice operation to obtain an accurate image of the overpass on the overpass Accurate image set of traffic areas on overpasses The actual length S is obtained by measuring the exact length of the traffic area on the overpass. overpass .
[0073] In one embodiment of the present invention, step f) comprises the following steps:
[0074] f-1) Accurate ramp diversion area image through YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n1}, n1 is the detected accurate ramp diversion area image The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle.
[0075] f-2) Accurate ramp area image through YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n2}, n2 is the detected accurate ramp area image The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle.
[0076] f-3) Accurate image of the underpass area using the YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n3}, n3 is the detected accurate image of the underbridge passage area The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle.
[0077] f-4) Accurate image of the traffic area on the overpass through the YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle , where j∈{1,2,...,n4}, n4 is the detected accurate image of the traffic area on the overpass The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle.
[0078] f-5) Through the formula Compute accurate ramp diversion images The center point of the jth motor vehicle The motion trajectory generated by the center point of the j-th motor vehicle in the ramp diversion area image with t frames of accuracy is solved according to the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle. , motion trajectory The start time is Movement trajectory The end time is
[0079] f-6) Through the formula
[0080] Calculate accurate ramp area image The center point of the jth motor vehicle The motion trajectory generated by the center point of the jth motor vehicle in the ramp area image with t frames is solved according to the maximum intersection-and-union ratio of the rectangular target detection frame of the jth motor vehicle. , motion trajectory The start time is Movement trajectory The end time is f-7) Through the formula
[0081] Calculate accurate image of underpass area The center point of the jth motor vehicle The motion trajectory generated by the center point of the j-th motor vehicle in the t-frame accurate underbridge traffic area image is solved based on the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle.
[0082] , motion trajectory The start time is Movement trajectory The end time is f-8) Through the formula
[0083]
[0084] Calculate accurate traffic zone image on overpass The center point of the jth motor vehicle According to the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle, the motion trajectory generated by the center point of the j-th motor vehicle in the t-frame accurate image of the traffic area on the overpass is solved. , motion trajectory The start time is Movement trajectory The end time is f-9) Set the accurate ramp diversion area image set X split The accurate ramp diversion area image in the first frame is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. The center point of the j-th motor vehicle The ramp diversion area image that is accurate in the trip start area and in the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the ramp diversion area image in the i-th frame is i,splitAdd 1.
[0085] f-10) Set the accurate ramp area image set X ramp The accurate ramp area image in the first frame is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. The center point of the j-th motor vehicle The ramp area image that is accurate in the trip start area and in the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate ramp area image in the i-th frame i,ramp Add 1.
[0086] f-11) The accurate image of the underpass area is collected as X road The accurate image of the underbridge passage area in the image is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the journey, and the area in front of the direction of vehicle flow is the end area of the journey. If the accurate image of the underbridge passage area in the first frame The center point of the j-th motor vehicle The image of the underpass area within the trip start area and accurate at the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate underbridge traffic area image in the i-th frame i,road Add 1.
[0087] f-12) The accurate image set X of the traffic area on the overpass overpass The accurate image of the traffic area on the overpass is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. If the accurate image of the traffic area on the overpass in the first frame The center point of the j-th motor vehicle The image of the traffic area on the overpass that is accurate in the i-th frame and is within the starting area of the trip The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate image of the overpass on the i-th frame i,overpass Add 1.
[0088] f-13) Set the time step to T, and use the formula Calculate the time step p, and count the number of cars passing through all the accurate ramp diversion area images within the time step p as car_num i,split Sum the number of vehicles passing through the ramp diversion area The car count car_num of all accurate ramp area images within time step pi,ramp Sum the number of cars passing through the ramp area The car count car_num of all accurate underbridge traffic area images within time step p i,road Sum the number of vehicles passing through the underpass area The car count car_num of all accurate images of the overpass traffic area within time step p i,overpass Sum the number of vehicles passing through the traffic area on the overpass f-14) by formula Calculate the speed of the jth motor vehicle passing through the ramp diversion area By formula Calculate the average speed of vehicles passing through the ramp diversion area within time step p f-15) through the formula Calculate the speed of the jth motor vehicle passing through the ramp area By formula Calculate the average speed of motor vehicles passing through the ramp area within time step p f-16) through the formula Calculate the speed of the jth motor vehicle passing through the underpass area By formula Calculate the average speed of motor vehicles passing through the underpass area within time step p f-17) through the formula Calculate the speed of the jth motor vehicle passing through the traffic area on the overpass By formula Calculate the average speed of motor vehicles passing through the traffic area on the overpass within time step p In step f-13), the value of T is 30s, 60s or 300s.
[0089] In one embodiment of the present invention, step g) comprises the following steps:
[0090] g-1) Establish the environment s consisting of the number of vehicles passing through the ramp area and the average speed within the time step p p ,
[0091] g-2) The action of controlling the signal light is defined as a q , q∈{1,2}, a1 means keeping the current ramp signal light phase action, and a2 means changing the current ramp signal light phase action.
[0092] g-3) Through the formula Calculate the reward function r p , where λ1 and λ2 are both variable parameters, The speed limit in the ramp area.
[0093] g-4) Establish the value function Q(s) of the Q-learning algorithm p ,a q ), use the sarsa algorithm to train the value function Q(s p ,a q ), and get the final value function Q * (s p ,a q ).
[0094] g-5) Through the formula π * = argmaxQ * (s p ,a q ) calculates the current environment s p Play the highest value action a q .
[0095] g-6) Ramp signal lights follow action a q Execute phase actions and control ramp lights in real time to ensure the traffic efficiency of vehicles passing on and under the overpass.
[0096] In this embodiment, preferably, λ1=0.26, λ2=0.05, Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis, characterized in that: The steps include: a) Obtain the video stream information of the cameras around the on- and off-ramps of the interchange, and obtain the monitoring image set F of the ramp diversion area split , ramp area monitoring image set F ramp , Bridge underpass area monitoring image set F road , Monitoring image set F of the traffic area on the overpass overpass ; b) Monitoring image set F of ramp diversion area split Perform ramp diversion area division to obtain an accurate ramp diversion area image set X split ; c) Monitoring image set F of ramp area ramp Perform ramp area division to obtain an accurate ramp area image set X ramp ; d) Monitoring image set F of the underpass area road Divide the underbridge traffic area and obtain an accurate underbridge traffic area image set X road ; e) Monitoring image set F of the traffic area on the overpass overpass Divide the traffic area on the overpass and obtain an accurate image set X of the traffic area on the overpass overpass ; f) Based on the accurate ramp diversion area image set X split , accurate ramp area image set X ramp , accurate image set of underpass area road , accurate image set X of the traffic area on the overpass overpass Calculate the number of vehicles passing through the ramp diversion area within time step p Number of vehicles passing through the ramp area Number of vehicles passing through the underpass Number of vehicles passing through the traffic area on the overpass Average speed of vehicles passing through the ramp diversion area Average speed of vehicles passing through the ramp area Average speed of vehicles passing through the underpass The average speed of vehicles passing through the traffic area on the overpass g) Based on the number of vehicles in the ramp diversion area Number of vehicles passing through the ramp area Number of vehicles passing through the underpass Number of vehicles passing through the traffic area on the overpass Average speed of vehicles passing through the ramp diversion area Average speed of vehicles passing through the ramp area Average speed of vehicles passing through the underpass The average speed of vehicles passing through the traffic area on the overpass The ramp signal light phase action is calculated and the ramp signal light performs the phase action.
2. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 1 is characterized in that: Step a) comprises the following steps: a-1) The video stream of the camera used to shoot the ramp diversion area of the upper and lower ramps of the interchange is obtained, and the video stream is framed to obtain a ramp diversion area monitoring image set F consisting of t frames of ramp diversion area monitoring images split , where F i split is the monitoring image of the ramp diversion area in the i-th frame, i∈{1,...,t}; a-2) The video stream of the camera used to shoot the ramp area of the on-ramp and off-ramp of the interchange is obtained, and the video stream is framed to obtain a ramp area monitoring image set F consisting of t frames of ramp area monitoring images. ramp , Among them, F i ramp is the i-th frame ramp area monitoring image, i∈{1,...,t}; a-3) The video stream of the camera used to shoot the underpass area of the interchange on and off ramps is obtained, and the video stream is framed to obtain a set of underpass area monitoring images F consisting of t frames of underpass area monitoring images. road , where F i road is the monitoring image of the underpass area in the i-th frame, i∈{1,...,t}; a-4) The video stream of the camera used to shoot the traffic area on the overpass at the on-ramp and off-ramp of the overpass is obtained, and the video stream is framed to obtain a set of monitoring images of the traffic area on the overpass consisting of t frames of monitoring images of the traffic area on the overpass overpass , Among them, F i overpass is the monitoring image of the traffic area on the overpass in the i-th frame, i∈{1,...,t}.
3. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 2 is characterized in that: In step b), the ramp diversion area monitoring image F of the i-th frame is manually marked. i split The ramp diversion area in the image is cut out by using the OPENCV slice operation to obtain an accurate ramp diversion area image. Accurate ramp diversion area image set The actual length of the ramp diversion area is measured accurately to obtain the true length S split .
4. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 3 is characterized in that: In step c), the ramp area monitoring image F of the i-th frame is manually marked. i ramp The ramp area in the image is cut out by OPENCV slicing operation to obtain an accurate image of the ramp area. Accurate ramp area image set Actually measure the exact length of the ramp area and get the true length S ramp .
5. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 4 is characterized in that: In step d), the i-th frame of the underbridge traffic area monitoring image F is manually marked. i road The image of the marked under-bridge traffic area is cut out using the OPENCV slicing operation to obtain an accurate under-bridge traffic area image. Accurate image set of underpass areas The actual length of the underpass is measured accurately to obtain the true length S road .
6. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 5 is characterized in that: In step e), the i-th frame of the monitoring image F of the traffic area on the overpass is manually marked. i overpass The image of the overpass on the overpass is cut out by using the OPENCV slice operation to obtain an accurate image of the overpass on the overpass Accurate image set of traffic areas on overpasses The actual length S is obtained by measuring the exact length of the traffic area on the overpass. overpass .
7. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 6 is characterized in that: Step f) comprises the following steps: f-1) Accurate ramp diversion area image through YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n1}, n1 is the detected accurate ramp diversion area image The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle; f-2) Accurate ramp area image through YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n2}, n2 is the detected accurate ramp area image The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle; f-3) Accurate image of the underpass area using the YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n3}, n3 is the detected accurate image of the underbridge passage area The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle; f-4) Accurate image of the traffic area on the overpass through the YOLOV8M target detection model Perform motor vehicle target detection, and list the rectangular target detection boxes of the jth motor vehicle Where j∈{1,2,...,n4}, n4 is the detected accurate image of the traffic area on the overpass The number of motor vehicles in , i∈{1,...,t}, is the horizontal coordinate of the center point of the rectangular target detection box of the j-th motor vehicle, is the ordinate of the center point of the rectangular target detection box of the jth motor vehicle, is the width of the rectangular target detection box of the j-th motor vehicle, is the height of the rectangular target detection box of the j-th motor vehicle; f-5) Through the formula Compute accurate ramp diversion area images The center point of the jth motor vehicle The motion trajectory generated by the center point of the j-th motor vehicle in the ramp diversion area image with t frames of accuracy is solved according to the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle. Movement trajectory The start time is Movement trajectory The end time is f-6) Through the formula Calculate accurate ramp area image The center point of the jth motor vehicle The motion trajectory generated by the center point of the jth motor vehicle in the ramp area image with t frames is solved according to the maximum intersection-and-union ratio of the rectangular target detection frame of the jth motor vehicle. , Movement trajectory The start time is Movement trajectory The end time is f-7) Through the formula Calculate accurate image of underpass area The center point of the jth motor vehicle The motion trajectory generated by the center point of the j-th motor vehicle in the t-frame accurate underbridge traffic area image is solved based on the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle. , Movement trajectory The start time is Movement trajectory The end time is f-8) Through the formula Calculate accurate traffic zone image on overpass The center point of the jth motor vehicle According to the maximum intersection-and-union ratio of the rectangular target detection frame of the j-th motor vehicle, the motion trajectory generated by the center point of the j-th motor vehicle in the t-frame accurate image of the traffic area on the overpass is solved. , Movement trajectory The start time is Movement trajectory The end time is f-9) Set the accurate ramp diversion area image set X split The accurate ramp diversion area image in the first frame is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. The center point of the j-th motor vehicle The ramp diversion area image that is accurate in the trip start area and in the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the ramp diversion area image in the i-th frame is i,split Add 1; f-10) Set the accurate ramp area image set X ramp The accurate ramp area image in the first frame is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. The center point of the j-th motor vehicle The ramp area image that is accurate in the trip start area and in the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate ramp area image in the i-th frame i,ramp Add 1; f-11) The accurate image of the underpass area is collected as X road The accurate image of the underbridge passage area in the image is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the journey, and the area in front of the direction of vehicle flow is the end area of the journey. If the accurate image of the underbridge passage area in the first frame The center point of the j-th motor vehicle The image of the underpass area within the trip start area and accurate at the i-th frame The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate underbridge traffic area image in the i-th frame i,road Add 1; f-12) The accurate image set X of the traffic area on the overpass overpass The accurate image of the traffic area on the overpass is divided equally according to the direction of vehicle flow. The area behind the direction of vehicle flow is the starting area of the trip, and the area in front of the direction of vehicle flow is the end area of the trip. If the accurate image of the traffic area on the overpass in the first frame The center point of the j-th motor vehicle The image of the traffic area on the overpass that is accurate in the i-th frame and is within the starting area of the trip The center point of the j-th motor vehicle In the end-of-trip area, the car count car_num of the accurate image of the overpass on the i-th frame i,overpass Add 1; f-13) Set the time step to T, and use the formula Calculate the time step p, and count the number of cars passing through all the accurate ramp diversion area images within the time step p as car_num i,split Sum the number of vehicles passing through the ramp diversion area The car count car_num of all accurate ramp area images within time step p i,ramp Sum the number of cars passing through the ramp area The car count car_num of all accurate underbridge traffic area images within time step p i,road Sum the number of vehicles passing through the underpass area The car count car_num of all accurate images of the overpass traffic area within time step p i,overpass Sum the number of vehicles passing through the traffic area on the overpass f-14) by formula Calculate the speed of the jth motor vehicle passing through the ramp diversion area By formula Calculate the average speed of vehicles passing through the ramp diversion area within time step p f-15) by formula Calculate the speed of the jth motor vehicle passing through the ramp area By formula Calculate the average speed of motor vehicles passing through the ramp area within time step p f-16) through the formula Calculate the speed of the jth motor vehicle passing through the underpass area By formula Calculate the average speed of motor vehicles passing through the underpass area within time step p f-17) through the formula Calculate the speed of the jth motor vehicle passing through the traffic area on the overpass By formula Calculate the average speed of motor vehicles passing through the traffic area on the overpass within time step p 8. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 7 is characterized in that: In step f-13), the value of T is 30s, 60s or 300s.
9. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 1, characterized in that: Step g) comprises the following steps: g-1) Establish the environment s consisting of the number of vehicles passing through the ramp area and the average speed within the time step p p , g-2) The action of controlling the signal light is defined as a q , q∈{1,2}, a1 means to keep the current ramp signal phase action, a2 means to change the current ramp signal phase action; g-3) Through the formula Calculate the reward function r p , where λ1 and λ2 are both variable parameters, The speed limit for the ramp area; g-4) Establish the value function Q(s) of the Q-learning algorithm p ,a q ), use the sarsa algorithm to train the value function Q(s p ,a q ), and get the final value function Q * (s p ,a q ); g-5) Through the formula π * = arg max Q * (s p ,a q ) calculates the current environment s p Play the highest value action a q ; g-6) Ramp signal lights follow action a q Perform phase actions.
10. The method for setting green waves for on- and off-ramps of urban interchanges based on reinforcement learning and multivariate video data analysis according to claim 9, characterized in that: λ1=0.26, λ2=0.05,
