Driving area detection method and device, computer equipment and storage medium
The method improves drivable area detection accuracy by using a target model with channel and spatial attention models and an adversarial network to enhance feature maps, addressing the robustness issues of existing models under varying lighting and climate conditions.
Patent Information
- Application Number
- CN202411198184.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-17
AI Technical Summary
Current deep learning models for drivable area detection, such as DeepLabv3, suffer from insufficient robustness and accuracy due to changes in lighting and climate conditions, leading to reduced detection performance.
A method involving a target model with an encoder and decoder, utilizing a channel and spatial attention model to enhance multi-scale feature maps, and an adversarial network for training, to improve drivable area detection accuracy.
Enhances the accuracy of drivable area detection by effectively suppressing irrelevant features and emphasizing relevant ones, leading to precise classification of driving areas.
Smart Images

Figure CN119152260A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image detection technology, and in particular to a driving area detection method, device, computer equipment and storage medium. Background Art
[0002] With the popularity of deep learning models, more and more models have emerged for the detection of drivable areas. For example, FCN (Fully Convolutional Network), SegNet (Segmentation Network), U-Net (U-Net), and DeepLabv3 (DeepLab Version 3, the third generation model of the Deep Lab). However, the current models have high requirements for the driving environment (for example, climate environment, lighting conditions, road conditions, etc.). The accuracy of the output of each model is prone to significant decline due to changes in the driving environment.
[0003] Taking DeepLabv3, which has the best performance among the above-listed models, as an example, when detecting drivable areas, it cannot identify changes in lighting conditions and climate conditions in a timely manner. Therefore, when lighting conditions and / or climate conditions change, DeepLabv3 has insufficient detection accuracy due to insufficient robustness. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for detecting a drivable area in order to improve the detection accuracy of the drivable area in response to the above technical problems.
[0005] In a first aspect, an embodiment of the present application provides a method for detecting a driving area, comprising:
[0006] Acquire an image to be detected, and input the image to be detected into a target model; wherein the target model includes an encoder and a decoder;
[0007] In the encoder, based on the first feature map, a second feature map is generated, and the second feature map is processed by using an attention model to obtain a third feature map; wherein the first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder, the receptive fields of the pixels in the second feature map are not all the same, and the attention model includes a channel attention model and a spatial attention model;
[0008] The first feature map and the third feature map are input into the decoder to obtain the driving area in the image to be detected.
[0009] In one of the embodiments, in the attention model, the channel attention model and the spatial attention model are sequentially connected;
[0010] Then the step of processing the second feature map using the attention model to obtain a third feature map includes:
[0011] Processing the second feature map through the channel attention model to generate a channel attention coefficient, and generating a fourth feature map based on the channel attention coefficient and the second feature map;
[0012] The fourth feature map is processed by the spatial attention model to generate a spatial attention coefficient, and the third feature map is generated based on the spatial attention coefficient and the second feature map.
[0013] In one embodiment, processing the second feature map by the channel attention model to generate a channel attention coefficient includes:
[0014] In the channel attention model, the second feature map is subjected to dimensionality reduction processing by a first convolution process and a first reshape function to obtain a first sub-feature map, and,
[0015] Performing feature compression on the second feature map through a second convolution process and a second reshape function to obtain a second sub-feature map; wherein the dimensionality reduction process indicates compressing the channel features of the second feature map, and the feature compression indicates compressing the height features and width features of the second feature map;
[0016] Normalizing the second sub-feature map, and multiplying the third sub-feature map obtained by the normalization process with the first sub-feature map to obtain a fourth sub-feature map; wherein the fourth sub-feature map indicates the attention distribution of the channel in the second feature map;
[0017] Based on the attention distribution, a channel attention coefficient is determined.
[0018] In one embodiment, processing the fourth feature map by the spatial attention model to generate a spatial attention coefficient includes:
[0019] In the spatial attention model, the fourth feature map is processed by a fourth convolution process, a pooling process, and a third reshape function to obtain a fifth sub-feature map, and the fourth feature map is processed by the fourth convolution process and a fourth reshape function to obtain a sixth sub-feature map;
[0020] The fifth sub-feature map is normalized and multiplied with the sixth sub-feature map, and the spatial attention coefficient is obtained through the fifth reshape function and normalization.
[0021] In one embodiment, in the encoder, generating a second feature map based on the first feature map includes:
[0022] Processing the image to be detected by the convolutional neural network in the encoder to obtain the first feature map; wherein the convolutional neural network in the encoder is connected to the expanded spatial pyramid pooling ASPP;
[0023] The first feature map is processed by the ASPP to obtain the second feature map.
[0024] In one embodiment, the target model is trained in the following manner:
[0025] Based on the model to be trained corresponding to the target model, an adversarial network is constructed, and a training image set is obtained; wherein the adversarial network is composed of a discriminator and a generator including the model to be trained, and the training image set includes training images and preset labels corresponding to the training images, and the preset labels indicate area information of a driving area in the training images;
[0026] In the adversarial network, the training image is processed by the generator to obtain a model label corresponding to the driving area in the training image, and the model label and the preset label are processed by the discriminator;
[0027] Based on the objective function of the adversarial network, the parameters of the adversarial network are optimized until the first parameter change value of the generator is less than the first preset change threshold, and the second parameter change value of the discriminator is less than the second preset change threshold, to obtain a target adversarial network; then the generator in the target adversarial network is the target model.
[0028] In one embodiment, the step of inputting the first feature map and the third feature map into the decoder to obtain the driving area in the image to be detected includes:
[0029] In the decoder, performing feature fusion on the first feature map and the third feature map to obtain a fused feature map;
[0030] Upsampling the fused feature map to obtain a fifth feature map of a preset resolution;
[0031] The pixel points in the fifth feature map are classified into two categories to obtain the driving area.
[0032] In a second aspect, an embodiment of the present application provides a driving area detection device, the device comprising:
[0033] An image module, used for acquiring an image to be detected and inputting the image to be detected into a target model; wherein the target model includes an encoder and a decoder;
[0034] A feature module, used in the encoder to generate a second feature map based on the first feature map, and use an attention model to process the second feature map to obtain a third feature map; wherein the first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder, the receptive fields of the pixels in the second feature map are not all the same, and the attention model includes a channel attention model and a spatial attention model;
[0035] The area module is used to input the first feature map and the third feature map into the decoder to obtain the driving area in the image to be detected.
[0036] In one of the embodiments, in the attention model, the channel attention model and the spatial attention model are connected sequentially; then the feature module is specifically used to process the second feature map through the channel attention model to generate a channel attention coefficient, and generate a fourth feature map based on the channel attention coefficient and the second feature map; process the fourth feature map through the spatial attention model to generate a spatial attention coefficient, and generate the third feature map based on the spatial attention coefficient and the second feature map.
[0037] In one embodiment, the feature module is specifically used to, in the channel attention model, perform dimensionality reduction processing on the second feature map through a first convolution processing and a first reshape function to obtain a first sub-feature map, and perform feature compression on the second feature map through a second convolution processing and a second reshape function to obtain a second sub-feature map; wherein the dimensionality reduction processing indicates compressing the channel features of the second feature map, and the feature compression indicates compressing the height features and width features of the second feature map; normalizing the second sub-feature map, and multiplying the third sub-feature map obtained by the normalization processing with the first sub-feature map to obtain a fourth sub-feature map; wherein the fourth sub-feature map indicates the attention distribution of the channel in the second feature map; and determining the channel attention coefficient based on the attention distribution.
[0038] In one embodiment, the feature module is also used in the spatial attention model to process the fourth feature map through a fourth convolution process, a pooling process and a third reshape function to obtain a fifth sub-feature map, and to process the fourth feature map through the fourth convolution process and a fourth reshape function to obtain a sixth sub-feature map; normalize the fifth sub-feature map, multiply it with the sixth sub-feature map, and obtain the spatial attention coefficient through the fifth reshape function and normalization process.
[0039] In one embodiment, the feature module is also used to process the image to be detected through the convolutional neural network in the encoder to obtain the first feature map; wherein the convolutional neural network in the encoder is connected to the expanded spatial pyramid pooling ASPP; the first feature map is processed by the ASPP to obtain the second feature map.
[0040] In one embodiment, the device also includes a training module, which is specifically used to construct an adversarial network based on a model to be trained corresponding to the target model, and obtain a training image set; wherein the adversarial network is composed of a discriminator and a generator containing the model to be trained, and the training image set includes training images and preset labels corresponding to the training images, and the preset labels indicate the area information of the driving area in the training images; in the adversarial network, the training images are processed by the generator to obtain a model label corresponding to the driving area in the training image, and the model label and the preset label are processed by the discriminator; the parameters of the adversarial network are optimized based on the objective function of the adversarial network until the first parameter change value of the generator is less than the first preset change threshold, and the second parameter change value of the discriminator is less than the second preset change threshold, so as to obtain a target adversarial network; then the generator in the target adversarial network is the target model.
[0041] In one of the embodiments, the area module is specifically used in the decoder to perform feature fusion on the first feature map and the third feature map to obtain a fused feature map; upsample the fused feature map to obtain a fifth feature map of a preset resolution; and perform binary classification on the pixels in the fifth feature map to obtain the driving area.
[0042] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect and any possible implementation method when executing the computer program.
[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method described in the first aspect and any possible implementation manner are implemented.
[0044] The above-mentioned driving area detection method, device, computer equipment and storage medium input the image to be detected into the target model, and use the attention model in the encoder to enhance the multi-scale feature map (i.e., the second feature map) from the channel dimension and the spatial dimension, so as to fuse the bottom-level output feature map (the first feature map) and the third feature map obtained by the feature enhancement of the attention model in the decoder. Since the channel features and spatial features in the third feature map that are not related to the driving area are effectively suppressed, and the channel features and spatial features related to the driving area are significantly enhanced, the decoder can be enabled to accurately classify the fused feature map obtained by fusion, accurately identify the pixel points belonging to the driving area, thereby effectively improving the accuracy of the detected driving area. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A diagram showing an application environment of a method for detecting a driving area in an embodiment;
[0046] Figure 2 is a schematic flow chart of a method for detecting a driving area in one embodiment;
[0047] Figure 3 is a schematic diagram of the structure of a target model in an embodiment;
[0048] Figure 4 A schematic flow chart of a method for processing a second feature map by using an attention model in one embodiment;
[0049] Figure 5 A schematic diagram of a process of processing a multi-scale feature map (i.e., a second feature map) by an attention model in one embodiment;
[0050] Figure 6 Schematic diagram of the structure of a channel attention model in one embodiment;
[0051] Figure 7 is a schematic diagram of the structure of a spatial attention model in one embodiment;
[0052] Figure 8 A flowchart of a method for training a model to be trained to obtain a target model in an embodiment;
[0053] Fig. 9 A schematic diagram of the structure of an adversarial network in one embodiment
[0054] Fig.10is a structural block diagram of a detection device for a driving area in an embodiment;
[0055] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0056] The technical solution of the present application is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations on the technical solution of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other.
[0057] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
[0058] The driving area detection method provided in this application can be applied to Figure 1 In the application environment shown.
[0059] The terminal 102 communicates with the server 104 via a network. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices equipped with cameras, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0060] In one embodiment, in order to facilitate the maintenance of the target model and reduce the storage and computing pressure of the terminal 102, the terminal 102 can be used to collect the image to be detected and send the image to be detected to the server 104 through the network, so that the server 104 can use the target model to accurately and efficiently identify the driving area after receiving the image to be detected. Then, the regional information of the driving area is sent to the terminal 102, so that the vehicle can plan the route according to the regional information. This embodiment is particularly suitable for vehicles whose driving environment is mostly urban.
[0061] To avoid the problem of reduced detection efficiency of the driving area due to poor network transmission performance, in one embodiment, the terminal 102 downloads and stores the target model from the server 104 via the network to directly detect the driving area in the collected image to be detected.
[0062] The terminal 102 obtains information from the server 104 at a preset time interval (e.g., one month, etc.) whether the target model is updated, so as to download the update package in time in the server 104 and update the local target model in the terminal 102. This embodiment is particularly suitable for long-distance vehicles whose driving environment is mostly suburban and national highways.
[0063] In one embodiment, Figure 2 As shown, a method for detecting a driving area is provided, comprising the following steps:
[0064] Step 201: Acquire an image to be detected and input the image to be detected into a target model.
[0065] Among them, the target model includes an encoder and a decoder.
[0066] The image to be detected can be obtained by collecting images of the road on which the vehicle is traveling using a camera device.
[0067] The image to be detected includes a road including a driving area (ie, a driving area), and facilities around the road, such as green belts, buildings, speed limit signs, and the like.
[0068] Step 202: In the encoder, based on the first feature map, a second feature map is generated, and the second feature map is processed using the attention model to obtain a third feature map.
[0069] The first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder. The second feature map is a multi-scale feature map, and the receptive fields of the pixels in the second feature map are not all the same.
[0070] The meaning of the receptive field is the area size of the input image corresponding to an element on the output feature map of a certain layer in the convolutional neural network. In the convolutional neural network, some layers output feature maps with high resolution and small receptive field, focusing on capturing detail information; some layers output feature maps with moderate resolution and receptive field, balancing detail and context information; some layers output feature maps with low resolution and large receptive field, focusing on capturing context information...
[0071] Therefore, the second feature map (i.e., multi-scale feature map) output by the above convolutional neural network is actually a fusion of the feature maps output by multiple layers in the convolutional neural network. The second feature map includes different levels of information from details to the whole in the image to be detected. It includes pixels corresponding to the same size of the detection area in the image to be detected, and also includes pixels corresponding to different sizes of the detection area in the image to be detected.
[0072] In an embodiment of the present application, the method for generating the second feature map (i.e., a multi-scale feature map) includes but is not limited to: BiFPN (Bidirectional Feature Pyramid Network), FPN (Feature Pyramid Network), T-FPN (Transformer-based Feature Pyramid Network) and ASPP.
[0073] The above convolutional neural network can be DCNN (Deep Convolutional Neural Networks).
[0074] In one embodiment, the encoder includes: a DCNN, and an ASPP (Atrous Spatial Pyramid Pooling) module connected to the DCNN. The generation of the first feature map and the second feature map is first described below:
[0075] Please refer to Figure 3 The encoder part in the encoder can first process the image to be detected through the deep convolutional network in the encoder to obtain a first feature map. The features in the first feature map are low-level features in the image to be detected.
[0076] Then, the first feature map is processed separately by multiple convolutional layers and pooling layers in ASPP and then fused to obtain a multi-scale feature map: the second feature map.
[0077] Furthermore, the above-mentioned attention model includes a channel attention model and a spatial attention model. In order to perform feature enhancement more efficiently and to capture the long-term dependencies between multi-scale channels in the multi-scale feature map (i.e., the second feature map), in one embodiment, the channel attention model and the spatial attention model are sequentially connected in the attention model, so that the channel attention model can first more accurately identify important channel features based on global features, such as channel features such as road boundary features, texture features, and color features; and the spatial attention model can accurately and efficiently focus on important local features, such as lane lines, on this basis; this connection method can also effectively avoid the problem of the spatial attention model over-focusing on the local features in the second feature map caused by the introduction of the spatial attention model first or the introduction of the spatial attention model and the channel attention model at the same time, thereby avoiding the reduction in the accuracy of the detection results, and avoiding the problem of reduced convergence speed of the attention model and reduced detection efficiency due to excessive focus on local features.
[0078] The following first describes in detail how to generate the third feature map through the attention model in the attention model. Please refer to Figure 4 :
[0079] Step 401: Process the second feature map through the channel attention model to generate a channel attention coefficient, and generate a fourth feature map based on the channel attention coefficient and the second feature map.
[0080] The channel attention model is based on the channel attention mechanism and can identify channel features that are irrelevant to road segmentation (i.e., detecting driving areas) and channel features that are influential to road segmentation by processing the second feature map, thereby suppressing channel features that are irrelevant to road segmentation (i.e., detecting driving areas) in the second feature map through the channel attention coefficient, and increasing the attention to channel features that are influential to road segmentation in the second feature map.
[0081] Taking the second feature map C×H×W as an example, the generation of channel attention coefficients is described in detail:
[0082] First, in the channel attention model, the second feature map is processed by the first convolution process and the second convolution process respectively. Specifically, the first convolution process and the first reshape function perform dimensionality reduction processing on the second feature map (C×H×W) to obtain the first sub-feature map.
[0083] And, the second feature map (C×H×W) is feature compressed through a second convolution process and a second reshape function to obtain a second sub-feature map.
[0084] The above-mentioned dimensionality reduction processing is to reduce the channel dimension, while the width feature and the height feature remain unchanged, that is, the channel feature in the second feature map is compressed; the feature compression is to compress the width and height features, while the channel feature remains unchanged, that is, the height feature and the width feature of the second feature map are compressed.
[0085] The sizes of the first sub-feature map and the second sub-feature map are preferably adapted to the subsequent product operation. For example, the size of the first sub-feature map may be (C / 2×1×1), and the size of the second sub-feature map may be (HW×1×1).
[0086] Then, the second sub-feature map is normalized to obtain a third sub-feature map. Specifically, the second sub-feature map may be processed by an activation function softmax to normalize the feature values in the second sub-feature map to obtain the third sub-feature map.
[0087] Next, the third sub-feature map obtained by normalization is multiplied with the first sub-feature map, that is, the third sub-feature map is multiplied element by element with the first sub-feature map to obtain a fourth sub-feature map of the same size as the first sub-feature map, and the fourth sub-feature map represents the attention distribution of the channel features in the second feature map.
[0088] Finally, based on the attention distribution, the channel attention coefficient is determined. Specifically, the fourth feature map is convolved through a 1×1 convolution layer, and the sub-feature map obtained by the convolution is processed through Layer Normaliztion to obtain a feature map (C×1×1). After that, the feature map (C×1×1) is processed using sigmoid to obtain the attention coefficient.
[0089] Furthermore, after determining the channel attention coefficient, the channel attention coefficient can be applied to suppress channel features that are irrelevant to the detected driving area, thereby obtaining the fourth feature map. Figure 5 , the channel attention coefficient can be multiplied with the second feature map (i.e., the multi-scale feature map), that is, the channel attention coefficient is dot-multiplied with the eigenvalue in the second feature map to obtain the fourth feature map (C×H×W).
[0090] Figure 6 A schematic diagram of the structure of a channel attention model provided in an embodiment is shown below. Figure 6 The channel attention model structure shown in the figure illustrates the determination of the fourth feature map:
[0091] The channel attention model first includes two Conv(1×1) (Convolutional Layer(1×1), 1×1 convolution (layer)), corresponding to the sub-feature map of the Conv(1×1) output (C / 2×1×1) of the first convolution processing, and the sub-feature map of the Conv(1×1) output (1×H×W) of the second convolution processing.
[0092] Next, the sub-feature graphs are processed by the first reshape function and the second reshape function respectively to obtain a first sub-feature graph with a size of (C / 2×1×1) and a second sub-feature graph with a size of (HW×1×1).
[0093] Next, the second sub-feature map is normalized by the softmax function, and the third sub-feature map obtained by the normalization is multiplied by the first sub-feature map, and then passed through a convolution module containing ConV (1×1), LayerNorm (LayerNormalization), and sigmoid function to obtain the channel attention coefficient.
[0094] The channel attention coefficient is multiplied by the eigenvalue in the second feature map to obtain a fourth feature map with the same size as the second feature map.
[0095] Step 402: Process the fourth feature map through the spatial attention model to generate a spatial attention coefficient, and generate a third feature map based on the spatial attention coefficient and the second feature map.
[0096] The spatial attention model processes the fourth feature map to accurately identify the features of important positions in the spatial dimension and dynamically adjust the importance of features at different positions, thereby improving the accuracy of the features in the third feature map.
[0097] In one embodiment, two 1×1 convolution layers are set in the spatial attention model to perform a fourth convolution process on the fourth feature map (C×H×W) to achieve feature extraction, so as to obtain two sub-feature maps of size (C / 2×H×W). Specifically, the fourth feature map can be processed by the fourth convolution process, the pooling process and the third reshape function to obtain a fifth sub-feature map (C / 2×1×1), and the fourth feature map can be processed by the fourth convolution process and the fourth reshape function to obtain a sixth sub-feature map (C / 2×HW);
[0098] Then, the sub-feature map obtained by normalizing the fifth sub-feature map is multiplied by the sixth sub-feature map, and the spatial attention coefficient (1×H×W) is obtained through the fifth reshape function and normalization.
[0099] For further information, please refer to Figure 5 , after determining the spatial attention coefficient, the spatial attention coefficient can be multiplied by the second feature map to obtain the third feature map.
[0100] Figure 7 A schematic diagram of the structure of a channel attention model provided in an embodiment is shown below. Figure 7 The spatial attention model structure shown illustrates the determination of the fourth feature map:
[0101] After the fourth feature map is input into the spatial attention model, it undergoes Conv (1×1), Global pooling (global pooling) and the third reshape processing corresponding to the fourth convolution processing in sequence to obtain the fifth sub-feature map (C / 2×1×1).
[0102] In addition, the fourth feature map is sequentially processed by Conv(1×1) corresponding to the fourth convolution process and the fourth reshape function to obtain a sixth sub-feature map (C / 2×HW).
[0103] Next, the fifth sub-feature map is normalized by the softmax function, and the sub-feature map obtained by normalization is multiplied by the sixth sub-feature map to obtain a sub-feature map (1×HW). After the sub-feature map (1×HW) is processed by the fifth reshape function, it is normalized by Sigmoid to obtain the spatial attention coefficient.
[0104] The spatial attention coefficient is multiplied (i.e., dot product) by the eigenvalue in the multi-scale feature map (i.e., the second feature map) to obtain the third feature map.
[0105] Step 203: Input the first feature map and the third feature map into the decoder to obtain the driving area in the image to be detected.
[0106] Specifically, in the decoder, the first feature map and the third feature map may be firstly fused to obtain a fused feature map. Figure 3 First, the first feature map containing shallow features is further convolved to obtain the sixth feature map, and then the sixth feature map and the sixth feature map obtained by upsampling the third feature map are feature spliced to achieve feature fusion and obtain a fused feature map.
[0107] Then, the fused feature map is upsampled to obtain a fifth feature map of a preset resolution. The size and resolution of the fifth feature map are the same as those of the image to be detected.
[0108] Finally, the pixels in the fifth feature map are classified into two categories to obtain the driving area. Specifically, the pixels can be divided into two categories. The pixels in the first category correspond to the driving area, and the pixels in the second category correspond to the non-driving area. After the classification, the area formed by the pixels in the first category can be determined as the driving area. The driving area can be marked in the image to be detected and output.
[0109] In one embodiment, the driving area may be directly displayed in a simulation image used for navigation, that is, the driving area may be directly marked in a 2D or 3D road image for the driver's driving reference.
[0110] Furthermore, in order to improve the background modeling ability of the target model, reduce the interference of the unbalanced data of the unstructured road on the target model, and improve the robustness of the target model, so that it has a strong resistance to disturbances (for example, environmental changes), that is, in scenes such as unstructured roads, the accuracy of its detection results can be unaffected or basically unaffected, so as to further improve the accuracy of the driving area detected by the target model; the following provides a method for training a training model to obtain a target model. Please refer to Figure 8 , the training method includes the following implementation steps:
[0111] Step 801: construct an adversarial network based on the model to be trained corresponding to the target model, and obtain a training image set.
[0112] The adversarial network is composed of a discriminator and a generator including a model to be trained. The training image set includes training images and preset labels corresponding to the training images, and the preset labels indicate the area information of the driving area in the training images.
[0113] Specifically, in the above adversarial network, the generator is used to identify the information of the driving area in the road image (ie, the training image) as the model label, and the discriminator is used to distinguish between the preset label and the model label.
[0114] In one embodiment, the preset labels are marked in the training images to achieve visualization. In this embodiment, the training image set includes training images without preset labels and segmented images in which the driving areas corresponding to the preset labels are marked in the preset images.
[0115] In one embodiment, the preset labels are relatively independent of the training images, that is, the training images are unlabeled images, and the preset labels contain parameter information such as longitude and latitude, shape of the driving area, etc., which describe the driving area in the training images.
[0116] Step 802: In the adversarial network, the training image is processed by the generator to obtain a model label corresponding to the driving area in the training image, and the model label and the preset label are processed by the discriminator.
[0117] Specifically, after the generator outputs the model label, the segmented image of the driving area corresponding to the model label and the segmented image of the driving area corresponding to the preset label can be input into the discriminator, so that the model label and the preset label can be distinguished by distinguishing the segmented image of the driving area corresponding to the model label and the segmented image of the driving area corresponding to the preset label.
[0118] Alternatively, the model labels corresponding to the driving areas in the training images identified by the generator and the preset labels in the training image set may be input into the discriminator so as to distinguish the model labels from the preset labels.
[0119] Step 803: Optimize the parameters of the adversarial network based on the objective function of the adversarial network until the parameter change values of the generator and the discriminator are less than a preset change threshold, thereby obtaining a target adversarial network; the generator in the target adversarial network is the target model.
[0120] Specifically, during the training process, the generator aims to generate model labels that are infinitely close to the preset labels, and the discriminator aims to accurately distinguish model labels from preset labels. In this way, the generator and the discriminator are jointly trained in the adversarial game.
[0121] The above objective function can be expressed as:
[0122]
[0123] Among them, G is the generator, D is the discriminator, x is the preset label, D(x) represents the judgment result of the discriminator D for the preset label x, z is the training image, G(z) is the model label obtained by the generator processing the training image, and D(G(z)) represents the judgment result of the discriminator on the model label.
[0124] log D(x) is the logarithmic probability that the discriminator D gives a "true" label for the preset label, maximizing This means training the discriminator D to better and more accurately distinguish between the preset labels and the model labels.
[0125] log(1-D(G(z))) is the log probability of the discriminator D giving a "false" label to the model label, so minimize This means that it is difficult to accurately distinguish between real labels and model labels when training the discriminator D. Since the training goal of the generator G is essentially to deceive the discriminator D, minimizing here can improve the accuracy of the model label output by the generator G that is closer to the preset label.
[0126] During the training process, the generator G of the discriminator D is trained alternately. When training the discriminator D, the parameters of the generator G are fixed and the parameters of the discriminator D are optimized to maximize the function value of the objective function; this step can be achieved through the gradient ascent method. When training the generator G, the parameters of the discriminator D can be fixed and the parameters of the generator G can be optimized to minimize the function value of the objective function; this step can be achieved through the gradient descent method.
[0127] Furthermore, as the training progresses, the first parameter change value of the generator G and the second parameter change value of the discriminator D are reduced until the first parameter change value of the generator G is less than the first preset change threshold, and the second parameter change value of the discriminator D is less than the second preset change threshold, it can be determined that the adversarial network converges, then the training of the adversarial network ends, and the target adversarial network is obtained. The generator G in the target adversarial network is the aforementioned target model for detecting the driving area.
[0128] The first preset change threshold of the generator G and the second preset change threshold of the discriminator D may be the same or different.
[0129] Furthermore, the following combination Fig. 9 , the structure of the adversarial network and the generator (i.e., the target model) in the adversarial network is explained.
[0130] The training image is an unlabeled training image in the aforementioned training image set. The model segmentation map is an image outputted after the generator processes the training image, in which the driving area corresponding to the model label is marked in the training image. The real segmentation map is an image in which the driving area corresponding to the preset label is marked in the aforementioned training image set.
[0131] Among them, the predicted label output by the discriminator is the predicted label marked by the discriminator after distinguishing the model segmentation map and the real segmentation map.
[0132] like Fig. 9 As shown in the figure, the adversarial network consists of G (Generator) and D (Discriminator).
[0133] The discriminator may include: a convolution module with 32 channels and a convolution kernel of 4×4 size; a convolution module with 64 channels and a convolution kernel of 4×4 size; a convolution module with 128 channels and a convolution kernel of 4×4 size; a convolution module with 256 channels and a convolution kernel of 4×4 size; a convolution module with 512 channels and a convolution kernel of 4×4 size. Each convolution module includes an Input layer, a Conv (Convolutional Layer) and a RELU (Rectified Linear Unit) function.
[0134] The generator includes an encoder and a decoder. The encoder includes a DCNN, a 1×1 convolution layer, a 3×3 convolution layer with a dilation rate of 6, a 3×3 convolution layer with a dilation rate of 12, a 3×3 convolution layer with a dilation rate of 18, and an ASPP module for image pooling.
[0135] The multi-scale feature map obtained by concatenating the features in ASPP is processed by 1×1 convolution and then input into the attention model, in which the channel attention model and the spatial attention model are sequentially connected.
[0136] The decoder includes a convolution layer for performing 1×1 convolution processing on the shallow features output by the DCNN. The obtained feature map and the feature map obtained by upsample By4 (4 times upsampling) the feature map output by the attention model are feature fused in the concat module, and then the 3×3 convolution layer is input, and then upsample By4 (4 times upsampling) is input to obtain a feature map with the same resolution and size as the training image. The pixels in the feature map are then classified into two categories to obtain the driving area, and then a segmented image of the driving area corresponding to the model label is obtained, that is, the model segmentation map.
[0137] It should be understood that although Figure 2-Figure 9 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-Figure 9 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0138] Based on the same inventive concept, the embodiment of the present application provides a driving area detection device, such as Fig.10 As shown, it includes: an image module 1001, a feature module 1002 and a region module 1003, wherein:
[0139] The image module 1001 is used to obtain an image to be detected and input the image to be detected into a target model; wherein the target model includes an encoder and a decoder.
[0140] The feature module 1002 is used to generate a second feature map based on the first feature map in the encoder, and process the second feature map using an attention model to obtain a third feature map; wherein the first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder, the receptive fields of the pixels in the second feature map are not all the same, and the attention model includes a channel attention model and a spatial attention model.
[0141] The area module 1003 is used to input the first feature map and the third feature map into the decoder to obtain the driving area in the image to be detected.
[0142] In the attention model, the channel attention model and the spatial attention model are sequentially connected; then the feature module 1002 is specifically used for:
[0143] The second feature map is processed by the channel attention model to generate a channel attention coefficient, and a fourth feature map is generated based on the channel attention coefficient and the second feature map; the fourth feature map is processed by the spatial attention model to generate a spatial attention coefficient, and the third feature map is generated based on the spatial attention coefficient and the second feature map.
[0144] The feature module 1002 is specifically used to, in the channel attention model, perform dimensionality reduction processing on the second feature map through a first convolution processing and a first reshape function to obtain a first sub-feature map, and perform feature compression on the second feature map through a second convolution processing and a second reshape function to obtain a second sub-feature map; wherein the dimensionality reduction processing indicates compressing the channel features of the second feature map, and the feature compression indicates compressing the height features and width features of the second feature map; normalizing the second sub-feature map, and multiplying the third sub-feature map obtained by the normalization processing with the first sub-feature map to obtain a fourth sub-feature map; wherein the fourth sub-feature map indicates the attention distribution of the channel in the second feature map; and determining the channel attention coefficient based on the attention distribution.
[0145] The feature module 1002 is also used for:
[0146] In the spatial attention model, the fourth feature map is processed by a fourth convolution process, a pooling process and a third reshape function to obtain a fifth sub-feature map, and the fourth feature map is processed by the fourth convolution process and a fourth reshape function to obtain a sixth sub-feature map; the fifth sub-feature map is normalized and multiplied with the sixth sub-feature map, and the spatial attention coefficient is obtained by the fifth reshape function and normalization process.
[0147] The feature module 1002 is also used for:
[0148] The image to be detected is processed by the convolutional neural network in the encoder to obtain the first feature map; wherein the convolutional neural network in the encoder is connected with the expanded spatial pyramid pooling ASPP; the first feature map is processed by the ASPP to obtain the second feature map.
[0149] The device also includes a training module, which is specifically used for:
[0150] Based on the model to be trained corresponding to the target model, an adversarial network is constructed, and a training image set is obtained; wherein the adversarial network is composed of a discriminator and a generator containing the model to be trained, and the training image set includes training images and preset labels corresponding to the training images, and the preset labels indicate the area information of the driving area in the training images; in the adversarial network, the training images are processed by the generator to obtain the model labels corresponding to the driving areas in the training images, and the model labels and preset labels are processed by the discriminator; based on the objective function of the adversarial network, the parameters of the adversarial network are optimized until the first parameter change value of the generator is less than the first preset change threshold, and the second parameter change value of the discriminator is less than the second preset change threshold, so as to obtain the target adversarial network; then the generator in the target adversarial network is the target model.
[0151] The area module 1003 is specifically used for:
[0152] In the decoder, the first feature map and the third feature map are feature fused to obtain a fused feature map; the fused feature map is upsampled to obtain a fifth feature map of a preset resolution; and the pixels in the fifth feature map are classified into two categories to obtain the driving area.
[0153] The specific definition of the detection device of the driving area can be found in the definition of the detection method of the driving area above, which will not be repeated here. Each module in the above-mentioned detection device of the driving area can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0154] Based on the same inventive concept, an embodiment of the present application provides a computer device, which may be a terminal, and its internal structure diagram may be as follows: Fig.11As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method of a driving area is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0155] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0156] Based on the same inventive concept, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0157] Acquire an image to be detected, and input the image to be detected into a target model; wherein the target model includes an encoder and a decoder;
[0158] In the encoder, based on the first feature map, a second feature map is generated, and the second feature map is processed by using an attention model to obtain a third feature map; wherein the first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder, the receptive fields of the pixels in the second feature map are not all the same, and the attention model includes a channel attention model and a spatial attention model;
[0159] The first feature map and the third feature map are input into the decoder to obtain the driving area in the image to be detected.
[0160] In one embodiment, in the attention model, the channel attention model and the spatial attention model are sequentially connected; when the processor executes the computer program, the following steps are also implemented:
[0161] The second feature map is processed by the channel attention model to generate a channel attention coefficient, and a fourth feature map is generated based on the channel attention coefficient and the second feature map; the fourth feature map is processed by the spatial attention model to generate a spatial attention coefficient, and the third feature map is generated based on the spatial attention coefficient and the second feature map.
[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0163] In the channel attention model, the second feature map is subjected to dimensionality reduction processing through a first convolution processing and a first reshape function to obtain a first sub-feature map, and the second feature map is subjected to feature compression through a second convolution processing and a second reshape function to obtain a second sub-feature map; wherein the dimensionality reduction processing indicates that the channel features of the second feature map are compressed, and the feature compression indicates that the height features and the width features of the second feature map are compressed; the second sub-feature map is subjected to normalization processing, and a third sub-feature map obtained by the normalization processing is multiplied by the first sub-feature map to obtain a fourth sub-feature map; wherein the fourth sub-feature map indicates the attention distribution of the channel in the second feature map; and the channel attention coefficient is determined based on the attention distribution.
[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0165] In the spatial attention model, the fourth feature map is processed by a fourth convolution process, a pooling process and a third reshape function to obtain a fifth sub-feature map, and the fourth feature map is processed by the fourth convolution process and a fourth reshape function to obtain a sixth sub-feature map; the fifth sub-feature map is normalized and multiplied with the sixth sub-feature map, and the spatial attention coefficient is obtained by the fifth reshape function and normalization process.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] The image to be detected is processed by the convolutional neural network in the encoder to obtain the first feature map; wherein the convolutional neural network in the encoder is connected with the expanded spatial pyramid pooling ASPP; the first feature map is processed by the ASPP to obtain the second feature map.
[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0169] Based on the model to be trained corresponding to the target model, an adversarial network is constructed, and a training image set is obtained; wherein the adversarial network is composed of a discriminator and a generator containing the model to be trained, and the training image set includes training images and preset labels corresponding to the training images, and the preset labels indicate the area information of the driving area in the training images; in the adversarial network, the training images are processed by the generator to obtain the model labels corresponding to the driving areas in the training images, and the model labels and preset labels are processed by the discriminator; based on the objective function of the adversarial network, the parameters of the adversarial network are optimized until the first parameter change value of the generator is less than the first preset change threshold, and the second parameter change value of the discriminator is less than the second preset change threshold, so as to obtain the target adversarial network; then the generator in the target adversarial network is the target model.
[0170] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0171] In the decoder, the first feature map and the third feature map are feature fused to obtain a fused feature map; the fused feature map is upsampled to obtain a fifth feature map of a preset resolution; and the pixels in the fifth feature map are classified into two categories to obtain the driving area.
[0172] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0173] Acquire an image to be detected, and input the image to be detected into a target model; wherein the target model includes an encoder and a decoder;
[0174] In the encoder, based on the first feature map, a second feature map is generated, and the second feature map is processed by using an attention model to obtain a third feature map; wherein the first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder, the receptive fields of the pixels in the second feature map are not all the same, and the attention model includes a channel attention model and a spatial attention model;
[0175] The first feature map and the third feature map are input into the decoder to obtain the driving area in the image to be detected.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0177] The second feature map is processed by the channel attention model to generate a channel attention coefficient, and a fourth feature map is generated based on the channel attention coefficient and the second feature map; the fourth feature map is processed by the spatial attention model to generate a spatial attention coefficient, and the third feature map is generated based on the spatial attention coefficient and the second feature map.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0179] In the channel attention model, the second feature map is subjected to dimensionality reduction processing through a first convolution processing and a first reshape function to obtain a first sub-feature map, and the second feature map is subjected to feature compression through a second convolution processing and a second reshape function to obtain a second sub-feature map; wherein the dimensionality reduction processing indicates that the channel features of the second feature map are compressed, and the feature compression indicates that the height features and the width features of the second feature map are compressed; the second sub-feature map is subjected to normalization processing, and a third sub-feature map obtained by the normalization processing is multiplied by the first sub-feature map to obtain a fourth sub-feature map; wherein the fourth sub-feature map indicates the attention distribution of the channel in the second feature map; and the channel attention coefficient is determined based on the attention distribution.
[0180] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0181] In the spatial attention model, the fourth feature map is processed by a fourth convolution process, a pooling process and a third reshape function to obtain a fifth sub-feature map, and the fourth feature map is processed by the fourth convolution process and a fourth reshape function to obtain a sixth sub-feature map; the fifth sub-feature map is normalized and multiplied with the sixth sub-feature map, and the spatial attention coefficient is obtained by the fifth reshape function and normalization process.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] Processing the image to be detected by the convolutional neural network in the encoder to obtain the first feature map; wherein the convolutional neural network in the encoder is connected to the expanded spatial pyramid pooling ASPP;
[0184] The first feature map is processed by the ASPP to obtain the second feature map.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0186] Based on the model to be trained corresponding to the target model, an adversarial network is constructed, and a training image set is obtained; wherein the adversarial network is composed of a discriminator and a generator containing the model to be trained, and the training image set includes training images and preset labels corresponding to the training images, and the preset labels indicate the area information of the driving area in the training images; in the adversarial network, the training images are processed by the generator to obtain the model labels corresponding to the driving areas in the training images, and the model labels and preset labels are processed by the discriminator; based on the objective function of the adversarial network, the parameters of the adversarial network are optimized until the first parameter change value of the generator is less than the first preset change threshold, and the second parameter change value of the discriminator is less than the second preset change threshold, so as to obtain the target adversarial network; then the generator in the target adversarial network is the target model.
[0187] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0188] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0189] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for detecting a driving area, characterized in that: include: Acquire an image to be detected, and input the image to be detected into a target model; wherein the target model includes an encoder and a decoder; In the encoder, based on the first feature map, a second feature map is generated, and the second feature map is processed by using an attention model to obtain a third feature map; wherein the first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder, the receptive fields of the pixels in the second feature map are not all the same, and the attention model includes a channel attention model and a spatial attention model; The first feature map and the third feature map are input into the decoder to obtain the driving area in the image to be detected.
2. The method according to claim 1, characterized in that In the attention model, the channel attention model and the spatial attention model are sequentially connected; Then the step of processing the second feature map using the attention model to obtain a third feature map includes: Processing the second feature map through the channel attention model to generate a channel attention coefficient, and generating a fourth feature map based on the channel attention coefficient and the second feature map; The fourth feature map is processed by the spatial attention model to generate a spatial attention coefficient, and the third feature map is generated based on the spatial attention coefficient and the second feature map.
3. The method according to claim 2, characterized in that The processing the second feature map by the channel attention model to generate a channel attention coefficient includes: In the channel attention model, the second feature map is subjected to dimensionality reduction processing by a first convolution process and a first reshape function to obtain a first sub-feature map, and, Performing feature compression on the second feature map through a second convolution process and a second reshape function to obtain a second sub-feature map; wherein the dimensionality reduction process indicates compressing the channel features of the second feature map, and the feature compression indicates compressing the height features and width features of the second feature map; Normalizing the second sub-feature map, and performing a product operation on the third sub-feature map obtained by the normalization process and the first sub-feature map to obtain a fourth sub-feature map; wherein the fourth sub-feature map indicates the attention distribution of the channel in the second feature map; Based on the attention distribution, the channel attention coefficient is determined.
4. The method according to claim 2 or 3, characterized in that Processing the fourth feature map by the spatial attention model to generate a spatial attention coefficient includes: In the spatial attention model, the fourth feature map is processed by a fourth convolution process, a pooling process, and a third reshape function to obtain a fifth sub-feature map, and, Processing the fourth feature map through the fourth convolution process and the fourth reshape function to obtain a sixth sub-feature map; The fifth sub-feature map is normalized and multiplied with the sixth sub-feature map, and the spatial attention coefficient is obtained through the fifth reshape function and normalization.
5. The method according to claim 1, characterized in that The step of generating a second feature map based on the first feature map in the encoder includes: Processing the image to be detected by the convolutional neural network in the encoder to obtain the first feature map; wherein the convolutional neural network in the encoder is connected to the expanded spatial pyramid pooling ASPP; The first feature map is processed by the ASPP to obtain the second feature map.
6. The method according to any one of claims 1 to 3 and 5, characterized in that: The target model is trained in the following way: Based on the model to be trained corresponding to the target model, an adversarial network is constructed, and a training image set is obtained; wherein the adversarial network is composed of a discriminator and a generator including the model to be trained, and the training image set includes training images and preset labels corresponding to the training images, and the preset labels indicate area information of a driving area in the training images; In the adversarial network, the training image is processed by the generator to obtain a model label corresponding to the driving area in the training image, and the model label and the preset label are processed by the discriminator; Based on the objective function of the adversarial network, the parameters of the adversarial network are optimized until the first parameter change value of the generator is less than the first preset change threshold, and the second parameter change value of the discriminator is less than the second preset change threshold, to obtain a target adversarial network; then the generator in the target adversarial network is the target model.
7. The method according to any one of claims 1 to 3, 5, characterized in that: The step of inputting the first feature map and the third feature map into the decoder to obtain the driving area in the image to be detected includes: In the decoder, performing feature fusion on the first feature map and the third feature map to obtain a fused feature map; Upsampling the fused feature map to obtain a fifth feature map of a preset resolution; The pixel points in the fifth feature map are classified into two categories to obtain the driving area.
8. A driving area detection device, characterized in that: The device comprises: An image module, used for acquiring an image to be detected and inputting the image to be detected into a target model; wherein the target model includes an encoder and a decoder; A feature module, used in the encoder to generate a second feature map based on the first feature map, and use an attention model to process the second feature map to obtain a third feature map; wherein the first feature map is obtained by processing the image to be detected by a convolutional neural network in the encoder, the receptive fields of the pixels in the second feature map are not all the same, and the attention model includes a channel attention model and a spatial attention model; The area module is used to input the first feature map and the third feature map into the decoder to obtain the driving area in the image to be detected.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Unmanned vehicle environment detection method based on deep learning
CN113436217A
Method and device for dividing drivable region based on split convolution large-scale selective attention
CN117876396A
System and method for boundary aware semantic segmentation
US20210089807A1
