Behavior cloning end-to-end automatic driving technical method embedded with attention mechanism

By incorporating an attention-based behavior cloning method, combined with multi-task supervision and Transformer encoding networks, the problems of behavioral controllability and computational overhead in end-to-end autonomous driving in complex environments are solved, achieving efficient autonomous driving policy generation and reduced hardware requirements.

CN121170731APending Publication Date: 2025-12-19YUNNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511194270.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing end-to-end autonomous driving methods exhibit poor behavioral controllability and high computational overhead when dealing with dynamic relationships and semantic differences in complex traffic environments, and are difficult to generalize in scenarios without maps or with weak maps.

Method used

A behavior cloning method with embedded attention mechanism is adopted to achieve direct mapping from perception to control by imitating expert driving behavior and combining multi-task supervision. A dual-branch architecture and Transformer encoding network are used to enhance perception capabilities, and training is carried out in combination with multi-supervised modules.

Benefits of technology

It improves the controllability and computational efficiency of autonomous driving systems in complex environments, reduces computational resource consumption, lowers hardware requirements, and enhances generalization capabilities in map-free scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121170731A_ABST
    Figure CN121170731A_ABST
Patent Text Reader

Abstract

The invention discloses a behavior cloning end-to-end automatic driving technical method embedded with an attention mechanism, and belongs to the technical field of automatic driving. According to the method, an environment image is collected through a monocular camera, vehicle state information is combined, local spatial features of the image are extracted through a convolutional neural network (CNN), modeling is carried out on the local spatial features and an attention mechanism of Transform, and efficient fusion of multi-modal features is achieved; the vehicle control parameters are dynamically and adaptively fused through the future waypoint trajectory to generate an optimal control instruction of the current driving scene; in the training stage, multi-task supervised learning is introduced, tasks such as road point prediction and control parameter generation are jointly optimized, and the generalization ability and robustness of the model are improved; the system overcomes the defects that a traditional modular automatic driving system accumulates errors and depends on a high-cost sensor, provides a light-weight and high-precision pure vision automatic driving solution, is suitable for complex traffic scenes, and can be applied to intelligent driving systems such as passenger vehicles and logistics vehicles.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of automatic driving, in particular to a behavior cloning end-to-end automatic driving technical method embedded with attention mechanism. BACKGROUND

[0002] End-to-end automatic driving is a kind of automatic driving strategy based on deep learning, which completes the whole driving task by a unified deep learning network model; its advantages lie in breaking through various shortcomings in traditional automatic driving systems, such as the traditional way usually including multiple independent modules such as perception, prediction, planning, etc., any error of any module will be transmitted to the final output, and the information transmission between modules depends on a specific format, which is difficult to adapt to diversified scenes and requirements, and has poor flexibility, etc. These shortcomings make the traditional automatic driving strategy have limited learning ability and is difficult to improve itself, which no longer meets the development requirements of current automatic driving technology; compared with the traditional method, end-to-end automatic driving reduces the coupling between modules through unified network optimization, reduces the development burden, improves the adaptability to dynamic environment, etc. This makes end-to-end automatic driving has become a new trend of current automatic driving technology; the basic principle of end-to-end automatic driving is to train a neural network through a large amount of driving data, so that it can directly predict the control instructions or future driving trajectory of the vehicle from the original sensor input (such as camera image, laser radar point cloud or multi-modal fusion data). Compared with the traditional method which relies on hand-designed features and rule-based procedural architecture, the end-to-end method learns the complex semantics and dynamic relationships hidden in the environment through data-driven way, so as to show stronger flexibility and generalization ability in decision-making process; the core advantage of end-to-end model lies in its simplification of system structure and reduction of error accumulation between modules; the network model can directly optimize the final behavior performance and improve the overall coordination of the system. In addition, deep neural network has strong expression ability and can automatically extract high-dimensional semantic information in input data such as lane structure, dynamic obstacle behavior and traffic rules, etc., and then make more reasonable decisions. It can be said that end-to-end automatic driving represents a data-driven and model-unified design concept, which not only improves the overall efficiency of the system, but also provides a technical foundation for future more intelligent and adaptive automatic driving systems.

[0003] While end-to-end autonomous driving methods have shown great potential in simplifying system architecture and improving decision-making efficiency, current mainstream methods still face a series of key challenges and shortcomings. These problems manifest differently in different models, but all limit the large-scale implementation and practical deployment of end-to-end methods. First, although early methods are simple in structure and easy to deploy, they rely too heavily on image input, have limited understanding of the spatial structure of the scene, and struggle to handle dynamic relationships and semantic differences in complex traffic environments. Simultaneously, these methods typically output low-level control commands, lacking trajectory-level planning capabilities, resulting in poor behavioral controllability and low interpretability. If the input image contains occlusions, blurring, or drastic changes, the system is prone to unpredictable control behaviors. While fusing multimodal inputs greatly enhances the model's perception capabilities in complex urban environments, this model structure introduces significant computational overhead, requiring not only high-quality training resources but also demanding higher hardware requirements for deployment. Furthermore, these methods still rely on high-quality semantic maps and path planning results as input, limiting their generalization ability in map-less or weakly mapped scenarios. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention proposes a behavior cloning end-to-end autonomous driving technology method that embeds an attention mechanism. Since the end-to-end autonomous driving method directly maps raw sensor data to planned trajectories or low-level control actions, it exhibits the advantage of simplicity and conceptually avoids the complex modular design and cascading errors of a large number of manual rules. Therefore, while retaining these advantages, this invention achieves a direct mapping from perception to control by imitating expert driving behavior and combining an attention mechanism with multi-task supervision; expert driving behavior is standard driving behavior.

