Automatic driving lane line detection method fusing multi-scale features and self-attention

By integrating a multi-scale convolutional autoencoder network with a multi-head self-attention mechanism, and dynamically adjusting the viewpoint feature weights, the problem of insufficient accuracy in traditional lane detection in complex scenarios is solved, achieving highly robust and accurate lane detection and control.

CN122493422APending Publication Date: 2026-07-31CATARC TIANJIN AUTOMOTIVE ENG RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CATARC TIANJIN AUTOMOTIVE ENG RES INST CO LTD
Filing Date
2026-04-15
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Traditional lane detection methods lack accuracy in complex scenarios, struggle to balance multi-scale features and environmental robustness, suffer from insufficient perspective distortion adaptability due to single-view image input, and are difficult for single-scale networks to capture fine-grained details and global structure.

Method used

By integrating a multi-scale convolutional autoencoder network with a multi-head self-attention mechanism, images are acquired through wide and narrow field-of-view cameras, and features are dynamically weighted and fused to achieve multi-scale feature extraction and enhancement. The weights are adjusted in conjunction with vehicle status to perform end-to-end steering wheel angle prediction.

Benefits of technology

It significantly improves the robustness and accuracy of lane detection, reduces the rate of missed and false detections in complex scenarios, and enhances the lane positioning accuracy and control stability of vehicles at different speeds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122493422A_ABST
    Figure CN122493422A_ABST
Patent Text Reader

Abstract

This invention provides an autonomous driving lane detection method that integrates multi-scale features and self-attention, comprising the following steps: acquiring wide-view and narrow-view images of the road to construct a dataset; feature extraction using a multi-scale convolutional autoencoder network (MSCAE); dynamic weighting coefficient calculation for vehicle motion state; multi-view feature weighting fusion; multi-head self-attention (MSA) enhancement; and end-to-end steering wheel angle prediction (multi-layer fully connected network). The beneficial effects of this invention are: by employing multi-scale convolutional autoencoders and multi-head self-attention, combined with wide-view and narrow-view dynamic weighting fusion, the accuracy, robustness, and speed adaptability of lane detection in complex scenarios are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of autonomous driving technology, and in particular relates to an autonomous driving lane detection method that integrates multi-scale features and self-attention. Background Technology

[0002] In the field of autonomous driving, lane detection is a fundamental step in achieving longitudinal speed control and lateral trajectory control of vehicles, and a core perception task to ensure the safe and stable operation of autonomous driving systems. As the most critical carrier of basic semantic information about road structure, lane lines directly define the vehicle's driving boundaries, the boundaries of traversable areas, and the baseline for trajectory planning. Their detection accuracy and environmental robustness directly determine the decision-making quality and control performance of the autonomous driving system. Specifically, high-precision lane detection can provide vehicles with multi-dimensional lane geometry parameters, including real-time lane position, dynamic lane width, and continuous curvature changes. This data provides precise spatial constraints for path planning algorithms, helping vehicles to stably maintain their position within a safe lane and effectively reducing the risk of collisions caused by lane departures. Secondly, as the core input for path prediction, local trajectory planning, and lane change decisions in autonomous driving systems, the quality of lane line recognition directly affects the stability of the control closed loop. When lane line recognition is incorrect or missing, the vehicle planning results will exhibit systematic deviations, leading to increased lateral control sway and decreased trajectory tracking accuracy, potentially causing vehicle loss of control or traffic accidents in extreme cases. Furthermore, lane detection technology plays a fundamental perception role in key functions such as Lane Keeping Assist (LKA), Adaptive Cruise Control (ACC), Automatic Lane Change Assist (ALC), Automatic Parking (APA), and Navigate on Autopilot (NOA), serving as a crucial support for high-level autonomous driving systems to achieve a closed loop of environmental perception, decision-making, planning, and control execution. Therefore, lane detection technology holds an irreplaceable core position in the field of autonomous driving. Continuously improving its detection accuracy, spatiotemporal continuity, and robustness in complex environments can not only significantly enhance the overall vehicle's active safety level but also effectively extend the reliable operating boundaries of autonomous driving systems under adverse weather and complex road conditions.

[0003] Problems with existing technology: (1) Traditional image processing methods are difficult to effectively mine deep semantic features in lane line detection. In complex scenarios such as strong light, shadow superposition, low light at night, vehicle occlusion, snow cover and road wear, the detection accuracy of the model is significantly reduced, and the environmental adaptability and robustness are insufficient.

