Method and device for identifying vehicle drivable area

The Segformer model is used to identify the drivable area of ​​the car, which solves the problem of excessive computing resource usage in the existing technology and achieves efficient and accurate identification on devices with limited computing resources.

CN117058657BActive Publication Date: 2024-09-06SHANGHAI BAOLONG AUTOMOTIVE CORP (WUHAN) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202311143128.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-05
Publication Date
2024-09-06
Estimated Expiration
2043-09-05

AI Technical Summary

Technical Problem

In the existing technology, vehicle drivable area identification takes up a lot of computing resources and is not suitable for devices with limited computing resources.

Method used

The Segformer model is used to identify the car's drivable area, and a bird's-eye view is generated by splicing multiple environmental sample images, and the trained Segformer model is used for identification to reduce computing resource usage.

Benefits of technology

It achieves efficient identification of the car's drivable area on devices with limited computing resources, reduces computing resource requirements and improves identification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117058657B
    Figure CN117058657B
Patent Text Reader

Abstract

The present invention relates to the field of automobile technology, and provides a method for identifying a drivable area of ​​an automobile, a method for constructing a deep learning model, and a device. The method for identifying a drivable area of ​​an automobile comprises: using a Segformer model to identify a drivable area of ​​an automobile. The present invention uses a Segformer model to identify a drivable area of ​​an automobile. Since the Segformer model has the characteristics of small size and high accuracy, it can reduce the computing resources occupied by the drivable area identification of the automobile, so that it can be run on some devices with limited computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automobile technology, and in particular to a method for identifying a drivable area of ​​an automobile, and a method and device for constructing a deep learning model. Background Art

[0002] The segmentation of the drivable area of ​​a car refers to the segmentation of an image of a car driving scene, which assigns each pixel in the image to a different category, thereby realizing the recognition and segmentation of the drivable area of ​​the car. Traditional image processing methods such as edge detection and optical flow method have some shortcomings in the detection of drivable areas, such as limited adaptability, lack of semantic information, parameter sensitivity and low computational efficiency. In addition, the existing technology often identifies the drivable area based on images from a single camera perspective, which limits the perspective of the recognition area and makes the recognition of the drivable area of ​​the car inaccurate.

[0003] In the prior art, some semantic segmentation models are also commonly used to segment recognizable areas. However, these semantic segmentation models are usually large in size. When they are applied to the method of identifying the drivable area of ​​a car, they will occupy more computing resources and are not suitable for running on some devices with limited computing resources.

[0004] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention

[0005] The technical problem to be solved by the present invention is that the vehicle drivable area identification in the prior art usually occupies a large amount of computing resources and is not suitable for running on some devices with limited computing resources.

[0006] The present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a method for identifying a drivable area of ​​a vehicle, comprising:

[0008] Use the Segformer model to identify the drivable area of ​​the car.

[0009] Preferably, the use of the Segformer model to identify the drivable area of ​​the vehicle specifically includes:

[0010] Multiple sample images of the environment around the car are stitched together to obtain a bird's-eye view centered on the car body;

[0011] After preprocessing the bird's-eye view image, it is input into the trained Segformer model to identify the drivable area for the car.

[0012] In a second aspect, the present invention further provides a method for constructing a deep learning model for identifying a drivable area of ​​a vehicle, wherein the deep learning model is a Segformer model, and the construction method comprises:

[0013] Label multiple bird's-eye views to generate training data sets, validation data sets, and test data sets;

[0014] Build the initial Segformer model;

[0015] The initial Segformer model is trained using the training data set, the validation data set, and the test data set to obtain a trained Segformer model for identifying a drivable area for a vehicle.

[0016] Preferably, the initial Segformer model is a MiT-B2 model of medium size;

[0017] The MiT-B2 model includes four encoders, a decoder and an output layer;

[0018] Each encoder includes a plurality of coding layers, and an overlapping compression merging layer is arranged between every two coding layers;

[0019] The decoder includes multiple decoding layers and an upsampling layer, wherein the decoding layer is used to integrate feature information of different levels using a self-attention mechanism and a cross-attention mechanism, and the upsampling layer is used to increase the size of the feature map to the same size as the input image;

[0020] The output layer includes a classification head, which is a convolutional layer implemented by a linear layer function, for assigning each pixel to a different category.

[0021] Preferably, the using the training data set, the validation data set and the test data set to train the initial Segformer model comprises:

[0022] Dividing the training data set into a plurality of batches of training subsets, dividing the validation data set into a plurality of batches of validation subsets, and dividing the test data set into a plurality of test subsets;

[0023] Input the training subset of each batch and the validation subset of each batch into the first intermediate model of the corresponding batch for training to obtain the second intermediate model of the corresponding batch; wherein the initial Segformer model is used as the first intermediate model of the first batch, and the second intermediate model of the previous batch is used as the first intermediate model of the next batch;

[0024] The second intermediate model of the corresponding batch is tested using the test subset of the corresponding batch to obtain the test results of the corresponding batch, and a second intermediate model is selected from the second intermediate models of all batches according to the test results of all batches as the trained Segformer model.

[0025] Preferably, the method further comprises:

[0026] After a preset number of second intermediate models are obtained through training, noise is added to each encoder of each subsequent first intermediate model;

[0027] According to the level of the added noise, a corresponding learning rate is set so that subsequent batches are trained according to the first intermediate model with added noise and the corresponding learning rate.

[0028] Preferably, the test result is the accuracy of each category, and the test subset of the corresponding batch is used to test the second intermediate model of the corresponding batch to obtain the test result of the corresponding batch, which specifically includes: performing the following operations on the second intermediate model of each batch:

[0029] Inputting the test subset of the corresponding batch into the second intermediate model of the corresponding batch, and outputting a prediction result; wherein the prediction result includes a predicted category of each pixel of each image in the test subset;

[0030] The predicted category of each pixel is matched with the labeled category of each pixel obtained by labeling, and it is determined whether the predicted category of each pixel is correct, and the accuracy of the second intermediate model of the corresponding batch in each category is counted.

[0031] Preferably, the step of selecting a second intermediate model from the second intermediate models of all batches as a trained Segformer model according to the test results of all batches specifically includes:

[0032] From the second intermediate models whose accuracy rates of all categories are greater than the corresponding preset accuracy rates, the second intermediate model with the highest overall accuracy rate is selected as the trained Segformer model; wherein the overall accuracy rate of the corresponding second intermediate model is calculated by combining the accuracy rates of each category of the second intermediate model with preset rules.

[0033] Preferably, before using the training data set, the validation data set and the test data set to train the initial Segformer model, the method further includes performing data augmentation on the images in the training data set, the validation data set and the test data set, specifically including:

[0034] Scale the images in the training dataset and the validation dataset so that the length and width of the scaled images are 2×m1×k and m2×k respectively; where m1 is the length of the image, m2 is the width of the image, and k is the preset scaling factor;