[0005] To achieve the above technical solution, the specific steps are as follows: S1. Acquire input data: Acquire camera images through a monocular camera and vehicle status data through vehicle sensors to obtain camera images and vehicle status vectors; The sensor section of the model in this invention adopts a dual-branch architecture, divided into an RGB camera branch and a vehicle state branch. The RGB camera used in the model of this invention is a monocular camera, which has a wide field of view (FOV), enabling the system to operate at every time step. Capture corresponding camera images The image resolution is W=900, H=256, and FOV=100, where W is the width and H is the height. The camera image visual input provides rich environmental information for feature extraction. Simultaneously, during vehicle operation, vehicle sensors collect various important vehicle status information, including speed, steering angle, and positioning coordinates. At time steps... At that time, the vehicle status is represented as follows: and ,in ( The encoding records control information, including speed and steering angle; positioning coordinates. It provides advanced navigation commands; here, The degree represents the state vector; therefore, the complete input vehicle state vector of the system is represented as: .

[0006] S2. Image feature extraction and vehicle state feature extraction; The image feature extraction method is as follows: inputting a camera image, extracting features through a convolutional neural network ResNet34 to obtain classification features and spatial features; The method for extracting vehicle state features is as follows: input the vehicle state vector, and obtain the state features through the state feature network module; In image feature extraction, this invention employs a residual network to extract features from the input camera image. Visual features are extracted, and two distinct features are generated as classification features. (batch, 1000) and spatial features (batch, 512, 8, 29); Classification features It is the output of the 34th layer of the residual network, representing classification information; spatial features. This is the feature map output from layer 33, representing spatial information; in vehicle state feature extraction, the vehicle state... and The input is fed into the state feature network module to obtain state features. (batch, 128); The parameters of the state feature network module are {Linear(9, 128), ReLU(128), Linear(128, 128), ReLU(128)}.

[0007] S3. Input spatial features, which are then passed through the position encoding network module and the Transformer encoding network module in sequence to obtain encoded features; In this invention, a location encoding network module is introduced to provide spatial information, which is then input into a Transformer encoding network module; the spatial features are then encoded. First, the input is fed into the location encoding network module to add location information, and then fed into the Transformer encoding network module for attention modeling to obtain encoded features. (batch, 512, 8, 29); Encoded features are only applied to spatial features. This is because the encoded features represent spatial information; among them, the input feature dimension of the positional encoding network module is 512, and the sequence length is 232; the input feature dimension of the Transformer encoding network module is 512, the number of attention heads is 8, and the number of encoder layers is 4.

[0008] S4. Combined Feature Generation and Branch Feature Generation: The method for generating the combined features is as follows: inputting classification features and state features, concatenating them through dimensions, and inputting them into the trajectory feature network module to obtain the combined features; The branch feature is generated as follows: input state features, and then pass through the state attention weight network module and the branch feature network module in sequence to obtain branch features; The combined feature generation method in this invention is as follows: combining classification features With state characteristics After being concatenated along dimension 1, the combined features are input into the trajectory feature network module to obtain the combined features. (batch,256); The parameters of the trajectory feature network module are {Linear(1128,512), ReLU(512), Linear(512,512), ReLU(inplace), Linear(512,256), ReLU(256)}; The branch feature generation method in this invention is as follows: [The method involves] generating state features... The input is fed into the state attention weight network module to obtain the learned attention weight map; the parameters of the attention weight network module are {Linear(128,256), ReLU(256), Linear(256,232), Softmax(1)}; then the learned attention weight map is broadcast into the shape of encoded features, multiplied element by element, summed along the dimension (2,3), and then combined with the state features. Concatenate along dimension 1; finally, input the processed features into the branch feature network module to obtain the branch features. (batch,256); The parameters of the branch feature network module are {Linear(640,512), ReLU(512), Linear(512,512), ReLU(512), Linear(512,256), ReLU(256)}.

[0009] S5. Generation of waypoint features: Input combined features, target point features and output features from the previous time step are sequentially passed through the trajectory gated recurrent unit network module and the trajectory output network module to obtain waypoint features; The target point features are the target point features extracted from the vehicle state; The output feature of the previous time step is a zero tensor with the same shape as the initial time step; This invention uses combined features Waypoint generation is performed; firstly, target point features extracted from vehicle states are used. (batch,2) is concatenated along dimension 1 with the output features from the previous time step (which were all-zero tensors of the same shape at the initial time step), and then combined with the combined features. (Used only at the initial time step) These features are input together into the trajectory-gated recurrent unit network module; the parameters of the trajectory-gated recurrent unit network module are: input 4, hidden state 256; the features obtained after passing through the trajectory-gated recurrent unit network module have three uses: first, they are input into the subsequent trajectory output network module {Linear(256,2)}; second, they replace the previous combined features. Third, the outputs of the four time steps are stacked into a tensor intermediate layer feature. (batch, 4, 256); After being input into the trajectory output network module, the obtained features are added to the output of the previous time step (initially a zero tensor of the same shape) to represent the coordinates of the next target point. The outputs of the four time steps are stacked into tensor waypoint features. (batch, 4, 2), and finally the PID controller converts it into specific driving actions.

[0010] S6. Control Parameter Generation: Input branch features, extract network modules through strategies, and then generate parameters respectively. μ Extracting network modules and parameters σ Extract the network module to obtain the control parameters. μ Features and parameters σ feature; This invention generates waypoints while simultaneously identifying branch features. It is also used in branching tasks to branch features. The input is fed into the policy extraction network module to obtain features containing control parameter information; the parameters of the policy extraction network module are {Linear(256,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256)}; the features containing control parameter information are then input into the parameters respectively. μ Extracting network modules and parameters σ Extracting parameters from the network module μ feature (batch, 2) and parameters σ feature (batch,2) inputs these two parameter features into the driving action conversion; where, the parameter μThe parameters of the extracted network module are {Linear(256,2), Softplus}. σ The parameters of the extracted network module are {Linear(256,2), Softplus}.

[0011] S7. Construct a multi-supervised module; input branch features, pass through the branch value network module to obtain predicted branch values; input combined features, pass through the trajectory value network module to obtain predicted trajectory values; input classification features, pass through the velocity network module to obtain predicted velocity; input parameters μ Features, parameters σ Features and branch features are used to obtain predicted features and prediction parameters through four time steps. μ Features and prediction parameters σ feature; Classification features were obtained in the process prior to this invention. Combination features and branching features Based on these characteristics, a branch value network module, a trajectory value network module, and a velocity network module are designed respectively; branch characteristics The predicted branch value is obtained through the branch value network module. (batch, 1); Combined features The predicted trajectory value is obtained through the trajectory value network module. (batch, 1); Classification features The predicted speed is obtained through the speed network module. (batch,1); where the parameters of the branch value network module are {Linear(256,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256), Linear(256,1)}; the parameters of the trajectory value network module are {Linear(256,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256), Linear(256,1)}; and the parameters of the velocity network module are {Linear(1000,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256), Linear(256,1)}; This invention will use parameters μ feature ,parameter σ feature and branching features After concatenating along dimension 1 (replacing the three initial input features mentioned above after the initial time step), the output of the branch-gated recurrent unit network module from the previous time step (which was a zero tensor of the same shape at the initial time step) is input into the branch-gated recurrent unit network module. The resulting output is then combined with the features from the corresponding time step (from the intermediate layer features). Extracting the values ​​from the image and concatenating them along dimension 1, then inputting them into the intermediate attention weight network module, and finally broadcasting the learned attention weight map into encoded features. After shaping, element-wise multiplication is performed, followed by summation along dimension (2,3). Finally, this summation is concatenated with the features output from the branch-gated recurrent unit network module along dimension 1. These concatenated features are then fed into the control feature network module and the control output network module. The resulting features are then compared with the output from the previous time step (which was the branch feature at the initial time step). And the branch features of the initial input in this process (Also replaced by this part of the output) are added together; the resulting features have two uses: one is to stack the outputs of the four time steps into tensor prediction features. (batch, 4, 256) Secondly, it is passed to the policy extraction network module to obtain features containing control parameter information, and then the features containing control parameter information are input into the parameters respectively. μ Extracting network modules and parameters σ Extracting new outputs from the network module (after the initial time step, the parameters initially input during this process) yields new outputs. μ feature and parameters σ feature The prediction parameters can be obtained by replacing the outputs of these two parts with the outputs of the four time steps, and then stacking the outputs of the four time steps into a tensor. μ feature (batch, 4, 2) and prediction parameters σ feature (batch,4,2).

[0012] S8. Model Training: Based on the multi-supervision module, the total loss value is obtained through loss calculation, and the total loss value is minimized to obtain the trained end-to-end autonomous driving model. The construction of the loss function specifically includes the following steps: S8.1 Input waypoint features and calculate the waypoint loss value using the waypoint loss function; The waypoint loss function in this invention The calculation formula is as follows: in, The weights representing waypoint losses, Indicates the model at time step The predicted waypoints are based on waypoint features. supply, t It is a time step. K It is the total number of time steps. Indicates the generated waypoints; Indicates the predicted waypoints with generated waypoints Sum of absolute errors; S8.2 Input control parameters and calculate the steering control loss value using the steering control loss function; Steering control loss function The optimized control actions are calculated using the following formula: in, It is the weight of the steering control loss. Representing the Beta distribution, parameterized by the predicted control distribution. Indicates the Kullback-Leibler divergence; in, and Indicates the predicted value. and These are the first and second true values, the true values ​​provided by experts; it is important to note that all future time steps... The loss will first be averaged out, and then added to the current time step. Regarding losses, optimizing the currently executed actions is the priority; S8.3 Input the predicted velocity, and calculate the velocity loss value using the velocity loss function; Velocity loss function in this invention The calculation formula is as follows: in, It is the weight of the speed loss. It is the actual speed value, and It is the speed of model prediction. Based on predicted speed supply; S8.4 Input the predicted trajectory value and the predicted branch value, and calculate the value loss value through the value loss function; Value loss function in this invention The calculation formula is as follows: in, It is the weight of value loss. It is the actual value. It is the value predicted by the model. It is the actual value of the trajectory. It is the actual value of the branch. and Data from experts; and From the predicted trajectory values ​​respectively and predicted branch value supply; S8.5 Input the combined features, branch features, and predicted features, and calculate the feature loss value using the feature loss function; Feature loss function in this invention The calculation formula is as follows: in, It is a combination loss function. It is the branch loss function. It is the loss function for predicting features. These are the weights of the feature loss. It is the sum of absolute errors. t It is a time step. K This is the total number of time steps (total is 4); , and These represent the combined true value, the encoded true value, and the feature true value, respectively. , and Each is composed of combined features Branching characteristics and predictive features supply; S8.6 Input waypoint loss value, steering control loss value, speed loss value, and prediction features, and calculate the total loss value through a weighted loss function; The weighted loss function in this invention The calculation formula is as follows: ; By summing the above losses in a weighted manner, the total loss is obtained, and the total loss value is minimized. The training process of this invention is based on behavioral cloning learning, using expert driving data (including images, states, control parameters, and trajectories) for supervised learning. Expert driving data is the same as standard driving data. By minimizing the loss function between the model output and the expert behavior, the model learns to imitate the expert's driving strategy.

[0013] S9. Deployment and operation based on end-to-end autonomous driving model: Input real-time camera images and vehicle status data, and output driving control commands through end-to-end autonomous driving model and according to trajectory scheme and fusion scheme; The trajectory scheme is as follows: input control parameters, and output steering, throttle and brake control signals through driving action conversion algorithm; The fusion scheme is as follows: input control signals and waypoint sequences, and output fused control signals through a scenario-fusion-based driving algorithm; In this invention, driving action conversion is based on Algorithm 1 and then Algorithm 2; the two driving methods are fused based on the scenario to obtain the final driving strategy; for the judgment of whether to go straight, this embodiment calculates the absolute value of all turning actions in the past second. If half of them are greater than 0.1, then the vehicle is assumed to be turning, and the fusion scheme is used in this scenario; otherwise, only the trajectory scheme is used. The beneficial effects of this invention are: This invention proposes an end-to-end autonomous driving technology method that embeds an attention mechanism and uses behavioral cloning for training. This method skips the deployment of a large number of diverse sensors and the use of expensive manually labeled data, which reduces the consumption of system computing resources while maintaining high-performance driving capabilities. Since end-to-end autonomous driving directly maps raw sensor data to planned trajectories or low-level control actions, it offers a very important advantage: conceptually avoiding complex modular design and cascading errors caused by manual rules. At the same time, by designing multiple supervision modules to guide the generation of driving strategies, a simple yet robust end-to-end autonomous driving benchmark model is created. Attached Figure Description

[0014] Figure 1 This is a diagram of the BeCAM-AD architecture of the present invention, wherein part (a) is the sensing part and part (b) is the planning part.

[0015] Figure 2 This is a diagram of the multi-supervision module of the present invention.

[0016] Figure 3 The following are evaluation results using different ResNet networks in this invention. Figure (a) shows the driving score for different ResNet networks, Figure (b) shows the route completion rate for different ResNet networks, and Figure (c) shows the violation score for different ResNet networks.

[0017] Figure 4Figure 1 shows a bird's-eye view and a front view of the vehicle during its journey with the vehicle in front, under the multi-supervision module (without attention) in this invention. Figure 2 shows a bird's-eye view of the vehicle during its journey with the vehicle in front, and Figure 3 shows a front view of the vehicle during its journey with the vehicle in front.

[0018] Figure 5 Figure (a) shows the bird's-eye view and the front view of the vehicle during its journey with the attention module added in this invention. Figure (b) shows the front view of the vehicle during its journey with the attention module added.

[0019] Figure 6 Figure (a) shows a bird's-eye view and a front view of a vehicle during a turn using the attention module (without a multi-supervision module) of the present invention. Figure (b) shows a bird's-eye view of the vehicle during a turn using the attention module (without a multi-supervision module), and Figure (b) shows a front view of the vehicle during a turn using the attention module (without a multi-supervision module).

[0020] Figure 7 The present invention includes a bird's-eye view and a front view of the vehicle during the turning process under the addition of a multi-supervision module. Figure (a) is a bird's-eye view of the vehicle during the turning process under the addition of the multi-supervision module, and Figure (b) is a front view of the vehicle during the turning process under the addition of the multi-supervision module.

[0021] Figure 8 shows the specific performance of the model of the present invention in the lane change scenario during testing. In Figure (a), the first frame of the lane change scenario is shown; in Figure (b), the second frame of the lane change scenario is shown; in Figure (c), the third frame of the lane change scenario is shown; and in Figure (d), the fourth frame of the lane change scenario is shown.

[0022] Figure 9 The figures shown are the specific performance of the model of the present invention in the scenario of passing through an intersection. Figure (a) is the first frame of the scenario of passing through an intersection, Figure (b) is the second frame of the scenario of passing through an intersection, Figure (c) is the third frame of the scenario of passing through an intersection, and Figure (d) is the fourth frame of the scenario of passing through an intersection.

[0023] Figure 10 The figures shown are the specific performance of the model of the present invention in a turning scene during testing. Figure (a) is the first frame of the turning scene, Figure (b) is the second frame of the turning scene, Figure (c) is the third frame of the turning scene, and Figure (d) is the fourth frame of the turning scene. Detailed Implementation

[0024] The present invention will be further described in detail below with reference to specific embodiments.

[0025] Although this embodiment improves perception capabilities by introducing the attention mechanism of Transformer, Transformer-based models lack the inductive biases present in convolutional networks, such as translation equivariance and local feature extraction. This makes them dependent on larger datasets for good performance. To address this issue, this invention proposes a hybrid model architecture that combines the structural advantages of ResNet34 in CNN networks with the attention mechanism of Transformer to enhance the system's ability to comprehensively perceive surrounding objects. like Figure 1 As shown, an end-to-end autonomous driving technology method with embedded attention mechanism behavior cloning includes the following steps: S1. Acquire input data: Acquire camera images through a monocular camera and vehicle status data through vehicle sensors to obtain camera images and vehicle status vectors; The sensor section of the model in this invention adopts a dual-branch architecture, divided into an RGB camera branch and a vehicle state branch. The RGB camera used in the model of this invention is a monocular camera, which has a wide field of view (FOV), enabling the system to operate at every time step. Capture corresponding camera images The image resolution is W=900, H=256, and FOV=100, where W is the width and H is the height. The camera image visual input provides rich environmental information for feature extraction. Simultaneously, during vehicle operation, vehicle sensors collect various important vehicle status information, including speed, steering angle, and positioning coordinates. At time steps... At that time, the vehicle status is represented as follows: and ,in ( The encoding records control information, including speed and steering angle; positioning coordinates. It provides advanced navigation commands; here, The degree represents the state vector; therefore, the complete input vehicle state vector of the system is represented as: ;like Figure 1 As shown, the camera images and vehicle state vectors of the perception part are obtained.

[0026] S2. Image feature extraction and vehicle state feature extraction: Input camera image, extract features through ResNet to obtain classification features and spatial features; Input vehicle state vector, obtain state features through state feature network module; In image feature extraction, this invention employs a residual network to extract features from the input camera image. Visual features are extracted, and two distinct features are generated as classification features. (batch, 1000) and spatial features (batch, 512, 8, 29); Classification features It is the output of the 34th layer of the residual network, representing classification information; spatial features. This is the feature map output from layer 33, representing spatial information; in vehicle state feature extraction, the vehicle state... and The input is fed into the state feature network module to obtain state features. (batch, 128); The parameters of the state feature network module are {Linear(9, 128), ReLU(128), Linear(128, 128), ReLU(128)}; In this embodiment, the classification features and spatial features are used for different downstream tasks; specifically, the classification features... Used for generating driving waypoints for the main task, while spatial features Both are used to assist in task steering control, and they also play an important role in multi-supervision systems.

[0027] S3. Input spatial features, which are then passed through the position encoding network module and the Transformer encoding network module in sequence to obtain encoded features; In this invention, a location encoding network module is introduced to provide spatial information, which is then input into a Transformer encoding network module; the spatial features are then encoded. First, the input is fed into the location encoding network module to add location information, and then fed into the Transformer encoding network module for attention modeling to obtain the encoding characteristics. (batch, 512, 8, 29); Encoded features are only applied to spatial features. This is because the encoded features represent spatial information; among them, the input feature dimension of the positional encoding network module is 512, and the sequence length is 232; the input feature dimension of the Transformer encoding network module is 512, the number of attention heads is 8, and the number of encoder layers is 4.

[0028] S4. Combined Feature Generation and Branch Feature Generation: Input classification features and state features, and input them into the trajectory feature network module through dimensional concatenation to obtain combined features; input state features, and input them into the state attention weight network module and the branch feature network module to obtain branch features. The combined feature generation method in this invention is as follows: combining classification features With state characteristics After being concatenated along dimension 1, the combined features are input into the trajectory feature network module to obtain the combined features. (batch,256); The parameters of the trajectory feature network module are {Linear(1128,512), ReLU(512), Linear(512,512), ReLU(inplace), Linear(512,256), ReLU(256)}; The branch feature generation method in this invention is as follows: [The method involves] generating state features... The input is fed into the state attention weight network module to obtain the learned attention weight map; the parameters of the attention weight network module are {Linear(128,256), ReLU(256), Linear(256,232), Softmax(1)}; then the learned attention weight map is broadcast into the shape of encoded features, multiplied element by element, summed along the dimension (2,3), and then combined with the state features. These operations, which involve concatenating along dimension 1, help the model select regions to focus on in subsequent tasks. Finally, the processed features are input into the branch feature network module to obtain the branch features. (batch,256); The parameters of the branch feature network module are {Linear(640,512), ReLU(512), Linear(512,512), ReLU(512), Linear(512,256), ReLU(256)}.

[0029] S5. Generation of waypoint features: Input combined features, target point features and output features from the previous time step are sequentially passed through the trajectory gated recurrent unit network module and the trajectory output network module to obtain waypoint features; The target point features are the target point features extracted from the vehicle state; The output feature of the previous time step is a zero tensor with the same shape as the initial time step; This invention uses combined features Waypoint generation is performed; firstly, target point features extracted from vehicle states are used. (batch,2) is concatenated along dimension 1 with the output features from the previous time step (which were all-zero tensors of the same shape at the initial time step), and then combined with the combined features. (Used only at the initial time step) These features are input together into the trajectory-gated recurrent unit network module; the parameters of the trajectory-gated recurrent unit network module are: input 4, hidden state 256; the features obtained after passing through the trajectory-gated recurrent unit network module have three uses: first, they are input into the subsequent trajectory output network module {Linear(256,2)}; second, they replace the previous combined features. Third, the outputs of the four time steps are stacked into a tensor intermediate layer feature. (batch, 4, 256); After being input into the trajectory output network module, the obtained features are added to the output of the previous time step (initially a zero tensor of the same shape) to represent the coordinates of the next target point. The outputs of the four time steps are stacked into tensor waypoint features. (batch,4,2), and finally the PID controller converts it into specific driving actions; S6. Steering control parameter generation: Input branch features, extract network modules through strategies, and then generate parameters respectively. μ Extracting network modules and parameters σ Extract the network module to obtain the control parameters. μ Features and parameters σ feature; This invention generates waypoints while simultaneously identifying branch features. It is also used in branching tasks to branch features. The input is fed into the policy extraction network module to obtain features containing control parameter information; the parameters of the policy extraction network module are {Linear(256,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256)}; the features containing control parameter information are then input into the parameters respectively. μ Extracting network modules and parameters σ Extracting parameters from the network module μ feature (batch, 2) and parameters σ feature (batch,2) inputs these two parameter features into the driving action conversion; where, the parameter μ The parameters of the extracted network module are {Linear(256,2), Softplus}. σ The parameters of the extracted network module are {Linear(256,2), Softplus}; S7. Construct a multi-supervised module; input branch features, pass through the branch value network module to obtain predicted branch values; input combined features, pass through the trajectory value network module to obtain predicted trajectory values; input classification features, pass through the velocity network module to obtain predicted velocity; input parameters μ Features, parameters σ Features and branch features are used to obtain predicted features and prediction parameters through four time steps. μ Features and prediction parameters σ feature; Classification features were obtained in the process prior to this invention. Combination features and branching features Based on these characteristics, branch value network modules, trajectory value network modules, and velocity network modules are designed respectively; these modules acquire important feature information that can supervise autonomous driving tasks and play a key role in training using imitation learning; for example... Figure 2 As shown, a multi-supervised partial graph; branch features. The predicted branch value is obtained through the branch value network module. (batch, 1); Combined features The predicted trajectory value is obtained through the trajectory value network module. (batch, 1); Classification features The predicted speed is obtained through the speed network module. (batch,1); where the parameters of the branch value network module are {Linear(256,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256), Linear(256,1)}; the parameters of the trajectory value network module are {Linear(256,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256), Linear(256,1)}; and the parameters of the velocity network module are {Linear(1000,256), ReLU(256), Linear(256,256), Dropout2d(p=0.5), ReLU(256), Linear(256,1)}; Although waypoint-based and control-based commands differ methodologically, their common goal is to achieve stable and precise driving actions. Therefore, this invention introduces a joint feature supervision mechanism, which utilizes intermediate layer features obtained during waypoint generation. This is used to guide the extraction of some supervised features; finally, three features for supervision are obtained: predictive features. (batch, 4, 256), prediction parameters σ feature (batch, 4, 2) and prediction parameters μ feature (batch, 4, 2); This design ensures information sharing and collaborative optimization between the two branches. The specific process is as follows: parameters μ feature ,parameter σ feature and branching features The features are concatenated along dimension 1 (after the initial time step, the three initial input features mentioned above are replaced), and then input together with the output of the branch-gated recurrent unit network module of the previous time step (which is a zero tensor of the same shape at the initial time step) into the branch-gated recurrent unit network module. The resulting output is then combined with the features of the corresponding time step (from the intermediate layer features). Extracting the values ​​from the image and concatenating them along dimension 1, then inputting them into the intermediate attention weight network module, and finally broadcasting the learned attention weight map into encoded features. After shaping, element-wise multiplication is performed, followed by summation along dimension (2,3). Finally, this summation is concatenated with the features output from the branch-gated recurrent unit network module along dimension 1. These concatenated features are then fed into the control feature network module and the control output network module. The resulting features are then compared with the output from the previous time step (which was the branch feature at the initial time step). And the branch features of the initial input in this process (Also replaced by this part of the output) are added together; the resulting features have two uses: one is to stack the outputs of the four time steps into tensor prediction features. (batch, 4, 256) Secondly, it is passed to the policy extraction network module to obtain features containing control parameter information, and then the features containing control parameter information are input into the parameters respectively. μ Extracting network modules and parameters σ Extracting new outputs from the network module (after the initial time step, the parameters initially input during this process) yields new outputs. μ feature and parameters σ feature The prediction parameters can be obtained by replacing the outputs of these two parts with the outputs of the four time steps, and then stacking the outputs of the four time steps into a tensor. μ feature (batch, 4, 2) and prediction parameters σ feature (batch,4,2).

[0030] S8. Model Training: Based on the multi-supervision module, the total loss value is obtained through loss calculation, and the total loss value is minimized to obtain the trained cloned end-to-end autonomous driving model. The construction of the loss function specifically includes the following steps: S8.1 Input waypoint features and calculate the waypoint loss value using the waypoint loss function; The waypoint loss function in this invention The calculation formula is as follows: in, The weights representing waypoint losses, Indicates the model at time step The predicted waypoints are based on waypoint features. supply, t It is a time step. K It is the total number of time steps. Indicates the generated waypoints; Indicates the predicted waypoints with generated waypoints Sum of absolute errors; S8.2 Input control parameters and calculate the steering control loss value using the steering control loss function; Steering control loss function The optimized control actions are calculated using the following formula: in, It is the weight of the steering control loss. Representing the Beta distribution, parameterized by the predicted control distribution. and This represents the steering control loss function at the current time step. and Represents the steering control loss function for future time steps; in, and Indicates the predicted value. and It is the first true value and the second true value. and The true value provided by experts This represents the Kullback-Leibler divergence, used to measure the similarity between the predicted control distribution and the expert control distribution; it is important to note that all future time steps... The loss will first be averaged out, and then added to the current time step. Regarding losses, optimizing the currently executed actions is the priority; S8.3 Input the predicted velocity, and calculate the velocity loss value using the velocity loss function; Velocity loss function in this invention The calculation formula is as follows: in, It is the weight of the speed loss. It is the actual speed value, and It is the speed of model prediction. Based on predicted speed supply, Data derived from experts; S8.4 Input the predicted trajectory value and the predicted branch value, and calculate the value loss value through the value loss function; Value loss function in this invention The calculation formula is as follows: in, It is the weight of value loss. It is the actual value. It is the value predicted by the model. It is the actual value of the trajectory. It is the actual value of the branch. and Data from experts; and From the predicted trajectory values ​​respectively and predicted branch value supply; S8.5 Input the combined features, branch features, and predicted features, and calculate the feature loss value using the feature loss function; Feature loss function in this invention The calculation formula is as follows: in, It is a combination loss function. It is the branch loss function. It is the loss function for predicting features. These are the weights of the feature loss. It is the sum of absolute errors. t It is a time step. K This is the total number of time steps (total is 4); , and These represent the combined true value, the encoded true value, and the feature true value, respectively. , and Each is composed of combined features Branching characteristics and predictive features supply; It is important to note that since the end-to-end autonomous driving model design in this invention incorporates two different driving strategies, both waypoint-based and control-based scenarios must be considered when constructing the loss function. The difference between these two lies in the different intermediate features used and the input combined features. The loss is used to calculate waypoint features, while the input branch features are... Used to calculate the loss of the control features; S8.6 Input waypoint loss value, steering control loss value, speed loss value, and prediction features, and calculate the total loss value through a weighted loss function; The weighted loss function in this invention The calculation formula is as follows: ; By summing the above losses in a weighted manner, the total loss is obtained, and the total loss value is minimized. The training process of this invention is based on behavioral cloning learning, using expert data (including images, states, control parameters, and trajectories) for supervised learning; by minimizing the loss function between the model output and the expert behavior, the model learns to imitate the expert's driving strategy.

[0031] S9. Deployment and operation based on end-to-end autonomous driving model: Input real-time camera images and vehicle status data, and output driving control commands through end-to-end autonomous driving model and according to trajectory scheme and fusion scheme; The trajectory scheme is as follows: input control parameters, and output steering, throttle and brake control signals through driving action conversion algorithm; The fusion scheme is as follows: input control signals and waypoint sequences, and output fused control signals through a scenario-based driving algorithm; the waypoint sequence is the actual value of the generated waypoints.

[0032] In this invention, driving action conversion is based on Algorithm 1 and then Algorithm 2; the two driving methods are fused based on the scenario to obtain the final driving strategy; for the judgment of whether to go straight, this embodiment calculates the absolute value of all turning actions in the past second. If half of them are greater than 0.1, then the vehicle is assumed to be turning, and the fusion scheme is used in this scenario; otherwise, only the trajectory scheme is used. The method of this invention was verified and tested in the CARLA driving simulator. The training data used in this embodiment comes from expert driving records in the CARLA simulator, including images, vehicle status, control commands, and trajectory information. This data is used to train an end-to-end model through behavior cloning to ensure that the model can learn safe and efficient driving strategies. Expert driving records are standard driving behaviors. The experimental task requires the autonomous driving agent to complete a closed-loop driving task, driving within a predetermined route. This route consists of a series of sparse navigation points, supplemented by high-level commands such as going straight, turning left, turning right, changing lanes, and keeping lanes. The autonomous driving agent must continuously adjust its driving strategy based on these navigation inputs in order to safely drive from the starting point to the destination and handle various disturbances in the simulated environment. To simulate real-world scenarios, this embodiment designs challenging scenarios in the simulator, including obstacle avoidance, navigation at unsignalized intersections, and sudden control failures. These scenarios place higher demands on real-time decision-making, path planning, and emergency response capabilities. To comprehensively evaluate the performance of the autonomous driving system, this embodiment uses multiple evaluation metrics: driving score, route completion rate, violation score, pedestrian collision, vehicle collision, road facility collision, running a red light, running a stop sign, leaving the road, route deviation, route timeout, and vehicle congestion. Route completion rate measures the percentage of times the autonomous driving agent successfully traverses the predetermined route, directly reflecting the vehicle's ability to drive stably under complex road conditions. Violation score assesses the number and severity of violations during driving, covering various violations, including pedestrian collision, vehicle collision, road facility collision, running a red light, running a stop sign, leaving the road, route deviation, route timeout, and vehicle congestion, reflecting the system's safety performance. The driving score, as the primary evaluation metric, balances driving efficiency and safety, while providing a quantitative measure of the system's overall driving capability. To verify the effectiveness of this invention, the model was compared with classic models on the CARLA leaderboard, demonstrating the superior results achieved by the method of this invention; as shown in Table 1: Table 1: Comparison results of the model of this invention with models on the CARLA leaderboard. Table 1 shows the comparison results between the model of this invention and models on the CARLA leaderboard, using three key metrics: driving score, route completion, and violation score. The end-to-end autonomous driving control model based on the CNN-Transformer hybrid architecture of this invention performs excellently in all three key metrics: driving score, route completion, and violation score. Specifically, the driving score of this invention's model is 52.16, and the route completion score is 87.15, both significantly exceeding the results of other models. It is worth noting that this invention uses only a single camera, while most other models use multiple cameras, and some even combine LiDAR. Although the violation score is not the best overall, the gap between this invention's model and the best-performing model is very small. Considering that the best model uses multiple cameras and LiDAR simultaneously, this invention achieves similar performance with only a single camera configuration, highlighting the advantages of the algorithm. In terms of route completion, the method of this invention is slightly inferior to models using LiDAR; one possible reason is that LiDAR-based methods offer better object detection capabilities. Based on their detection results, these models typically employ a slow-moving strategy, meaning the vehicle moves slowly when it remains stationary for an extended period and no obstacles are detected ahead. This strategy allows for more detailed analysis of the driving environment, contributing to improved violation scores. After evaluating the scheme of this invention on the CARLA simulator, the vehicle of this invention performed well in obstacle avoidance, lane keeping, and lane changing; these results are consistent with the theoretical expectations of this invention, further validating the effectiveness of the method.

[0033] To verify the generalization ability of the model of this invention, additional evaluations were conducted on multiple routes in Town02. Compared with Town05, Town02 is a more congested urban environment characterized by narrower lanes and denser traffic, presenting completely different driving conditions. The analysis shows that even in these challenging scenarios, the model of this invention maintains strong performance, as shown in Table 2. Table 2: Average results after multiple verifications on seven routes in each of the two towns. Table 2 shows the results, which are the average values ​​after multiple validations on seven routes in each of the two towns. Seven completely different long routes were set up in each town and validated multiple times. Simultaneously, this invention also validated the RGB image feature extraction network for the perception part. This invention verified the generalization ability of its model under different perception networks by replacing the mainstream ResNet network. This embodiment selected four lightweight networks for validation to avoid significantly consuming computational resources during feature extraction. The results are as follows... Figure 3 As shown in Table 3: Table 3: Scores of the four ResNet networks in three key metrics This embodiment conducts quantitative experiments to compare the attention module and the multi-supervised module models to analyze their advantages and disadvantages. As shown in Table 4, although the multi-supervised module achieves better scores in violation points compared to the attention module, specifically in red light running, driving in front of stop signs, boundary crossings, route deviations, and agent blocking, indicating that the vehicle is closer to an expert in obeying traffic rules, the multi-supervised module performs poorly in collision detection, exhibiting multiple collision behaviors. Figure 5 As shown, this demonstrates that the attention module is effective in tasks involving perceiving surrounding objects and reducing collisions; Figure 4Figure 1 shows a bird's-eye view and a front view of the vehicle during its journey with the vehicle in front, under the multi-supervision module (without attention). Figure 2 shows a bird's-eye view of the vehicle during its journey with the vehicle in front, and Figure 3 shows a front view of the vehicle during its journey with the vehicle in front. Figure 5 The images shown are bird's-eye view and front view of the vehicle during its collision with the preceding vehicle, both with the attention module added. Figure (a) shows the bird's-eye view of the vehicle with the attention module and the preceding vehicle, and Figure (b) shows the front view of the vehicle with the attention module and the preceding vehicle. The attention module achieves better collision performance than the multi-supervision module, as shown in Table 4. Table 4: Comparison of Attention Module and Multi-Supervised Module Models like Figure 6 and Figure 7 As shown; Figure 6 Figure 1 shows a bird's-eye view and a front view of a vehicle during a turn using the attention module (without a multi-supervision module) of the present invention. Figure 2 shows a bird's-eye view of the vehicle during a turn using the attention module (without a multi-supervision module), and Figure 3 shows a front view of the vehicle during a turn using the attention module (without a multi-supervision module). Figure 7 The present invention incorporates a bird's-eye view and a front view of the vehicle during the turning process under the multi-supervision module. Figure (a) shows the bird's-eye view of the vehicle during the turning process under the multi-supervision module, and Figure (b) shows the front view of the vehicle during the turning process under the multi-supervision module. Figure 6 The vehicle, under the attention module (without multi-supervision), deviated from its original lane during driving. This is not a good driving method and contradicts the expert's driving plan. Figure 7 The vehicle driving process with the addition of a multi-monitoring module can be driven well according to the expert's driving strategy.

[0034] As shown in Figure 8, Figure 9 , Figure 10 Figure 8 shows the demonstration effect of lane changing scenarios in the CARLA simulator of the present invention, including intersection scenarios and turning scenarios; Figure 8 shows the specific performance of the model of the present invention in lane changing scenarios during testing, wherein Figure (a) represents the first frame of the lane changing scenario, Figure (b) represents the second frame of the lane changing scenario, Figure (c) represents the third frame of the lane changing scenario, and Figure (d) represents the fourth frame of the lane changing scenario. Figure 9The figures in the middle are specific performance diagrams of the model of the present invention in the scenario of passing through an intersection during testing. In the figure, part (a) shows the first frame of the scenario of passing through an intersection, part (b) shows the second frame of the scenario of passing through an intersection, part (c) shows the third frame of the scenario of passing through an intersection, and part (d) shows the fourth frame of the scenario of passing through an intersection. Figure 10 The figures show the performance of the model of this invention in a turning scenario during testing. Figure (a) represents the first frame of the turning scenario, Figure (b) represents the second frame, Figure (c) represents the third frame, and Figure (d) represents the fourth frame. Evaluation of the model in the CARLA simulator shows that the vehicle performs well in lane-changing, intersection-crossing, and turning scenarios, which is consistent with the theory of this invention.

[0035] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A behavior cloning end-to-end autonomous driving technology method embedding an attention mechanism, characterized in that, Includes the following steps: S1. Acquire camera images through a monocular camera and vehicle status data through vehicle sensors to obtain camera images and vehicle status vectors; S2. Image feature extraction and vehicle state feature extraction; The image feature extraction method is as follows: input a camera image, extract features through a residual network to obtain classification features and spatial features; The method for extracting vehicle state features is as follows: input the vehicle state vector, and obtain the state features through the state feature network module; S3. The spatial features extracted from the input image are sequentially passed through the location coding network module and the Transformer coding network module to obtain the coded features; S4. Generate combined features from the classification features extracted from image features and the state features extracted from vehicle state features; generate branch features from the state features extracted from vehicle state features. S5. Input combined features, target point features, and target point features output features at the previous time step are sequentially passed through the trajectory gated cyclic unit network module and the trajectory output network module to obtain waypoint features; The target point features are the target point features extracted from the vehicle state; The output feature of the previous time step is a zero tensor with the same shape as the initial time step; S6. Steering control parameter generation; input branch features, extract network modules through strategy, and then use the first parameter. μ Extracting network modules and second parameters σ Extract the network module to obtain the first parameter of the control parameters. μ Features and second parameters σ feature; S7. Construct a multi-supervision module; Input Branch features are processed through a branch value network module to obtain predicted branch values; combined input features are processed through a trajectory value network module to obtain predicted trajectory values; classification features are processed through a velocity network module to obtain predicted velocities; and the first parameter is input. μ Features, second parameter σ Features and branch features are used to obtain predicted features through four time steps, and the first parameter is predicted. μ Features and prediction second parameter σ feature; S8. Model Training: Based on the multi-supervision module, the total loss value is obtained through loss calculation, and the total loss value is minimized to obtain the trained end-to-end autonomous driving model. S9. Deployment and operation based on end-to-end autonomous driving model; input real-time camera images and vehicle status data, and output driving control commands through end-to-end autonomous driving model and according to trajectory scheme and fusion scheme.

2. The end-to-end autonomous driving technology method with embedded attention mechanism as described in claim 1, characterized in that, The process involves acquiring camera images using a monocular camera and acquiring vehicle status data using vehicle sensors to obtain camera images and vehicle status vectors. The resolution of the camera image is W=900, H=256, and FOV=100, where W is the width, H is the height, and FOV is the field of view. The vehicle status data includes speed, steering angle, and positioning coordinates.

3. The end-to-end autonomous driving technology method with embedded attention mechanism as described in claim 1, characterized in that, In the image feature extraction and vehicle state feature extraction, the image feature extraction method is as follows: inputting the camera image into ResNet34 to extract classification features and spatial features; the classification features are the output of the 34th layer of the residual network; the spatial features are the output of the 33rd layer.

4. The end-to-end autonomous driving technology method with embedded attention mechanism as described in claim 1, characterized in that, The spatial features extracted from the input image are sequentially passed through a location encoding network module and a Transformer encoding network module to obtain encoded features. The input feature dimension of the location encoding network module is 512, and the sequence length is 232. The input feature dimension of the Transformer encoding network module is 512, the number of attention heads is 8, and the number of encoder layers is 4. The method of obtaining encoded features is as follows: the spatial features are first input into the location encoding network module to add location information, and then input into the Transformer encoding network module for attention modeling to obtain encoded features.

5. The end-to-end autonomous driving technology method with embedded attention mechanism as described in claim 1, characterized in that, The process involves generating combined features from the classification features extracted from image features and the state features extracted from vehicle state features; and generating branch features from the state features extracted from vehicle state features. The combined features are generated by inputting classification features and state features, concatenating them through dimension 1, and inputting them into the trajectory feature network module to obtain combined features. The branch features are generated by inputting state features, sequentially passing them through the state attention weight network module and the branch feature network module to obtain branch features.

6. The end-to-end autonomous driving technology method with embedded attention mechanism as described in claim 1, characterized in that, The method based on a multi-supervision module, which calculates the total loss value and minimizes it to obtain the trained end-to-end autonomous driving model, involves the following steps: S8.1 Input waypoint features and calculate the waypoint loss value using the waypoint loss function; S8.2 Input control parameters and calculate the steering control loss value using the steering control loss function; S8.3 Input the predicted velocity, and calculate the velocity loss value using the velocity loss function; S8.4 Input the predicted trajectory value and the predicted branch value, and calculate the value loss value through the value loss function; S8.5 Input the combined features, branch features, and predicted features, and calculate the feature loss value using the feature loss function; S8.6 Input waypoint loss value, steering control loss value, speed loss value, and prediction features. Calculate the total loss value using a weighted loss function. The expression for the weighted loss function is as follows: ; in, Let be the waypoint loss function. For steering control loss function, Let the velocity loss function be... For the value loss function, This is the feature loss function.

7. The end-to-end autonomous driving technology method with embedded attention mechanism as described in claim 1, characterized in that, The input real-time camera images and vehicle status data are processed by an end-to-end autonomous driving model, and driving control commands are output based on a trajectory scheme and a fusion scheme. The trajectory scheme is as follows: input control parameters, and output steering, throttle, and brake control signals through a driving action conversion algorithm. The fusion scheme is as follows: input control signals and waypoint sequences, and output fused control signals through a scenario-based driving algorithm. The waypoint sequence is the actual value of the generated waypoints.