[0004] (2) Single feature representation dimension. Single-scale convolutional neural networks or self-attention mechanisms are difficult to capture multi-scale spatial features and fine-grained details of lane lines in a coordinated manner. In scenarios where lane lines are blurred, broken, or partially occluded, the detection results are prone to fragmentation, missed detections, and false detections.

[0005] (3) Relying solely on single-view image input (such as a single narrow or wide field of view camera) makes it difficult to simultaneously capture near-field high-resolution details (such as the texture of worn lane line edges) and far-field global structural features (such as changes in curve curvature), resulting in insufficient adaptability of the system to lane line perspective deformation at different vehicle speeds. Summary of the Invention

[0006] In view of this, the present invention aims to propose an autonomous driving lane line detection method that integrates multi-scale features and self-attention, so as to solve at least one of the problems existing in the above-mentioned prior art.

[0007] To achieve the above objectives, the technical solution of the present invention is implemented as follows: An autonomous driving lane detection method integrating multi-scale features and self-attention includes the following steps: S1. Collect wide-view and narrow-view images of the road and construct a dataset; S2. Multi-scale convolutional autoencoder network feature extraction: Based on the dataset in step S1, a multi-scale convolutional autoencoder network is used to extract multi-scale features, obtaining the global semantic features of the wide-view image and the local detail features of the narrow-view image. S3. Calculation of dynamic weighting coefficients for vehicle status: Based on the real-time motion status of the vehicle, wide-view weights and narrow-view weights are generated through a lightweight multilayer sensor. S4. Multi-view feature weighted fusion: Based on the global semantic features of the wide view image and the local detail features of the narrow view image in step S2, as well as the wide view weight and narrow view weight in step S3, multi-view features are weighted and fused through a weighted fusion expression to obtain the fused features. S5. Multi-head self-attention feature enhancement: Flatten the fused features from step S4 into a one-dimensional sequence, and model long-distance spatial dependence through a multi-head self-attention mechanism to obtain enhanced features; S6. End-to-end steering wheel angle prediction: The enhanced features from step S5 are mapped to steering wheel angle commands through a multi-layer fully connected network.

[0008] Furthermore, in step S1, wide-view and narrow-view images of the road are acquired to construct a dataset, including: By jointly acquiring road images using a front-mounted wide-view camera and a narrow-view camera, and ensuring that the two are synchronized in time, a dataset including different perspectives, lighting conditions, and road conditions is constructed.

[0009] Furthermore, in step S2, the feature extraction of the multi-scale convolutional autoencoder network includes: S21. Feature extraction in the encoding stage: Based on wide-view and narrow-view images, parallel convolution kernels are used to extract semantic features of different receptive fields, capturing local details and global structure; S22. Feature recovery in the decoding stage: Spatial resolution is recovered layer by layer by using depooling and deconvolution, and key edge details are preserved by combining cross-layer connections. S23. Obtain the global semantic features of the wide-view image and the local detail features of the narrow-view image.

[0010] Furthermore, in step S3, the calculation of the vehicle state dynamic weighting coefficient includes: S31. Vehicle Status Time Alignment and Standardization: The status quantities of vehicle speed, steering wheel angle, and yaw rate are output at high frequency through the vehicle bus and interpolated and aligned based on the image acquisition timestamp; the status quantities are standardized to eliminate dimensional differences. S32. Dynamic weight generation: The standardized state variables are encoded by a lightweight multilayer perceptron, and wide-view weights and narrow-view weights are generated by the softmax function.

[0011] Furthermore, in step S5, the multi-head self-attention feature is enhanced, including: S51. Flatten the multi-view fusion features into a one-dimensional sequence; S52. Project the sequence features into a query, key, and value vector; S53. Multiple parallel attention heads are used, each head independently calculates scaled dot product attention in different subspaces. The outputs of the multiple heads are concatenated and then subjected to linear transformation, combined with residual connections and layer normalization to obtain enhanced features.

[0012] Furthermore, in step S6, the end-to-end steering wheel angle prediction includes: S61, Feature vectorization compression: Global average pooling is performed on the features enhanced by multi-head self-attention to compress the two-dimensional feature map into a channel-dimensional vector; S62, Multilayer Fully Connected Network Regression: Input vectors into a fully connected network, and achieve the mapping from features to steering wheel angle through linear transformation and nonlinear activation; S63, Output and Control Closed Loop: The predicted steering wheel angle is transmitted to the vehicle lateral controller at a set refresh rate.