[0035] The scaled image is cropped to restore the cropped image to the size of the image before scaling, and the image is flipped; wherein the cropping ratio of the scaled image does not exceed a preset cropping ratio;

[0036] It also adjusts the brightness, contrast, saturation and hue of the image, and converts the image into color space.

[0037] In a third aspect, the present invention further provides a device for identifying a drivable area of ​​a vehicle, the device comprising:

[0038] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the method for identifying a drivable area of ​​a vehicle described in the first aspect or the method for constructing a deep learning model for identifying a drivable area of ​​a vehicle described in the second aspect.

[0039] In a fourth aspect, the present invention further provides a non-volatile computer storage medium, which stores computer executable instructions, which are executed by one or more processors to complete the method for identifying a drivable area for a vehicle described in the first aspect or the method for constructing a deep learning model for identifying a drivable area for a vehicle described in the second aspect.

[0040] The present invention uses the Segformer model to identify the drivable area of ​​the vehicle. Since the Segformer model has the characteristics of small size and high accuracy, it can reduce the computing resources occupied by the drivable area identification of the vehicle, so that it can run on some devices with limited computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0042] Figure 1 It is a flowchart of a first method for identifying a drivable area of ​​a vehicle provided by an embodiment of the present invention;

[0043] Figure 2It is a flowchart of a method for building a deep learning model for identifying a drivable area of ​​a vehicle provided by an embodiment of the present invention;

[0044] Figure 3 It is a flowchart of another method for building a deep learning model for identifying a drivable area of ​​a vehicle provided by an embodiment of the present invention;

[0045] Figure 4 It is a flowchart of another method for building a deep learning model for identifying a drivable area of ​​a vehicle provided by an embodiment of the present invention;

[0046] Figure 5 It is a schematic diagram of the change of a bird's-eye view in a method for identifying a drivable area for a vehicle provided by an embodiment of the present invention;

[0047] Figure 6 is a schematic diagram of a bird's-eye view in a method for identifying a drivable area for a vehicle provided in an embodiment of the present invention;

[0048] Figure 7 It is a flowchart of another method for building a deep learning model for identifying a drivable area of ​​a vehicle provided by an embodiment of the present invention;

[0049] Figure 8 is a schematic diagram of a recognition model in a method for identifying a drivable area of ​​a vehicle provided by an embodiment of the present invention;

[0050] Fig. 9 It is a schematic diagram of various evaluation indicators of a trained model in a method for identifying a drivable area for an automobile provided in an embodiment of the present invention;

[0051] Fig.10 It is a schematic diagram of the architecture of a vehicle drivable area identification device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0053] The terms "first", "second", etc. in the present invention are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0054] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0055] Embodiment 1:

[0056] The prior art method for identifying a drivable area for a car usually occupies a lot of computing resources and is not suitable for running on devices with limited computing resources. In order to solve this problem, Example 1 of the present invention provides a method for identifying a drivable area for a car, including: using a Segformer model to identify a drivable area for a car. Compared with other models, the SegFormer model has a smaller model size, fewer parameters, and a faster inference speed, but it still uses some techniques to improve the accuracy of the model, so it is more suitable for deployment and use on edge devices with limited computing resources. Therefore, this embodiment uses a smaller Segformer model to identify the drivable area for a car, thereby reducing the computing resources occupied, making it suitable for running on devices with limited computing resources.

[0057] In actual use, existing methods for identifying drivable areas for automobiles, such as edge detection and optical flow methods, have some disadvantages in drivable area detection, such as limited adaptability, lack of semantic information, parameter sensitivity, and low computational efficiency. In addition, the existing technology often identifies drivable areas based on images from a single camera perspective, which results in a limited perspective of the identification area and inaccurate identification of drivable areas for automobiles. In order to solve this problem, in combination with the above embodiments, this embodiment further provides a preferred implementation, namely, the use of a Segformer model to identify drivable areas for automobiles, such as Figure 1 As shown, specifically including:

[0058] In step 201, multiple sample images of the environment around the vehicle are stitched together to obtain a bird's-eye view centered on the vehicle body; wherein the sample images of the environment are obtained by a tester driving a vehicle on a road and turning on the vehicle's surround view camera to collect sample photos of the road environment around the vehicle. The stitching of multiple sample images of the environment around the vehicle can be done by using an AVM surround view stitching algorithm to stitch the multiple sample images of the environment into a bird's-eye view of the vehicle's drivable area centered on the vehicle body.

[0059] The PointSIFT method can also be used to extract feature descriptors from each camera image. These descriptors can be point clouds, feature points, or local feature descriptors, which are used to represent key information in the image; then for each camera's feature descriptor, a similarity metric (such as L2 norm or cosine similarity) is used to calculate the distance or similarity between the feature descriptors of other cameras. By comparing the similarity between feature descriptors, cameras can be matched; finally, RANSAC or other consistency estimation methods are used to perform inlier screening on matching point pairs and estimate the geometric relationship between cameras, such as camera pose or basic matrix. The RANSAC algorithm can remove false matches and outliers, thereby improving the accuracy of the estimation. Based on the estimated geometric relationship between cameras, the AVM surround stitching algorithm is used to stitch multiple environment sample images to obtain a bird's-eye view.

[0060] In step 202, after preprocessing the bird's-eye view image, the image is input into the trained Segformer model to identify the drivable area of ​​the vehicle.

[0061] In actual application scenarios, the preprocessing of the bird's-eye view image specifically includes: using mean shift to filter out noise in the environment sample image, and performing image enhancement on the environment sample image. Using mean shift to filter out noise in the environment sample image can be using Process each pixel in the environment sample image. t is the position of the tth iteration, x i represents the i-th sample in the data set, K is the kernel function, and h is the bandwidth parameter used to control the accuracy of the estimation. In each iteration, the mean shift is calculated by calculating the current position x t The similarity with other samples, and then weighted average to get the new position x t+1 , repeat this process until convergence. Here, according to the grayscale distribution of each image and repeated debugging, the values ​​t and i are positioned at 7 and 1. By filtering out noise points, the interference of factors such as light and vibration during the shooting process of the vehicle camera can be eliminated, so that the training results are more accurate.

[0062] The image enhancement of the environmental sample image specifically includes: for the lack of contrast in some photos, the image quality is improved through histogram equalization, gamma transform and deep learning image super-resolution restoration method. Since the bird's-eye view image directly processed by ESRGAN will lose about 30% of the high-frequency texture due to the dark background road pixel value, and the loss of too dark may be 80% or more, in a preferred embodiment, the gamma transform is integrated into the super-resolution restoration model ESRGAN method (GAMA-ESRGAN), such as adding a gamma transform in the pre-processing stage of ESRGAN, and the gamma transform is: o = α*i γ ; where o and i are the output and input image pixel values, respectively, and α and o are positive constants. When γ<1, the power law curve maps a narrow range of dark input values ​​to a wider range of output values, and vice versa when γ>1. Considering that the image is dark overall, γ is set to 0.6. The dynamic range of the image is adjusted by the gamma transform parameter γ, so that the brightness range of the image meets the input requirements of the restoration model.

