Traffic simulation method and system based on motion intention velocity field
By constructing the motion intention velocity field and calculating the directional guidance vector of the energy optimization function, the existing traffic simulation methods are solved inadequate behavioral solidification and generalization capabilities when simulating complex intersections, and a more realistic and flexible traffic simulation simulation is achieved.
Patent Information
- Application Number
- CN202510124310.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-04-11
AI Technical Summary
When existing traffic simulation methods simulate scenes such as complex intersections, it is difficult to truly reflect the dynamic decision-making process of human drivers, and there are problems of insufficient behavioral solidification and generalization capabilities.
By constructing the velocity field corresponding to each motion intention in the set scene, using the motion intention velocity field to calculate the direction guidance vector in the energy optimization function, thereby selecting the speed that minimizes the energy optimization function, and realizing traffic simulation of the set scene.
This method can truly reflect various driving behaviors, improve the flexibility of the simulation process, and make the simulation results closer to the actual behavior of human drivers.
Smart Images

Figure CN119808593A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a traffic simulation method and system based on motion intention velocity field, belonging to the technical field of automatic driving. Background Art
[0002] With the rapid development of autonomous driving technology, the demand for traffic simulation in the field of autonomous driving has increased significantly. A high-precision simulation environment is the key to verifying and testing autonomous driving systems, ensuring that the system can make safe and reliable decisions in complex traffic scenarios. Especially in the context of intelligent traffic management and smart city planning, traffic flow simulation is not only a core tool for evaluating autonomous driving performance, but also an important support for optimizing urban traffic operations and formulating emergency response plans. However, when simulating traffic scenarios such as complex intersections, existing simulation methods still face severe challenges in generalization and fidelity. These problems mainly focus on how to deal with the high degree of freedom of traffic behavior, diverse traffic flow patterns, and complex interactions between participants.
[0003] As a typical complex scene in traffic simulation, intersections pose challenges to traditional simulation methods due to their unique structural characteristics and diverse traffic behaviors. Many existing methods guide agents to move along these paths by pre-defining invisible paths. For example, some traffic simulators use preset lanes and combine them with vehicle tracking models to make vehicles travel in fixed queues. However, this approach relies too much on regularized agent behavior, which limits the flexibility of behavior and easily leads to the phenomenon of agents queuing on predefined paths. In contrast, when dealing with complex intersections, human drivers and pedestrians often plan their movement intentions based on their own experience and intuition, and flexibly adjust their routes according to real-time traffic conditions. Therefore, the current traffic simulation methods have a large solidification problem, and it is difficult to truly reproduce the dynamic decision-making process of human drivers in complex traffic scenarios. Summary of the invention
[0004] The purpose of the present invention is to provide a traffic simulation method and system based on motion intention velocity field to solve the problem that the simulation process of traffic simulation is relatively rigid and cannot truly reflect the driving behavior of human drivers.
[0005] In order to solve the above technical problems, the present invention provides a traffic simulation method based on motion intention velocity field, and the simulation method comprises the following steps:
[0006] 1) constructing a velocity field corresponding to each motion intention in a set scene, wherein each motion intention velocity field includes a velocity vector of a region corresponding to the trajectory data of the motion intention in space;
[0007] 2) The direction guidance vector in the energy optimization function is calculated using the motion intention velocity field, and the speed that minimizes the energy optimization function is selected from the corresponding motion intention velocity field to achieve traffic simulation of the set scene.
[0008] Furthermore, the construction process of each motion intention velocity field is as follows: obtain the historical trajectory data under the set scenario, find the historical trajectory data that is the same as the intelligent agent's motion intention, and perform rasterization processing to construct the velocity field under each motion intention; wherein for any motion intention, each grid stores the velocity set at the position under the motion intention.
[0009] Furthermore, when constructing each motion intention velocity field, the method also uses the speed generated by the sketch to fill the motion intention velocity field. The process of sketching the speed is obtained by using the path guidance method based on the influence field vector. The speed of any point on the guide line is estimated by the relative position relationship with its neighboring points.
[0010] Furthermore, when estimating the speed of any point on the guide line using the relative position relationship with the neighboring points, a Gaussian radial basis function is used as a weight function to set weights for all neighboring points within the set neighboring point radius, and the closer the neighboring point is to the calculated point, the greater the weight.
[0011] Furthermore, when the speed obtained in step 2) does not meet the set requirements, the method also performs trajectory prediction through a trajectory prediction model, supplements speed data based on the predicted trajectory, substitutes the supplemented speed data into the energy optimization function, and selects the speed that minimizes the energy optimization function.
[0012] Furthermore, the trajectory prediction model is implemented using a spatial graph convolutional network.
[0013] Furthermore, after performing trajectory prediction, the spatial graph convolutional network segments the predicted trajectory, calculates the angle of each trajectory segment, classifies the trajectory segments according to the angles, performs a comprehensive similarity score on the candidate trajectory segments that meet the behavior requirements of the intelligent agent and the angle changes, and selects the trajectory segments that meet the set requirements. The speed data corresponding to the trajectory segments that meet the set requirements are the speed data to be supplemented.
[0014] Furthermore, the comprehensive similarity score is obtained by calculating the similarity between each candidate trajectory segment and the target trajectory in terms of direction, length and curvature.
[0015] Furthermore, the energy optimization function is:
[0016] E=ω v E v +ω g E g +ω cE c
[0017] Where E is the energy optimization function, E v is the velocity energy function, E g is the direction-guided energy function, E c is the collision avoidance energy function with motion intention awareness, ω v ,ω g and ω c They are the weights of the speed energy function, the direction guidance energy function and the motion intention-aware collision avoidance energy function.
[0018] The present invention also provides a traffic simulation system based on motion intention velocity field, comprising a processor, wherein the processor is used to execute computer program instructions to implement the above-mentioned traffic simulation method based on motion intention velocity field.
[0019] The beneficial effect of the present invention is as follows: the present invention constructs a speed field corresponding to each motion intention in a set scene to obtain a speed set of each motion intention in different regional positions in the set scene, uses the motion intention speed field to calculate the direction guidance vector in the energy optimization function, and selects the speed that minimizes the energy optimization function from the corresponding motion intention speed field to achieve traffic simulation of the set scene. The entire simulation process of the present invention is achieved by constructing a motion intention speed field, and the motion intention speed field is composed of various speeds under the same motion intention, which can truly reflect various driving behaviors, making the entire simulation process more flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic diagram of the principle of the traffic simulation method based on the motion intention velocity field of the present invention;
[0021] Figure 2a is a schematic diagram of a crossroads scene used in an embodiment of the present invention;
[0022] Figure 2b is a schematic diagram of a roundabout scene used in an embodiment of the present invention;
[0023] Figure 2c is a schematic diagram of a staggered intersection scenario used in an embodiment of the present invention;
[0024] Figure 3a is a schematic diagram of the speed difference between the present invention and the TraInterSim method and the ground truth in the intersection scenario;
[0025] Figure 3b is a schematic diagram of the steering difference between the present invention and the TraInterSim method and the ground truth in the intersection scenario;
[0026] Figure 4 is a comparison diagram of the errors of the present invention and the TraInterSim method in the crossroad scenario;
[0027] Figure 5a It is a schematic diagram of the speed difference between the present invention and the TraInterSim method and the ground truth in the misaligned intersection scenario;
[0028] Figure 5b It is a schematic diagram of the steering difference between the present invention and the TraInterSim method and the ground truth in the misaligned intersection scenario;
[0029] Figure 6 is a comparison diagram of the errors of the present invention and the TraInterSim method in the misaligned intersection scenario;
[0030] Figure 7a It is a schematic diagram of the speed difference between multiple sketches and a single sketch and the ground truth;
[0031] Figure 7b is a schematic diagram of the steering differences between multiple sketches and a single sketch and the ground truth;
[0032] Figure 8 It is a comparison chart of multiple sketches and single sketches with errors;
[0033] Fig. 9 It uses the Interaction Fields sketch method to generate IF visualization diagrams;
[0034] Fig.10 The sketch method of the present invention is used to generate a velocity vector visualization schematic diagram;
[0035] Fig.11a It is a schematic diagram of the speed difference between the trajectory generated by the baking solution of the present invention and the current speed continuity model in the intersection scenario;
[0036] Fig.11b It is a schematic diagram of the steering difference between the trajectory generated by the baking solution of the present invention and the current speed continuity model in the intersection scenario;
[0037] Fig.12 It is a comparison diagram of the errors between the trajectories generated by the baking solution of the present invention and the current speed continuity model in the intersection scenario;
[0038] Fig.13a This is a diagram of the ratings of participants in the Street View study;
[0039] Fig.13b is a schematic diagram of the rating results of participants in the agent view study;
[0040] Fig.14A schematic diagram of the visualization of the motion intention velocity field obtained in an embodiment of the present invention;
[0041] Fig.15 It is a schematic diagram of the visualization of direction vectors used in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0043] The present invention constructs a velocity field corresponding to each motion intention in a set scene to obtain a velocity set of each motion intention in different areas of the set scene, uses the motion intention velocity field to calculate the direction guidance vector in the energy optimization function, and selects the speed that minimizes the energy optimization function from the corresponding motion intention velocity field to realize traffic simulation of the set scene.
[0044] Embodiment of traffic simulation method based on motion intention velocity field
[0045] The present invention first constructs the velocity field corresponding to each motion intention in the set scene, and then uses the motion intention velocity field to calculate the direction guidance vector in the energy optimization function, and selects the speed that minimizes the energy optimization function from the corresponding motion intention velocity field. If the determined speed meets the requirements, the trajectory prediction model is used to perform trajectory prediction, and the velocity data is supplemented based on the predicted trajectory. The supplemented velocity data is substituted into the energy optimization function, and the speed that minimizes the energy optimization function is selected. The implementation principle of this method is as follows Figure 1 shown.
[0046] In the real world, there are no strictly divided lanes in the central area of an intersection. However, when crossing an intersection, road users often plan a general driving route based on their own experience and travel habits. Although interaction with surrounding vehicles or pedestrians may cause a local path deviation or adjustment, their overall movement still follows the pre-planned area. Based on this feature, the present invention proposes a traffic simulation method based on motion intention velocity field, and constructs a motion intention planning model for each intelligent agent to more realistically reflect its actual behavior characteristics.
[0047] The motion intention velocity field is essentially a two-dimensional grid map. Assuming that the size of each grid in the map is M*M square meters, the grid stores the velocity vectors of the corresponding areas in space with the same motion intention trajectory data. The motion intention velocity field G of any agent in the scene can be expressed as:
[0048] G i =<R,C>
[0049] Where i is the agent number, R and C are the row index and column index of the grid in space, respectively.<R,C> Represents all the speed information stored in the grid located in the Rth row and Cth column in space. The motion intention velocity field is a gridded velocity field. Each agent randomly selects trajectory data with the same motion intention and converts it into a velocity field to fill the velocity field. The velocity field is interpolated using a Gaussian convolution kernel to ensure that there are no grids with empty velocity data in the motion intention velocity field of the agent.
[0050] 1. Construct the velocity field of each motion intention.
[0051] The same motion intention refers to a behavior pattern of entering the central area of an intersection from the same intersection and exiting from the same road. Users with the same motion intention also have similar plans for passing through intersections. For a road user with a certain motion intention, if the road users who pass before him and have the same motion intention in the scene all follow similar plans, then the user's motion intention velocity field remains similar to the velocity field of the previous road user, and usually no significant changes will occur. Therefore, the present invention uses multiple trajectory data to construct a corresponding motion intention velocity field for each type of specific motion intention. These trajectories are all from agents with the same motion intention. To ensure the diversity of the simulation results, the selected trajectory data is sampled in a random manner to avoid the influence of singleness or repeatability on the results.
[0052] Taking agent i as an example, assuming that agent i is a motor vehicle with the movement intention of entering the central area from the east lane and turning right in the intersection scene, the generation process of its movement intention velocity field is as follows:
[0053] 1) Randomly select k trajectory data with the same motion intention as agent i, denoted as Γ=[Γ1,Γ2,...,Γ k ].
[0054] 2) Divide each trajectory data into corresponding grids according to the spatial distribution of trajectory point coordinates, and store all speed data converted from trajectory data in the grid. Take the first randomly selected trajectory data as an example, assuming that it is a trajectory containing n coordinate points, represented by Γ1=<(x0,y0),(x1,y1),...,(x t ,y t ),...,(x n ,y n )>, where (x t ,y t ) is the coordinate point at time t in the trajectory. For the data at any time in the trajectory, according to the row index and column index of the grid to which the coordinate position belongs (R, C) = (x t / M,y t / M), and then convert it into velocity data and store it in the corresponding grid, which is:
[0055] v t =(x t+1 -x t ,y t+1 -y t ),v t ∈V R,C
[0056] Where (x t+1 ,y t+1 ) is the coordinate point at time t+1 in the trajectory. Through this process, all trajectory data in the trajectory set Γ can be converted into velocity and stored in the corresponding grid.
[0057] 3) Since the trajectory set corresponding to each motion intention is randomly selected, there may be grids with empty data inside the motion intention velocity field constructed by step 2), and these empty grids need to be filled. The motion intention velocity field is essentially a velocity field filled with data of the same motion intention trajectory. The speed change in any area of the velocity field will not be very significant. Therefore, the present invention fills the blank grids by randomly selecting the speed in the adjacent grids of the blank grids through the Gaussian convolution kernel. For example, the Gaussian convolution kernel size used in this embodiment is 3*3, and the speed is randomly selected from the adjacent grids of the blank grid with a weight of 0.1 to fill the blank grid. The construction of the motion intention velocity field of agent i can be realized through the above process. The motion intention velocity field obtained in this embodiment is as follows: Fig.14 As shown, the velocity fields of various heterogeneous agents with other motion intentions use the same construction method.
[0058] In order to deal with the situation where there is no empirical data or the data quality is not high, and to more realistically and reasonably realize the simulation of the intelligent agent in complex scenarios, the present invention also uses sketches to fill the motion intention velocity field, so that the data in the motion intention velocity field is richer.
[0059] The present invention proposes a visualization tool based on OpenGL for drawing and interactively operating B-spline curves, thereby generating a sketch capable of filling the motion intention velocity field. The tool generates a B-spline curve through the control points input by the user, and supports real-time adjustment of the control points and dynamic updating of the curve shape. To achieve the above functions, a structure point for representing plane points is first defined, and a function for calculating the Euclidean distance between any two points is provided. In addition, a set of global variables are designed in the system to store the control points of each segment of the curve, the generated sampling points, and the flag variables for tracking the mouse input and the curve state. In the process of generating the B-spline curve, the program uses a stepwise interpolation method to calculate the curve sampling points according to the subdivision parameters specified by the user, and stores these points as sample points. The generated sample points are not only used for the graphical display of the curve, but also can be exported as an external file, which is convenient for subsequent data processing and analysis. The user can add or move the control points in the drawing area through the mouse operation, and the program will automatically adjust and update the curve in real time to ensure that the user can intuitively observe the effect of the adjustment. In order to improve the user experience, the system also implements the function of adaptive window size, and ensures that the curve can be correctly displayed at different resolutions by adjusting the viewport and projection matrix. In addition, the tool supports saving the generated curve results to a file, which facilitates subsequent analysis and application, and provides users with an intuitive and flexible B-spline curve drawing and adjustment platform. In order to further optimize the accuracy of speed estimation, the present invention introduces Gaussian radial basis function (RBF) as a weight function during interpolation. The RBF function uses the distance attenuation characteristic to give higher weights to neighboring points closer to the target point, thereby effectively reflecting the contribution of neighboring points to speed estimation. The vector field method is a widely used technology in traffic simulation and path planning, which is used to guide the motion path of a moving body. Based on this, the present invention proposes an innovative method for path guidance using influence field (IF) vectors. In this method, the IF vector of each point on the guide line is determined by the coordinate difference between its neighboring points, thereby estimating the speed. Specifically, the speed of any point on the guide line can be calculated by the relative position relationship between it and the neighboring points. In order to ensure the accuracy of speed estimation, it is necessary to reasonably set the selection range of neighboring points. To this end, the parameter radius is introduced as the search radius of neighboring points, and only points within this radius will be used for interpolation operations. This setting not only improves the reliability of the estimation results, but also enhances the stability of the calculation. i , whose velocity estimate v i It is expressed as:
[0060]
[0061] Where N(i) represents the set of all adjacent points within the radius radius, v j represents the vector of point j, represents the weight function based on Gaussian radial basis function, which can be expressed as:
[0062]
[0063] Where σ is a parameter that controls the speed of weight decay. In this way, an accurate vector field can be constructed to guide the smooth movement of the moving body along the predetermined path.
[0064] 2. Use the energy optimization function to search for the appropriate speed from the motion intention velocity field.
[0065] The energy optimization function used in the present invention is:
[0066] E=ω v E v +ω g E g +ω c E c
[0067] Where E represents the energy optimization function, E v is the velocity energy function, E g is the direction-guided energy function, E c is the collision avoidance energy function with motion intention awareness, ω v ,ω g and ω c are the weights of the speed energy function, direction guidance energy function, and motion intention perception collision avoidance energy function. Speed energy function E v Used to represent an agent trying to achieve its desired velocity while maintaining a bounded velocity change:
[0068]
[0069] in, and Respectively represent the continuity of velocity in direction and magnitude, indicates that the agent tends to approach its expected speed, e i,t is the maximum speed that agent i is expected to achieve at time step t.
[0070] The direction guidance energy function is used to control the direction in which the agent moves towards its destination. The direction guidance vector represents the direction in which the agent expects to move at the current moment. When in the central area of the intersection, the direction guidance vector of agent i at time step t is expressed as:
[0071]
[0072] in is the destination coordinate of agent i. When in the non-central area, the agent moves along the road direction. At this time, the direction guidance vector is parallel to the road direction. The direction guidance energy function is defined as:
[0073]
[0074] The collision energy function can be expressed as follows:
[0075]
[0076] Where Φ is the set of all neighbors (traffic lights and other heterogeneous agents) within the perception range of agent i at time step t, φ is any neighbor in the set Φ, and E(i,φ) is the collision avoidance energy function of the interaction between agent i and its neighbor φ.
[0077] The agent searches for the speed that minimizes the energy optimization function with the help of its own speed field. Assume that at time t, agent i calculates the row index and column index (R) of the grid in the speed field corresponding to the motion intention in space according to its current coordinates. i,t , C i,t )=p i,t / M, the updating process of its own motion state can be described by the following formula:
[0078] D VQ =V Ri,t,Ci,t ∪Q
[0079] v i,t =argE(ω,v,S i,t-1 )
[0080] p i,t =p i,t-1 +v i,t
[0081] Among them, D VQ is the candidate speed dataset from which the agent searches for the speed that minimizes the energy optimization function, V Ri,t,Ci,t is all the speed data stored in the grid where the agent i is located at time t, and Q is the supplementary data set generated by the multimodal trajectory prediction model.
[0082] Substitute each speed provided by the candidate speed set into the energy optimization equation for calculation, so that the speed with the minimum value of the energy optimization equation is the optimal speed. According to the specific steps of calculating the direction guidance vector based on the motion intention velocity field, all the speeds of the candidate speed set in the current grid are normalized to obtain an average unit velocity vector as the direction guidance vector. Based on the above energy optimization function, the present invention calculates the direction guidance vector through the motion intention velocity field of the intelligent agent, and the vector is used to indicate the expected direction of the intelligent agent to move to its target position at the current moment. Each grid of the motion intention velocity field stores the movement experience data of road users in the area, reflecting the general movement trend of road users with the same motion intention in space. Therefore, the present invention uses the unit vector of all speed data differences stored in the grid as the direction guidance vector of the intelligent agent in the grid area. Assuming that the intelligent agent i is currently located in a grid containing q speed data, its direction guidance vector in the grid can be expressed as:
[0083] g i,t =(v1+v2+...+v q ) / ||v1+v2+...+v q ||
[0084] Among them, v1, v2, v q is the speed data stored in the grid where the agent is currently located, v1, v2, v q ∈V Ri,t,Ci,t The visual schematic diagram of the direction guidance vector in this embodiment is as follows: Fig.15 shown.
[0085] 3. Use the trajectory prediction model baking solution for speed optimization.
[0086] Through steps 1 and 2, the speed data determined by the energy optimization function can be used to implement the corresponding traffic simulation. However, if the speed data determined by the above process does not meet the requirements, new speed data needs to be generated for further optimization.
[0087] The present invention sets a threshold indicator τ(v i,t-1 ,v) to measure whether the current optimal speed that minimizes the energy function is suitable for updating the movement of the agent, that is, whether it meets the requirements:
[0088]
[0089] Among them, τ m (‖v i,t-1 ‖,‖v‖) and They are used to measure the continuity of velocity magnitude and direction, τ g (ω g E g) is used to measure the degree of deviation from the destination direction after the agent chooses this speed to move, τ c (ω c E c ) is used to measure the impact of collisions with neighbors after moving at this speed.
[0090] First, the predicted trajectory is obtained using the trajectory prediction model. This embodiment uses the Spatial Graph Convolutional Network (SGCN) as the core algorithm of the trajectory prediction model. SGCN can capture the spatial relationship between agents based on the structure of the graph, effectively learn the interaction mode, and thus optimize the multi-step trajectory prediction. Its efficient computing performance enables it to handle large-scale, multi-agent scenarios, providing technical support for real-time simulation.
[0091] The trajectory data output by the trajectory prediction model is then processed. Based on the angle change of the trajectory, the continuous trajectory is segmented by setting an angle threshold. Each segment is characterized by the angle change between its start and end points. The angles of these segmented trajectories are calculated using the following formula:
[0092] θ=tan -1 [(y2-y1) / x2-x1)]
[0093] Subsequently, these trajectory segments are classified by angle, and an angle-trajectory set is constructed. On this basis, the current trajectory and the trajectories stored in the trajectory set are evaluated for similarity, and a threshold for the similarity score is set. If the similarity score reaches or exceeds the threshold, similar trajectories are no longer stored repeatedly to improve the efficiency of subsequent matching and retrieval. Specifically, the present invention evaluates the behavioral requirements of each agent through a baking scheme, including requirements such as straight driving, turning, and speed adjustment. The evaluation process comprehensively considers the vehicle's current position, current speed, and surrounding traffic environment (such as adjacent vehicles, pedestrians, and obstacles), thereby generating a steering demand score and a braking demand score for the agent, and calculating the total score according to certain weights. Among them, the steering demand score is obtained by comparing the deviation angle between the vehicle's current driving direction and the target direction, and its calculation formula is:
[0094] ω turn =|θ desired -θ current | / 180°
[0095] Among them, θ desired is the direction angle of the vehicle's expected travel, θ current The actual direction of the vehicle is the angle of the vehicle's current direction. This formula ensures that the score is between 0 and 1, where 1 means the direction is completely opposite and 0 means the direction is the same. brakeThe distance between the vehicle and the obstacle in front (such as vehicles, pedestrians, etc.) is considered. When the distance is lower than the safety threshold, the braking score needs to be improved:
[0096] ω brake =max(0,1-distance / SafetyDistance)
[0097] Where distance is the actual distance between the vehicle and the obstacle in front, SafetyDistance is the ideal safety distance determined based on the vehicle speed and road conditions. If the actual distance is greater than or equal to the safety distance, the braking score is 0, indicating that no braking is required.
[0098] According to the steering demand score and braking demand score calculated above, the total score is obtained according to a certain proportion to give the agent's behavioral needs. The specific calculation method is that if the braking score is greater than 0.5, then the agent's behavioral need is braking first. If the braking score is lower, then look at the steering score. If it is greater than 0.3, the agent's behavioral need is to turn, otherwise the agent's behavioral need is to go straight. Angle change: Each trajectory segment is characterized by the angle change between its starting and ending points, which is θ introduced above. The trajectory segment that meets the agent's angle change is the candidate trajectory under the same θ as the agent trajectory in the constructed angle-trajectory set. According to the above two points, the trajectory segments that meet both the agent's behavioral needs and angle changes are selected, and then further similarity evaluation is performed.
[0099] After the behavior evaluation, the trajectory segments that meet the agent's behavior requirements and angle changes are further evaluated for comprehensive similarity. This evaluation relies on the comparison of each trajectory segment with the agent's historical trajectory, mainly considering the scores of the following three dimensions: direction, length, and curvature. After that, if there are multiple trajectory segments that meet the requirements, the system will apply an energy calculation method to determine the optimal trajectory. The agent's historical trajectory is the actual motion trajectory of the agent in the previous few frames.
[0100] The similarity score is calculated as follows: For each candidate trajectory segment, the system calculates its similarity with the target trajectory in terms of direction, length, and curvature. The similarity score S is calculated as:
[0101] S=ω dir *S dir +ω len *S len +ω curv *S curv
[0102] Among them, ω dir ,ω len and ω curv are the weight factors of direction, length and curvature, corresponding to the importance of direction, length and curvature respectively, and there is ω dir +ωlen +ω curv =1, each weight can be set according to the actual situation. The similarity components are defined as follows:
[0103] Direction similarity S dir :S dir =cos(θ target -θ candidate ), where θ target is the direction angle of the target trajectory, θ candidate is the orientation angle of the candidate trajectory.
[0104] Length similarity S len :S len =1-|L ttarget -L candidate | / max(L target -L candidate ) Among them, L target and L candidate are the lengths of the target trajectory and the candidate trajectory, respectively.
[0105] Curvature similarity S curv : in, and are the average curvatures of the target and candidate trajectories, respectively, and σ is a parameter that controls the attenuation.
[0106] Subsequently, the system evaluates the similarity of each trajectory segment that is consistent with the agent's behavioral requirements and angle changes, comprehensively considers the comprehensive scores of the trajectory segment and the agent's historical trajectory in direction, length, and curvature, and selects the most suitable driving trajectory based on the score, and selects the trajectory segment with the highest score as the optimal trajectory segment. Once the optimal trajectory segment is selected, the basic velocity vector of each point in the trajectory segment is calculated, and the velocity vector is adjusted according to the current dynamic state of the vehicle. This process includes scaling the velocity vector to match the actual operating capability and safety requirements of the vehicle. The adjusted velocity vector is added to D VQ That is, the agent's candidate speed data set, from which the agent searches for the speed that minimizes the energy optimization function to guide the agent's movement in the next frame, thereby providing real-time and accurate driving guidance, and dynamically adjusting the vehicle's driving strategy according to the complex traffic environment and the vehicle's immediate needs. After determining the optimal trajectory segment, the system will calculate the basic speed vectors of each point in the trajectory segment and adjust these speed vectors based on the vehicle's current dynamic state. During the adjustment process, the speed vector is scaled to adapt to the vehicle's actual operating capabilities and safety requirements. The adjusted speed vector is added to the agent's candidate speed data set D VQ, for the agent to search for the speed value that can minimize the energy optimization function to guide its movement in the next frame. This method can not only provide real-time and accurate driving guidance for the agent, but also dynamically optimize the driving strategy of the agent according to the changes in the complex traffic environment and the immediate needs of the vehicle, thereby improving the overall adaptability and safety of the system.
[0107] Traffic simulation system implementation based on motion intention velocity field
[0108] The traffic simulation system based on motion intention velocity field of this embodiment includes a processor, wherein the processor is used to execute computer program instructions to implement the traffic simulation method based on motion intention velocity field of the present invention. The specific implementation of this method has been described in detail in the traffic simulation method based on motion intention velocity field embodiment, and will not be repeated here.
[0109] Experimental verification
[0110] In order to further demonstrate the effect of the present invention, the present invention is experimentally verified under different setting scenarios. The simulation result snapshots under the setting scenarios selected in this experiment are as follows: Figure 2a , Figure 2b and Figure 2c As shown, there are four-lane intersections, roundabouts and staggered intersections.
[0111] The trajectory data can be derived from a variety of devices (such as sensors, video tracking, etc.), and the data is supplemented by sketches and trajectory prediction models. The present invention can simulate a variety of complex traffic intersection scenes. For experiments on intersections and roundabouts, this study selected samples from the VTP-TL dataset. The trajectory data of this dataset was extracted from different traffic intersection videos taken by drones, and the video frame rate was 30fps. For intersection scenes, the central area is joined by four lanes from different directions. For staggered intersection scenes, the experimental data was selected from the INTERACTION dataset, in which the trajectories were collected by drones and fixed cameras with a sampling frequency of 10Hz.
[0112] 1) Runtime performance
[0113] The present invention is implemented on a 64-bit desktop equipped with a 3.80GHz Intel(R) Core(TM) i710700K processor and 32GB memory through Unreal Engine. The energy optimization equation in TraInterSim is used to transform the agent's per-frame decision process into an agent energy minimization problem. The runtime performance of the present invention under different traffic intersection scenarios is shown in Table 1.
[0114] Table 1
[0115]
[0116] It can be seen that the running time increases with the number of agents, mainly due to the candidate speed energy calculation cost when the agents interact.
[0117] 2) Validity of motion intention velocity field
[0118] Due to the random nature of traffic, traffic simulations usually do not directly compare trajectories. In traffic intersection scenarios, vehicles come from different directions, and it is difficult to directly calculate the distance between vehicles. To verify the performance of the present invention, this experiment selects the distribution of speed and steering angle as comparison indicators. Speed is a basic parameter that reflects motion properties, while steering angle is used to measure vehicle turning performance, and evaluates the effectiveness of motion intentions from both qualitative and quantitative aspects. In qualitative experiments, the experiment uses VTP-TL and INTERACTION datasets as inputs, uses the same initial conditions, and simulates in intersections and misaligned intersection scenarios by TraInterSim and the present invention, respectively. To further verify the results, the Unreal Engine is used to reproduce the dataset and produce three specific traffic animations. Since TraInterSim performs poorly in misaligned intersection scenarios and cannot complete normal traffic flow simulation, auxiliary lanes are set for it to assist the agent in better controlling the direction. In quantitative experiments, this study clarifies the specific size of the motion intention grid field and the number of speeds stored in each grid, thereby systematically verifying the applicability and accuracy of the present invention in different scenarios.
[0119] The slight difference between the simulation result and the ground truth speed is not significant for visual effects, while the steering angle is more obvious. Therefore, all values of speed and steering angle are divided into 15 intervals and 30 intervals. The probability of speed and steering angle in each interval is calculated. The probability difference between the true value and the simulation result is the sum of the probability differences of all intervals. The lower the score, the closer the distribution is to the true value. In addition, in order to better demonstrate the superiority of the present invention, not only the speed and steering angle are divided into intervals, because doing so loses the individual differences of the agent. Therefore, for each agent, the DTW distance between its speed and steering angle per frame and the true situation is calculated to measure the similarity difference with the true situation. Figure 3a , Figure 3b , Figure 4 , Figure 5a , Figure 5b and Figure 6The experimental results are shown. In the intersection scenario, the speed difference between TraInterSim and the ground truth is A1, and the steering angle difference is B1. The speed difference between the present invention and the ground truth is A2, and the steering angle difference is B2. In the misaligned intersection scenario, the speed difference between TraInterSim and the ground truth is A3, and the steering angle difference is B3. The speed difference between the present invention and the ground truth is A4, and the steering angle difference is B4. The experimental results show that the present invention is superior to TraInterSim in the intersection scenario, and in the misaligned intersection scenario, even with the guidance of the auxiliary lane line, the present invention still performs better than TraInterSim.
[0120] The present invention adopts a motion intention modeling method based on uniform grids, aiming to improve the motion diversity and randomness of the agent in the virtual environment. Specifically, the agent dynamically selects an adaptive motion intention velocity field according to its own position and preset motion intention. To achieve this goal, the motion intention velocity field is pre-set in the simulation initialization phase, where the size of each grid unit is 2m×2m. In order to further refine the representation of the velocity field, interpolation vectors are generated and parameterized at three position points of each grid, thereby constructing velocity vectors of 12 different sizes and directions.
[0121] In order to enhance the randomness of the agent's movement, three sketch trajectories are set in each motion intention velocity field as a reference for generating velocity vectors. In each grid cell, 36 candidate velocity vectors are generated through these three sketch trajectories, forming a velocity vector set for the agent's movement. Experiments were conducted in the intersection scene to investigate the effect of the number of velocity vectors and sketch trajectories on the movement effect. The experimental results are shown in Figure 2. Figure 7a , Figure 7b and Figure 8 As shown in the figure, it is shown that the velocity vector effect generated by three sketch trajectories is significantly better than that of a single sketch trajectory. Therefore, the present invention combines multi-trajectory sketches with grid parameterization to generate a richer set of velocity vectors, providing a diverse range of motion selection spaces for the intelligent agent, and significantly improving the motion simulation effect.
[0122] 3) Sketch generation effectiveness
[0123] According to the definition in Interaction Fields, the speed or direction of a single agent (IF agent) near a specific source point can be represented by an interaction field (IF). Interaction Fields proposes an algorithm based on inverse distance weighting (IDW) interpolation to convert the user-drawn sketch guide curve into a global motion intention field (IF). This method calculates the motion intention vector at any position by weighted integration, where the weight is determined by the distance from the point to the guide curve. The farther the distance, the smaller the weight. Fig. 9 Shows an example of a guide curve in InteractionFields and the interpolated motion intention field it generates.
[0124] To further improve the accuracy of velocity estimation, the present invention introduces a key parameter "neighborhood radius" (radius), and only uses points within the radius to participate in the interpolation calculation. At the same time, in the weight calculation, the Gaussian radial basis function (RBF) replaces the traditional IDW weighting method. Fig.10 The sketch example of the present invention and the visualization results of the interpolation vector generated by it are shown. Compared with the Interaction Fields method, the present invention not only reflects the overall trend of the trajectory more accurately, but also significantly improves the accuracy of the interpolation vector. In addition, the Interaction Fields method only generates a single velocity vector within the grid, while the present invention generates multiple IF velocity vectors within each grid through uniform interpolation. This improvement not only ensures the accuracy of the agent's velocity vector, but also enhances the diversity and expressiveness of the motion intention field.
[0125] Comparative visualization results further verify the advantages of the present invention, clearly demonstrating its significant improvement in trajectory trend capture and speed estimation accuracy. These improvements not only expand the expressive power of the motion intention field, but also provide stronger support for the diversity and authenticity of intelligent agent behavior.
[0126] 4) Effectiveness of trajectory prediction model baking solution
[0127] In the prior art, speed continuity models are often used to supplement data at runtime to alleviate the problem of insufficient input data quality. This method can quickly generate supplementary data and significantly improve the real-time response capability of the system even in the absence of high-quality input data. However, since the speed continuity model mainly relies on the current motion state of the agent, the data it generates has certain limitations in reflecting long-term traffic behavior. Especially in complex traffic scenarios, the short-term tendency of this model may have an adverse effect on the overall prediction accuracy. Therefore, although the speed continuity model has advantages in immediate response and short-term data generation, its performance is relatively insufficient in terms of modeling and prediction accuracy of long-term traffic behavior, which restricts its potential in more complex application scenarios.
[0128] In contrast, trajectory prediction models have significant advantages because they can generate high-quality traffic data. However, the design of such models usually pays more attention to prediction accuracy, while relatively less consideration is given to computational efficiency, which limits their applicability in real-time traffic simulation scenarios. Due to the high computational complexity of trajectory prediction models, directly integrating them into the traffic simulation framework often places high demands on the real-time performance of the system, which faces many challenges in practical applications. Therefore, although trajectory prediction models have demonstrated powerful capabilities in generating reliable traffic data, their high computational overhead limits their widespread application in real-time simulation environments. In order to resolve the above contradiction, the present invention proposes a baking scheme based on a trajectory prediction model, which aims to take into account the needs of fast response and high-precision prediction. In order to verify the effectiveness of the trajectory prediction model baking scheme of the present invention, quantitative experiments were carried out in a four-lane intersection scenario, and compared with the speed continuity model. The experimental results are shown in the figure. Fig.11a , Fig.11b and Fig.12 As shown in the figure, the trajectory prediction model based on SGCN generates more accurate motion trajectories by capturing the interaction relationship between intelligent agents in complex scenes. At the same time, the experiment also measured the time consumption of the trajectory prediction baking solution. The results showed that its calculation time was always maintained at the millisecond level, which fully met the performance requirements of the real-time simulation system.
[0129] From the analysis of the results, it can be seen that the trajectory prediction model baking scheme can not only significantly improve the simulation accuracy, but also optimize the prediction ability of complex traffic scenarios on the basis of meeting real-time performance. This shows that the trajectory prediction baking scheme proposed in this paper has obvious advantages in balancing response speed and prediction accuracy, and provides strong support for efficient and accurate traffic simulation.
[0130] 5) Authenticity of simulation in each scenario
[0131] In order to evaluate the ability of the present invention in simulating multiple scenarios and the authenticity of its simulation effect, a comparative analysis was conducted between the present invention and the currently advanced TraIntersim method. Table 2 summarizes the statistical results of whether the present invention and the TraIntersim method perform well in different scenarios, and further quantitatively compares the applicability and effect differences of the methods. In addition, Figure 3a , Figure 3b , Figure 4 , Figure 5a , Figure 5b and Figure 6 The detailed comparison of speed distribution and steering angle distribution in different scenarios between the present invention and the existing methods is shown. The experimental results show that the present invention has superior simulation capabilities in various scenarios and can generate more realistic traffic flow behaviors, further verifying its effectiveness and robustness in complex traffic scenarios.
[0132] Table 2
[0133]
[0134]
[0135] 6) User Research
[0136] In order to more intuitively evaluate the performance of the present invention, two user comparison experiments were designed and implemented. In the experiments, Ground Truth, TraIntersim and the present invention were used to generate simulation animations of multiple traffic scenes. The animation of each scene was captured from two perspectives: street view and proxy view, where the proxy view further enhanced the user's immersive experience. The experiment covered three types of traffic simulation scenes: four-lane intersection, roundabout and staggered intersection.
[0137] In the more complex roundabout and staggered intersection scenarios, the TraIntersim method failed to generate reasonable simulation animations. Although auxiliary lanes were set for the TraIntersim method to guide the direction of the intelligent agent, its performance was still unsatisfactory. Therefore, these two types of scenarios only used the Ground Truth method to compare with the present invention. In the four-lane intersection scenario, animations were generated using Ground Truth and TraIntersim respectively, and the experimental results were marked as Crossroad-1 and Crossroad-2, while Crossroad-3 corresponded to the comparison results between the TraIntersim method and the present invention in the complex four-lane intersection scenario. A total of 30 traffic intersection simulation animations and 15 pairs of paired comparison animations were generated in this user experiment to comprehensively evaluate the performance of each method in different traffic scenarios.
[0138] This experiment recruited 50 graduate students from the same university as participants. In each comparison, participants rated the rationality of the simulation results using a 7-point Likert scale (1-7 points): 1 means completely biased towards the left simulation, 7 means completely biased towards the right simulation, and 4 means no obvious preference. Fig.13a and Fig.13b ,in Fig.13a and Fig.13b The detailed scores for the Street View and Proxy View studies are shown separately, where the colored lines represent the median (yellow) and mean (purple), respectively. The lower the score, the more the participants prefer the method on the left; the higher the score, the more the participants prefer the method on the right.
[0139] In the Street View study, participants rated Fig.13a As shown. In addition to showing the detailed scores of each scene, the total voting results are also counted. The results show that the participants generally give significantly higher evaluations to the present invention than to the comparison methods. In order to quantitatively analyze the statistical significance of the voting results, a single-sample t-test is used, assuming that the average score of the present invention is greater than 4 (no preference). The experimental results show that the average score of the rationality of the present invention in the street view study is significantly higher than that of the comparison method, which is statistically significant (t(49)=3.3133, p=0.0009<0.005).
[0140] In the proxy view study, participants rated Fig.13b As shown, in addition to the score of each scene, the total voting results are also counted. The results show that the performance of the present invention is significantly better than the comparison method, and its advantage is more obvious than that in the street view study. The single sample t-test results show that the average score of the present invention is significantly higher than the hypothesized mean, which is statistically significant (t(49)=3.3670, p=0.00073<0.01).
[0141] In both of the above user studies, the present invention received good reviews. After the experiment, participants were interviewed informally, and most of them said that the main advantages of the present invention are the smoothness of the trajectory and the more natural interaction between agents. These features enhance the realism and rationality of the simulation, further proving the effectiveness of the present invention.
Claims
1. A traffic simulation method based on motion intention velocity field, characterized in that: The simulation method includes the following steps: 1) constructing a velocity field corresponding to each motion intention in a set scene, wherein each motion intention velocity field includes a velocity vector of a region corresponding to the trajectory data of the motion intention in space; 2) The direction guidance vector in the energy optimization function is calculated using the motion intention velocity field, and the speed that minimizes the energy optimization function is selected from the corresponding motion intention velocity field to achieve traffic simulation of the set scene.
2. The traffic simulation method based on motion intention velocity field according to claim 1 is characterized in that: The construction process of each motion intention velocity field is as follows: obtain the historical trajectory data under the set scene, find the historical trajectory data that is the same as the intelligent body's motion intention, and perform rasterization processing to construct the velocity field under each motion intention; for any motion intention, each grid stores the velocity set at the position under the motion intention.
3. The traffic simulation method based on motion intention velocity field according to claim 2 is characterized in that: When constructing each motion intention velocity field, this method also uses the velocity generated by the sketch to fill the motion intention velocity field. The process of sketching the velocity is obtained by using the path guidance method based on the influence field vector. The velocity of any point on the guide line is estimated by the relative position relationship with its neighboring points.
4. The traffic simulation method based on motion intention velocity field according to claim 3 is characterized in that: When estimating the speed of any point on the guide line using the relative position relationship with the neighboring points, a Gaussian radial basis function is used as a weight function to set weights for all neighboring points within the set neighboring point radius. The closer the neighboring point is to the calculated point, the greater the weight.
5. The traffic simulation method based on motion intention velocity field according to claim 1 is characterized in that: When the speed obtained in step 2) does not meet the set requirements, the method also performs trajectory prediction through a trajectory prediction model, supplements speed data based on the predicted trajectory, substitutes the supplemented speed data into the energy optimization function, and selects the speed that minimizes the energy optimization function.
6. The traffic simulation method based on motion intention velocity field according to claim 5 is characterized in that: The trajectory prediction model is implemented using a spatial graph convolutional network.
7. The traffic simulation method based on motion intention velocity field according to claim 6 is characterized in that: After performing trajectory prediction, the spatial graph convolutional network segments the predicted trajectory, calculates the angle of each trajectory segment, classifies the trajectory segments according to the angle, performs a comprehensive similarity score on the candidate trajectory segments that meet the behavior requirements of the intelligent agent and the angle changes, and selects the trajectory segments that meet the set requirements. The speed data corresponding to the trajectory segments that meet the set requirements are the speed data to be supplemented.
8. The traffic simulation method based on motion intention velocity field according to claim 7 is characterized in that: The comprehensive similarity score is obtained by calculating the similarity between each candidate trajectory segment and the target trajectory in terms of direction, length and curvature.
9. The traffic simulation method based on motion intention velocity field according to any one of claims 1 to 8, characterized in that: The energy optimization function is: E=ω v E v +oh g E g +oh c E c Where E is the energy optimization function, E v is the velocity energy function, E g is the direction-guided energy function, E c is the collision avoidance energy function with motion intention awareness, ω v ,ω g and ω c They are the weights of the speed energy function, the direction guidance energy function and the motion intention-aware collision avoidance energy function.
10. A traffic simulation system based on motion intention velocity field, comprising a processor, characterized in that: The processor is used to execute computer program instructions to implement the traffic simulation method based on motion intention velocity field as described in any one of claims 1-9.