[0013] Compared with existing technologies, the autonomous driving lane detection method integrating multi-scale features and self-attention described in this invention has the following advantages: (1) This invention employs a multi-scale convolutional autoencoder network to achieve step-by-step feature extraction and reconstruction from low-level texture to high-level structure. Traditional image processing methods rely on manually designed edge, threshold, or color features, which are extremely sensitive to scenes such as changes in lighting, shadow interference, and road wear; single-scale convolutional networks, due to their fixed receptive field, find it difficult to simultaneously capture local details and perceive the overall structure. The multi-scale design of this invention, through parallel convolutional kernels and cross-scale feature fusion technology, can simultaneously capture fine-grained texture features and large-scale geometric shapes, effectively improving the detection stability of the model in complex scenes such as strong light, weak light, occlusion, and snow accumulation, and significantly enhancing the robustness and generalization ability of the algorithm.

[0014] (2) Introducing a multi-head self-attention mechanism to enhance the feature representation capability of key lane line regions. Traditional convolutional structures are limited by local receptive fields, making it difficult to model long-distance dependencies across regions, especially in complex scenarios such as blurred, broken, or unevenly coated lane lines, which can easily lead to fragmented recognition results. This invention uses multi-head attention to model global dependencies in parallel across different feature subspaces, enabling the model to automatically focus on lane line edge contours, curvature changes, and spatial connectivity, effectively enhancing the structural completion capability of broken lane lines, significantly reducing false negative and false positive rates, and improving the overall continuity and stability of lane line recognition.

[0015] (3) A dynamic weighted fusion mechanism for wide and narrow field-view cameras is constructed, and adaptive adjustment of viewpoint and scale is achieved by combining it with vehicle speed perception strategy. Traditional single-camera solutions, due to their fixed viewpoint, cannot simultaneously capture high-resolution texture details in the near field and global geometric structure in the far field; when changes in vehicle speed cause increased perspective distortion, the false detection rate further increases. This invention captures distant structural information through a wide-view camera and extracts local high-precision edge details through a narrow-view camera, and dynamically adjusts the weight distribution of the two according to real-time vehicle speed to achieve adaptive matching of multi-scale features. This mechanism can significantly improve the positioning accuracy of long-distance lane lines in high-speed scenarios, while enhancing the ability to resolve details in low-speed or complex lane marking environments, ultimately providing highly reliable perception input for vehicle lateral control and steering wheel angle prediction. Attached Figure Description

[0016] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a schematic diagram of the overall architecture as described in an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall process described in an embodiment of the present invention. Detailed Implementation

[0017] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0018] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0019] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0020] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0021] like Figures 1 to 2 As shown, the autonomous driving lane detection method that integrates multi-scale features and self-attention includes the following steps: S1. Collect wide-view and narrow-view images of the road and construct a dataset; S2. Multi-scale convolutional autoencoder network feature extraction: Based on the dataset in step S1, a multi-scale convolutional autoencoder network is used to extract multi-scale features, obtaining the global semantic features of the wide-view image and the local detail features of the narrow-view image. S3. Calculation of dynamic weighting coefficients for vehicle status: Based on the real-time motion status of the vehicle, wide-view weights and narrow-view weights are generated through a lightweight multilayer sensor. S4. Multi-view feature weighted fusion: Based on the global semantic features of the wide view image and the local detail features of the narrow view image in step S2, as well as the wide view weight and narrow view weight in step S3, multi-view features are weighted and fused through a weighted fusion expression to obtain the fused features. S5. Multi-head self-attention feature enhancement: Flatten the fused features from step S4 into a one-dimensional sequence, and model long-distance spatial dependence through a multi-head self-attention mechanism to obtain enhanced features; S6. End-to-end steering wheel angle prediction: The enhanced features from step S5 are mapped to steering wheel angle commands through a multi-layer fully connected network.

[0022] Specifically as follows: The first step involves collecting road data using wide-view and narrow-view cameras. By combining and synchronizing the data collected by the pre-installed wide-view and narrow-view cameras, a corresponding dataset is constructed.

[0023] The second step is feature extraction using a multi-scale convolutional autoencoder network (MSCAE). Multi-scale convolutional autoencoders (MSCAEs) can simultaneously capture local and global features, enhancing robustness to size variations, complex backgrounds, and noise. Multi-scale feature fusion improves representational power, making reconstruction and downstream tasks more stable and accurate. A MSCAE network is used as the basic structure, performing layer-by-layer feature extraction and reconstruction supervision through an "encode-decode" process. The encoding stage consists of multiple convolutional and pooling layers, with parallel multi-scale convolutional modules (3×3, 5×5, 7×7) inserted into each layer to capture semantic information from different receptive fields. Pooling then compresses the features to extract the global structure. The decoding stage gradually restores spatial resolution through deconvolution and unpooling, and combines cross-layer connections to preserve key edge details. The resulting wide-view and narrow-view features contain both fine-grained edge information and stable global geometric structures, providing complete multi-scale input for subsequent fusion and attention mechanisms.