[0063] In an optional implementation, the method further includes: using an AVM stitching algorithm to stitch multiple images of the restored image into a bird's-eye view image of the vehicle's drivable area centered on the vehicle body. This embodiment stitches the environmental sample images to obtain a bird's-eye view centered on the vehicle body, thereby providing a wider viewing angle, thereby improving the accuracy of identifying the vehicle's drivable area.

[0064] Embodiment 2:

[0065] After providing a method for identifying a vehicle drivable area as described in Example 1, the present invention will further provide a method for constructing a deep learning model for identifying a vehicle drivable area, in order to make relevant elaborations on the construction and training aspects of the Segformer model in Example 1, and further make relevant in-depth analysis on its design principles.

[0066] This embodiment provides a method for constructing a deep learning model for identifying a drivable area for a vehicle. Figure 2 As shown, including:

[0067] In step 301, a plurality of bird's-eye views are marked to generate a training data set, a verification data set, and a test data set; wherein the training data set and the verification data set are used to train the recognition model, and the test data set is used to test the trained recognition model to determine whether the recognition model has achieved the required training effect. In subsequent embodiments, feature maps are also used as alternative descriptions of the bird's-eye views in the training data set, the verification data set, and the test data set.

[0068] In step 302, an initial Segformer model is constructed, wherein each parameter in the initial Segformer model is obtained by those skilled in the art based on empirical analysis.

[0069] In step 303, the recognition model is trained using the training data set, the validation data set, and the test data set to obtain a trained Segformer model for identifying a drivable area for a vehicle. Example 1 The trained Segformer model obtained in this example is used to identify a drivable area for a vehicle. Specifically, each parameter in the trained Segformer model is stored on a device, and the device is used to identify a drivable area for a vehicle. In this implementation, the device can be an offline device. The method for identifying a drivable area for a vehicle has been described in detail in Example 1 and will not be repeated here.

[0070] In an optional embodiment, in order to strike a balance between the size of the model and the accuracy of recognition, the initial Segformer model described in this embodiment is a MiT-B2 model of medium size; that is, among the six Segformer models of different sizes, MiT-B0 to MiT-B5, a model of medium size is selected. The amount of trainable coefficients for the encoder and the amount of trainable coefficients for the decoder in each Segformer model are different. The trainable coefficients for the encoder in MiT-B0 occupy about 3.4M of storage space, and the trainable coefficients for the decoder occupy about 0.4M of storage space; the trainable coefficients for the encoder in MiT-B1 occupy about 13.1M of storage space, and the trainable coefficients for the decoder occupy about 0.6M of storage space; the trainable coefficients for the encoder in MiT-B2 occupy about 24.2M of storage space, and the trainable coefficients for the decoder occupy about 3.3M of storage space; the trainable coefficients for the encoder in MiT-B3 occupy about 44M of storage space, and the trainable coefficients for the decoder occupy about 3.3M of storage space; the trainable coefficients for the encoder in MiT-B4 occupy about 60.8M of storage space, and the trainable coefficients for the decoder occupy about 3.3M of storage space; the trainable coefficients for the encoder in MiT-B5 occupy about 81.4M of storage space, and the trainable coefficients for the decoder occupy about 3.3M of storage space.

[0071] The MiT-B2 model includes four encoders, a decoder and an output layer; each encoder includes multiple encoding layers, and an overlapping compression merging layer is arranged between every two encoding layers; wherein the number of each encoder Encoder Layer in the four stages of the MiT-B2 model is set to 3, 4, 6 and 3 respectively.

[0072] Each encoder contains features of different scales. The four encoders form a Transformer structure, in which each encoder is stacked by several Encoder Layers composed of Efficient Self-Attention mechanisms and Mix-Forward Neural Networks. Overlapped Patch Merging is also performed between Encoder Layers. Finally, the outputs of the four encoders are passed to the decoder together.

[0073] The decoder includes multiple decoding layers and an upsampling layer, wherein the decoding layer is used to integrate feature information of different levels using a self-attention mechanism and a cross-attention mechanism, and the upsampling layer is used to increase the size of the feature map to the same size as the input image.

[0074] The decoder is used to decode and fuse the effective receptive fields of the corresponding four stages in the encoder. The decoder is essentially a Transformer structure with multiple Decoder Layers. The Decoder Layer integrates feature information at different levels by utilizing the self-attention mechanism and cross-attention mechanism in the encoder. The goal of the decoder is to convert the semantic information extracted by the encoder into pixel-level segmentation predictions. In order to achieve pixel-level segmentation, Segformer uses an upsampling operation at the end of the decoder (i.e., the upsampling layer) to increase the size of the feature map to the same size as the input image. This process can be accomplished by interpolation or transposed convolution.

[0075] The output layer includes a classification head, which is a convolutional layer implemented by a linear layer function, which is used to assign each pixel to a different category. The output layer performs semantic segmentation prediction by applying a pixel-wise classification head on the output of the decoder. The number of output channels of the classification head is equal to the number of categories in the segmentation task. Finally, each pixel is assigned to a different category through the linear layer function.

[0076] On the basis of the above embodiment, in order to further improve the accuracy of the recognition of the drivable area of ​​the vehicle, this embodiment also provides the following preferred implementation manner, that is, the initial Segformer model is trained using the training data set, the validation data set and the test data set, such as Figure 3 As shown, specifically including:

[0077] In step 401, the training data set is divided into multiple batches of training subsets, the validation data set is divided into multiple batches of validation subsets, and the test data set is divided into multiple test subsets; wherein the number of batches of training subsets, validation subsets and test subsets obtained by dividing the training data set, validation data set and test data set is the same, and the number of batches is obtained by technical personnel in this field based on empirical analysis.

[0078] In step 402, the training subset of each batch and the validation subset of each batch are input into the first intermediate model of the corresponding batch for training to obtain the second intermediate model of the corresponding batch; wherein the initial Segformer model is used as the first intermediate model of the first batch, and the second intermediate model of the previous batch is used as the first intermediate model of the next batch.

[0079] It should be noted here that the "previous batch" and "next batch" mentioned in this embodiment are relative to two adjacent batches. For example, three batches of training have been carried out by a certain time. For the convenience of description, these three batches are called the first batch, the second batch and the third batch in chronological order. The first batch is the "previous batch" of the second batch, the second batch is the "next batch" of the first batch, the second intermediate model of the first batch is the first intermediate model of the second batch, the second batch is the "previous batch" of the third batch, the third batch is the "next batch" of the second batch, and the second intermediate model of the second batch is the first intermediate model of the third batch.

