Collaborative lane changing scene extraction and generation method and device based on natural driving data
By extracting and generating collaborative road change scenarios from natural driving data, the problem of scarcity of collaborative driving test scenarios is solved, more comprehensive testing and evaluation is achieved, and the reliability and safety of the intelligent transportation system is improved.
Patent Information
- Application Number
- CN202411541260.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
Existing collaborative driving test scenarios are scarce, and it is difficult to obtain sufficient data for systematic testing and evaluation.
By extracting and generating collaborative dock swap scenes from natural driving data, and using diffusion models and custom loss functions, representative collaborative driving scenario data are generated.
It improves the test coverage and comprehensive evaluation of the collaborative driving system, provides a solid data foundation for the development and optimization of intelligent transportation systems, and enhances the reliability and safety of the system in practical applications.
Smart Images

Figure CN119478870A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation systems, and specifically relates to a method and device for extracting and generating collaborative lane-changing scenes based on natural driving data. Background Art
[0002] With the continuous advancement of autonomous driving technology, the intelligence level of vehicles is also gradually improving, especially in terms of perception technology, pattern recognition and control intelligence. At the same time, the popularization of wireless communication technology allows vehicles to communicate with other vehicles (V2V) and infrastructure (V2I) to achieve real-time data exchange. Based on the advancement of these technologies, the concept of connected and autonomous vehicles (CAVs) has received more and more attention. CAVs can communicate with other vehicles and traffic infrastructure to achieve collaborative interaction, and the concept of collaborative driving has also emerged. Through the collaborative interaction of multiple vehicles, collaborative driving can optimize traffic flow, improve road use efficiency, and significantly reduce the risk of traffic accidents.
[0003] Although cooperative driving technology based on CAVs is expected to achieve greater progress and strategy optimization in the future, a lot of testing and verification under real conditions is still needed to achieve widespread application of this technology. Therefore, it is crucial to conduct comprehensive testing and evaluation of cooperative driving systems. However, since cooperative driving involves complex interactions and coordination between multiple vehicles, such scenarios are relatively rare in daily driving, making it extremely difficult to obtain sufficient data for testing. Existing methods for obtaining test scenarios mainly include road testing and simulation testing. Although road testing can provide valuable data in a real environment, it is costly, time-consuming, and requires a lot of resources to manage the operation of test vehicles under various traffic conditions. In addition, due to the physical limitations of the test environment, the range of testable scenarios is also relatively limited. Although simulation testing has greater flexibility and controllability, it can conduct large-scale testing in different scenarios at a relatively low cost. However, it is difficult to fully reproduce the complex interactions and dynamic changes in the real world in a simulation environment. Summary of the invention
[0004] In view of the scarcity of existing cooperative driving test scenarios, the present invention provides a method and device for extracting and generating cooperative lane changing scenarios based on natural driving data, which identifies and generates rare cooperative lane changing driving scenarios from natural driving trajectory data.
[0005] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0006] A method for extracting and generating a collaborative lane-changing scene based on natural driving data, comprising:
[0007] Step 1, extracting a lane-changing scene from natural driving data; wherein the extracted lane-changing scene data includes trajectory data of the lane-changing vehicle and surrounding vehicles;
[0008] Step 2, selecting a coordinated lane-changing scene from all extracted lane-changing scenes based on preset conditions; wherein the lane-changing vehicle and the rear vehicle in the target lane in the coordinated lane-changing scene are recorded as a coordinated lane-changing vehicle group, and the coordinated lane-changing scene data includes trajectory data of the coordinated lane-changing vehicle group;
[0009] Step 3, extracting cooperative driving features from the trajectory data of each cooperative lane-changing vehicle group;
[0010] Step 4: Using the cooperative driving features as input features and the cooperative lane changing scene data as output trajectories, the diffusion model is trained to obtain a cooperative lane changing scene generation model;
[0011] Step 5: Input the cooperative driving features extracted in step 3 into the cooperative lane changing scenario generation model to generate a new cooperative lane changing scenario.
[0012] Furthermore, the vehicle's trajectory data includes the vehicle's speed, position, and lane information.
[0013] Furthermore, the preset conditions for screening the coordinated lane-changing scenario include: (1) the vehicle behind the target lane has not changed lanes, (2) the distance between the vehicle behind the target lane and the lane-changing vehicle along the lane direction at the initial moment is less than a preset threshold d max , (3) The vehicle behind in the target lane decelerates; if a lane-changing scenario satisfies the above conditions at the same time, then the lane-changing scenario is a cooperative lane-changing scenario, otherwise it is not a cooperative lane-changing scenario.
[0014] Furthermore, the preset conditions for screening the coordinated lane-changing scenario also include: (4) the speed response of the vehicle behind the target lane and the lane-changing vehicle are synchronized;
[0015] The method for screening collaborative lane-changing scenarios is as follows: if a certain lane-changing scenario satisfies the preset conditions (1)(2)(3) at the same time, a visualization animation is further created based on the trajectory data of the vehicle behind the target lane and the lane-changing vehicle, and the lane-changing scenario is manually reviewed based on the visualization animation to determine whether it satisfies the preset condition (4). If the preset condition (4) is met, the lane-changing scenario is a collaborative lane-changing scenario; otherwise, it is not a collaborative lane-changing scenario.
[0016] Furthermore, the cooperative driving features include: the relative position and relative speed of the cooperative lane-changing vehicle group during the lane-changing process, the lane numbers of the lane-changing vehicles before and after the lane-changing process, and the starting position and ending position of the lane-changing vehicles during the lane-changing process.
[0017] Furthermore, the diffusion model adopts a Wide&Deep network structure to embed cooperative driving features, wherein the Wide part is used to process continuous temporal features in the cooperative driving features, and the Deep part is used to process discrete non-temporal features in the cooperative driving features.
[0018] Furthermore, the loss function used to train the diffusion model is:
[0019] TotalLoss=MSELoss+SmoothnessLoss+DirectionLoss
[0020] In the formula, TotalLoss is the overall loss, MSELoss, SmoothnessLoss, and DirectionLoss are MSE loss, smoothness loss, and direction consistency loss, respectively;
[0021]
[0022]
[0023] in, Represents the i-th trajectory data generated by prediction, ∈ i represents the i-th actual trajectory sample, and N represents the number of actual trajectory samples; They represent the trajectory values at the tth moment, t-1th moment, t-2th moment, and t+1th moment in the predicted i-th trajectory data respectively; T represents the length of the time series of the trajectory data of the lane changing process.
[0024] Furthermore, when a new cooperative lane changing scenario is generated using the cooperative lane changing scenario generation model in step 5, constraints are imposed on the generated cooperative lane changing scenario:
[0025] (1) Deceleration constraint, that is, the speed reduction of the vehicle behind the target lane must meet the following requirements:
[0026] Δv min ≤Δv FL ≤Δv max
[0027] In the formula, Δv FL Indicates the speed drop of the vehicle behind the target lane during the lane change process, Δv FL (t) = v FL (t 0 )-v FL (t n ), v FL (t 0 ),v FL (t n ) represents the target lane rear vehicle at the initial lane change time t 0and the end time t n The speed of min , Δv max is the speed change threshold of the vehicle behind the target lane during the lane changing process, which is obtained from the trajectory data of the coordinated lane changing vehicle group obtained in step 2;
[0028] (2) Initial spacing constraint, i.e., the distance d between the lane-changing vehicle and the vehicle behind in the target lane at the initial moment along the lane direction. initial Need to meet:
[0029] d min ≤d initial ≤d max
[0030] Where, d min d max is the distance threshold between the lane-changing vehicle and the vehicle behind in the target lane along the lane direction at the initial moment, d min It is obtained from the trajectory data of the coordinated lane-changing vehicle group obtained in step 2, and d max is the preset threshold.
[0031] An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements any of the above-mentioned methods for extracting and generating collaborative lane-changing scenes based on natural driving data.
[0032] The present invention generates data for existing collaborative lane-changing scenarios by combining a generation model to obtain more representative collaborative driving scenario data. Specifically, it includes the following improvements and optimizations:
[0033] 1: Definition and improvement of input features. In order to better capture the dynamic interaction between vehicles during the lane change process, the present invention uses the relative position and relative speed of the input lane-changing vehicle and the vehicle behind the target lane as continuous features. These features are used to describe the kinematic relationship between the two vehicles during the lane change process. In addition, the present invention uses information such as lane number, lane change start time, and lane change end time as discrete features to input the model. By using an embedding layer to map discrete features into continuous vectors in a high-dimensional space, the model can better process this discrete information and enhance the ability to recognize and generate different scenarios.
[0034] 2: Design of custom loss function. In order to improve the accuracy and rationality of the generated trajectory, a custom loss function is designed, which combines MSE loss, smoothness loss and direction consistency loss.
[0035] 3: Constraints and optimization of trajectory generated by the model. The kinematic features of cooperative driving obtained in the previous feature analysis are used to constrain the generated trajectory. A reasonable generation threshold is set. When the generated trajectory does not meet these features (such as speed, relative position change, etc.), it will be regenerated until it meets the set standards. This process ensures that the generated trajectory meets the requirements of the real cooperative driving scenario.
[0036] Therefore, the present invention can efficiently reproduce and simulate complex cooperative lane-changing scenarios. The generated scenario data can not only improve the test coverage and comprehensiveness of the cooperative driving system, but also provide a solid data foundation for the development and optimization of advanced driver assistance systems (ADAS) and future intelligent transportation systems. By simulating various cooperative driving scenarios, the present invention can evaluate the performance of the cooperative driving system under various traffic conditions, test its ability to handle complex road conditions and respond to emergencies, and ultimately improve the reliability and safety of the system in practical applications.
[0037] In summary, the present invention effectively solves the problem of scarce collaborative driving scene data by extracting and generating natural driving data, and provides important technical support and data guarantee for the research and development of intelligent transportation systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 This is a flow chart of a method for extracting and generating a collaborative lane-changing scene based on natural driving data according to an embodiment of the present application;
[0040] Figure 2 Schematic diagram of the whole process of the method for extracting and generating a collaborative lane-changing scene based on natural driving data according to an embodiment of the present application;
[0041] Figure 3 A schematic diagram of a lane-changing vehicle group provided in one embodiment of the present application. DETAILED DESCRIPTION
[0042] The following is a detailed description of an embodiment of the present invention. This embodiment is based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process to further explain the technical solution of the present invention.
[0043] The embodiment of the present invention provides a method for extracting and generating a coordinated lane-changing scene based on natural driving data, referring to Figure 1-3As shown, the following steps are included:
[0044] Step 1: extracting lane-changing scenes from natural driving data; wherein the extracted lane-changing scene data includes trajectory data of the lane-changing vehicle and surrounding vehicles.
[0045] Scenes involving lane-changing operations are extracted from the natural driving dataset, including the trajectory data of the lane-changing vehicle and its surrounding vehicles. These data cover the vehicle's speed, position, lane information, etc., forming a complete lane-changing behavior trajectory.
[0046] In this embodiment, the Python programming environment is used to process trajectory information containing more than 10 million data items, and the trajectory segments of lane changes are extracted according to certain judgment rules. Including:
[0047] 1. Lane-changing vehicle data extraction
[0048] The present invention performs data screening for vehicles on the off-ramp, and uses the Python programming environment to process trajectory information containing more than 10 million data items. Through sorting, grouping and date conversion operations, vehicles with lane-changing behavior are screened out according to lane number changes.
[0049] 2. Extraction of lane change time of vehicles on the off-ramp
[0050] The lane change process is divided into the decision-making stage and the execution stage. By extracting the trajectory data of the lane change execution stage, the start and end time of the lane change are calculated. According to the lane ID change and the longitudinal position difference, the specific time point of the lane change execution stage is extracted to ensure the integrity of the lane change process. The specific calculation process is as follows:
[0051] (1) Determine the lane change centerline
[0052] λ α (t) is the lane ID of vehicle α at time t, t lc is the moment when the lane ID of the lane-changing vehicle starts to change, and Δt is the time interval between two consecutive data points in the trajectory. α (t lc )≠λ α (t lc +Δt), the lane-changing vehicle at time t lc The front centerline of the vehicle is considered the lane change centerline.
[0053] (2) Calculate the longitudinal position difference φ α (t)
[0054] y α (t) is the longitudinal position of vehicle α at time t, that is, the distance from the front center of vehicle α to the leftmost edge of the road along the forward direction. φ α (t) is the time from time t to time t for vehicle αlc The longitudinal position difference between them is calculated as follows:
[0055] φ α (t) = y α (t)-y α (t lc ) (3-1)
[0056] (3) Calculate lane change time
[0057] During the lane change, |φ α (t)| will first decrease gradually, and then increase gradually. α (t)|greater than ω α / 2, the whole lane change process is completed, where ω α is the width of the vehicle. Therefore, the time t at which the lane change begins s It can be defined as the moment before this period, when the lane change ends t e It can be defined as the moment after this period of time. The specific calculation is shown in the following formula:
[0058]
[0059] The time for the vehicle to change lane is [t s ,t e ] It is worth noting that sometimes the driver may abandon the lane change that has already started and start again after multiple time steps. In this case, equations (3-2) and (3-3) cannot accurately calculate the lane change duration. Therefore, the formula is modified as follows, as shown in equations (3-4) and (3-5):
[0060]
[0061] Based on the above formula, the trajectory data of the off-ramp vehicles are extracted, and finally the lane change trajectories of some off-ramp vehicles are obtained.
[0062] 3. Extraction of vehicle group data around the vehicle on the off-ramp
[0063] In order to improve the accuracy of driving risk prediction, the vehicle interaction relationship is analyzed using a vehicle group. The vehicle group defined in this paper includes five vehicles, namely the lane-changing vehicle (LCV), the front vehicle in the original lane (Olead), the rear vehicle in the original lane (Olag), the front vehicle in the target lane (Tlead), and the rear vehicle in the target lane (Tlag). Among them, the original lane refers to the lane where the vehicle is currently located, and the target lane is the new lane that the vehicle intends to enter. The specific extraction process is as follows: By calculating the relative position and trajectory changes of the lane-changing vehicle and the surrounding vehicle groups, the dynamic relationship between each vehicle during the lane change process is analyzed to improve the accuracy of driving risk prediction.
[0064] λα (t) is the lane ID of vehicle α at time t, t lc is the moment when the lane ID of the lane-changing vehicle starts to change, and Δt is the time interval between two consecutive data points in the trajectory. α (t lc )≠λ α (t lc +Δt), calculate t lc , t lc +Δt is the longitudinal position difference between the center vehicle and the surrounding vehicles at two moments. The vehicles with the smallest difference and the same lane ID are taken as the surrounding vehicles, that is, the front and rear vehicles in the original lane and the front and rear vehicles in the target lane.
[0065] ID_Olead=agrmin(x α (t lc )-x center (t lc )) (3-6)
[0066] ID_Olag=agrmax(x α (t lc )-x center (t lc )) (3-7)
[0067] ID_Tlead=agrmin(x α (t lc+Δt )-x center (t lc+Δt )) (3-8)
[0068] ID_Tlag=agrmax(x α (t lc+Δt )-x center (t lc+Δt )) (3-9)
[0069] Where: ID_Olead and ID_Olag are the IDs of the front and rear vehicles in the original lane, ID_Tlead and ID_Tlag are the IDs of the front and rear vehicles in the target lane; agrmin means finding the value of the vehicle ID that makes the function obtain the minimum value; agrmax means finding the value of the vehicle ID that makes the function obtain the maximum value; x α (t) represents the lateral position of vehicle α at time t; x center (t) represents the lateral position of the vehicle on the off-ramp at time t.
[0070] Step 2, screening cooperative lane changing scenarios from all extracted lane changing scenarios based on preset conditions; wherein the lane changing vehicle and the rear vehicle in the target lane in the cooperative lane changing scenario are recorded as a cooperative lane changing vehicle group, and the cooperative lane changing scene data includes trajectory data of the cooperative lane changing vehicle group.
[0071] The preset conditions for screening the coordinated lane-changing scenario include: (1) the vehicle behind the target lane has not changed lanes, (2) the distance between the vehicle behind the target lane and the lane-changing vehicle along the lane direction at the initial moment is less than the preset threshold d max , (3) the vehicle behind the target lane decelerates; (4) the speed responses of the vehicle behind the target lane and the lane-changing vehicle are synchronized.
[0072] Step 2.1, obtain lane-changing trajectory. Extract the trajectory data of the lane-changing vehicle and the vehicle behind the target lane in the lane-changing scenario, including the positions of the two vehicles, lane numbers, and trajectory change information, to provide a data basis for subsequent analysis.
[0073] The vehicle trajectory data is expressed as:
[0074] Trajectory LC ={(x LC (t),y LC (t),lane LC (t))|t∈[t 0 ,t n ]}
[0075] Trajectory FL ={(x FL (t),y FL (t),lane FL (t))|t∈[t 0 ,t n ]}
[0076] In the formula, x LC (t), y LC (t) represents the position coordinate of the lane-changing vehicle at time step t; x FL (t), y FL (t) represents the position coordinates of the vehicle behind the target lane at time step t; lane LC (t) represents the lane number of the lane-changing vehicle at time step t, lane FL (t) represents the lane number of the vehicle behind the target lane at time step t. 0 ,t n are the start time and end time of the entire lane changing process of the lane changing vehicle respectively.
[0077] Step 2.2, lane change behavior screening. According to the lane number in the trajectory data, determine whether the vehicle behind the target lane has changed lanes, so as to screen out the vehicle group that has not changed lanes. The screening condition for not issuing a lane change is:
[0078] if lane FL (t 0 )=lane FL (t n )and lane LC (t 0 )≠lane LC (t n )
[0079] This step ensures that the vehicle behind the target lane in the screened vehicle group will not interfere with the data analysis results due to its own lane changing behavior, thus ensuring the accuracy of the results.
[0080] Step 2.3: Spacing screening. According to the initial position in the trajectory data, calculate the horizontal distance between the vehicle behind the target lane and the lane-changing vehicle at the initial time, that is, the distance between the two vehicles along the lane direction, recorded as d initial ; Judge d initial Is it less than the preset threshold of 50 meters? The specific calculation is as follows:
[0081] d initial =x LC (t 0 )-x FL (t 0 )<50m
[0082] This screening step is designed to ensure that the analysis is of vehicles that are close to each other and have potential for cooperative behavior. If the horizontal distance between the target lane rear vehicle and the lane-changing vehicle is too large at the initial moment, it means that there may not be enough interaction opportunities between them, and the analysis of cooperative behavior is not representative.
[0083] Step 2.4, speed calculation. Calculate the horizontal speed v of the vehicle behind the target lane during the lane-changing process by using the difference method. FL (t), the specific calculation is as follows:
[0084] v FL (t) = x FL (t)-x FL (t-1)
[0085] Step 2.5, deceleration behavior judgment. Further analyze the vehicle group selected in step 2.3 to judge the speed change of the vehicle behind the target lane. If the speed of the vehicle behind the target lane drops significantly during the lane change process, it is preliminarily judged that there may be coordinated behavior between the lane-changing vehicle and the vehicle behind the target lane. The specific calculation formula is as follows:
[0086] Δv FL (t) = v FL (t 0 )-v FL (t n )
[0087] ifΔv FL (t)<0durig lane-change period
[0088] Step 2.6, manual review and visualization. After the preliminary coordinated lane-changing scenarios are screened out through steps 2.2 to 2.5, an animation visualization of the real-time trajectory and speed changes of the lane-changing vehicle and the following vehicle in the target lane is created. By checking these animations, it is observed how the speed response of the following vehicle in the target lane is synchronized with the behavior of the lane-changing vehicle to determine whether there is coordinated behavior, ensure the accuracy of the screening results, and obtain the final coordinated lane-changing scenario.
[0089] The speed behavior synchronization refers to the consistency and coordination between the speed response of the vehicle behind the target lane and the behavior of the lane-changing vehicle in terms of time and trajectory. Specifically, the speed change of the vehicle behind can maintain a high correlation with the trajectory and speed of the lane-changing vehicle, showing a response to the behavior of the lane-changing vehicle; in addition, the following vehicle can maintain a reasonable safety distance during the lane-changing process, and the change in this distance shows a stable coordination relationship with the behavior of the lane-changing vehicle.
[0090] Step 3: Extract cooperative driving features and generate model constraints from the trajectory data of each cooperative lane-changing vehicle group.
[0091] In order to better capture the dynamic interaction between vehicles during the lane changing process, the embodiment of the present invention uses the relative position and relative speed of the lane changing vehicle and the vehicle behind in the target lane as continuous features (features that can take any value within a certain range, usually real numbers) to describe the kinematic relationship between the two vehicles during the lane changing process. In addition, the embodiment of the present invention uses information such as lane number, lane change start and end positions as discrete features (features with a finite value range and these values cannot be divided in a continuous manner). By using an embedding layer to map discrete features into continuous vectors in a high-dimensional space, the model can better process this discrete information and enhance the ability to recognize and generate different scenarios. Therefore, the embodiments of the present invention conduct an in-depth analysis of the selected collaborative lane-changing scenarios, extract and summarize the collaborative driving features in the collaborative driving scenarios: (1) the relative position of the collaborative lane-changing vehicle group, that is, the position difference between the two vehicles along the lane direction and / or the vertical direction, which is used to describe the distance relationship between the two vehicles in a certain direction; (2) the relative speed of the collaborative lane-changing vehicle group, that is, the speed difference between the two vehicles along the lane direction and / or the vertical direction, which is used to describe the speed relationship between the two vehicles in a certain direction; (3) the lane number of the lane-changing vehicle before and after the lane-changing; (4) the starting position and ending position of the lane-changing vehicle during the lane-changing process.
[0092] In addition, in order to facilitate the generation of trajectory data by the constraint generation model, this step further extracts a detailed analysis of factors such as distance and speed changes during the lane change process, and can derive corresponding thresholds as constraints for generating trajectory data. For example:
[0093] Initial distance threshold d min and d max : At the beginning of the lane change, the horizontal distance distribution between the two vehicles can extract reasonable upper and lower limits to ensure that the generated trajectory conforms to the distance characteristics in the actual collaborative driving scenario.
[0094] Speed change threshold Δv min and Δv max : According to the deceleration behavior of the vehicle behind in the target lane, the range of speed change during the lane change process is analyzed, and a reasonable speed change amplitude is extracted to ensure that the deceleration behavior in the generated model is consistent with the actual data.
[0095] These thresholds derived through analysis will be used as constraints for generating models to ensure that during the model generation process, the generated trajectories can meet the key features of actual collaborative driving scenarios, thereby improving the accuracy and rationality of the generated data.
[0096] Step 4: Using the cooperative driving features as input features and the cooperative lane changing scene data as output trajectories, the diffusion model is trained to obtain a cooperative lane changing scene generation model.
[0097] In this embodiment, the diffusion model adopts a Wide&Deep network structure to embed collaborative driving features. The Wide part emphasizes the memory function and captures the importance of individual features and their interactions, while the Deep part focuses on generalization and learning high-level abstractions and feature combinations. This combination effectively captures simple and complex patterns in the trajectory. Therefore, in order to better capture the dynamic interactions between vehicles during the lane change process, the embodiment of the present invention sends the relative speed and relative distance of the collaborative lane-changing vehicle group (motion attributes with multiple values) as continuous features to the Wide network for processing, and sends the lane number and lane change start / end position (discrete external attributes) of the lane-changing vehicle to the Deep network for processing. The Wide network consists of a fully connected layer that can capture the linear relationship between motion attributes; while the Deep network embeds discrete features into high-dimensional vectors and then learns complex feature interactions through multiple layers of fully connected layers. Finally, the outputs generated by the Wide&Deep network will be combined and integrated into each Resnet module to generate collaborative lane-changing scenario data that conforms to actual scenarios.
[0098] In order to improve the accuracy and rationality of the generated trajectory, the embodiment of the present invention designs a custom loss function to train the diffusion model to optimize the model parameters through back propagation. The custom loss function of this embodiment combines MSE loss, smoothness loss and direction consistency loss:
[0099] TotalLoss=MSELoss+SmoothnessLoss+DirectionLoss
[0100] In the formula, TotalLoss is the overall loss, MSELoss, SmoothnessLoss, and DirectionLoss are MSE loss, smoothness loss, and direction consistency loss, respectively.
[0101] (1) MSE loss: used to measure the error between the generated trajectory and the actual data to ensure that the model can make effective predictions. It can be expressed as:
[0102]
[0103] In the formula, Represents the i-th trajectory data generated by prediction, ∈ i represents the i-th actual trajectory sample, and N represents the number of actual trajectory samples.
[0104] (2) Smoothness loss: By introducing the second-order difference operator, the smoothness of the generated trajectory is guaranteed and unnatural trajectory jumps are reduced. It can be expressed as:
[0105]
[0106] In the formula, They represent the trajectory values at the tth moment, t-1th moment, and t-2th moment in the predicted i-th trajectory data respectively; T represents the length of the time series of the trajectory data of the lane changing process.
[0107] (3) Direction consistency loss: Based on the inner product of the direction vector, it ensures the consistency of the direction of the generated trajectory between different time steps to avoid discontinuous or abrupt direction changes. It can be expressed as:
[0108]
[0109] In the formula, Represents the trajectory value at the t+1th moment in the i-th trajectory data generated by the prediction
[0110] Step 5: Input the cooperative driving features extracted in step 3 into the cooperative lane changing scenario generation model to generate a new cooperative lane changing scenario.
[0111] In this embodiment, when using the collaborative lane changing scenario generation model to generate a new collaborative lane changing scenario, constraints are imposed on the generated collaborative lane changing scenario:
[0112] (1) Deceleration constraint, that is, the speed reduction of the vehicle behind the target lane must meet the following requirements:
[0113] Δv min ≤Δv FL ≤Δv max
[0114] In the formula, Δv FL Indicates the speed drop of the vehicle behind the target lane during the lane change process, Δv FL (t) = v FL (t 0 )-v FL (t n ), v FL (t 0 ),v FL (t n ) represents the target lane rear vehicle at the initial lane change time t 0 and the end time t n The speed of min , Δv max is the speed change threshold of the vehicle behind the target lane during the lane changing process, which is obtained from the trajectory data of the coordinated lane changing vehicle group obtained in step 2;
[0115] (2) Initial spacing constraint, i.e., the distance d between the lane-changing vehicle and the vehicle behind in the target lane at the initial moment along the lane direction. initial Need to meet:
[0116] d min ≤d initial≤d max =50m
[0117] Where, d min d max is the distance threshold between the lane-changing vehicle and the vehicle behind in the target lane along the lane direction at the initial moment, d min It is obtained from the trajectory data of the coordinated lane-changing vehicle group obtained in step 2, and d max is the preset threshold.
[0118] Through these two constraints, namely, the deceleration of the vehicle behind the target lane meets the deceleration threshold and the initial horizontal distance between the two vehicles meets the distance threshold, it is ensured that the generated collaborative driving scenario is highly representative and reliable under real driving conditions. If the generated trajectory does not meet the above two constraints, the system will automatically regenerate the trajectory until all conditions are met. This process ensures the validity of the generated data, can better simulate the real interaction in collaborative driving, and improve the performance of the model in practical applications.
[0119] The above embodiments are preferred embodiments of the present application. Ordinary technicians in this field can also make various changes or improvements on this basis. Without departing from the overall concept of the present application, these changes or improvements should fall within the scope of protection required by the present application.
Claims
1. A method for extracting and generating collaborative lane-changing scenarios based on natural driving data, characterized in that: include: Step 1, extracting a lane-changing scene from natural driving data; wherein the extracted lane-changing scene data includes trajectory data of the lane-changing vehicle and surrounding vehicles; Step 2, selecting a coordinated lane-changing scene from all extracted lane-changing scenes based on preset conditions; wherein the lane-changing vehicle and the rear vehicle in the target lane in the coordinated lane-changing scene are recorded as a coordinated lane-changing vehicle group, and the coordinated lane-changing scene data includes trajectory data of the coordinated lane-changing vehicle group; Step 3, extracting cooperative driving features from the trajectory data of each cooperative lane-changing vehicle group; Step 4: Using the cooperative driving features as input features and the cooperative lane changing scene data as output trajectories, the diffusion model is trained to obtain a cooperative lane changing scene generation model; Step 5: Input the cooperative driving features extracted in step 3 into the cooperative lane changing scenario generation model to generate a new cooperative lane changing scenario.
2. The method for extracting and generating a collaborative lane-changing scene based on natural driving data according to claim 1, characterized in that: The vehicle's trajectory data includes the vehicle's speed, position, and lane information.
3. The method for extracting and generating a collaborative lane-changing scene based on natural driving data according to claim 1, characterized in that: The preset conditions for screening the coordinated lane-changing scenario include: (1) the vehicle behind the target lane has not changed lanes, (2) the distance between the vehicle behind the target lane and the lane-changing vehicle along the lane direction at the initial moment is less than the preset threshold d max , (3) The vehicle behind in the target lane decelerates; if a lane-changing scenario satisfies the above conditions at the same time, then the lane-changing scenario is a cooperative lane-changing scenario, otherwise it is not a cooperative lane-changing scenario.
4. The method for extracting and generating a coordinated lane-changing scene based on natural driving data according to claim 3, characterized in that: The preset conditions for screening the cooperative lane-changing scenarios also include: (4) the speed response of the vehicle behind the target lane and the lane-changing vehicle is synchronized; The method for screening collaborative lane-changing scenarios is as follows: if a certain lane-changing scenario satisfies the preset conditions (1)(2)(3) at the same time, a visualization animation is further created based on the trajectory data of the vehicle behind the target lane and the lane-changing vehicle, and the lane-changing scenario is manually reviewed based on the visualization animation to determine whether it satisfies the preset condition (4). If the preset condition (4) is met, the lane-changing scenario is a collaborative lane-changing scenario; otherwise, it is not a collaborative lane-changing scenario.
5. The method for extracting and generating a collaborative lane-changing scene based on natural driving data according to claim 1, characterized in that: The cooperative driving features include: the relative position and relative speed of the cooperative lane-changing vehicle group during the lane-changing process, the lane numbers of the lane-changing vehicles before and after the lane-changing process, and the starting position and ending position of the lane-changing vehicles during the lane-changing process.
6. The method for extracting and generating a coordinated lane-changing scene based on natural driving data according to claim 1, characterized in that: The diffusion model adopts a Wide&Deep network structure to embed cooperative driving features, wherein the Wide part is used to process continuous temporal features in the cooperative driving features, and the Deep part is used to process discrete non-temporal features in the cooperative driving features.
7. The method for extracting and generating a coordinated lane-changing scene based on natural driving data according to claim 6, characterized in that: The loss function used to train the diffusion model is: TotalLoss=MSELoss+SmoothnessLoss+DirectionLoss In the formula, TotalLoss is the overall loss, MSELoss, SmoothnessLoss, and DirectionLoss are MSE loss, smoothness loss, and direction consistency loss, respectively; in, Represents the i-th trajectory data generated by prediction, ∈ i represents the i-th actual trajectory sample, and N represents the number of actual trajectory samples; They represent the trajectory values at the tth moment, t-1th moment, t-2th moment, and t+1th moment in the predicted i-th trajectory data respectively; T represents the length of the time series of the trajectory data of the lane changing process.
8. The method for extracting and generating a coordinated lane-changing scene based on natural driving data according to claim 1, characterized in that: When using the cooperative lane changing scenario generation model to generate a new cooperative lane changing scenario in step 5, constraints are imposed on the generated cooperative lane changing scenario: (1) Deceleration constraint, that is, the speed reduction of the vehicle behind the target lane must meet the following requirements: Δv min ≤Δv FL ≤Δv max In the formula, Δv FL Indicates the speed drop of the vehicle behind the target lane during the lane change process, Δv FL (t) = v FL (t0)-v FL (t n ), v FL (t0), v FL (t n ) represents the time between the initial time t0 and the end time t of the lane change of the vehicle behind the target lane. n The speed of min , Δv max is the speed change threshold of the vehicle behind the target lane during the lane changing process, which is obtained from the trajectory data of the coordinated lane changing vehicle group obtained in step 2; (2) Initial spacing constraint, i.e., the distance d between the lane-changing vehicle and the vehicle behind in the target lane at the initial moment along the lane direction. initial Need to meet: d min ≤d initial ≤d max Where, d min ,d max is the distance threshold between the lane-changing vehicle and the vehicle behind in the target lane along the lane direction at the initial moment, d min It is obtained from the trajectory data of the coordinated lane-changing vehicle group obtained in step 2, and d max is the preset threshold.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to implement the method according to any one of claims 1 to 8.