[0024] Let the wide view image and the narrow view image be respectively: Wide view image Narrow view image For each image, features of different receptive fields are extracted using parallel multi-scale convolutional kernels (3×3, 5×5, 7×7), as shown in the following expression: (1); in, Convolution operation Refers to the convolution kernel features at various scales, and I refers to the wide-view or narrow-view image.

[0025] The features from the three scales are concatenated along the channel dimension, and then dimensionality reduction and nonlinear activation are performed using 1×1 convolution, as shown in the following expression: (2); Here, Concat refers to the concatenation operation. This is the activation function.

[0026] Applying pooling operations to extract deeper features, the expression is as follows: (3); in, "E" refers to pooling operations, and "E" refers to the feature after pooling.

[0027] The decoder uses unpooling and deconvolution to restore the spatial resolution of the features layer by layer, as shown in the following expression: (4); (5); in, Refers to unpooling operation. Refers to deconvolution operation. Refers to the spatial characteristics after unpooling. Where is the number of layers, and D refers to the spatial features after deconvolution.

[0028] The semantic layer features of wide-view and narrow-view images are output separately, as shown in the following expressions: (6); in, Multi-scale fusion semantic features for wide-view images This involves multi-scale fusion of semantic features for narrow-view images. Both features will be input into the next step for dynamic viewpoint weighting and feature fusion.

[0029] Step 3: Calculation of dynamic weighting coefficients for vehicle motion state Before fusing the multi-scale features generated by the wide-view and narrow-view cameras, the importance of features from different perspectives is dynamically adjusted based on the vehicle's current motion state. In different scenarios such as high-speed straight driving, low-speed turning, and lane changing, the vehicle's reliance on near-field wide-angle information and far-field narrow-angle information varies significantly. If a fixed ratio is always used to fuse the two types of features, it will result in insufficient feature utilization efficiency and may even lead to lane line position deviations. Therefore, by modeling state variables such as vehicle speed, steering wheel angle, and yaw rate, feature weighting coefficients that can change at any time are obtained, enabling the system to automatically adapt to the vehicle's current operating conditions.

[0030] Time alignment and standardization of vehicle motion states vehicle speed Steering wheel angle yaw rate State variables are output at a high frequency by the vehicle bus, while camera images have a low and fixed frame rate. Therefore, to ensure temporal consistency between state variables and images, the vehicle state is interpolated and aligned based on the image acquisition timestamp, so that each frame corresponds to a unique set of state vectors, as expressed below: (7); Specifically as follows: The vehicle state is encoded using a lightweight multi-layer perceptron (MLP), and two scalar weights are generated using softmax, as shown in the following expression: (8); in, Corresponding to the broad view weight, Corresponding to narrow view weights, ensuring .

[0031] Step 4: Multi-view feature weighted fusion After dynamic weighting, the features from wide-view and narrow-view cameras can be proportionally adjusted according to the real-time vehicle conditions. However, inherent differences remain between the two types of features in terms of representation scale, response range, and geometric sensitivity. Wide-view features are more global, fully covering the lane line neighborhood, while narrow-view features focus more on the geometric structure of distant lane lines. To construct a lane line representation that combines local detail with overall coherence, this invention further integrates the two features hierarchically, gradually unifying multi-scale information into a structurally consistent semantic space within the network. This significantly improves the continuity and stability of lane lines under complex road conditions.

[0032] This invention introduces dynamic weighting coefficients into the fusion calculation, ensuring that the contributions from different perspectives align with the vehicle's motion state. Fusion Features The expression is as follows: (9); This fusion retains the spatial coverage advantage of wide vision while integrating the distant structural information of narrow vision, thus achieving a preliminary unification of visual information.

[0033] Step 5: Multi-head Self-Attention (MSA) Enhancement By using a self-attention mechanism to model long-distance spatial dependencies, the continuity of lane lines and the ability to complete lane lines when they are occluded are enhanced, thereby improving robustness.

[0034] Fusion features , For the number of channels, For feature map height, The feature map width and sequence length are given by the given information. Flatten the features for sequence The expression is as follows: (11); Projection for query ,key Sum , , , This corresponds to the projection matrix. Multi-head scaling dot product attention is performed, expressed as follows: (12); (13); in, For normalization operations, For the number of heads to focus on, The output after attention weighting.