[0080] The training subset is used to train the parameters of the first intermediate model of the corresponding batch, and the verification subset is used to input the first intermediate model after training the parameters of the first intermediate model using the training subset of the corresponding batch to obtain the model output, and the key evaluation index of the first intermediate model after training is calculated according to the model output, and the weight decay coefficient of the optimizer in the first intermediate model and / or the hyperparameter of the optimizer are adjusted until the calculated key evaluation index reaches the first preset index. The optimizer can be an AdamW optimizer; the key evaluation index includes one or more of the loss function of the model, the accuracy (acc) of the decoder, and the mean intersection over union (mIoU) of the model. The loss function of the model can be the cross entropy loss function (CrossEntropyLoss) of the model. If the cross entropy loss function is judged to converge too quickly, the weight decay coefficient is reduced, and the hyperparameters of the optimizer are adjusted to prevent overfitting.

[0081] If the cross entropy loss function determines that the cross entropy loss converges too slowly, the weight attenuation coefficient is increased, and the hyperparameters of the optimizer are adjusted to prevent underfitting. In an optional embodiment, the weight attenuation coefficient can be increased or decreased by a preset step size. For example, when it is adjusted to a smaller value, the weight attenuation coefficient is reduced by a preset step size, and when it is increased, the weight attenuation coefficient is increased by a preset step size. The preset step size is obtained by a technician in this field based on empirical analysis. The first preset indicator is obtained by a technician in this field based on empirical analysis.

[0082] By adjusting the weight decay coefficient of the optimizer, the regularization effect of the model can be balanced to increase the regularization ability of the model and prevent overfitting, such as using a smaller weight decay coefficient; the hyperparameters of the AdamW optimizer (i.e., β1, β2, and ε) are adjusted to forget historical gradient information faster and improve numerical stability. For example, during multiple iterations of training, smaller β1 and β2 values ​​are gradually used, and the β1 and β2 values ​​are changed from [0.9, 0.999] to [0.879, 0.959], which solves the problem of slow loss convergence in model training.

[0083] In step 403, the second intermediate model of the corresponding batch is tested using the test subset of the corresponding batch to obtain the test results of the corresponding batch, and a second intermediate model is selected from the second intermediate models of all batches according to the test results of all batches as the trained Segformer model.

[0084] It should be noted here that the first intermediate model and the second intermediate model have the same structure as the Segformer model. The first intermediate model can be understood as the model of the corresponding batch before training, and the second intermediate model can be understood as the model of the corresponding batch after training.

[0085] In an optional embodiment, in a specific application scenario, the test result is the accuracy of each category, and the test subset of the corresponding batch is used to test the second intermediate model of the corresponding batch to obtain the test result of the corresponding batch, specifically including: performing the following operations on the second intermediate model of each batch:

[0086] Input the test subset of the corresponding batch into the second intermediate model of the corresponding batch, and output the prediction result; wherein the prediction result includes the predicted category of each pixel in each image in the test subset. Match the predicted category of each pixel with the labeled category of each pixel obtained by labeling, determine whether the predicted category of each pixel is correct, and count the accuracy of the second intermediate model of the corresponding batch in each category.

[0087] The method of selecting a second intermediate model from the second intermediate models of all batches as the trained Segformer model according to the test results of all batches specifically includes: selecting the second intermediate model with the highest overall accuracy from the second intermediate models whose accuracy rates of all categories are greater than the corresponding preset accuracy rates as the trained Segformer model; wherein the overall accuracy rate of the corresponding second intermediate model is calculated by combining the accuracy rates of each category of the second intermediate model with preset rules. The preset accuracy rate and preset rules are obtained by those skilled in the art based on experience and analysis of the accuracy rate requirements of each category, such as by adding or averaging the accuracy rates of each category to obtain the overall accuracy rate, or by weighted summing the accuracy rates of each category to obtain the overall accuracy rate.

[0088] There is also a preferred implementation method: if the accuracy of the corresponding category of the second intermediate model of the corresponding batch is not greater than the preset accuracy, then adjust the ratio of the training set, the validation set and the test set, increase the proportion of the training set and manually remove the extremely difficult to identify data, and then re-train the models of each batch until the accuracy of the second intermediate models of all batches in all categories is greater than the preset accuracy, and select the one with the highest overall accuracy from all the second intermediate models as the trained Segformer model.

[0089] In order to improve the accuracy of the model, this embodiment also provides the following preferred implementations: Figure 4 As shown, specifically including:

[0090] In step 501, after a preset number of second intermediate models are obtained through training, noise is added to each encoder of each subsequent first intermediate model; wherein the preset number is obtained by those skilled in the art based on empirical analysis. The noise may be one or more of salt and pepper noise, random noise, and Gaussian noise.

[0091] In step 502, a corresponding learning rate is set according to the level of the added noise, so as to facilitate the training of subsequent batches according to the first intermediate model with added noise and the corresponding learning rate. In an optional embodiment, the learning rate in the nth training iteration is Among them, α n is a preset parameter set according to the total number of iterations, which is obtained by those skilled in the art based on empirical analysis. n-1 represents the learning rate set last time, that is, the learning rate in the n-1th training iteration, m n represents the noise added for the nth time and follows the standard normal distribution.

[0092] For example, when training iterates 5000 times (i.e., the preset number of times), Gaussian noise is added to each encoder, and the learning rate is specified according to the noise level so that the network updates parameters more cautiously in areas with higher noise. The goal is to improve the robustness and generalization ability of the model by introducing noise during the model training process, wherein the learning rate is gradually reduced during the training process.

[0093] In order to further improve the accuracy of the model, before using the training data set, the validation data set and the test data set to train the initial Segformer model, the method also includes performing data augmentation on the images in the training data set, the validation data set and the test data set, specifically including:

[0094] The images in the training data set and the validation data set are scaled so that the length and width of the scaled images are 2×m1×k and m2×k, respectively; wherein m1 is the length of the image, m2 is the width of the image, and k is a preset scaling factor; the preset scaling factor is obtained by a technician in this field based on empirical analysis.

[0095] The scaled image is cropped to restore the cropped image to the size before scaling, and the image is flipped; wherein the cropping ratio of the scaled image does not exceed a preset cropping ratio; the preset cropping ratio is obtained by technicians in this field based on experience analysis.

[0096] It also adjusts the brightness, contrast, saturation and hue of the image, and converts the image into color space.

[0097] If the length and width of each image are the same, perform the following steps:

[0098] (1) Scaling the image, such as scaling the image to 2*m*k×m*k (m represents the original length and width, k represents the scaling ratio, such as randomly selecting a value from [0.5-2.0] as the value), and increasing the upper limit of the k value and reducing the lower limit in the random scaling.

[0099] (2) The image is randomly cropped back to its original size of m×m, the image is randomly flipped horizontally, and a target maximum cropping ratio is added in the random cropping so that the cropped semantic information cannot exceed this ratio, and the possibility of random horizontal flipping of the image is increased.

