A multi-task traffic scene detection algorithm based on an attention mechanism
By incorporating attention-based multi-task traffic scene detection into the detection algorithm, existing traffic problems are solved, efficient traffic scene detection is achieved, and the accuracy of traffic scene detection is improved.
Patent Information
- Application Number
- CN202310696843.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-13
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-06-13
AI Technical Summary
Existing traffic scene detection algorithms lack attention mechanisms, causing the network to fail to focus on important information. Furthermore, small convolutional kernels have small receptive fields, making it impossible to obtain global information about objects, which affects detection accuracy.
A multi-task traffic scene detection algorithm based on attention mechanism is adopted, using a shared encoder and three decoders. It combines a large convolutional kernel attention mechanism with the ELAN structure of YOLOv7, and performs feature fusion through a cross-stage spatial pyramid pooling module, a feature pyramid network and a path aggregation network. A segmentation enhancement module is added to improve lane line detection accuracy.
The accuracy of the multi-task perception model in traffic scenarios has been improved, especially the accuracy of lane detection. By using a large convolutional kernel attention mechanism and a multi-scale information interaction mechanism, the network's ability to detect important information has been enhanced.
Smart Images

Figure CN116958910B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of multi-task traffic scene detection, and in particular to a multi-task traffic scene detection algorithm based on an attention mechanism. BACKGROUND
[0002] In the past decade, great progress has been made in the fields of computer vision and deep learning, but vision-based tasks such as vehicle target detection, drivable area detection, and lane line detection are still challenging in traffic scene applications that require low cost and high precision. In recent years, multi-task learning-based methods have shown excellent performance in traffic scene perception problems, providing high-precision and high-efficiency solutions. Target detection plays an important role in providing information on the location and size of traffic obstacles, helping autonomous vehicles and road monitoring personnel make accurate and timely decisions; drivable area detection and lane line segmentation provide rich information for route planning and driving safety. Therefore, it is crucial to study traffic target detection, drivable area detection, and lane line detection tasks.
[0003] Each of these three tasks has a typical representative network, including but not limited to SSD series, R-CNN series, and YOLO series for target detection; ENet, PSPNet, and other networks for drivable area detection; SAD-ENet, SCNN, and other networks for lane line segmentation. Although the above networks can well achieve traffic target detection, drivable area, and lane line segmentation, passing the image through three cascaded networks in sequence will cause a significant delay, making the task processing time longer.
[0004] Patent No. CN202211141578.X proposes a multi-task panoramic driving perception method and system based on improved YOLOv5. The method first pre-processes the images in the data set to obtain input images; uses the improved YOLOv5 backbone network to extract the features of the input images to obtain feature maps; the backbone network is obtained by replacing the C3 module in the YOLOv5 backbone network with an inverted residual bottleneck module; the feature maps obtained by the neck network are fused with the feature maps obtained by the backbone network; the fused feature maps are input into the detection head for traffic target detection; the feature maps of the neck network are input into the branch network for lane line detection and drivable area segmentation.
[0005] However, the above traffic scene detection algorithm is based on a convolutional neural network as a basic module, lacks an attention mechanism, and cannot focus on important input information. In addition, current neural networks use small convolution kernels as the basis, and the small convolution kernel receptive field is relatively small, which cannot obtain global information of objects, thus resulting in poor algorithm performance. SUMMARY
[0006] The application aims to further improve the precision of the multi-task perception model of the traffic scene, and provides a multi-task traffic scene detection algorithm based on an attention mechanism.
[0007] To achieve the above-mentioned purpose, the application adopts the following technical solutions:
[0008] The multi-task traffic scene detection algorithm based on the attention mechanism comprises a shared encoder and three decoders; the shared encoder is composed of a backbone network and a neck network; the three decoders respectively complete the detection tasks of traffic targets, drivable areas and lane lines;
[0009] The backbone network is used for extracting features of an input image and comprises a convolution module, a feature extraction module and a down-sampling module; the convolution module is composed of a Conv convolution layer, a BatchNorm batch normalization layer and a SiLU activation function; the feature extraction module fuses a large-core attention mechanism and an ELAN structure, and builds a backbone network for feature extraction; the down-sampling module adds a down-sampling layer on the basis of the convolution module, forms two branches, and finally performs feature fusion through dimension addition, so that the channel number of the output feature map is twice that of the input, and the length and width of the output feature map are 1 / 2 of the input;
[0010] The neck network comprises a cross-stage spatial pyramid pooling module, a feature pyramid network and a path aggregation network; the cross-stage spatial pyramid pooling module is used for expanding a receptive field, fusing information of feature maps of different scales and completing feature fusion; in the process of feature map transmission, deep feature maps carry strong semantic features and weak position information, while shallow feature maps carry strong position information and weak semantic features; the feature pyramid network transmits the semantic features of the deep layers to the shallow layers, thereby enhancing the semantic expression of multiple scales; the path aggregation network transmits the position information of the shallow layers to the deep layers, thereby enhancing the positioning ability of multiple scales;
[0011] The specific process of the detection algorithm is as follows: the input of the network is a 640*640*3 RGB picture, which first enters the convolution module for feature transmission. In the second and fourth convolution modules, the feature map length and width are reduced by 1 / 2, and the output feature map length and width are 1 / 4 of the input. The feature map enters the feature extraction module and the down-sampling module for feature extraction. After three times of down-sampling, the output feature map length and width are reduced from 1 / 4 of the original image to 1 / 32 of the original image. Then the extracted feature map is sent to the neck network for multi-scale feature fusion. The traffic target detection module transmits the feature map to three traffic target detection heads of different sizes. Finally, three feature maps with sizes of (W / 8, H / 8, 256), (W / 16, H / 16, 512), and (W / 32, H / 32, 1024) are output. The input size of the drivable area detection module and the lane line detection module is (W / 8, H / 8, 128). The drivable area detection module includes a BottleneckCSP module for feature extraction and three down-sampling modules. After information transmission, the output feature map has a size of (W / 8, H / 8, 2). For the lane line detection module, the semantic information extracted by the backbone network is enriched by a segmentation enhancement module before input. The subsequent structure is the same as that of the drivable area detection module.
[0012] The main network of YOLOv7 is selected as the basic network structure, and the original ELAN structure is replaced with a feature extraction module based on this.
[0013] The ELAN structure is a high-efficiency layer aggregation network that can improve the learning ability of the network without destroying the original gradient path. It can also learn more diverse features by guiding the calculation of different feature groups. Since the LKA mechanism contains both self-attention mechanisms that can solve long-distance dependency problems and convolutional mechanisms that can utilize local context information, the LKA mechanism is combined with the ELAN structure in YOLOv7 to form a feature extraction module.
[0014] The feature extraction module includes four convolution modules and two LKA-Module layers. The input passes through two convolution modules, two convolution modules, and a LKA-Module layer in a cascading structure, respectively outputting feature maps with channel numbers o = i / 2, where o is the output channel number and i is the input channel number. Finally, the dimensions of the output feature maps are added.
[0015] The feature extraction module has two forms. One form is that the output channel number of the first two convolution modules is 1 / 2 of the input channel number, and the input and output channel numbers of the last two convolution modules are the same. The other form is that the output channel number of the first two convolution modules is 1 / 4 of the input channel number, and the input and output channel numbers of the last two convolution modules are the same.
[0016] The LKA-Module layer comprises a BatchNorm batch normalization layer and an attention module and a feedforward neural network module in a Transformer structure, and the attention module and the feedforward neural network module are cascaded to extract features; in order to prevent gradient explosion and accelerate model convergence, the input feature map is first subjected to batch normalization processing, and then enters the attention module and the feedforward neural network module;
[0017] The attention module is composed of a 1*1 convolution, a GELU activation function and an LKA module, the LKA module is a large kernel attention layer, which helps the network to selectively learn the input features;
[0018] The feedforward neural network module is composed of a 1*1 ordinary convolution, a 3*3 deep dilated convolution and a GELU activation function, wherein the dilated rate of the deep dilated convolution is equal to 3.
[0019] In the segmentation enhancement module, three different size convolution kernels of 7*7, 11*11 and 21*21 are added to interact multi-scale information, and the K*K convolution kernel is decomposed into a 1*K horizontal convolution kernel and a K*1 vertical convolution kernel to further reduce the computational complexity.
[0020] A gating mechanism is added in the segmentation enhancement module, which can selectively learn important information features by recalibrating the weight size of different channels; from the perspective of data flow, the input feature map of the model is first subjected to 1*1 ordinary convolution, and then subjected to deep convolution of 7*7, 11*11 and 21*21 to learn multi-scale information features, and then the output feature map is added to the original input feature map to obtain a new output feature map; in order to add the attention mechanism, the feature map is multiplied by the channel weight subjected to global average pooling to achieve the effect of selectively learning important channels, and in the training process, BatchNorm batch normalization layer and ReLU activation function are added to prevent overfitting.
[0021] The beneficial effects of the present application are: the present application firstly fuses the large convolution kernel attention mechanism with the ELAN structure proposed by YOLOv7 as a new backbone network, combines the large kernel attention mechanism with the multi-scale information fusion mechanism, and proposes a segmentation enhancement module for the lane line segmentation task, which is added after the backbone network and before the lane line detection segmentation head to further improve the accuracy of the lane line detection task. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 It is a schematic diagram of the overall structure of the algorithm of the present application;
[0023] Figure 2 It is a detection flowchart in the present application;
[0024] Figure 3Fig. 1 is a schematic diagram of one form of the LKA-ELAN module of the present application;
[0025] Figure 4 Fig. 2 is a schematic diagram of another form of the LKA-ELAN module of the present application;
[0026] Figure 5 Fig. 3 is a schematic diagram of the LKA-Module structure of the present application;
[0027] Figure 6 Fig. 4 is a schematic diagram of the SegMod module structure of the present application;
[0028] The present application will be described in detail with reference to the drawings, wherein the following examples are provided as a description of the present application. DETAILED DESCRIPTION
[0029] The principles and features of this application can be better understood when considered in connection with the accompanying figures. The figures are provided to illustrate embodiments of the application and to provide an understanding of the principles and features of the application. The figures are not provided to limit the scope of the application. In the following paragraphs, the principles and features of the application are described in more detail with reference to the figures. Advantages and features of the application will become apparent from the following description of the application with reference to the figures. It is to be understood that the figures are provided on a highly simplified basis and are not drawn to scale, but are used only to facilitate, clarify and aid in the explanation of the embodiments of the present application.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this description, the singular forms "a", "an" and "the" include plural references unless the context clearly dictates otherwise. The term "and / or" includes any and all combinations of one or more of the associated listed items.
[0031] The present application will be further described with reference to the figures and examples:
[0032] Currently, many researchers have designed multi-task learning networks (MultiNet, DLT-Net, YOLOP) in which an encoder-decoder architecture is used, and the decoders of the three detection tasks share the same encoder. Marvin Teichmann et al. first introduced the concept of multi-task into the field of traffic scene perception in the MultiNet network, which uses a VGG16 backbone structure as an encoder, then fuses the feature maps generated by the encoder, and finally sends them into ClassificationDecoder, DetectionDecoder and SegmentationDecoder three decoders to complete the target classification, target detection and lane line detection three tasks. Qian et al. first determined the detection task as traffic target detection, drivable area detection and lane line detection in the DLT-Net network, and proposed a context tensor to share the information of DrivableAreaDecoder with TrafficObjectDecoder and LanelineDecoder, which significantly improves the overall performance without increasing the computational overhead. Wu et al. first introduced the YOLO series network into the multi-task algorithm, using YOLOv5 as the backbone structure to complete the target detection task, and using the ENet network decoding structure to obtain the feature maps of lane line detection and drivable area detection, further realizing the lightweight and portability of the model, and bringing the multi-task learning of the traffic scene perception field into the YOLO era. Although many excellent networks have been proposed, the detection accuracy and other indicators of the proposed algorithm still need to be improved.
[0033] To further improve the accuracy of the multi-task traffic scene perception model, after in-depth study of the above methods, the present application proposes a multi-task traffic scene detection algorithm based on attention mechanism, which includes a shared encoder and three decoders; the shared encoder is composed of a backbone network (Backbone) and a neck network (Neck); the three decoders respectively complete the traffic target, drivable area and lane line detection tasks;
[0034] The backbone network is used to extract the features of the input image, including a convolution module (CBS), a feature extraction module (LKA-ELAN) and a down-sampling module (MP), the CBS is composed of a Conv convolution layer, a BatchNorm batch normalization layer and a SiLU activation function; the LKA-ELAN fuses a large kernel attention mechanism (LKA) and an ELAN structure, and builds a backbone network for feature extraction; the MP adds a down-sampling layer (MaxPooling) based on the CBS, forms two branches, and finally performs feature fusion by adding the dimensions, the output feature map channel number is twice that of the input, and the output feature map length and width are 1 / 2 of the input;
[0035] The neck network comprises a spatial pyramid pooling cross-stage partial (SPPCSP) module, a feature pyramid network (FPN), and a path aggregation network (PAN);
[0036] The SPPCSP functions to expand a receptive field, fuse information of feature maps of different scales, and complete feature fusion; in the process of feature map transmission, deep feature maps carry strong semantic features and weak position information, and shallow feature maps carry strong position information and weak semantic features; the FPN transmits deep semantic features to shallow layers, thereby enhancing semantic expression at multiple scales, and the PAN transmits position information of shallow layers to deep layers, thereby enhancing positioning capability at multiple scales;
[0037] The specific process of the detection algorithm is shown in FIGS. 1 to 3. Figure 1 、 Figure 2 As shown in FIGS. 1 to 3, the input of the network is an RGB picture of 640*640*3, which first enters the CBS for feature transmission; the length and width of the second and fourth CBS feature maps are reduced by 1 / 2, and the length and width of the output feature map are 1 / 4 of the input; the feature map enters the LKA-ELAN and the MP for feature extraction, and after three times of down-sampling, the length and width of the output feature map are reduced from 1 / 4 of the original image to 1 / 32 of the original image; then the extracted feature map is sent to the Neck for multi-scale feature fusion; the traffic target detection module transmits the feature map to three traffic target detection heads of different sizes; finally, three feature maps with sizes of (W / 8, H / 8, 256), (W / 16, H / 16, 512), and (W / 32, H / 32, 1024) are outputted; the input size of the drivable area detection module and the lane line detection module is (W / 8, H / 8, 128); the drivable area detection module comprises a BottleneckCSP module and three MPs for feature extraction; after information transmission, a feature map with a size of (W / 8, H / 8, 2) is outputted; for the lane line detection module, the semantic information extracted by the backbone network is first enriched by a segmentation enhancement module before input, and the subsequent structure is the same as that of the drivable area detection module.
[0038] The backbone network of YOLOv7 is selected as the basic network structure, and the original ELAN structure is replaced by the LKA-ELAN to construct an improved YOLOv7 backbone network.
[0039] The ELAN structure is a high-efficiency layer aggregation network, which can improve the learning ability of the network without destroying the original gradient path, and can also learn more diversified features by guiding the calculation blocks of different feature groups; since the LKA mechanism contains both the self-attention mechanism which can solve the long-distance dependence problem and the convolution which can utilize local context information, the LKA mechanism is fused with the ELAN structure in YOLOv7 to form LKA-ELAN;
[0040] The LKA-ELAN includes four CBS and two LKA-Module layers, and the input sequentially passes through two CBS, two CBS and a LKA-Module layer in a cascaded structure, and outputs feature maps with a channel number o = i / 2, where o is the output channel number (OutputChannel) and i is the input channel number (InputChannel), and finally the dimension of the output feature map is added;
[0041] The LKA-ELAN only aggregates all the layers in front of the last layer of the structure, which not only inherits the advantages of DenseNet in representing multiple features with multiple receptive fields, but also solves the problem of low efficiency of dense connection, and at the same time, compared with VoVNet, the large kernel attention mechanism is added to further improve the network performance.
[0042] The feature extraction module (LKA-ELAN) includes two forms, one form is that the output channel number of the first two convolution modules (CBS) is 1 / 2 of the input channel number, and the input and output channel numbers of the last two convolution modules (CBS) are the same, as shown in Figure 3 Another form is that the output channel number of the first two convolution modules (CBS) is 1 / 4 of the input channel number, and the input and output channel numbers of the last two convolution modules (CBS) are the same, as shown in Figure 4 .
[0043] As shown in Figure 5 , similar to the DETR and VAN algorithms, the LKA-Module layer includes a BatchNorm batch normalization layer and an attention module (Attention) and a feedforward neural network module (FeedForwardNetwork, FFN) in the Transformer structure, and the Attention and FFN are cascaded to perform feature extraction; in order to prevent gradient explosion and accelerate model convergence, the input feature map is first batch normalized, and then enters the Attention and FFN;
[0044] The Attention is composed of a 1*1 convolution, a GELU activation function and an LKA module, and the LKA module is a large kernel attention layer that helps the network selectively learn input features;
[0045] The FFN is composed of a 1*1 normal convolution, a 3*3 deep dilated convolution, and a GELU activation function, wherein the dilation rate (d) of the deep dilated convolution is equal to 3.
[0046] The attention mechanism can be regarded as an adaptive selection process that can select discriminative features and automatically ignore noise responses according to input features. The key step of the attention mechanism is to generate an attention feature map, which can represent the importance of different parts.
[0047] Currently, there are two methods to learn the relationship between different features.
[0048] The first is to use a self-attention mechanism to capture long-range dependencies. Although the self-attention mechanism is very effective in natural language processing, it still has three shortcomings when processing computer vision tasks: 1) it treats images as one-dimensional sequences during processing, ignoring the two-dimensional structure of images; 2) its computational complexity grows quadratically with the resolution of the input, which is costly for high-resolution image processing; 3) it only achieves spatial adaptability, while ignoring the adaptability of the channel dimension.
[0049] The second is the method used in the present application, which uses large convolution kernels to construct attention feature maps. As shown in Figure 4 Since adding large convolution kernels (17*17, 21*21, etc.) to the network will cause the network computation to explode, which is not conducive to the increase of model depth, in the LKA module, the K*K convolution kernel is replaced by a (2d-1)*(2d-1) deep convolution, a (K / d)*(K / d) deep dilated convolution, and a 1*1 normal convolution, wherein the deep convolution and the deep dilated convolution both use grouped convolution, and the number of groups is equal to the number of input channels. Through the above operations, the receptive field can be increased while reducing the number of parameters to obtain more global features, and then the input is multiplied by the output processed by the large convolution kernel to add the attention mechanism, which can better selectively learn the input features.
[0050] In the multi-task traffic scene detection algorithm, there are two detection tasks related to segmentation, namely the drivable area detection and lane line detection tasks. Although the two downstream segmentation tasks are also improved after replacing the large kernel attention backbone network, the lane line detection accuracy is improved to a smaller extent, so a segmentation enhancement module containing a large convolution kernel and a multi-scale information interaction mechanism is proposed to improve the lane line segmentation effect.
[0051] In the process of comparing part of the classic semantic segmentation model (DeepLabV3+, SETR, SegNeXt), it is found that a successful semantic segmentation model should first have a powerful backbone network. Considering the particularity of the multi-task traffic scene detection algorithm that multiple detection tasks share a backbone network, no changes are made to improve the performance of the lane line segmentation of the model. Second, it should have the characteristics of multi-scale information interaction. Unlike image classification tasks that mainly identify single objects, semantic segmentation is a dense prediction task that needs to handle detection objects of different sizes in a single image. Therefore, three different size convolution kernels, 7*7, 11*11, and 21*21, are added to the segmentation enhancement module for multi-scale information interaction. At the same time, the K*K convolution kernel is decomposed into a 1*K horizontal convolution kernel and a K*1 vertical convolution kernel to further reduce the computational complexity. Third, it should have an attention mechanism to better select input features.
[0052] Similar to SENet, a gating mechanism is added to the segmentation enhancement module to enable the model to selectively learn important information features by recalibrating the weight size of different channels. As shown in Figure 6 from the perspective of data flow, the input feature map of the model first passes through a 1*1 normal convolution, then passes through 7*7, 11*11, and 21*21 deep convolutions to learn multi-scale information features, and then the output feature map is added to the original input feature map to obtain a new output feature map. To add an attention mechanism, multiply the feature map by the channel weight after global average pooling (GAP), which achieves the effect of selectively learning important channels. During training, BatchNorm batch normalization layer and ReLU activation function are added to prevent overfitting.
[0053] The present application first combines the large kernel attention mechanism with the ELAN structure proposed by YOLOv7 as a new backbone network.
[0054] At the same time, the present application combines the large kernel attention mechanism with the multi-scale information fusion mechanism to propose a segmentation enhancement module for the lane line segmentation task. The module is added after the backbone network and before the lane line detection segmentation head to further improve the accuracy of the lane line detection task.
[0055] The above exemplary description of the present application is made in conjunction with the accompanying drawings, and it is obvious that the specific implementation of the present application is not limited by the above method. Any improvement or direct application to other fields using the method concept and technical solution of the present application is within the scope of protection of the present application.
Claims
1. An attention mechanism-based multi-task traffic scene detection algorithm, characterized in that, it comprises a shared encoder and three decoders; the shared encoder is composed of a backbone network and a neck network; the three decoders respectively complete the traffic target, drivable area and lane line detection tasks; the backbone network is used for extracting features of an input image and comprises a convolution module, a feature extraction module and a down-sampling module; the convolution module is composed of a Conv convolution layer, a BatchNorm batch normalization layer and a SiLU activation function; the feature extraction module fuses a large kernel attention mechanism and an ELAN structure and builds a backbone network for feature extraction; the down-sampling module adds a down-sampling layer to the convolution module to form two branches; finally, the features are fused by adding the dimensions, the number of channels of the output feature map is twice that of the input, and the length and width of the output feature map are 1 / 2 of the input; the backbone network of YOLOv7 is selected as the basic network structure, and the original ELAN structure is replaced with the feature extraction module on this basis to build an improved YOLOv7 backbone network; the ELAN structure is an efficient layer aggregation network that can improve the learning ability of the network without destroying the original gradient path and can also learn more diverse features by guiding the calculation blocks of different feature groups; since the LKA mechanism contains both the self-attention mechanism that can solve the long-distance dependence problem and the convolution that can utilize local context information, the LKA mechanism is fused with the ELAN structure in YOLOv7 to form a feature extraction module; the feature extraction module comprises four convolution modules and two LKA-Module layers; the input successively passes through two convolution modules, two convolution modules and a LKA-Module layer in a cascaded structure, and outputs feature maps with a channel number o = i / 2, wherein o is the output channel number and i is the input channel number; finally, the dimensions of the output feature maps are added; the neck network comprises a cross-stage spatial pyramid pooling module, a feature pyramid network and a path aggregation network; the cross-stage spatial pyramid pooling module expands the receptive field and fuses the information of feature maps of different scales to complete feature fusion; during the transmission of feature maps, deep feature maps carry strong semantic features and weak position information, while shallow feature maps carry strong position information and weak semantic features; the feature pyramid network transmits deep semantic features to shallow layers to enhance semantic expression at multiple scales; the path aggregation network transmits position information from shallow layers to deep layers to enhance positioning ability at multiple scales; The specific process of the detection algorithm is as follows: the input of the network is a 640*640*3 RGB picture, which first enters the convolution module for feature transmission, and the feature map is reduced by 1 / 2 in length and width at the 2nd and 4th convolution modules, and the output feature map is 1 / 4 of the input in length and width. The feature map enters the feature extraction module and the down-sampling module for feature extraction. After three times of down-sampling, the length and width of the output feature map are reduced from 1 / 4 of the original image to 1 / 32 of the original image. Then the extracted feature map is sent to the neck network for multi-scale feature fusion. The traffic target detection module transmits the feature map into three traffic target detection heads of different sizes. Finally, three feature maps with sizes of (W / 8, H / 8, 256), (W / 16, H / 16, 512) and (W / 32, H / 32, 1024) are outputted. The input size of the drivable area detection module and the lane line detection module is (W / 8, H / 8, 128). The drivable area detection module contains a BottleneckCSP module for feature extraction and three down-sampling modules. After information transmission, the output size of the input is (W / 8, H / 8, 2). For the lane line detection module, the semantic information extracted by the backbone network is enriched by the segmentation enhancement module before input, and the subsequent structure is the same as that of the drivable area detection module.
2. The multi-task traffic scene detection algorithm based on the attention mechanism according to claim 1, wherein The feature extraction module includes two forms. One form is that the output channel number of the first two convolution modules is 1 / 2 of the input channel number, and the input and output channel numbers of the last two convolution modules are the same. The other form is that the output channel number of the first two convolution modules is 1 / 4 of the input channel number, and the input and output channel numbers of the last two convolution modules are the same.
3. The multi-task traffic scene detection algorithm based on the attention mechanism according to claim 2, wherein The LKA-Module layer includes a BatchNorm batch normalization layer and an attention module and a feedforward neural network module in a Transformer structure, the attention module and the feedforward neural network module are cascaded to extract features, and the input feature map is first subjected to batch normalization processing to prevent gradient explosion and accelerate model convergence before entering the attention module and the feedforward neural network module; The attention module is composed of a 1*1 convolution, a GELU activation function and an LKA module. The LKA module is a large kernel attention layer, which helps the network to selectively learn the input features. The feedforward neural network module is composed of a 1*1 ordinary convolution, a 3*3 deep dilated convolution and a GELU activation function, wherein the dilated rate of the deep dilated convolution is equal to 3.
4. The multi-task traffic scene detection algorithm based on the attention mechanism according to claim 3, wherein In the segmentation enhancement module, three different size convolution kernels of 7*7, 11*11 and 21*21 are added at the same time to interact multi-scale information, and the K*K convolution kernel is decomposed into 1*K horizontal convolution kernel and K*1 vertical convolution kernel to further reduce the computational complexity.
5. The multi-task traffic scene detection algorithm based on the attention mechanism according to claim 4, characterized in that, In the segmentation enhancement module, a gating mechanism is added to enable the model to selectively learn important information features by recalibrating the weight size of different channels. From the perspective of data flow, the input feature map of the model is first subjected to 1*1 ordinary convolution, then subjected to deep convolution of 7*7, 11*11 and 21*21 to learn multi-scale information features, and then the output feature map is added to the original input feature map to obtain a new output feature map. To add the attention mechanism, the feature map is multiplied by the channel weight subjected to global average pooling to achieve the effect of selectively learning important channels. In the training process, a BatchNorm batch normalization layer and a ReLU activation function are added to prevent overfitting.
Citation Information
Patent Citations
Multi-task panoramic driving perception method and system based on improved YOLOv5
CN115223130A