[0035] Step 6: End-to-end steering wheel angle prediction (multi-layer fully connected network) The semantically enhanced features are vectorized and the steering wheel angle is directly regressed using MLP to achieve end-to-end image-to-control command mapping.

[0036] The weighted features are compressed into channel vectors using global average pooling (GAP). The expression is as follows: (15); Will Input a three-layer fully connected network and output a scalar steering wheel angle. The expression is as follows: (16); (17); (18); in, This is the first layer weight matrix. For the first layer bias, This is the output of the first layer. And so on.

[0037] Example 1: An application case of end-to-end lane detection deployed on L2 / L2+ autonomous vehicles Using a wide-view (120° FOV) and narrow-view (45° FOV) binocular camera as input, multi-level features are extracted through a multi-scale convolutional autoencoder network (MSCAE). Combined with the vehicle motion state, the viewpoint features are fused through adaptive weights. Multi-head self-attention (MSA) is used to extract global spatiotemporal information, and finally the vehicle steering wheel angle command is output to realize the closed loop of lane line detection and lateral control.

[0038] Step 1: Data Collection A1. Data Acquisition Equipment and Installation Preparation Before data acquisition, the Senyun wide-view camera and narrow-view camera were first fixedly mounted above the vehicle's windshield. Their relative orientation was rigidly connected using a dedicated automotive-grade bracket to ensure no relative pose drift occurred during driving. During installation, the optical axis direction, pitch angle, lateral offset, and mounting height of the devices were precisely measured and recorded as initial values ​​for extrinsic parameter optimization. To avoid the impact of vehicle vibration on imaging stability, the cameras were mounted on a vibration-damping bracket, ensuring no obstruction at the lens edges. These preparatory steps ensured clear geometric constraints on the spatial configuration of the two cameras, laying the foundation for subsequent joint calibration.

[0039] A2. Multi-scene image acquisition process in road environments After equipment installation, the data acquisition vehicle sequentially enters urban roads, highways, ramp loops, winding road sections, tunnel entrances and exits, and complex lighting environments such as nighttime and rain / snow, following a pre-set route. During the journey, wide-view and narrow-view cameras acquire image data at a uniform frame rate, recording the acquisition time of each frame with a high-precision timestamp. Simultaneously, the vehicle's speed, steering wheel angle, yaw rate, and acceleration are recorded, providing a temporal data foundation consistent with the vehicle's motion state for subsequent feature fusion algorithms. Furthermore, in road scenes with drastically changing lighting conditions, the camera system dynamically adjusts exposure and white balance according to the current environment, ensuring sufficient texture contrast and adaptability to non-ideal conditions such as strong light, backlight, and nighttime. Through this acquisition process, a 1920×1080 pixel dataset can be obtained.

[0040] Step 2: Image Preprocessing Before entering the feature extraction network, the image undergoes a unified preprocessing procedure to ensure consistency in scale, brightness, and color distribution between the dual-camera inputs. Specifically, this embodiment first scales the original images captured by the wide-view and narrow-view cameras to a resolution of 640×360 to reduce computational load and ensure a fixed input size for subsequent networks. Then, the image is converted from the RGB color space to the YUV space, separating brightness and color information to obtain a more stable brightness representation in scenes with significant lighting changes, such as strong light, shadows, and nighttime. To further enhance the detail contrast in the lane line area, the system applies the CLAHE adaptive histogram equalization method to the brightness channel, enhancing local contrast through block-based processing to highlight lane line edges and texture features. After brightness enhancement, the image is normalized. (20); A linear mapping to the [-1,1] interval is performed, thereby improving the numerical stability of network training and accelerating convergence. After the above preprocessing steps, the dual-camera images are unified in terms of brightness dynamic range, color distribution, and numerical scale, providing a high-quality input foundation for subsequent multi-scale feature extraction and fusion calculations.

[0041] Step 3: Design of Multi-Scale Convolutional Autoencoder Network (MSCAE) The multi-scale convolutional autoencoder network (MSCAE) used in this embodiment consists of multi-scale convolutions and an autoencoder. Its structural design aims to simultaneously acquire fine-grained texture features and global geometric structure of lane lines. Encoding and decoding each contain two convolutional layers and one multi-scale convolutional layer. The multi-scale convolutional layer contains three convolutional kernels at three scales, each with one neuron. The kernel sizes are 3×3, 5×5, and 7×7. Max pooling layers are then applied after the first convolutional layer, the multi-scale convolutional layer, and the second convolutional layer, with pooling windows of 2×1 in each case.