[0100] (3) Adjust the brightness, contrast, saturation, hue and color space conversion of the image. The purpose of these changes is to retain more effective information when doing data enhancement and also increase the possibility that the enhanced image has more semantic content. This allows the model to adapt to a variety of scenarios and have stronger generalization capabilities.

[0101] Embodiment 3:

[0102] On the basis of the method for identifying a drivable area for a vehicle described in Example 1, in order to improve the efficiency of the process of identifying a drivable area for a vehicle, this embodiment further provides a method for identifying a drivable area for a vehicle, which specifically includes:

[0103] If in the last recognition process, it is identified that there is a non-drivable area around the car, then the contour of each object is identified from the non-drivable area, and the contour of each object is compared with the contour in the preset contour library. The object that is likely to be a static object is taken as the target object. Then, in the next recognition, the relative offset between the target object and the car is calculated according to the speed of the car; wherein the preset contour library is collected and constructed by technical personnel in this field, and a static object or a dynamic object is marked for each contour.

[0104] According to the relative offset, the possible position of the target object in the corresponding feature map (i.e., the bird's-eye view used to identify the drivable area of ​​the vehicle) at the next recognition is determined, and the similarity between the actual pixel distribution of the possible position in the image and the pixel distribution of the target object obtained in the previous recognition is calculated; the similarity between the actual pixel distribution of the possible position and the pixel distribution of the target object is obtained by calculating the pixel similarity between the pixels of each position of the target object and the pixels of the corresponding position in the possible positions, and then combining the pixel similarity of all pixel distributions of the actual pixel distribution of the possible position and the pixel distribution of the target object.

[0105] If the similarity is greater than the first preset similarity, it is considered that the actual offset of the image relative to the car is consistent with the calculated relative offset, that is, the relative movement between the target object and the car is only caused by the car, and the target object is judged to be a static object. In the subsequent recognition process, the location of the target object is directly divided into a non-drivable area for cars. Figure 5 As shown in the figure, if an identification is performed at time t0 and a tree-like contour is found in the feature map, it is identified as a target object. If another identification is performed at time t1 and the relative offset of the tree-like contour in the feature map of the two identifications is consistent with the relative offset caused by the car's driving, it is identified as a static object. The tree-like contour does not participate in the subsequent process of using the recognition model to identify the drivable area, but is directly divided into a non-drivable area.

[0106] If the similarity is less than or equal to a second preset similarity, it is determined that the target object is not a static object. In the subsequent recognition process, the target object is still retained in the feature map and input into the recognition model for recognition.

[0107] If the similarity is greater than the second preset similarity and less than or equal to the first preset similarity, contour recognition is performed on the possible position. If a single contour or more than two contours are recognized, in the subsequent recognition process, the target object is still retained in the feature map and input into the recognition model for recognition. If two contours are recognized, that is, the target object is blocked by another object, such as Figure 6 As shown, the tree-shaped outline is blocked by the human-shaped outline, thereby forming two outlines. Corresponding processing is performed according to the positional relationship between the target object and the car, including: if the front of the car has exceeded the target object, the position of the target object is directly divided into a non-drivable area for the car, without inputting it into the recognition model for recognition.

[0108] If the possible static object is located in front of the front of the car, the pixel area within the preset range on both sides of the target object is selected, and the pixel area in the image during the last recognition is combined with the pixel area in the image during the next recognition. Through pixel matching, the offset of the other object that obscures the target object relative to the surrounding environment during the two recognition processes is determined, and the movement trend of the other object is determined based on the offset. If the movement trend of the other object is determined to be away from the direction of the car, the location of the target object is divided into a non-drivable area for the car; if the movement trend of the other object is determined to be toward the direction of the car, while the location of the target object is divided into a non-drivable area for the car, the driver is reminded to pay attention to the dynamic objects coming and going through alarms, image annotations, etc.

[0109] The pixel regions within the preset range on both sides of the target object may be selected from the pixel regions on the target object and the other object with relatively higher definition. The first preset similarity and the second preset similarity are both obtained by those skilled in the art based on empirical analysis, and the first preset similarity is greater than the second preset similarity.

[0110] Specifically, the position of the target object is directly divided into a non-drivable area for the car by not identifying the position of the target object, but deleting the target object from the feature map by pixel covering or eliminating pixels, so as not to input it into the recognition model for recognition, but directly dividing the position of the target object into a non-drivable area for the car until the target object fades out of the recognition field of view of the car. For example, preset pixels are filled at the position of the target object, so that the target object is blocked and does not participate in the recognition of the recognition model. In the subsequent recognition process, the position of the target object is determined based on the relative offset of the target object calculated according to the speed of the car and the position of the target object at the last recognition, and the relative offset is determined.

[0111] This implementation method recognizes static objects and does not allow the static objects to participate in the recognition of the recognition model, thereby improving recognition efficiency and real-time performance, further reducing resource usage, and facilitating deployment and use on edge devices.

[0112] Embodiment 4:

[0113] The present invention is based on the methods described in Example 1 and Example 2, combined with specific application scenarios, and uses technical descriptions in related scenarios to illustrate the implementation process of the present invention in characteristic scenarios.

[0114] The method for identifying a drivable area of ​​a vehicle described in this embodiment is as follows: Figure 7 As shown, specifically including:

[0115] In step 601, a surround view camera mounted on the vehicle is used to take photos of the vehicle while it is driving to obtain sample photos of the road environment (ie, obtain multiple sample images of the environment around the vehicle).

[0116] In step 602, the collected image (ie, the environmental sample image in Example 1) is preprocessed, including AVM stitching, image enhancement, scale scaling and other operations, to obtain a preprocessed bird's-eye view image sample of the vehicle drivable area.

[0117] In step 603, the pre-processed bird's-eye view image samples of the automobile drivable area are labeled, and after labeling, all samples and labels are assigned to a training set (i.e., the training data set in Example 1), a verification set (i.e., the verification data set in Example 1), and a test set (i.e., the test data set in Example 1).

[0118] In step 604, the improved Segformer model (ie, the recognition model in Example 1) is used to perform model training on the bird's-eye view image samples of the vehicle drivable area in step 603 to obtain model weights. The method comprises: constructing a Segformer initial model; training the Segformer initial model based on a bird's-eye view image sample; performing data augmentation on the bird's-eye view images in the training set and the verification set respectively; inputting the verification set and the training set into the Segformer initial model and training the Segformer initial model based on a preset learning strategy, that is, inputting image data, labels and Segformer pre-trained weights into the model in the form of images, images and binary files for training respectively, and after each batch of training is completed, analyzing the key evaluation indicators (i.e. the key evaluation indicators in Example 1), iteratively optimizing the parameters until the loss function of the model reaches a preset value (which can be understood as selecting the loss function of the model as the key evaluation indicator and using the preset value as the first preset indicator), and outputting the model and the evaluation indicator; testing the output model based on the test set, and if it is judged that the preset threshold is reached (which can be understood as the evaluation indicator in Example 2 reaches the second preset indicator), then outputting the final training optimal model.

[0119] In step 605, the weight model of the trained model obtained in step 604 is converted, and the model is inferred to obtain an accurate segmentation result of the vehicle drivable area.

[0120] Wherein, the step 602 specifically includes:

[0121] In order to solve the problem that the vehicle-mounted camera is easily disturbed by factors such as light and vibration during the shooting process, the image noise is filtered out using mean shift.

[0122] Furthermore, the mean shift is:

[0123]

[0124] Among them, x t is the position of the tth iteration, x i represents the i-th sample in the data set, K is the kernel function, and h is the bandwidth parameter used to control the accuracy of the estimation. In each iteration, the mean shift is calculated by calculating the current position x t The similarity with other samples, and then weighted average to get the new position x t+1 , repeat this process until convergence. Here, according to the grayscale distribution of each image and repeated debugging, the values ​​​​t and i are positioned at 7 and 1.

[0125] In order to address the problem of insufficient contrast in some photos, the image quality is improved through histogram equalization, gamma transform and deep learning image super-resolution restoration methods.

[0126] This embodiment integrates gamma transform into the method of super-resolution restoration model ESRGAN (GAMA-ESRGAN). For the bird's-eye view image directly processed by ESRGAN, about 30% of the high-frequency texture will be lost due to the dark background road pixel value. For the too dark ones, 80% or even more texture may be lost. This embodiment adds gamma transform in the pre-processing stage of ESRGAN, and adjusts the dynamic range of the image through the gamma transform parameter γ, so that the brightness range of the image adapts to the input requirements of the restoration model.

[0127] The gamma transform is:

[0128] o=α*i γ

[0129] Where o and i are the output and input image pixel values, respectively, and α and o are positive constants. When γ<1, the power law curve maps a narrow range of dark input values ​​to a wider range of output values, and vice versa when γ>1. Considering that the image is overall dark, γ is set to 0.6.

[0130] For the restored image, the AVM stitching algorithm is used to stitch multiple images into a bird's-eye view of the drivable area of ​​the car centered on the car body.

[0131] This embodiment also proposes an AVM stitching algorithm for matching adjacent cameras based on RANSAC and PointSIFT, first using the PointSIFT method to extract feature descriptors from each camera image. These descriptors can be point clouds, feature points or local feature descriptors, which are used to represent key information in the image.

[0132] Then, for each camera’s feature descriptor, a similarity metric (such as L2 norm or cosine similarity) is used to calculate the distance or similarity between the feature descriptors of other cameras. By comparing the similarities between feature descriptors, matching between cameras can be performed.

[0133] Finally, RANSAC or other consistency estimation methods are used to screen the matching point pairs for inliers and estimate the geometric relationship between the cameras, such as the camera pose or basic matrix. The RANSAC algorithm can remove false matches and outliers, thereby improving the accuracy of the estimation. Based on the estimated geometric relationship between the cameras, the AVM surround stitching algorithm is used to stitch multiple environment sample images to obtain a bird's-eye view.

[0134] The step 603 specifically includes: dividing the bird's-eye view images of the area where the car can be driven into a training set, a validation set and a test set at an empirical ratio of 8:1:1; annotating the training set and the validation set, wherein: the drivable areas such as roads and parking spaces are recorded as drivable areas, with a label value of 1, and a corresponding pixel value of (1,1,1); pedestrians are recorded as non-drivable areas, with a label value of 2, and a corresponding pixel value of (2,2,2); other visible vehicles are recorded as non-drivable areas, with a label value of 3, and a corresponding pixel value of (3,3,3); grass and trees are recorded as non-drivable areas, with a label value of 4, and a corresponding pixel value of (4,4,4).

[0135] The initial Segformer model constructed in step 604 is as follows Figure 8 As shown, it consists of the following parts:

[0136] (1) Encoder: The encoder part of Segformer is essentially a Transformer structure that uses four consecutive encoders containing features of different scales. Each encoder is composed of a stack of encoder layers consisting of several efficient self-attention mechanisms and mixed fully connected feedforward networks. Overlapped PatchMerging is also performed between encoder layers. Finally, the outputs of the four encoders are passed together to the decoder.

[0137] (2) Decoder: The decoder decodes and fuses the effective receptive fields of the corresponding four stages in the encoder. The decoder of Segformer is essentially a Transformer structure with multiple Decoder Layers. The DecoderLayer integrates feature information at different levels by utilizing the self-attention mechanism and cross-attention mechanism in the encoder. The goal of the decoder is to convert the semantic information extracted by the encoder into pixel-level segmentation predictions. In order to achieve pixel-level segmentation, Segformer uses an upsampling operation at the end of the decoder to increase the size of the feature map to the same size as the input image. This process can be accomplished through interpolation or transposed convolution.

[0138] (3) Semantic segmentation prediction module (i.e., output layer in Example 1): Segformer performs semantic segmentation prediction by applying a pixel-wise classification head on the output of the decoder. The classification head is a convolutional layer whose output channels are equal to the number of categories in the segmentation task. Finally, each pixel is assigned to a different category through a linear layer function.

[0139] In order to meet different requirements for model size and performance, this embodiment constructs Segformer models of different sizes. According to the different Encoder Layers used in each encoder, we divide each Segformer model into six models, MiT-B0 to MiT-B5. It should be noted that Figure 8 Only a Segformer model is used as an example to illustrate its hierarchical structure. Considering the computing power of edge computing devices and model inference performance, the MiT-B2 model in the middle of the model sizes MiT-B0 to MiT-B5 in Segformer is selected as the initial Segformer model. The number of encoder layers in each of the four encoding stages of the MiT-B2 model is set to 3, 4, 6, and 3.

[0140] In addition, when computing resources are sufficient and the detection accuracy requirements are very high, you can consider choosing a larger model than MiT-B2; when computing resources are tight and the detection accuracy requirements are average or low, you can consider choosing a smaller model than MiT-B2.

[0141] In step 604, data augmentation is performed on the bird's-eye view images in the training set and the validation set respectively, specifically including:

[0142] (1) Scale the image to 2*m*k×m*k (m represents the original length and width, k represents the scaling ratio, such as randomly selecting a value from [0.5-2.0] as the k value). In the random scaling, increase the upper limit of the k value and reduce the lower limit.

[0143] (2) The image is randomly cropped back to its original size of m×m, the image is randomly flipped horizontally, and a target maximum cropping ratio is added in the random cropping so that the cropped semantic information cannot exceed this ratio, and the possibility of random horizontal flipping of the image is increased.

[0144] (3) Changing the brightness, contrast, saturation, hue and color space conversion of the image. The purpose of these changes is to retain more effective information when performing data enhancement while also increasing the possibility that the enhanced image has more semantic content.

[0145] In step 604, the validation set and the training set are input into the initial Segformer model and the initial Segformer model training is performed based on a preset learning strategy, specifically including:

[0146] Divide all data (including training set, validation set and test set) into several batches. After each batch is trained, analyze and optimize the parameters until all batches are completed. Finally, the loss function and other indicators of the model of the last batch reach the preset values, and output the model and evaluation indicators (which can be understood as the process of inputting the training subset and validation subset of the corresponding batch into the corresponding first intermediate model for training, and adjusting the hyperparameters to obtain the second intermediate model of each batch);

[0147] The AdamW optimizer is modified on the entire Segformer model structure, including the following two points:

[0148] (1) Adjust the learning rate scheduling strategy: Try to use a more appropriate learning rate scheduling strategy to speed up the convergence of the model. For example, if you use the "diffusion Poly learning rate strategy", after 5000 training iterations, add Gaussian noise to each encoder and schedule the learning rate based on the idea of ​​specifying the learning rate according to the noise level, so that the network updates parameters more cautiously in areas with higher noise. The goal of this method is to improve the robustness and generalization ability of the model by introducing noise during the model training process, and gradually reduce the learning rate during the training process.

[0149] (2) Adjust other hyperparameter settings: By adjusting the weight decay coefficient in the AdamW optimizer, balance the regularization effect of the model to increase the regularization ability of the model and prevent overfitting, such as trying to use a smaller weight decay coefficient; adjust the hyperparameters of the AdamW optimizer (β1, β2 and ε) to forget historical gradient information faster and improve numerical stability. For example, in the process of multiple model training experiments, gradually use smaller β1 and β2 (parameters in the Adam optimizer) values, from [0.9, 0.999] to [0.879, 0.959], thereby solving the problem of slow loss convergence in actual model training.

[0150] Among them, during the training process, the key evaluation indicators of each batch of model training, such as CrossEntropyLoss (cross entropy loss function), acc (Accuracy), and mIoU (Mean Intersection over Union), are analyzed, the current model training effect is fed back and the parameters are optimized again, and the feedback is circulated until the model is trained to the last step, and the output model of the corresponding batch after parameter optimization is obtained (which can be understood as the second intermediate model in Example 2). Finally, the loss function of the overall Segformer model, the accuracy of the decoder, the loss function of the decoder, the mIoU of the relevant categories, and the mIoU of the model as a whole are analyzed and sorted out, as shown in the figure. Fig. 9 As shown, a model that can achieve the best effect (i.e., the Segformer model trained in Example 2) is selected from all batches. Specifically: the output model is tested based on the test set, that is, after outputting the second intermediate model of each batch, each second intermediate model is also preliminarily verified, including: using pixel-level semantic induction to bring the test set images into four different categories, namely, drivable areas, pedestrians, vehicles, grass and trees, and indicate them with the pixel values ​​in the annotations, that is, for each pixel on each image in the test set, the coordinate value and the pixel value must be matched one by one, and then the matching result is determined based on the label on the test set. Then, the accuracy values ​​of different categories are counted and compared with the preset accuracy. If the accuracy of a certain category does not meet the standard, the proportion in step 603 is adjusted to increase the proportion of the training set and manually remove the extremely difficult to identify data. If all meet the standards, the final trained model is output.

[0151] In order to facilitate the deployment of the trained model, this embodiment also includes:

[0152] Convert the trained Segformer model ending in .pth format into a Segformer model ending in .pt format, which has higher actual deployment efficiency.

[0153] In actual use, the method further includes:

[0154] The results of Segformer semantic segmentation model inference are post-processed, and the obtained mask image is equalized using binarization and morphological opening and closing operations, and pseudo-color is added to make the mask image pixels of each target more prominent.

[0155] The mask image and the original image are superimposed in a ratio of 2:1 to obtain the final image, that is, the final image = 2 / 3*mask image + 1 / 3*original image.

[0156] In actual use, there is also an optional implementation for step 602: for a single original image, do not use surround stitching, directly align and annotate the data, and then put it into model training.

[0157] In step 602, if the acquisition phase meets the following points, the contents of these two steps can be reduced or deleted accordingly: 1) Camera settings: Cameras with high pixels, large apertures, and short exposure times can obtain higher quality images under the same lighting conditions. 2) Environmental design: Optimize the acquisition environment to reduce the impact of factors such as poor lighting, such as selecting acquisition time and weather conditions, and installing sun visors, windshields, and sunscreen nets at the acquisition site. 3) Acquisition posture: Through reasonable vehicle posture control, the camera can better capture road information, such as keeping the vehicle level, maintaining an appropriate distance and height, etc. 4) Multi-sensor combination: Combine data from different sensors, such as using sensors such as lidar to obtain more accurate map information, and improve prediction performance by fusing multimodal data.

