Lane line detection method and device based on global feature aggregation
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INST OF AUTOMATION CHINESE ACAD OF SCI
- Filing Date
- 2025-08-01
- Publication Date
- 2026-08-07
AI Technical Summary
但由于车道线本身固有细长特性,且在无人驾驶场景中,还面临如恶劣天气、路面模糊、路面拥堵等造成的视觉线索不明显的问题,
[0016]本发明提供的基于全局特征聚合的车道线检测方法以及装置,通过编码器提取车道线图像的局部特征图后,先通过聚合器的输入模块将二维特征压缩为一维序列,使后续处理更高效;再经聚合器的全局建模模块对序列进行重排和选择性扫描,突破了传统卷积感受野限制,实现跨区域的全局信息交互;随后由聚合器的输出模块将增强后的序列与原始特征图通过维度恢复和跳跃连接融合,既保留了细节信息又强化了全局上下文;最终由解码器整合优化后的特征,显著提升了对弯道、遮挡或低光照等复杂场景的车道线结构理解能力,从而全面提升检测准确性。
Smart Images

Figure CN121147863B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a lane line detection method and apparatus based on global feature aggregation. Background Technology
[0002] Lane detection technology can obtain the semantic category and location information of each lane line from the front view captured by the vehicle's monocular camera, and is widely used in applications such as localization, path planning, and obstacle avoidance of autonomous vehicles.
[0003] Mainstream lane detection algorithms employ an encoder-decoder framework, using a convolutional neural network as the encoder to acquire feature maps, and then using a decoder to predict lane line information from these feature maps. However, due to the inherently slender nature of lane lines, and in autonomous driving scenarios, challenges arise such as inclement weather, blurred road surfaces, and traffic congestion leading to unclear visual cues. Therefore, relying solely on the encoder often makes it difficult to extract subtle lane line features, resulting in limited global perception of the decoded visual features and difficulty in achieving accurate lane line localization. Summary of the Invention
[0004] This invention provides a lane line detection method and apparatus based on global feature aggregation, which solves the problem of difficulty in accurately locating lane lines in the prior art and can effectively enhance global modeling capabilities while maintaining linear computational complexity.
[0005] This invention provides a lane line detection method based on global feature aggregation, comprising the following steps.
[0006] Acquire a lane line image; input the lane line image into a lane line detection model to obtain the lane line detection result output by the lane line detection model, wherein the process includes: extracting features from the lane line image using an encoder to obtain a feature map; adjusting the dimensions of the feature map using an aggregator's input module to obtain a one-dimensional feature sequence; performing sequence rearrangement and selective scanning on the one-dimensional feature sequence using the aggregator's global modeling module to form a global receptive field and obtain multiple feature-enhanced output sequences; performing dimension restoration and skip connections between the multiple feature-enhanced output sequences and the feature map using the aggregator's output module to obtain a globally aggregated feature map; and decoding the globally aggregated feature map using a decoder to obtain the lane line detection result corresponding to the lane line image.
[0007] According to the lane line detection method based on global feature aggregation provided by the present invention, the step of adjusting the dimension of the feature map to obtain a one-dimensional feature sequence includes: using... The convolutional layer converts the feature map Channel dimension compressed to target channel dimension Then, a one-dimensional feature sequence is obtained through a linear layer. ,in, : in, Represents a one-dimensional feature sequence. Indicates a linear layer. This represents the activation function. Indicates batch normalization, express Two-dimensional convolution operation, Representing feature maps, Indicates the sequence length. Indicates the feature map height. Indicates the width of the feature map. Indicates the dimension of the target channel.
[0008] According to the present invention, a lane line detection method based on global feature aggregation is provided, wherein the aggregator is a global feature selective aggregator based on Mamba.
[0009] According to the present invention, a lane detection method based on global feature aggregation is provided, wherein the one-dimensional feature sequence is rearranged and selectively scanned to form a global receptive field, resulting in multiple feature-enhanced output sequences, including: Discrete rearrangement of the one-dimensional feature sequence yields four new one-dimensional feature sequences: in, Indicates the first A new one-dimensional feature sequence This represents a discrete rearrangement operation. Represents a one-dimensional feature sequence; The four new one-dimensional feature sequences are selectively scanned repeatedly along both horizontal and vertical directions to form a global receptive field, resulting in four feature-enhanced output sequences. in, Indicates the first The output sequence with enhanced features This represents the state-space model of a Mamba-based global feature-selective aggregator. This represents one-dimensional convolution.
[0010] According to the present invention, a lane detection method based on global feature aggregation is provided, the method further comprising: performing a gating operation on the output sequence of the feature enhancement and the one-dimensional feature sequence to obtain gated and enhanced global features. in, Indicates the gating signal source. Represents a one-dimensional feature sequence. This represents the global features after gating enhancement. Indicates the first The output sequence with enhanced features This represents element-wise multiplication. This represents the activation function.
[0011] According to the present invention, a lane line detection method based on global feature aggregation is provided, wherein the output sequence based on the multiple feature enhancements is subjected to dimensionality recovery and skip connection with the feature map to obtain a feature map after global feature aggregation, including: Dimension recovery is performed on the output sequence of the multiple feature enhancements to obtain the aggregated feature sequence; Based on the target dropout rate, a skip connection is performed between the aggregated feature sequence and the feature map to obtain the feature map after global feature aggregation: in, This represents the feature map after global feature aggregation. This indicates a discard rate of 0.2%. This represents the activation function. Indicates batch normalization, Represents two-dimensional convolution. Indicates a linear layer. Represents aggregated feature sequences. Represents the feature map.
[0012] This invention also provides a lane detection device based on global feature aggregation, comprising the following modules: an acquisition module for acquiring a lane line image; and a lane line detection module for inputting the lane line image into a lane line detection model to obtain a lane line detection result output by the lane line detection model, wherein the device includes: extracting features from the lane line image using an encoder to obtain a feature map; adjusting the dimension of the feature map using an input module of an aggregator to obtain a one-dimensional feature sequence; performing sequence rearrangement and selective scanning on the one-dimensional feature sequence using a global modeling module of the aggregator to form a global receptive field and obtain multiple feature-enhanced output sequences; performing dimension recovery and skip connections between the multiple feature-enhanced output sequences and the feature map using an output module of the aggregator to obtain a feature map after global feature aggregation; and decoding the feature map after global feature aggregation using a decoder to obtain the lane line detection result corresponding to the lane line image.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the lane detection method based on global feature aggregation as described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the lane line detection method based on global feature aggregation as described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the lane line detection method based on global feature aggregation as described above.
[0016] The lane detection method and apparatus based on global feature aggregation provided by this invention extracts local feature maps of lane line images through an encoder. First, the input module of an aggregator compresses the two-dimensional features into a one-dimensional sequence, making subsequent processing more efficient. Then, the global modeling module of the aggregator rearranges and selectively scans the sequence, breaking through the limitations of the receptive field of traditional convolution and achieving cross-regional global information interaction. Subsequently, the output module of the aggregator fuses the enhanced sequence with the original feature map through dimensionality recovery and skip connections, preserving detailed information while enhancing the global context. Finally, the decoder integrates the optimized features, significantly improving the ability to understand lane line structures in complex scenes such as curves, occlusions, or low light, thereby comprehensively improving detection accuracy. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced one by one below. Obviously, the accompanying drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the lane line detection method based on global feature aggregation provided by the present invention.
[0019] Figure 2 This is a schematic diagram illustrating the principle of the lane detection method based on Mamba-oriented global feature aggregation provided by the present invention.
[0020] Figure 3 This is a schematic diagram of the aggregator module provided by the present invention.
[0021] Figure 4 This is a comparison chart of the lane line detection effects provided by the present invention.
[0022] Figure 5 This is a schematic diagram of the lane line detection device based on global feature aggregation provided by the present invention.
[0023] Figure 6 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] Currently, some works utilize the self-attention mechanism of Transformers to supplement more global contextual information, greatly improving the accuracy of lane line localization. However, the quadratic computational complexity of self-attention also severely impacts the network's inference speed. Therefore, achieving a balance between performance and efficiency remains a challenging problem to overcome for lane line detection tasks with high real-time requirements.
[0026] This invention proposes a lane detection method based on Mamba-based global feature selective aggregation. By fully utilizing Mamba's selective scanning mechanism and multiple scanning strategies of visual Mamba, a Mamba-based global feature selective aggregator (hereinafter referred to as the "aggregator") is constructed. This aggregator supports scanning the feature map from four directions, effectively improving the global context modeling capability of image lane detection. This aggregator can be used as a plug-and-play feature enhancement module to upgrade existing mainstream encoder-decoder lane detection networks, improving detection performance in cases where visual differences are not obvious while maintaining linear computational complexity.
[0027] Optionally, the lane detection method based on global feature aggregation in this embodiment can be executed by a server, by a terminal device, or by both a server and a terminal device. For example, the lane detection method based on global feature aggregation in this embodiment can be executed by an in-vehicle terminal.
[0028] Figure 1 This is a flowchart illustrating the lane detection method based on global feature aggregation provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps.
[0029] Step 101: Obtain the lane line image.
[0030] In this embodiment of the invention, the lane line image may be a front view captured from an onboard monocular camera, or an image including lane lines acquired in real time by other image acquisition devices.
[0031] Step 102: Input the lane line image into the lane line detection model to obtain the lane line detection result output by the lane line detection model.
[0032] In this embodiment of the invention, the lane line detection model is a baseline model of the encoder-decoder framework, which is then used as an intermediate layer (or the intermediate layer is replaced) by an aggregator to obtain an upgraded baseline model.
[0033] The encoder in the upgraded baseline model (i.e., the lane detection model) is used to extract features from the input image to obtain a feature map; The feature map obtained in the first step is dimensionally adjusted using the input module in the aggregator to fit the input of Mamba, a one-dimensional feature sequence. The global modeling module in the aggregator is used to rearrange the obtained one-dimensional feature sequence. The rearranged feature sequence is then subjected to a four-term selective scan to form a global receptive field, resulting in a feature map with enhanced features. The output module in the aggregator is used to restore the dimension of the feature map after feature enhancement, so that it matches the dimension of the feature map, and the feature map after dimension restoration is obtained. A decoder is used to decode the feature map after the dimensionality is restored to obtain the final lane line detection result.
[0034] Specifically, step 102 includes the following steps: Step 1021: Use an encoder to extract features from the lane line image to obtain a feature map.
[0035] In this embodiment of the invention, RESA is selected as the baseline model, and an aggregator is used to replace the intermediate layer of the original RESA to obtain RESA+.
[0036] The RESA (Recurrent Feature-Shift Aggregator) model is used as the baseline. The standard structure of RESA typically includes: a backbone encoder (such as ResNet), a feature refinement layer consisting of multiple cascaded RESA modules, and a segmentation decoder consisting of multi-branch prediction heads.
[0037] The intermediate feature refinement layers (i.e., multi-layer REAS modules) in the RESA model were identified as the targets for replacement. These REAS modules were originally responsible for local context aggregation through cyclic feature translation operations.
[0038] The Mamba-based global feature selective aggregator (containing an input module, a global modeling module, and an output module) is treated as an independent unit and directly replaces all the REAS module layers in the original RESA structure. RESA+ selects ResNet34 as the encoder to extract features from the input lane line image, obtaining the feature map. .
[0039] Step 1022: The feature map is dimensionally adjusted through the input module of the aggregator to obtain a one-dimensional feature sequence.
[0040] According to the lane detection method based on global feature aggregation provided by the present invention, the feature map is dimensionally adjusted to obtain a one-dimensional feature sequence, including: use Convolutional layers convert feature maps Channel dimension compressed to target channel dimension Then, a one-dimensional feature sequence is obtained through a linear layer. ,in, : in, Represents a one-dimensional feature sequence. Indicates a linear layer. This represents the activation function. Indicates batch normalization, express Two-dimensional convolution operation, Representing feature maps, Indicates the sequence length. Indicates the feature map height. Indicates the width of the feature map. Indicates the dimension of the target channel.
[0041] In this embodiment of the invention, the input module first uses a 3×3 convolutional layer to compress the F-channel dimension of the feature map to [value missing]. Then, a one-dimensional feature sequence is obtained through a linear layer. ,in This allows for initial alignment with the input shape of Mamba.
[0042] use Convolutional layers compress the feature map channel dimensions from the original dimensions to the target dimensions. Generate two-dimensional features This step preserves spatial local correlations by using small convolution kernels, while reducing the computational complexity of subsequent operations.
[0043] Temporary features Batch normalization (execution batch normalization) )and Activation enhances the nonlinear representation of features and optimizes gradient flow.
[0044] Two-dimensional features are processed through a linear layer (fully connected layer). Spatial Dimensions Combined into length (Right now The final output is a one-dimensional sequence.
[0045] Through the embodiments of the present invention, 3×3 convolution preserves local structural information (such as lane line edges) while compressing the channel dimension, avoiding spatial information loss caused by direct flattening; batch normalization improves training stability.
[0046] Step 1023: Through the global modeling module of the aggregator, the one-dimensional feature sequence is rearranged and selectively scanned to form a global receptive field, resulting in multiple feature-enhanced output sequences.
[0047] According to the present invention, a lane line detection method based on global feature aggregation is provided, wherein the aggregator is a global feature selective aggregator based on Mamba.
[0048] In this embodiment of the invention, the global modeling module of the Mamba-based global feature selective aggregator first processes the one-dimensional feature sequence. Discrete rearrangement is performed to form four new one-dimensional sequences to serve as inputs to one-dimensional convolutions and SSM layers in Mamba.
[0049] This aggregator directly adopts the Mamba sequence modeling structure as the core of its global modeling module. Essentially, it is an optimized implementation of the Structured State-Space Model (SSM).
[0050] Through the embodiments of the present invention, the aggregator achieves global receptive field modeling and dynamic feature selection at a near-linear computational cost by using Mamba's sequence rearrangement and selective scanning mechanism, thereby improving the accuracy of structure perception while maintaining real-time inference efficiency.
[0051] According to the present invention, a lane detection method based on global feature aggregation performs sequence rearrangement and selective scanning on a one-dimensional feature sequence to form a global receptive field, resulting in multiple feature-enhanced output sequences, including: Discrete rearrangement of the one-dimensional feature sequence yields four new one-dimensional feature sequences: in, Indicates the first A new one-dimensional feature sequence This represents a discrete rearrangement operation. Represents a one-dimensional feature sequence; The four new one-dimensional feature sequences are selectively scanned repeatedly along both the horizontal and vertical directions to form a global receptive field, resulting in four feature-enhanced output sequences. in, Indicates the first The output sequence with enhanced features This represents the state-space model of a Mamba-based global feature-selective aggregator. This represents one-dimensional convolution.
[0052] In this embodiment of the invention, the global modeling module first processes the one-dimensional feature sequence. Discrete rearrangement is performed to form four new one-dimensional feature sequences, which are then used as inputs to the one-dimensional convolutional and SSM layers in Mamba. This indicates a discrete rearrangement operation.
[0053] After the sequence is rearranged, Mamba selectively scans the sequence repeatedly in both horizontal and vertical directions, allowing each element to aggregate information from all other positions in different directions, thus forming a global receptive field.
[0054] In some embodiments, a one-dimensional feature sequence The feature map is split into four non-overlapping subsequences along the spatial dimension, each subsequence covering a different spatial quadrant of the feature map. This is achieved using a predefined rearrangement function. The subsequences are reordered to generate four new one-dimensional feature sequences.
[0055] For each new one-dimensional feature sequence One-dimensional convolution (1DConv) is applied channel-by-channel to initially optimize features through local context fusion. The convolution result is then input into Mamba's state-space model (SSM) for bidirectional sequence scanning. Horizontal scan (covering lane lateral curvature): Forward scan: Propagate the state from left to right for each row, modeling the continuity of the lanes from left to right (such as curve transitions). Reverse scan: Pass the state from right to left for each row, capturing the lane associations from right to left (such as bifurcated lanes).
[0056] Vertical scan (covering continuous longitudinal lanes): Forward scanning: The state is passed from top to bottom for each column, reinforcing the spatial dependence of lanes from near to far (such as distant dashed lines); Reverse scan: Pass the state from bottom to top for each column, and complete the lane context from far to near (e.g., occlusion recovery).
[0057] Through the embodiments of this application, the selective scanning mechanism in both horizontal and vertical directions establishes global dependencies on key directions (curved and continuous) of lane lines with minimal computational cost, significantly improving the structural integrity and anti-interference capability of complex scenes while maintaining real-time performance.
[0058] According to the lane detection method based on global feature aggregation provided by the present invention, the method further includes: Gating operations are performed between the feature-enhanced output sequence and the one-dimensional feature sequence to obtain the gated-enhanced global features: in, Indicates the gating signal source. Represents a one-dimensional feature sequence. This represents the global features after gating enhancement. Indicates the first The output sequence with enhanced features This represents element-wise multiplication. This represents the activation function.
[0059] In this embodiment of the invention, a cross-sequence interaction operation is performed between the original one-dimensional feature sequence and the feature enhancement sequence to generate a gated signal source through the deep feature interaction between the two. This process captures the complementary relationship between the original local details and the global enhanced features.
[0060] A parameterized linear transformation is applied to the generated gated signal source, and a nonlinear mapping is performed using the SiLU activation function. The unique smooth threshold property of the SiLU function (similar to Sigmoid) allows the model to autonomously adjust the weight strength: outputting high weights in key lane regions (such as curve apex) and suppressive low weights in background noise regions.
[0061] The optimized gating weights are then multiplied element-wise with the feature-enhanced output sequence. This operation assigns independent weighting coefficients to the feature channels at each spatial location, enabling adaptive enhancement of key lane structure information.
[0062] Through the embodiments of the present invention, the gating mechanism, through multi-level feature interaction and dynamic weighting, autonomously strengthens the global context related to lane structure while preserving local accuracy, significantly improving the robustness of the model to broken lanes, low light and complex backgrounds, without introducing additional computational burden.
[0063] Step 1024: Through the output module of the aggregator, dimensionality recovery and skip connections are performed on the output sequences of multiple feature enhancements and the feature map to obtain the feature map after global feature aggregation.
[0064] According to the present invention, a lane detection method based on global feature aggregation is provided, which performs dimensionality recovery and skip connections on the output sequences of multiple feature enhancements and the feature map to obtain a feature map after global feature aggregation, including: Dimension recovery is performed on the output sequence based on multiple feature enhancements to obtain an aggregated feature sequence; Based on the target dropout rate, a skip connection is performed between the aggregated feature sequence and the feature map to obtain the feature map after global feature aggregation: in, This represents the feature map after global feature aggregation. This indicates a discard rate of 0.2%. This represents the activation function. Indicates batch normalization, Represents two-dimensional convolution. Indicates a linear layer. Represents aggregated feature sequences. Represents the feature map.
[0065] In this embodiment of the invention, the average value of multiple feature-enhanced output sequences is used as the aggregated feature sequence. : in, Represents aggregated feature sequences. This indicates restoring the original one-dimensional sequence order. This represents the global features after gating enhancement. This represents the average value function.
[0066] Then pass through a linear layer and a 3 × 3 convolutional layer to... The feature map is transformed into a two-dimensional feature map and restored to its original size, resulting in a feature map with the same dimension F as the initial feature map. Finally, it is added as a skip connection with a dropout rate of 0.2. In the process, the enhanced feature map is obtained. .
[0067] in, Indicates the feature map height. Indicates the width of the feature map. This represents the original channel dimension of the feature map.
[0068] Through the embodiments of the present invention, by restoring the aggregated feature sequence to a two-dimensional structure (dimensional restoration) to preserve the spatial layout information of global modeling, and then making skip connections with the original feature map at the target drop rate, local details and global context are dynamically fused.
[0069] Step 1025: The feature map after global feature aggregation is decoded by the decoder to obtain the lane line detection result corresponding to the lane line image.
[0070] In this embodiment of the invention, the decoder recovers spatial details by fusing global aggregated feature maps with shallow high-resolution features, and generates pixel-level lane masks and instantiated curves by using a multi-branch prediction mechanism (semantic segmentation, instance embedding and key point regression).
[0071] The following describes an example of a lane detection method based on global feature aggregation provided by this invention in a practical application. Specifically, it includes the following steps.
[0072] Model training process: Input: CULane dataset DCU, pre-trained model MBASE Output: The trained lane detection model M; Initialization: Input image size is set to 288 × 800, initial learning rate is set to 2.5e-2; training is performed using an SGD optimizer with momentum of 0.9 and weight decay of 1e-4; batch size is set to 8; loss function consists of regular segmentation loss LBCE and classification loss LCE; a warm-up strategy is used for the first 500 batches of training, followed by a multinomial learning rate decay strategy with a power of 0.9; total number of training epochs is 12.
[0073] refer to Figure 2 , Figure 2 This is a schematic diagram illustrating the principle of the lane detection method based on Mamba-oriented global feature aggregation provided by the present invention. It includes: input, encoder, discrete rearrangement, four-way scanning, aggregator dimension reconstruction, decoder, and output. Step 1, as follows Figure 2 As shown, a batch of training images is input, and the ResNet34 encoder is used to extract features to obtain feature maps. .
[0074] refer to Figure 3 , Figure 3 This is a schematic diagram of aggregator modules provided by the present invention, which includes: feature diagrams Aggregator (including input, global modeling, and output) and feature map after global feature aggregation .
[0075] Step 2, as follows Figure 3 As shown, the feature map X after dimensional transformation is obtained by using the input module in the aggregator.
[0076] Step 3, as follows Figure 3As shown, the feature map X is discretized and rearranged using the global modeling (module) in the aggregator, resulting in... .
[0077] Step 4: Use the global modeling module in the aggregator to perform a selective scan of global features, obtaining the enhanced features. .
[0078] Step 5, combining the gated branches, yields .
[0079] Step 6: Use the output module in the aggregator to calculate The average value is obtained Then, the final enhanced feature map is obtained through dimensionality transformation. .
[0080] Step 7, as follows Figure 2 As shown, a decoder is used for... Decode the code and calculate the loss function L = LBCE + LCE.
[0081] Step 8: Update the model parameters W through backpropagation and optimization; Repeat the above steps, and after 12 iterations, save the parameters of the model with the best performance as the optimal model. .
[0082] Testing process: Step 1: Input the lane line image to be tested; Step 2: Perform forward inference using the trained optimal model; Step 3: Obtain the final lane line detection results.
[0083] refer to Figure 4 , Figure 4 This is a comparison chart of lane line detection results provided by the present invention, which includes the true value, RESA, and RSEA. + .
[0084] like Figure 4 As shown, RSEA + This is used to illustrate the actual effect of using the present invention to upgrade RSEA. + In scenarios where visual cues are not obvious, it significantly outperforms the original RSEA in detection performance.
[0085] This invention proposes a lane detection method based on Mamba-based global feature selective aggregation. By utilizing Mamba's selective scanning mechanism, it effectively enhances global context modeling capabilities while maintaining linear computational complexity, achieving a good balance between detection performance and efficiency. The Mamba-based global feature selective aggregator constructed in this invention can serve as a plug-and-play feature enhancement module for upgrading any existing mainstream encoder-decoder lane detection network.
[0086] In this embodiment of the invention, after the encoder extracts the local feature map of the lane line image, the two-dimensional features are first compressed into a one-dimensional sequence by the input module of the aggregator, making subsequent processing more efficient. Then, the global modeling module of the aggregator rearranges and selectively scans the sequence, breaking through the limitations of the receptive field of traditional convolution and realizing cross-regional global information interaction. Subsequently, the output module of the aggregator fuses the enhanced sequence with the original feature map through dimension recovery and skip connections, which not only preserves detailed information but also enhances the global context. Finally, the decoder integrates the optimized features, which significantly improves the ability to understand the lane line structure in complex scenes such as curves, occlusions, or low light, thereby comprehensively improving the detection accuracy.
[0087] The lane detection device based on global feature aggregation provided by the present invention will be described below. The lane detection device based on global feature aggregation described below can be referred to in correspondence with the lane detection method based on global feature aggregation described above.
[0088] refer to Figure 5 , Figure 5 This is a schematic diagram of the lane line detection device based on global feature aggregation provided by the present invention.
[0089] The acquisition module 501 is used to acquire lane line images; The lane line detection module 502 is used to input the lane line image into the lane line detection model and obtain the lane line detection result output by the lane line detection model, wherein the result includes: The lane line image is processed by an encoder to extract features and obtain a feature map. The feature map is dimensionally adjusted using the input module of the aggregator to obtain a one-dimensional feature sequence; The global modeling module of the aggregator performs sequence rearrangement and selective scanning on the one-dimensional feature sequence to form a global receptive field, resulting in multiple feature-enhanced output sequences. The aggregator's output module performs dimensionality recovery and skip connections with the feature map based on the output sequences of the multiple feature enhancements to obtain a feature map after global feature aggregation. The feature map after global feature aggregation is decoded by the decoder to obtain the lane line detection result corresponding to the lane line image.
[0090] Specifically, the lane detection device based on global feature aggregation provided by the present invention can implement all the method steps implemented in the above-mentioned lane detection method embodiment based on global feature aggregation, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0091] Figure 6 This is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as... Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630, and a communications bus 640, wherein the processor 610, the communications interface 620, and the memory 630 communicate with each other through the communications bus 640. The processor 610 can call logical instructions in the memory 630 to execute a lane detection method based on global feature aggregation. This method includes: acquiring a lane line image; inputting the lane line image into a lane line detection model to obtain a lane line detection result output by the lane line detection model, wherein the method includes: extracting features from the lane line image using an encoder to obtain a feature map; adjusting the dimension of the feature map using the input module of an aggregator to obtain a one-dimensional feature sequence; performing sequence rearrangement and selective scanning on the one-dimensional feature sequence using the global modeling module of the aggregator to form a global receptive field, obtaining multiple feature-enhanced output sequences; performing dimension recovery and skip connections based on the multiple feature-enhanced output sequences and the feature map using the output module of the aggregator to obtain a globally aggregated feature map; and decoding the globally aggregated feature map using a decoder to obtain the lane line detection result corresponding to the lane line image.
[0092] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0093] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the lane detection method based on global feature aggregation provided by the above methods. The method includes: acquiring a lane line image; inputting the lane line image into a lane line detection model to obtain a lane line detection result output by the lane line detection model, wherein the method includes: extracting features from the lane line image through an encoder to obtain a feature map; adjusting the dimension of the feature map through the input module of an aggregator to obtain a one-dimensional feature sequence; performing sequence rearrangement and selective scanning on the one-dimensional feature sequence through the global modeling module of the aggregator to form a global receptive field and obtain multiple feature-enhanced output sequences; performing dimension recovery and skip connections based on the multiple feature-enhanced output sequences and the feature map through the output module of the aggregator to obtain a feature map after global feature aggregation; and decoding the feature map after global feature aggregation through a decoder to obtain the lane line detection result corresponding to the lane line image.
[0094] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the lane detection method based on global feature aggregation provided by the above methods. This method includes: acquiring a lane line image; inputting the lane line image into a lane line detection model to obtain a lane line detection result output by the lane line detection model, wherein the method includes: extracting features from the lane line image using an encoder to obtain a feature map; adjusting the dimension of the feature map using an input module of an aggregator to obtain a one-dimensional feature sequence; performing sequence rearrangement and selective scanning on the one-dimensional feature sequence using a global modeling module of the aggregator to form a global receptive field, obtaining multiple feature-enhanced output sequences; performing dimension recovery and skip connections based on the multiple feature-enhanced output sequences and the feature map using an output module of the aggregator to obtain a feature map after global feature aggregation; and decoding the feature map after global feature aggregation using a decoder to obtain the lane line detection result corresponding to the lane line image.
[0095] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A lane detection method based on global feature aggregation, characterized in that, include: Acquire lane line images; The lane line image is input into the lane line detection model to obtain the lane line detection result output by the lane line detection model, which includes: The lane line image is processed by an encoder to extract features and obtain a feature map. The feature map is dimensionally adjusted using the input module of the aggregator to obtain a one-dimensional feature sequence; The global modeling module of the aggregator performs sequence rearrangement and selective scanning on the one-dimensional feature sequence to form a global receptive field, resulting in multiple feature-enhanced output sequences. The aggregator's output module performs dimensionality recovery and skip connections with the feature map based on the output sequences of the multiple feature enhancements to obtain a feature map after global feature aggregation. The feature map after global feature aggregation is decoded by the decoder to obtain the lane line detection result corresponding to the lane line image. The aggregator is a global feature-selective aggregator based on Mamba; The process of rearranging and selectively scanning the one-dimensional feature sequence to form a global receptive field yields multiple feature-enhanced output sequences, including: Discrete rearrangement of the one-dimensional feature sequence yields four new one-dimensional feature sequences: ; in, Indicates the first A new one-dimensional feature sequence This represents a discrete rearrangement operation. Represents a one-dimensional feature sequence; The four new one-dimensional feature sequences are selectively scanned repeatedly along both horizontal and vertical directions to form a global receptive field, resulting in four feature-enhanced output sequences. ; in, Indicates the first The output sequence with enhanced features This represents the state-space model of a Mamba-based global feature-selective aggregator. This represents one-dimensional convolution.
2. The lane line detection method based on global feature aggregation according to claim 1, characterized in that, The step of adjusting the dimension of the feature map to obtain a one-dimensional feature sequence includes: use The convolutional layer converts the feature map Channel dimension compressed to target channel dimension Then, a one-dimensional feature sequence is obtained through a linear layer. ,in, : ; in, Represents a one-dimensional feature sequence. Indicates a linear layer. This represents the activation function. Indicates batch normalization, express Two-dimensional convolution operation, Representing feature maps, Indicates the sequence length. Indicates the feature map height. Indicates the width of the feature map. Indicates the dimension of the target channel.
3. The lane line detection method based on global feature aggregation according to claim 1, characterized in that, The method further includes: Based on the enhanced output sequence and the one-dimensional feature sequence, a gating operation is performed to obtain the gated enhanced global features: ; in, Indicates the gating signal source. Represents a one-dimensional feature sequence. This represents the global features after gating enhancement. Indicates the first The output sequence with enhanced features This represents element-wise multiplication. This represents the activation function.
4. The lane line detection method based on global feature aggregation according to claim 1, characterized in that, The output sequence based on the multiple feature enhancements is combined with the feature map through dimensionality restoration and skip connections to obtain a feature map after global feature aggregation, including: Dimension recovery is performed on the output sequence of the multiple feature enhancements to obtain the aggregated feature sequence; Based on the target dropout rate, a skip connection is performed between the aggregated feature sequence and the feature map to obtain the feature map after global feature aggregation: ; in, This represents the feature map after global feature aggregation. This indicates a discard rate of 0.2%. This represents the activation function. Indicates batch normalization, Represents two-dimensional convolution. Indicates a linear layer. Represents aggregated feature sequences. Represents the feature map.
5. A lane detection device based on global feature aggregation, characterized in that, include: The acquisition module is used to acquire lane line images; A lane line detection module is used to input the lane line image into a lane line detection model and obtain the lane line detection result output by the lane line detection model, wherein the result includes: The lane line image is processed by an encoder to extract features and obtain a feature map. The feature map is dimensionally adjusted using the input module of the aggregator to obtain a one-dimensional feature sequence; The global modeling module of the aggregator performs sequence rearrangement and selective scanning on the one-dimensional feature sequence to form a global receptive field, resulting in multiple feature-enhanced output sequences. The aggregator's output module performs dimensionality recovery and skip connections with the feature map based on the output sequences of the multiple feature enhancements to obtain a feature map after global feature aggregation. The feature map after global feature aggregation is decoded by the decoder to obtain the lane line detection result corresponding to the lane line image. The aggregator is a global feature-selective aggregator based on Mamba; The global modeling module of the aggregator is specifically used for: Discrete rearrangement of the one-dimensional feature sequence yields four new one-dimensional feature sequences: ; in, Indicates the first A new one-dimensional feature sequence This represents a discrete rearrangement operation. Represents a one-dimensional feature sequence; The four new one-dimensional feature sequences are selectively scanned repeatedly along both horizontal and vertical directions to form a global receptive field, resulting in four feature-enhanced output sequences. ; in, Indicates the first The output sequence with enhanced features This represents the state-space model of a Mamba-based global feature-selective aggregator. This represents one-dimensional convolution.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the lane detection method based on global feature aggregation as described in any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the lane detection method based on global feature aggregation as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the lane detection method based on global feature aggregation as described in any one of claims 1 to 4.