[0042] Ultimately, wide-view characteristics With narrow vision The depth features are all 80×45, providing a unified high-level semantic representation for subsequent multi-view fusion and self-attention enhancement.

[0043] Step 4: Dynamic weighted fusion design of vehicle motion state and visual characteristics In the feature fusion stage of this invention, a dynamic weighting mechanism based on vehicle motion state is introduced, enabling the fusion ratio of wide-view and narrow-view features to be automatically adjusted according to the current operating conditions of the vehicle. Specifically, the system takes the vehicle's real-time speed, yaw rate, and steering wheel angle as inputs, performs state encoding through two layers of lightweight multilayer perceptrons (MLPs) with 32 units per layer, and generates wide-view and narrow-view weights through a softmax function.

[0044] (twenty two); This weight reflects the vehicle's current dependence on information from different perspectives. For example, in high-speed straight-ahead scenarios (around 80 km / h), the model emphasizes distant structures, so the narrow-view weight can reach 0.75. In low-speed curve scenarios (around 30 km / h with a large steering wheel angle), the vehicle needs more near-field geometric details, and the wide-view weight can be increased to 0.72. In mixed driving conditions such as urban roads, the importance of the two perspectives tends to be similar, and the weights are usually stable at around 0.5. Finally, the dynamically weighted fusion features are obtained through linear combination.

[0045] (twenty three); This enables the model to adaptively select the best source of visual information under different vehicle speeds, curvatures, and dynamic environments, thereby improving the overall stability of lane detection and control prediction.

[0046] Step 5: Design of Multi-Head Self-Attention (MSA) Enhancement Module After completing the dynamic weighted fusion of multi-view features, the resulting fused feature F is a two-dimensional feature map with dimensions of 80×45. It retains the spatial structure and semantic association information of lane lines. However, this two-dimensional format cannot directly adapt to the input requirements of the subsequent multi-head self-attention mechanism for one-dimensional sequence features. Therefore, the two-dimensional fused feature map is strictly flattened through the Flatten layer, as follows: Using row-major order as the traversal criterion, the feature values ​​corresponding to each spatial position (i,j) (where i∈[0,79], j∈[0,44]) in the two-dimensional feature map are extracted sequentially. The 80×45=3600 feature elements originally distributed in the two-dimensional spatial grid are arranged into a one-dimensional vector according to the traversal order, and the final output is a one-dimensional feature sequence with a dimension of 1×3600. This flattening process strictly preserves the original correlation between each feature element, without losing any semantic information, and realizes the transformation of the feature form from a two-dimensional spatial structure to a one-dimensional sequence, providing a standardized input foundation for subsequent global dependency modeling and dimensionality compression.

[0047] Considering the high dimensionality of the flattened 1×3600 one-dimensional feature sequence, directly inputting it into a multi-head self-attention mechanism would lead to a surge in computation and easily introduce redundant information that would interfere with feature learning performance. Therefore, two fully connected layers are further designed to reduce its dimensionality. The first fully connected layer maps the 3600-dimensional features to 800 dimensions through a linear transformation, and introduces non-linear expressive power of the features through a non-linear activation function (such as ReLU), effectively filtering key semantic information. The second fully connected layer further compresses the 800-dimensional features to 400 dimensions, and finally outputs a 1×400 one-dimensional compact feature vector.

[0048] Building upon multi-view fusion features, this invention further introduces a multi-head self-attention structure to enhance the global consistency and robustness of lane line features in complex scenarios. This attention module employs eight parallel attention heads, each with a 32-dimensional query, key, and value vector to capture cross-regional feature correlations across different subspaces. The output is then non-linearly transformed by a feedforward network (FFN) with a hidden layer dimension of 1024, and training stability is maintained through residual and normalization operations. The features processed by multi-head attention are denoted as follows: (twenty four); Its structure has a stronger ability to model long-distance dependencies, enabling the model to overcome local occlusion, lighting changes and reflection interference, automatically fill in broken lane lines, and enhance the expression of curvature continuity in curves, thereby significantly improving detection performance and overall robustness in occluded, reflective and texture weakened scenes.

[0049] This invention further constructs an end-to-end regression network structure to complete the mapping from high-dimensional feature vectors to a single control command. A 1×400-dimensional one-dimensional feature vector is input into a regression network consisting of three fully connected layers. The first fully connected layer has 256 hidden units and uses linear transformations and nonlinear activation functions to deeply mine the features, strengthening the correlation between key geometric information of lane lines and steering wheel angle. The second fully connected layer compresses the feature dimension to 64 dimensions, further filtering core effective features, eliminating redundant interference information, and improving the model's generalization ability. The third fully connected layer serves as the output layer, using a linear mapping of one neuron to transform the 64-dimensional feature vector into 1×1-dimensional scalar data, which is the predicted steering wheel angle.