[0158] In step 604, it is possible to consider using traditional image processing methods or other semantic segmentation methods. Traditional edge detection algorithms usually detect image edges based on brightness or gradient changes, but in complex scenes, edges may be disturbed by factors such as lighting changes, shadows, and textures, resulting in reduced accuracy of edge detection. Optical flow methods are also prone to erroneous optical flow estimation in the presence of rapid motion or texture loss. Edge detection can only provide boundary information in the image, but cannot provide semantic information about different regions. For executable area detection, it is often difficult to accurately distinguish roads, obstacles, and other objects based solely on edge information. In addition, traditional edge detection and optical flow methods usually require adjustment of some parameters, such as filter size, gradient threshold, etc. The selection of these parameters has a great impact on the performance of the algorithm; in different scenes and different images, the selection of parameters may be different, and manual adjustment is required, making the algorithm not adaptive and stable enough. Some traditional edge detection algorithms and optical flow methods are computationally complex and have high requirements for computing resources. This may cause problems in applications with high performance requirements in real-time scenarios.

[0159] The improved Segformer takes into account the model size (compared with the large VIT model, the SegFormer model has a smaller model size and fewer parameters), inference speed (due to the small size of the SegFormer model, the inference speed is also faster, which is suitable for real-time scenarios such as autonomous driving), accuracy (some techniques to improve the accuracy of the model are used, such as Deformable Convolutional Networks and Spatial Attention), and generalization ability (the SegFormer model uses data augmentation and regularization techniques during the training process, which is conducive to improving the generalization ability of the model, so that the model can achieve good performance on different data sets).

[0160] In step 605, if there is no demand for actual hardware, Python code can be used for reasoning directly; if the platform where the hardware is deployed does not support the .pth format model, the model can be converted into other binary deployment reasoning format models, such as .onnx, .engine, .bin, etc. The trained Segformer model is deployed on the corresponding device, and the device is used to identify the drivable area of ​​the car during the driving process of the car. The recognition process has been described in detail in Example 1 and will not be repeated here.

[0161] The splicing ratio of the mask image and the original image is not fixed, but is obtained by those skilled in the art based on the actual quality of the mask image and the imaging quality of the original image in the HSV color space.

[0162] Embodiment 5:

[0163] like Fig.10 FIG. 1 is a schematic diagram of the architecture of a device for identifying a drivable area of ​​a vehicle according to an embodiment of the present invention. The drivable area identification device of the present embodiment includes one or more processors 21 and a memory 22. Fig.10 A processor 21 is taken as an example.

[0164] The processor 21 and the memory 22 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0165] The memory 22 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the vehicle drivable area identification method in Embodiment 1, Embodiment 3, and Embodiment 4 or the deep learning model construction method for vehicle drivable area identification in Embodiment 2. The processor 21 executes the vehicle drivable area identification method by running the non-volatile software programs and instructions stored in the memory 22.