[0050] To ensure the stability and accuracy of the output results, batch normalization (BN) is introduced after each fully connected layer. This effectively reduces the internal covariate shift during network training, lowers the training difficulty of deep networks, enhances the nonlinear expressive power of the model, and accelerates the convergence speed.

[0051] During training, predicted values ​​are calculated through forward propagation. and the true value The MSE between layers was determined, and the Adam optimizer was used to optimize the parameters of each layer via backpropagation (BP). The learning rate of the Adam optimization algorithm was set to 0.001, the batch size to 50, and the epochs to 100. During the inference phase, the 1×1 dimensional steering wheel angle data output by the regression network was directly used as the core command for vehicle lateral control, and transmitted to the vehicle lateral controller at a refresh rate of 30Hz to achieve closed-loop execution of autonomous driving lateral control and ensure that the vehicle accurately follows the lane lines. The root mean square error (RMSE) and mean absolute error (MAE) were used to evaluate the performance of the prediction model. Both of these evaluation metrics can reflect the accuracy of the steering wheel angle prediction results. The evaluation results of different models are shown in Table 1.

[0052] Table 1 A comprehensive comparison reveals that traditional machine learning models (RF, GBDT) rely on manual feature engineering, leading to a surge in errors under complex conditions, making them unsuitable for the high-precision requirements of autonomous driving. Single deep learning models (Pure CNN, Pure MLP, Pure MSA) are either limited by local receptive fields or lack effective feature extraction and multi-scale fusion mechanisms, exhibiting significant shortcomings in global feature modeling and robustness to low-quality lane lines, with RMSE and MAE significantly higher than the algorithm of this invention. In contrast, the MFF-MSA-1DR algorithm of this invention achieves full-link optimization through multi-scale feature fusion to accurately capture lane line details and global structure, Flatten layer canonical dimension transformation, multi-head self-attention modeling of long-distance dependencies, and hierarchical regression network to achieve accurate mapping. Under all scenarios, the RMSE is only 1.13° and the MAE is only 0.76°. Even under extreme and complex conditions such as rain and curves, the error remains low, reducing the error by more than 48% compared to the comparison models. Its prediction accuracy and robustness are significantly superior, fully meeting the high-precision requirements of lateral control in autonomous driving.

[0053] The statistical results of the actual vehicle test are shown in Table 2.

[0054] Table 2 The system can travel continuously and stably for 30km without losing lane markings.

[0055] In this embodiment, the data processing part is implemented using the Matlab language, the lifetime prediction part is implemented using the Python language, the deep learning environment is built using Tensorflow+Keras, and the software platform is PyCharm.

[0056] The beneficial effects of this invention are: (1) This invention employs a multi-scale convolutional autoencoder network to achieve step-by-step feature extraction and reconstruction from low-level texture to high-level structure. Traditional image processing methods rely on manually designed edge, threshold, or color features, which are extremely sensitive to scenes such as changes in lighting, shadow interference, and road wear; single-scale convolutional networks, due to their fixed receptive field, find it difficult to simultaneously capture local details and perceive the overall structure. The multi-scale design of this invention, through parallel convolutional kernels and cross-scale feature fusion technology, can simultaneously capture fine-grained texture features and large-scale geometric shapes, effectively improving the detection stability of the model in complex scenes such as strong light, weak light, occlusion, and snow accumulation, and significantly enhancing the robustness and generalization ability of the algorithm.

[0057] (2) Introducing a multi-head self-attention mechanism to enhance the feature representation capability of key lane line regions. Traditional convolutional structures are limited by local receptive fields, making it difficult to model long-distance dependencies across regions, especially in complex scenarios such as blurred, broken, or unevenly coated lane lines, which can easily lead to fragmented recognition results. This invention uses multi-head attention to model global dependencies in parallel across different feature subspaces, enabling the model to automatically focus on lane line edge contours, curvature changes, and spatial connectivity, effectively enhancing the structural completion capability of broken lane lines, significantly reducing false negative and false positive rates, and improving the overall continuity and stability of lane line recognition.