[0166] The memory 22 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 22 may optionally include a memory remotely arranged relative to the processor 21, and these remote memories may be connected to the processor 21 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0167] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, the vehicle drivable area identification method in the above-mentioned embodiments 1, 3, and 4 or the deep learning model construction method for vehicle drivable area identification in embodiment 2 is executed.

[0168] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific contents can be found in the description of the method embodiment of the present invention and will not be repeated here.

[0169] A person skilled in the art may understand that all or part of the steps in the various methods of the embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

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

Claims

1. A method for identifying a vehicle drivable area, It is characterized in that include: The Segformer model is used to identify the drivable area of ​​the car, including: Multiple sample images of the environment around the car are stitched together to obtain a bird's-eye view centered on the car body. After preprocessing the bird's-eye view, it is input into the trained Segformer model to identify the drivable area of ​​the car. The preprocessing of the bird's-eye view image includes: using mean shift to filter out noise in the environment sample image, and performing image enhancement on the environment sample image; the specific method of using mean shift to filter out noise in the environment sample image is: using Process each pixel in the environment sample image; where: is the position of the tth iteration, Indicates the first samples, is the kernel function, is the bandwidth parameter, which is used to control the accuracy of the estimate; in each iteration, the mean shift is calculated by Similarity with other samples, and then weighted average to get the new position , repeat this process until convergence; The method for constructing the trained Segformer model includes: marking a plurality of bird's-eye views to generate a training data set, a verification data set, and a test data set; constructing an initial Segformer model; using the training data set, the verification data set, and the test data set to train the initial Segformer model to obtain a trained Segformer model for identifying a drivable area for a vehicle; The initial Segformer model is a MiT-B2 model of medium size; the MiT-B2 model includes four encoders, a decoder and an output layer; each encoder includes multiple encoding layers, and the number of encoding layers in each encoder is set to 3, 4, 6 and 3 respectively; an overlapping compression merging layer is also set between every two encoding layers; the decoder includes multiple decoding layers and an upsampling layer, the decoding layer is used to integrate feature information of different levels using self-attention mechanism and cross-attention mechanism, and the upsampling layer is used to increase the size of the feature map to the same size as the input image; the output layer includes a classification head, which is a convolutional layer implemented by a linear layer function, and is used to assign each pixel to a different category; The initial Segformer model is trained using the training data set, the validation data set and the test data set, including: Dividing the training data set into a plurality of batches of training subsets, dividing the validation data set into a plurality of batches of validation subsets, and dividing the test data set into a plurality of test subsets; Input the training subset of each batch and the validation subset of each batch into the first intermediate model of the corresponding batch for training to obtain the second intermediate model of the corresponding batch; wherein the initial Segformer model is used as the first intermediate model of the first batch, and the second intermediate model of the previous batch is used as the first intermediate model of the next batch; Using the test subset of the corresponding batch to test the second intermediate model of the corresponding batch, obtaining the test result of the corresponding batch, and selecting a second intermediate model from the second intermediate models of all batches as the trained Segformer model according to the test results of all batches; After a preset number of second intermediate models are obtained through training, noise is added to each encoder of each subsequent first intermediate model based on a diffusion Poly learning rate strategy; According to the level of the added noise, a corresponding learning rate is set so that subsequent batches of training are performed according to the first intermediate model with added noise and the corresponding learning rate; wherein the corresponding learning rate is set according to the following method: the learning rate in the nth training iteration ,in, is a preset parameter set according to the total number of iterations, which is obtained by those skilled in the art based on empirical analysis. represents the learning rate set last time, that is, the learning rate in the n-1th training iteration, represents the noise added for the nth time and follows the standard normal distribution.

2. The method for identifying a drivable area of ​​a vehicle according to claim 1, It is characterized in that The test result is the accuracy of each category. The test subset of the corresponding batch is used to test the second intermediate model of the corresponding batch to obtain the test result of the corresponding batch, which specifically includes: performing the following operations on the second intermediate model of each batch: Inputting the test subset of the corresponding batch into the second intermediate model of the corresponding batch, and outputting a prediction result; wherein the prediction result includes a predicted category of each pixel of each image in the test subset; The predicted category of each pixel is matched with the labeled category of each pixel obtained by labeling, and it is determined whether the predicted category of each pixel is correct, and the accuracy of the second intermediate model of the corresponding batch in each category is counted.

3. The method for identifying a drivable area of ​​a vehicle according to claim 2, It is characterized in that The step of selecting a second intermediate model from the second intermediate models of all batches as a trained Segformer model according to the test results of all batches specifically includes: From the second intermediate models whose accuracy rates of all categories are greater than the corresponding preset accuracy rates, select the second intermediate model with the highest overall accuracy rate as the trained Segformer model; wherein the overall accuracy rate of the second intermediate model is calculated by combining the accuracy rates of each category of the second intermediate model with preset rules.

4. The method for identifying a drivable area of ​​a vehicle according to claim 1, It is characterized in that Before using the training data set, the validation data set and the test data set to train the initial Segformer model, the method further includes performing data augmentation on the images in the training data set, the validation data set and the test data set, specifically including: Scale the images in the training dataset and the validation dataset so that the length and width of the scaled images are 2×m1×k and m2×k respectively; where m1 is the length of the image, m2 is the width of the image, and k is the preset scaling factor; The scaled image is cropped to restore the cropped image to the size of the image before scaling, and the image is flipped; wherein the cropping ratio of the scaled image does not exceed a preset cropping ratio; It also adjusts the brightness, contrast, saturation and hue of the image, and converts the image into color space.

5. A device for identifying a drivable area for a vehicle, It is characterized in that The device comprises: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the method for identifying a drivable area of ​​a vehicle as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Synthetic aperture radar target identification method for small sample residual error learning

    CN109492556A

  • Scaled learning for training dnn

    CN113196304A

  • Differential privacy protection method and device based on deep learning

    CN113468592A

  • Driving area detection method, device and equipment and storage medium

    CN114663397A

  • Method for detecting abnormal behavior of vehicle in road monitoring video

    CN116363587A