[0058] (3) A dynamic weighted fusion mechanism for wide and narrow field-view cameras is constructed, and adaptive adjustment of viewpoint and scale is achieved by combining it with vehicle speed perception strategy. Traditional single-camera solutions, due to their fixed viewpoint, cannot simultaneously capture high-resolution texture details in the near field and global geometric structure in the far field; when changes in vehicle speed cause increased perspective distortion, the false detection rate further increases. This invention captures distant structural information through a wide-view camera and extracts local high-precision edge details through a narrow-view camera, and dynamically adjusts the weight distribution of the two according to real-time vehicle speed to achieve adaptive matching of multi-scale features. This mechanism can significantly improve the positioning accuracy of long-distance lane lines in high-speed scenarios, while enhancing the ability to resolve details in low-speed or complex lane marking environments, ultimately providing highly reliable perception input for vehicle lateral control and steering wheel angle prediction.

[0059] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An autonomous driving lane detection method integrating multi-scale features and self-attention, characterized by: Includes the following steps: S1. Collect wide-view and narrow-view images of the road and construct a dataset; S2. Multi-scale convolutional autoencoder network feature extraction: Based on the dataset in step S1, a multi-scale convolutional autoencoder network is used to extract multi-scale features, obtaining the global semantic features of the wide-view image and the local detail features of the narrow-view image. S3. Calculation of dynamic weighting coefficients for vehicle status: Based on the real-time motion status of the vehicle, wide-view weights and narrow-view weights are generated through a lightweight multilayer sensor. S4. Multi-view feature weighted fusion: Based on the global semantic features of the wide view image and the local detail features of the narrow view image in step S2, as well as the wide view weight and narrow view weight in step S3, multi-view features are weighted and fused through a weighted fusion expression to obtain the fused features. S5. Multi-head self-attention feature enhancement: Flatten the fused features from step S4 into a one-dimensional sequence, and model long-distance spatial dependence through a multi-head self-attention mechanism to obtain enhanced features; S6. End-to-end steering wheel angle prediction: The enhanced features from step S5 are mapped to steering wheel angle commands through a multi-layer fully connected network.

2. The autonomous driving lane detection method integrating multi-scale features and self-attention as described in claim 1, characterized in that: In step S1, wide-view and narrow-view images of the road are acquired to construct a dataset, including: By jointly acquiring road images using a front-mounted wide-view camera and a narrow-view camera, and ensuring that the two are synchronized in time, a dataset including different perspectives, lighting conditions, and road conditions is constructed.

3. The autonomous driving lane detection method integrating multi-scale features and self-attention as described in claim 1, characterized in that: In step S2, feature extraction using a multi-scale convolutional autoencoder network includes: S21. Feature extraction in the encoding stage: Based on wide-view and narrow-view images, parallel convolution kernels are used to extract semantic features of different receptive fields, capturing local details and global structure; S22. Feature recovery in the decoding stage: Spatial resolution is recovered layer by layer by using depooling and deconvolution, and key edge details are preserved by combining cross-layer connections. S23. Obtain the global semantic features of the wide-view image and the local detail features of the narrow-view image.

4. The autonomous driving lane detection method integrating multi-scale features and self-attention as described in claim 1, characterized in that: In step S3, the calculation of the dynamic weighting coefficients for the vehicle state includes: S31. Vehicle Status Time Alignment and Standardization: The status quantities of vehicle speed, steering wheel angle, and yaw rate are output at high frequency through the vehicle bus and interpolated and aligned based on the image acquisition timestamp; the status quantities are standardized to eliminate dimensional differences. S32. Dynamic weight generation: The standardized state variables are encoded by a lightweight multilayer perceptron, and wide-view weights and narrow-view weights are generated by the softmax function.

5. The autonomous driving lane detection method integrating multi-scale features and self-attention as described in claim 1, characterized in that: In step S5, the multi-head self-attention feature is enhanced, including: S51. Flatten the multi-view fusion features into a one-dimensional sequence; S52. Project the sequence features into a query, key, and value vector; S53. Multiple parallel attention heads are used, each head independently calculates scaled dot product attention in different subspaces. The outputs of the multiple heads are concatenated and then subjected to linear transformation, combined with residual connections and layer normalization to obtain enhanced features.

6. The autonomous driving lane detection method integrating multi-scale features and self-attention as described in claim 1, characterized in that: In step S6, the end-to-end steering wheel angle prediction includes: S61, Feature vectorization compression: Global average pooling is performed on the features enhanced by multi-head self-attention to compress the two-dimensional feature map into a channel-dimensional vector; S62, Multilayer Fully Connected Network Regression: Input vectors into a fully connected network, and achieve the mapping from features to steering wheel angle through linear transformation and nonlinear activation; S63, Output and Control Closed Loop: The predicted steering wheel angle is transmitted to the vehicle lateral controller at a set refresh rate.