Autonomous driving simulation image enhancement method and device based on deep learning
The enhancement of autonomous driving simulation images through deep learning technology solves the problems of low image data rendering accuracy and poor light and shadow effects in existing simulation technology, and improves the training effect of autonomous driving algorithms.
Patent Information
- Application Number
- CN202410592390.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-05-13
AI Technical Summary
The image data generated by existing autonomous driving simulation sensor simulation technology has problems such as low rendering accuracy, poor light and shadow effects, and abnormal object materials, resulting in unsatisfactory autonomous driving algorithm training results.
The automatic driving simulation image enhancement method based on deep learning is used to input the G buffer image of the simulation image into the G buffer encoder, extract the G buffer features, and input it with the simulation image into the trained generator to output the enhanced simulation image. , improve the realism and rendering accuracy of the image.
It improves the realism and light and shadow effects of simulation images, improves the training effect of autonomous driving algorithms, and enhances the rendering accuracy of images.
Smart Images

Figure CN118334221B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of autonomous driving technology, and in particular to a method and device for enhancing an autonomous driving simulation image based on deep learning. Background Art
[0002] Autonomous driving simulation sensor simulation technology plays a very critical role in building data-driven autonomous driving algorithms (such as deep learning perception and planning algorithms). It can not only generate important driving scene data and / or rare edge driving scene data (image data) on a large scale and at low cost, effectively reducing the economic and time costs of data collection; but also directly generate some data that is difficult to collect through existing sensors, such as depth and parallax true values.
[0003] Mainstream autonomous driving simulation sensor simulation frameworks such as CARLA, AirSim, Prescan and VTD all use game engines to render vehicle driving scenes to obtain relevant image data required by autonomous driving algorithms.
[0004] In the prior art, the image data generated by the game engine-based autonomous driving simulation sensor simulation technology usually has problems such as low rendering accuracy, poor lighting effects, and abnormal object materials compared to real data. Therefore, when the image data generated by the simulation software is directly used for autonomous driving algorithm / model training, the training effect is not ideal. Summary of the invention
[0005] In view of this, the present application proposes an autonomous driving simulation image enhancement method and device based on deep learning to solve the above problems.
[0006] On the one hand, the present application proposes a method for enhancing an autonomous driving simulation image based on deep learning, comprising the following steps:
[0007] Inputting the G-buffer image corresponding to the simulation image into the G-buffer encoder to obtain the G-buffer feature;
[0008] The G-buffer features and the simulated image are input into the trained generator, and an enhanced simulated image is output.
[0009] As an optional implementation scheme of the present application, optionally, the step of inputting the G buffer image corresponding to the simulation image into the G buffer encoder to obtain the G buffer feature includes:
[0010] Extracting a target buffer in the G-buffer image;
[0011] Inputting the target buffer into the trained G buffer encoder and performing normalization processing to obtain a normalized buffer result;
[0012] Obtain a depth buffer in the G-buffer image, and refer to the internal parameters of the RGB virtual camera example to project each pixel of the depth buffer into a three-dimensional space according to a preset projection method to obtain a three-dimensional point cloud;
[0013] The normalized buffer result, the depth buffer and the normal buffer in the G buffer image are superimposed and mapped to the three-dimensional point cloud to obtain a point feature point cloud;
[0014] Inputting the point feature point cloud into a preset point cloud network to obtain point cloud features;
[0015] According to the preset projection method, the point cloud feature is projected onto a 2D plane to obtain the G buffer feature.
[0016] As an optional implementation scheme of the present application, optionally, the method further includes: obtaining the trained generator, specifically including:
[0017] Get the simulated data set and the real data set respectively;
[0018] Separately dividing the simulated data set and the real data set into image blocks, and performing image block matching in a preset manner to obtain a model training data set;
[0019] Inputting the G-buffer image block corresponding to each divided simulation image block in the simulation data set into the G-buffer encoder to obtain training G-buffer features;
[0020] Input the training G buffer features and the simulated image blocks in the model training data set into the pre-trained generator, and output an enhanced simulated training image; wherein the simulated training image is the enhanced simulated image generated during the training process;
[0021] The enhanced simulated training image and the real image blocks in the model training data set are input into the discriminator, the discriminant loss is calculated, and back-propagation training is performed to obtain the trained generator.
[0022] As an optional implementation scheme of the present application, optionally, when acquiring the simulation data set, it includes:
[0023] The scene is built in advance; when the scene is built, a data collection vehicle instance is constructed, and an RGB virtual camera instance and a corresponding semantic segmentation camera instance are constructed at a preset position of the collection vehicle;
[0024] Collecting the RGB image queue returned by the RGB virtual camera instance to obtain a simulated RGB image;
[0025] The semantic segmentation queue returned by the semantic segmentation camera instance is collected to obtain a semantic segmentation truth map; and the semantic segmentation truth map is aligned with the simulated RGB image;
[0026] The G buffer image when the RGB virtual camera instance performs image rendering is extracted.
[0027] As an optional implementation scheme of the present application, optionally, when acquiring the real data set, it includes:
[0028] Set key frame extraction indicators;
[0029] Calculating the key frame extraction index between the key frame image and the current frame image;
[0030] Determine whether the key frame extraction index is less than a key frame threshold;
[0031] If so, updating the current frame image to a key frame image, and extracting the updated key frame image to form the real data set;
[0032] If not, recalculate the key frame extraction index between the key frame image and the next frame image until the calculation of all video frame images in the road acquisition video is completed;
[0033] The next frame image is a frame image after the current frame image.
[0034] As an optional implementation scheme of the present application, optionally, the calculation process of the key frame threshold includes:
[0035] Determining the maximum and minimum values of the key frame extraction index;
[0036] A preset number of intervals are set on average between the maximum value and the minimum value, and the number and probability density of values in each of the intervals are counted;
[0037] Traversing each of the intervals, respectively calculating the total probability and variance of the left interval and the current interval, and the total probability and variance of the right interval, and correspondingly obtaining a first calculation result and a second calculation result of each of the intervals;
[0038] After adding the first calculation result and the second calculation result, the intra-group variance of each interval is obtained;
[0039] The maximum intra-group variance among all the intra-group variances is determined, and the median value of the interval corresponding to the maximum intra-group variance is obtained to obtain the key frame threshold.
[0040] As an optional implementation scheme of the present application, optionally, the image blocks are respectively divided for the simulation data set and the real data set, and image block matching is performed in a preset manner to obtain a model training data set, including:
[0041] Preset an image selection interval, and randomly extract a two-dimensional point in the image selection interval;
[0042] Extracting a set of virtual image blocks from the simulation data set and a set of real image blocks from the real data set based on the two-dimensional points;
[0043] Presetting an image block matching index, and using the image block matching index to respectively calculate a feature tensor of a virtual image block in the virtual image block set and a feature tensor of a real image block in the real image block set;
[0044] A virtual image block feature tensor that matches the distance of the real image block feature tensor is calculated, an image pair is constructed, and the image pairs are combined into a model training data set.
[0045] As an optional implementation scheme of the present application, optionally, the step of inputting the training G buffer features and the simulated image blocks in the model training data set into a pre-trained generator and outputting an enhanced simulated training image comprises:
[0046] Pre-training a generator to obtain pre-trained weights of the generator;
[0047] The G-buffer feature and the simulated image block are input into the generator loaded with the pre-trained weights, and an enhanced simulated training image is output.
[0048] As an optional implementation scheme of the present application, optionally, the pre-training generator to obtain the pre-training weights of the generator includes:
[0049] Preset random mask of image;
[0050] The real data set is subjected to random mask processing of the image to obtain a generator training set;
[0051] The generator is self-supervised trained based on the generator training set to obtain pre-trained weights of the generator.
[0052] As an optional implementation scheme of the present application, optionally, the step of inputting the enhanced simulated training image and the real image block in the model training data set into a discriminator, calculating the discriminant loss, and performing back propagation training to obtain the trained generator includes:
[0053] Inputting the enhanced simulated training image and the real image block into a discriminator to calculate the discrimination loss;
[0054] The G-buffer encoder, the generator, and the discriminator are back-propagated using the discriminant loss to obtain the trained G-buffer encoder, the generator, and the discriminator.
[0055] In another aspect, the present application provides a device for implementing any of the above-mentioned deep learning-based autonomous driving simulation image enhancement methods, including:
[0056] A G-buffer feature determination module is configured to input a G-buffer image corresponding to the simulation image into a G-buffer encoder to obtain a G-buffer feature;
[0057] The simulation image enhancement module is configured to input the G-buffer feature and the simulation image into the trained generator and output an enhanced simulation image.
[0058] Technical effects of the present invention:
[0059] The present application enhances the simulation data through a generative deep learning method to improve the realism of the image. Specifically, it includes: inputting the G-buffer image corresponding to the simulation image into the G-buffer encoder to obtain the G-buffer feature; inputting the G-buffer feature and the simulation image into the trained generator, and outputting the enhanced simulation image. The present application enhances the simulation data through a generative deep learning method to improve the realism of the image. After the G-buffer feature and the simulation image are input into the trained generator, the generator output is the enhanced simulation image corresponding to the simulation image. The G-buffer feature is combined with the simulation image as the input of the generator, that is, the feature map output by the G-buffer encoder is used to enhance the simulation image, so that the image output by the generator has a strong sense of reality, and effectively improves the light and shadow effect of the image, improves the rendering accuracy, and at the same time, when the autonomous driving algorithm is trained based on the enhanced simulation image data, it can also effectively improve the training effect of the autonomous driving algorithm.
[0060] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0062] Figure 1 The figure shows a flowchart of an automatic driving simulation image enhancement method based on deep learning in an embodiment of the present application;
[0063] Figure 2 It is shown as a data collection flow chart in an embodiment of the present application;
[0064] Figure 3 It is a schematic diagram of the G buffer in the embodiment of the present application;
[0065] Figure 4 It is a schematic diagram of the key frame extraction process in the embodiment of the present application;
[0066] Figure 5 It is a schematic diagram of the image segmentation process in the embodiment of the present application;
[0067] Figure 6 It is a schematic diagram of the overall architecture of the model in the embodiment of the present application;
[0068] Figure 7 It is a schematic diagram before and after the superposition of the normal buffer and the normalized buffer results in the embodiment of the present application. DETAILED DESCRIPTION
[0069] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0070] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0071] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0072] Example 1
[0073] like Figure 1 As shown, on the one hand, the present application proposes a method for enhancing an autonomous driving simulation image based on deep learning, comprising the following steps:
[0074] S100, inputting the G buffer image corresponding to the simulation image into a G buffer encoder to obtain a G buffer feature;
[0075] In this step, since the G-buffer data are all 2D images, but part of the G-buffer encodes three-dimensional spatial structure information, such as pixel-level depth, pixel-level normal direction, etc., it is difficult to fully utilize this type of information in the G-buffer by simply applying the encoding method of 2D images. Therefore, this application innovatively introduces an encoder based on 3D point cloud convolution to encode the 2D G-buffer to obtain G-buffer features. In addition, the G-buffer encoder in this step processes the G-buffer image in a manner that includes at least one of normalization, point cloud mapping, point cloud feature extraction, and point cloud projection. The G-buffer features obtained after the above processing are convenient for subsequent input into the generator, so that an enhanced simulation image can be obtained.
[0076] At the same time, it should be particularly noted that in this step, the G-buffer image corresponding to the simulation image is input into the G-buffer encoder to obtain the G-buffer feature. In the simulation process, the simulation data set is obtained by simulation software based on a graphics engine, and preferably a CARLA simulation engine. For the acquisition of the G-buffer image, CARLA uses the deferred rendering technology to generate a G-buffer as an intermediate product during the rendering process. In this step, the listen_to_gbuffer API interface of CARLA is used to extract the G-buffer during the rendering process, thereby obtaining the G-buffer image.
[0077] S200, input the G-buffer features and the simulation image into the trained generator, and output the enhanced simulation image.
[0078] In this step, the simulation data is enhanced by a generative deep learning method to improve the realism of the image. After the G-buffer feature and the simulation image are input into the trained generator, the generator output is the enhanced simulation image corresponding to the simulation image. It should be noted that in this step, the G-buffer feature is combined with the simulation image as the input of the generator, that is, the simulation image is enhanced using the feature map output by the G-buffer encoder, so that the image output by the generator has a strong sense of reality, and effectively improves the light and shadow effect of the image, improves the rendering accuracy, and at the same time, when the autonomous driving algorithm is trained based on the enhanced simulation image data, it can also effectively improve the training effect of the autonomous driving algorithm.
[0079] As an optional implementation scheme of the present application, optionally, the G-buffer image corresponding to the simulation image is input into the G-buffer encoder to obtain G-buffer features, including: extracting the target buffer in the G-buffer image; inputting the target buffer into the trained G-buffer encoder, performing normalization processing, and obtaining a normalized buffer result; obtaining the depth buffer in the G-buffer image, and referring to the internal parameters of the RGB virtual camera example, projecting each pixel of the depth buffer into the three-dimensional space according to a preset projection method to obtain a three-dimensional point cloud; superimposing the normalized buffer result, the depth buffer and the normal buffer in the G-buffer image, and mapping them to the three-dimensional point cloud to obtain a point feature point cloud; inputting the point feature point cloud into a preset point cloud network to obtain point cloud features; projecting the point cloud features onto a 2D plane according to a preset projection method to obtain G-buffer features.
[0080] It should be noted that the above processes are all performed in the G buffer encoder.
[0081] The method of the present application innovatively uses an encoder based on 3D point cloud convolution to encode the 2D G buffer, which can fully and effectively utilize the three-dimensional spatial structure information in the G buffer, thereby more accurately capturing the geometric and lighting details in the scene. Figure 3 As shown, the G buffer image in this application includes a depth buffer, a template buffer, a normal buffer, a texture buffer, a diffuse buffer, a material-specific buffer, a shadow buffer, a velocity buffer, and a screen space ambient occlusion texture buffer. Specifically:
[0082] Depth buffer: The actual depth of the scene corresponding to each pixel in the image, the value comes from the depth buffer in the rendering pipeline.
[0083] Template buffer: The original value of the template buffer in the rendering pipeline. The template is a binary image that contains only values 0 and 1 and is used to limit the area where some special effects act in the image space.
[0084] Normal buffer: Each pixel in the image represents the normal vector of the object plane at the spatial point corresponding to the pixel.
[0085] Texture Buffer: Texture GBuffer is a three-channel image obtained by superimposing three single-channel grayscale images. The R channel is the metallicity of the object at the spatial point corresponding to the pixel. G corresponds to the specularity at the corresponding point. The B channel represents the roughness of the corresponding point.
[0086] Diffuse buffer: The diffuse reflection GBuffer is the diffuse reflection color calculated according to the diffuse reflection physical model under the scene lighting.
[0087] Material-specific buffer: The content of each pixel of this GBuffer is determined by the material rendering model of the object at the pixel position.
[0088] Shadow buffer: contains pre-calculated shadow intensities for every pixel in the scene.
[0089] Velocity buffer: includes the relative velocity of each pixel corresponding to the camera in screen space.
[0090] Screen Space Ambient Occlusion Texture Buffer: Contains the raw value of the ambient occlusion intensity for each pixel in screen space.
[0091] It should also be noted that after the G buffer image in the simulation image is input into the G buffer encoder, the processing method of the G buffer encoder includes at least one of normalization, point cloud mapping, point cloud feature extraction and projection. When the encoder based on 3D point cloud convolution encodes the G buffer image, buffer normalization is first performed, which is aimed at the target buffer in the G buffer image, in order to obtain a normalized buffer result. Among them, the target buffer in the present application includes at least one of a template buffer, a texture buffer, a diffuse reflection buffer, a material specialized buffer, a shadow buffer, a velocity buffer and a screen space ambient occlusion texture buffer. Furthermore, after normalization, point cloud mapping, point cloud feature extraction and point cloud projection are performed in sequence to obtain G buffer features.
[0092] The following is a detailed description of the specific encoding process of the G buffer encoder:
[0093] 1. Buffer normalization: For all buffers except the depth buffer and normal buffer, calculate the average value and standard deviation of each pixel in the same category of buffers. After obtaining the statistical results, subtract the average value and standard deviation of the unified category from each pixel of the buffer to obtain the normalized G buffer result.
[0094] 2. First, take the depth buffer. Assume that the size of each image in the G buffer is HxWx4. Based on the internal parameters of the simulated camera, project each pixel into the three-dimensional space to obtain a point cloud in the three-dimensional space. At this time, there are a total of HxW points in the point cloud. Figure 7 As shown, the normal buffer and all normalized buffers are then concatenated (superimposed) pixel by pixel to obtain a feature of length 36 at each pixel;
[0095] Then, through the depth buffer, the point cloud is obtained. The specific method is:
[0096] According to the principle of binocular camera imaging, for any point (x, y, z) in the world coordinate system in three-dimensional space, the point can be mapped to the camera coordinate system through the binocular camera external parameter matrix, and then the point can be mapped to the image coordinate system through the camera internal parameter matrix. Similarly, if the depth value of each pixel is available, the position of the three-dimensional coordinate point in the world coordinate system corresponding to each pixel can be obtained by the reverse process of the above process. Since this method only requires the information of the 3D point cloud and does not require the point cloud information under different camera poses, it can be assumed that the world coordinate system and the camera coordinate system are exactly the same. The formula for the position of the 3D point cloud can be obtained as follows:
[0097]
[0098]
[0099] z w =z c
[0100] In the formula, z c is the depth value of the pixel, u, v are the coordinates of the current pixel on the image, u0, v0 are the center of the image pixel, and f / dx, f / dy are the pixel focal lengths of the camera. u0, v0, f / dx, f / dy can be obtained from the camera's intrinsic parameter matrix.
[0101] After obtaining the point cloud based on the above method, each feature with a length of 36 is mapped to the three-dimensional point cloud to obtain the point feature point cloud in the three-dimensional space.
[0102] 3. Based on the PointNet++ network, set the number of input dimensions to 39 (plus the 3D spatial position of each point, a total of three dimensions), and the output dimension to 64. Input the point cloud features obtained in the previous step into PointNet++ to obtain point cloud features with the same number and position as the input, and the length of each point feature is 64.
[0103] Here, it should be noted that the method of the present application belongs to a class of image quality enhancement methods for simulated rendering, that is, extracting the rendering intermediate (GBuffer) in the simulation engine, and replacing the rendering engine of the simulation software with a neural network to make the rendering result more realistic. However, image rendering requires extracting information in three-dimensional space and simulating the interaction of information in three-dimensional space. For example, light in nature will be reflected and refracted multiple times in three-dimensional space, and colors will be obtained at different positions in space, and mapped to other positions in space. In order to extract information in space, the present application uses a depth map to map image features into a 3D point cloud. And in order to simulate the interaction in three-dimensional space, PointNet++ is used to interact and fuse point cloud features in three-dimensional space.
[0104] 4. Finally, perform point cloud projection operation, project each 64-dimensional point feature onto the 2D plane according to the pixel-3D coordinate mapping relationship calculated in the second step, and obtain a feature map of size HxWx64. This feature map is the output of the G buffer encoder. The purpose is to organize the point cloud features into the data structure of image features, which is convenient for subsequent input to the generator.
[0105] It should be noted that the method of the present application adjusts the above-mentioned various buffers to the same dimension, splices them, and maps them to three-dimensional space to obtain G-buffer features. The feature map output by the G-buffer encoder is used to enhance the simulated image, so that the image output by the network has a strong authenticity, and the light and shadow effects, material, etc. of the image are enhanced. The core idea of the method of the present application is to replace the rendering pipeline in the simulation software with a neural network, that is, to directly fit the rendering intermediate product (G-buffer) to the real image by using a neural network. Since the G-buffer already contains the material information and three-dimensional information of each object in the image, the features extracted by the G-buffer will also contain this information. Compared with the direct end-to-end from the simulated image to the real image, in this case, the network also needs to learn to extract material, depth and other scene information from the two-dimensional image, which is more beneficial to image enhancement.
[0106] Moreover, the method of the present application uses a trained generator to enhance the simulation data, and the G-buffer features obtained through the above process and the simulation image to be enhanced are input into the trained generator to obtain the enhanced simulation image. The generator training process in the present application will be described in detail below.
[0107] As an optional implementation scheme of the present application, optionally, the method in the present application also includes: obtaining a trained generator, specifically including: obtaining a simulated data set and a real data set respectively; performing image segmentation on the simulated data set and the real data set respectively, and performing image block matching in a preset manner to obtain a model training data set; inputting the G buffer image block corresponding to each segmented simulated image block in the simulated data set into a G buffer encoder to obtain a training G buffer feature; inputting the training G buffer feature and the simulated image block in the model training data set into a pre-trained generator to output an enhanced simulated training image; inputting the enhanced simulated training image and the real image block in the model training data set into a discriminator, calculating the discriminant loss, and performing back-propagation training to obtain a trained generator.
[0108] It should be noted that the above-mentioned simulated training images are enhanced simulated images (simulated image blocks) generated during the training process, which correspond one-to-one to the real image blocks.
[0109] In the process of training the generator, after obtaining the simulated data set and the real data set, the method of the present application performs image segmentation on the simulated data set and the real data set respectively. It should be emphasized here that the method of the present application can process the entire image of the simulated data set and the real data set, but in order to obtain a more suitable training data set, the image segmentation is selected to divide the image into multiple target areas, which can perform more detailed processing on each area and speed up the processing speed. Not only that, it should also be noted that in the existing virtual image generation model training process, it is usually necessary to train based on image pairs composed of virtual images and corresponding real images, and the similarity between virtual images and real images is required to be high (the similarity between the two must be above 90%). Compared with the existing training methods, the method of the present application can achieve the effect of image quality enhancement and style transfer based on the above image pairs without using image pairs that meet the above similarity requirements, effectively reducing the difficulty and cost of data collection.
[0110] Specifically, when training the generator, the present application first obtains a simulation data set and a real data set respectively;
[0111] In this step, since model training requires both simulated data sets and real data sets, the simulated data sets and real data sets are collected separately to construct the model training data sets required for subsequent model training. Among them, the simulated data sets include simulated RGB images, their corresponding semantic segmentation truth maps and G buffer images (GBuffer truth values), and are generated based on the CARLA simulation engine. The collection of real data sets is obtained by key frame extraction processing of real road video data.
[0112] As an optional implementation scheme of the present application, optionally, when acquiring a simulation data set, it includes: setting up a scene in advance; and when setting up the scene, constructing a data collection vehicle instance, and building an RGB virtual camera instance and a corresponding semantic segmentation camera instance at a preset position of the collection vehicle; collecting the RGB image queue returned by the RGB virtual camera instance to obtain a simulated RGB image; collecting the semantic segmentation queue returned by the semantic segmentation camera instance to obtain a semantic segmentation truth map; and aligning the semantic segmentation truth map with the simulated RGB image; extracting the G buffer image when the RGB virtual camera instance performs image rendering.
[0113] It should be noted that in the process of collecting simulation data sets, scene construction is a crucial link, which provides the necessary environment and conditions for subsequent data collection. Before the method of the present application officially starts to collect data, it is necessary to first build a simulation scene that meets the requirements, and create an instance of a data collection vehicle in the simulation scene, so that it has similar characteristics and capabilities to the actual collection vehicle, so as to simulate the real driving scene. At the same time, RGB virtual camera examples and corresponding semantic segmentation camera examples are constructed respectively, which are used to capture RGB images and generate semantic segmentation truth maps respectively. Among them, the position, orientation and parameter settings of the captured RGB images can reflect the visual information in the real driving scene, and the different objects in the scene, such as vehicles, pedestrians, etc., are identified by the generated semantic segmentation truth map, and corresponding notes are assigned to them, which is convenient for subsequent image segmentation and recognition.
[0114] Specifically, Figure 2 As shown, when collecting simulation data sets, the main process includes scene construction and data collection. The scene construction of this embodiment includes map selection, time and weather settings, collection vehicle initialization, sensor initialization, and AI vehicle and pedestrian initialization. The following will explain the above scene construction in detail:
[0115] 1. Map selection: Randomly select a map from the list of available maps and execute map loading.
[0116] 2. Time and weather settings: After the above maps are loaded, initialize the time controller and weather controller. The parameters of the time controller include the sun's depression angle and azimuth, and the parameters of the weather controller include rain intensity, fog intensity, wind intensity, road surface water intensity, etc. The values of each parameter can be dynamically cycled in a cycle throughout the collection process, so as to ensure that one collection process can cover data of various time, light and weather conditions.
[0117] 3. Initialize the data collection vehicle (self-vehicle): Get the list of currently available spawn points through the CARLA (open source autonomous driving simulator) API (application programming interface), randomly select one of the spawn points as the spawn point of the self-vehicle, and then construct a data collection vehicle instance. Since the data collection vehicle needs to run automatically, set the vehicle's autopilot (automatic assisted driving system) attribute to True through the CARLA API.
[0118] 4. Sensor initialization: Construct an RGB virtual camera instance at the front and top of the acquisition vehicle, specifically with the center of the vehicle as the origin, 1.5m forward and 1.4m above, and construct a semantic segmentation camera instance with exactly the same intrinsic parameters as the RGB camera at the same position. The resolution of the image captured by the camera is uniformly set to 1920x1080. It should be noted that the method of the present application has no specific requirements for the intrinsic parameters of the virtual camera, nor does it require the intrinsic parameters of the virtual camera to be consistent with the camera used for real data acquisition. Therefore, this method uses the default camera parameters in the CARLA API.
[0119] 5. Initialization of AI vehicles and AI pedestrians: Get the list of currently available birth points through the CARLA API, and randomly select a birth point as the birth point of the vehicle. To ensure that the created vehicle instance can drive automatically, set the autopilot attribute of the vehicle to True through the CARLA API. The initialization of AI pedestrians can be achieved in the same way, and the repetition will not be repeated.
[0120] Furthermore, the scene data of the constructed scene is collected and stored. First, the simulated RGB image is collected, wherein the RGB image queue returned by the RGB virtual camera constructed above is selected to obtain one frame every 5 frames, and the acquired image is saved on disk. Subsequently, the semantic segmentation truth map is collected, wherein the semantic segmentation map queue returned by the semantic segmentation camera example constructed above is also selected to obtain one frame every 5 frames and save it to disk to ensure that the simulated RGB image and the semantic segmentation truth map can be aligned. Finally, the G buffer image is collected, wherein it should be specially noted that the CARLA of the present application uses deferred rendering technology, and a G buffer will be generated as an intermediate product during the rendering process. This step uses the listen_to_gbuffer API interface of CARLA to extract the G buffer used in the rendering process of the simulated RGB camera image. And the G buffers are all four-channel images of the same size as the RGB image. If not explicitly stated, the fourth channel A channel of the G buffer is 0 value.
[0121] Thus, a series of simulated RGB images and corresponding semantic segmentation truth maps, as well as corresponding multiple G-buffer images are obtained. It should be noted that the method of the present application subsequently regards semantic segmentation as an additional G-buffer.
[0122] As an optional implementation scheme of the present application, optionally, when acquiring a real data set, it includes: setting a key frame extraction index; calculating a key frame extraction index between a key frame image and a current frame image; determining whether the key frame extraction index is less than a key frame threshold; if so, updating the current frame image to a key frame image, and extracting the updated key frame image to form a real data set; if not, recalculating the key frame extraction index between the key frame image and the next frame image until the calculation of all video frame images in the road acquisition video is completed; wherein the next frame image is a frame image after the current frame image.
[0123] The method of the present application uses the method of obtaining key frames from road sampling videos to construct a real data set, in which the two indicators FeatSIM and SSIM are innovatively used as the basis for extracting key frames. The reason is that the common SSIM indicator calculates the structural similarity between two images, including the similarity between the brightness, contrast and structure of the two images, but since this method usually adopts a traversal method to calculate the similarity of the same position (local) of the two images, and then calculates the similarity to find the average. In the actual recording process, affected by the camera's autofocus, automatic white balance, and automatic exposure functions, there will be large differences in brightness and contrast between adjacent similar frames, which will lead to a decrease in SSIM, and then cause similar frames to be missed from filtering.
[0124] In view of this, the method of the present application provides a more robust indicator as an auxiliary indicator, which can compare images at the semantic level and eliminate the influence of dynamically changing brightness and contrast on image similarity. The image features extracted by the deep neural network often contain information at the semantic level of the image and are not easily affected by image brightness. Therefore, the method of the present application uses the FeatSIM indicator based on the neural network feature as an auxiliary indicator.
[0125] It should be noted that the real data set in the method of the present application includes real RGB images and corresponding semantic segmentation labels. In order to obtain real RGB images, the road sampling video is first standardized, and the video image resolution is uniformly set to 1920x1080, that is, for videos with too low resolution, linear interpolation is used to upsample to 1920x1080, and for videos with too high resolution, linear interpolation is also used to downsample to 1920x1080. Subsequently, the video key frames are extracted in order to remove continuous frames and static fragments. Since the structure and semantic information contained in these frames are very similar, the corresponding image frames cannot provide additional valuable information in model training. If they are not removed, the efficiency of model training will be reduced. It should be emphasized that the method of the present application extracts image key frames based on the FeatSIM indicator and the SSIM indicator. Among them, the calculation of the FeatSIM indicator is based on a pre-trained InceptionResnetV2 image classification network, and the image features before the classification head of the classification network are taken (a one-dimensional tensor with a length of 1536). The similarity between two images is defined as the cosine similarity of the features extracted from the two images through the network, such as Figure 4 As shown, the method of the present application adds the FeatSIM index and the SSIM index as the key frame extraction index. The key frame index is the sum of the FeatSIM index and the SSIM index. Then, starting from the first frame of the video, the first frame is defined as a key frame, and then one frame is entered. If the sum of the FeatSIM index and the SSIM index of the current frame and the key frame is less than a preset similarity threshold, then one frame is entered, otherwise the key frame is updated. In addition, only the key frame is retained during the extraction process. In other words, the method of the present application calculates the key frame extraction index between the key frame image and the current frame image, and compares the key frame extraction index with the key frame threshold size, so as to determine whether the current frame image in the road acquisition video needs to be updated to the key frame image, wherein the key frame image and the current frame image are both a frame image in the road acquisition video, and the current frame image is a frame image after the key frame image. When the key frame extraction index is less than the key frame threshold, the current frame image is updated to the key frame image, and the updated key frame image is extracted to form a real data set. Subsequently, the above process is re-executed to calculate the key frame extraction index between the updated key frame image and the next frame image. When the key frame extraction index is greater than or equal to the key frame threshold, the key frame extraction index between the key frame image and the next frame image of the current frame image is recalculated until the calculation of all video frame images in the road acquisition video is completed.
[0126] As an optional implementation scheme of the present application, optionally, the calculation process of the key frame threshold includes: determining the maximum and minimum values in the key frame extraction index; setting a preset number of intervals between the maximum and minimum values on average, and counting the number and probability density of values in each interval; traversing each interval, respectively calculating the total probability and variance of the left interval and the current interval, as well as the total probability and variance of the right interval, and correspondingly obtaining the first calculation result and the second calculation result of each interval; adding the first calculation result and the second calculation result to obtain the intra-group variance of each interval; determining the maximum intra-group variance among all intra-group variances, and obtaining the median value of the interval corresponding to the maximum intra-group variance, to obtain the key frame threshold.
[0127] It should be noted that since the method of the present application introduces the FeatSIM indicator, when setting the key frame indicator, the sum of the FeatSIM indicator and the SSIM indicator is obtained by randomly selecting 50 pairs of similar frames and 50 pairs of difference frames. The specific calculation can be based on the Otsu threshold method. After determining the key frame threshold, the key frame threshold is used to determine which images in the road acquisition video belong to the key frame images, and continuous frames and still segments are removed to obtain a real data set. In turn, in model training, the problem that similar image frames cannot provide additional valuable information can be solved, and the training efficiency of the model can be improved after removal.
[0128] The process of determining the similarity threshold is described in detail below.
[0129] First, take the minimum and maximum of the above 100 values, then set 20 intervals between the minimum and maximum values on average, and count the number of values and probability density in each interval, where the probability density of an interval is equal to the number of values in the interval divided by the number of all values, that is, 100. Further, traverse each interval and calculate the probability and P0(t) and variance of the left interval (including the current interval) As well as the probability and P1(t) and variance of the right interval And calculate the within-group variance in the current interval The calculation formula is as follows:
[0130]
[0131] Where P0(t) = ∑ i≤t p(t),P1(t)=∑ i>t p(t), that is, the probability and P0(t) on the left side of the interval corresponding to threshold t and the probability and P1(t) on the right side of the interval corresponding to t. The similarity threshold is finally determined to be the median value of the interval with the largest variance within the group.
[0132] The determination of the FeatSIM index and the SSIM index will be described in detail below.
[0133] The calculation formula of FeatSIM is:
[0134]
[0135] In the formula, x1, x2 are image features, I1, I2 are original images, σ IRNv2 It is the InceptionResnetV2 network.
[0136] The SSIM used in the present invention is the average SSIM. First, the image is converted into a grayscale image, and then the SSIM in the window is calculated for each window position x and y corresponding to each position on the two images. The calculation of SSIM consists of three parts, namely brightness (l), contrast (c) and structure (s), and the calculation formula is as follows:
[0137]
[0138]
[0139]
[0140] In the formula, μ x ,μ y are the average values of the two images in the window. are the variances of the two images in the window. xy is the covariance of the pixels in the two image windows. c1=6.50, c2=58.52 are two constants.
[0141] The window width and height in the method of the present application are 11×11, and a Gaussian sliding window is used, that is, each pixel in the window is weighted according to a 2D Gaussian distribution, and the sliding step length on the image length and width is 1. After obtaining the SSIM values at all window positions of the image, the final SSIM between the two images is the average of all SSIM values.
[0142] At this point, the simulated data set and the real data set are obtained respectively.
[0143] Subsequently, the simulated data set and the real data set are divided into image blocks, and image block matching is performed according to a preset method to obtain a model training data set;
[0144] In this step, the preprocessing of the simulation data set and the real data set includes image segmentation and image block matching. After the simulation data set and the real data set are segmented, a set of virtual image blocks of the simulation data set and a set of real image blocks of the real data set are obtained. Subsequently, based on the distance between the image blocks, multiple virtual image blocks that can match the real image blocks are determined, thereby obtaining multiple image pairs, and then after combining the image pairs, a model training data set is constructed for subsequent model training.
[0145] As an optional implementation scheme of the present application, optionally, the simulated data set and the real data set are respectively divided into image blocks, and image blocks are matched in a preset manner to obtain a model training data set, including: presetting an image selection interval and randomly extracting two-dimensional points in the image selection interval; extracting a virtual image block set from the simulated data set and a real image block set from the real data set based on the two-dimensional points; presetting an image block matching index, and using the image block matching index to respectively calculate the virtual image block feature tensor in the virtual image block set and the real image block feature tensor in the real image block set; calculating the virtual image block feature tensor that matches the distance of the real image block feature tensor, constructing image pairs, and combining the image pairs into a model training data set.
[0146] The method of the present application performs data preprocessing after collecting the simulation data set and the real data set, wherein the data preprocessing includes two steps: image segmentation and image block matching.
[0147] For image segmentation, the image segmentation method of the present application is preferably random segmentation. Specifically, the size of the fixed image block is 256, such as Figure 5 As shown, assuming that the length and width of the image are w_img and h_img, the height interval in the image selection interval is [0, h_img-256], and the width interval is [0, w_img-256]. Randomly extract a two-dimensional point in the height interval and the width interval, use the two-dimensional point as the upper left corner of the image block, and take the 256×256 image in the lower right corner to obtain the image block. The method of the present application randomly divides each image in the simulation data set and the real data set into 16 256×256 image blocks by repeating the above method. Subsequently, the image blocks obtained from the simulation image set are composed of a virtual image block set, and all the image blocks obtained from the real image set are composed of a real image block set.
[0148] Furthermore, image block matching is performed. In order to achieve image block matching, it is first necessary to clearly define the matching index between image blocks, that is, to define the distance function between image blocks. The following will introduce the distance calculation method between image blocks in detail:
[0149] Based on the image features extracted by the pre-trained neural network, the distance between any two image blocks in the real image block set and the virtual image block set is calculated. Using the InceptionResnetV2 network pre-trained on ImageNet, a feature tensor with a length of 1536 is calculated for the image blocks obtained in the previous step. The distance between any two image blocks is then the Euclidean distance between the feature tensors.
[0150] Therefore, the specific implementation method of the image block matching of the method of the present application is: for all image blocks, the feature vector of each image block is calculated, and then for the feature vector of each real image block, k=8 virtual image block feature tensors with the smallest distance are calculated. Finally, among the 8 candidate image block feature tensors, the tensors with a calculated distance greater than 1 are eliminated. Thus, image pairs composed of multiple real image blocks and virtual image blocks are obtained, and these image pairs are combined into a model training data set. Among them, for some real image blocks, it may not be possible to find virtual image blocks that match them. For these image blocks, they are not included in the model training data set.
[0151] Furthermore, the G-buffer image blocks corresponding to each block of the simulated image blocks in the simulated data set are input into the G-buffer encoder to obtain the training G-buffer features. That is, the method of the present application uses the G-buffer image blocks to input into the G-buffer encoder, and after the normalization, point cloud mapping, point cloud feature extraction and point cloud projection steps of the G-buffer encoder, the training G-buffer features are obtained, so that when the generator is subsequently trained, the pre-trained generator can be input based on the training G-buffer features and the simulated data blocks in the model training data set to output the enhanced simulated training images.
[0152] As an optional implementation scheme of the present application, optionally, the training G-buffer features and the simulated image blocks in the model training data set are input into a pre-trained generator, and an enhanced simulated training image is output, including: pre-training the generator to obtain the pre-trained weights of the generator; inputting the G-buffer features and the simulated image blocks into the generator loaded with the pre-trained weights, and outputting the enhanced simulated training image.
[0153] The method of the present application, when training a generative model based on an adversarial method, in order to enable the generator to obtain effective gradients for training and improve the problem of slow convergence of the final model, a generator pre-training process is added before end-to-end training to quickly improve the strength of the generated gas in the early stage. Among them, the model in the present application includes a G buffer encoding network, a generation network and a discriminant network, and the discriminant network is only used in the model training process. It should be noted that the image enhancement network in the present application is implemented using a generator, and the generator uses a Transformer-enhanced UNet structure, which includes an image encoder, a Transformer module and a decoder. It should be particularly noted that in this step, in the overall model training process, a generator pre-training step is added before end-to-end training to improve the problem that the performance of the generator is slower than that of the discriminator, so that the generator can obtain effective gradients for training. That is, the training G-buffer features output by the G-buffer encoder and the simulated image blocks in the model training data set are input into the pre-trained generator, and the simulated images are enhanced so that the images output by the network have better authenticity. They are used to calculate the discriminant loss in the subsequent input discriminator, and back-propagation training is performed to obtain the trained generator.
[0154] As an optional implementation scheme of the present application, optionally, the generator is pre-trained to obtain the pre-trained weights of the generator, including: pre-setting an image random mask; obtaining a generator training set after subjecting a real data set to image random mask processing; and performing self-supervised training on the generator based on the generator training set to obtain the pre-trained weights of the generator.
[0155] Specifically, the pre-training process of the method of the present application is based on the self-supervised proxy task of image restoration to enhance the robustness of the pre-trained model on downstream tasks. Use a black mask to randomly mask a part of the image and input it into the generator network. The generator network generates a predicted image, calculates the loss for the predicted image and the original image without masking, and trains the generator. This method is a self-supervised method, does not require additional image annotation, and uses real images obtained by road sampling as the training data set for this task.
[0156] The process of generating an image coverage mask is described in detail below.
[0157] First, in each iteration of model training, a random area ratio r is preset, ranging from 0.25 to 0.75. Then, one of the three sizes (32x32, 64x64, 128x128) is randomly selected to construct a black square mask, and the mask is placed in a random place in the real image, and the masked area of the image is updated according to the size of the square. Repeat the selection and placement of squares until the ratio of the masked area of the image to the image area is greater than or equal to r, then stop. At this point, the generated image is the input of the model. After the masked image is input, the loss is calculated between the network output and the real image. This method uses L1 loss to train the network, that is, the average of the absolute difference between each corresponding pixel between the output image and the real image.
[0158] Specifically, Figure 6 As shown, the model training process of the present application method includes:
[0159] 1. First, pre-train the generator. After masking the real data set, use it as a training set for self-supervised training of the generator. After the model converges, the pre-trained weights of the generator are obtained.
[0160] 2. In the end-to-end training process, the 9 G-buffers in the above simulation data set are input into the G-buffer encoder. After normalization, point cloud mapping, point cloud feature extraction and projection in the G-buffer encoder, the training G-buffer features are obtained.
[0161] 3. The generator loads the pre-trained weights of the above generator.
[0162] 4. Input the simulated image blocks and training G-buffer features in the model training dataset into the generator network and output the enhanced simulated training images.
[0163] 5. Input the enhanced simulated training image and real image block into the discriminator for discrimination, and calculate the discrimination loss by formula (*) and formula (**). The loss value is used to back-propagate the entire network system, i.e., the G-buffer encoder, generator, and discriminator, until the system converges, completing the end-to-end training process of the system.
[0164] The specific optimization goal is shown in the following formula. Where G and D are the generator and discriminator networks used in this method, respectively. real ,p fake is the data distribution of real data and virtual simulation data images. E represents the expected value, x real represents the real training image patch, x fake Represents a virtual simulation training image patch.
[0165]
[0166]
[0167] It should be noted that in the process of realizing the back propagation function, it is not limited to the discriminator and Loss function of the present application. The back propagation function can also be realized by using other conventional discriminators and other conventional Loss functions. No specific limitation is made here.
[0168] As an optional implementation scheme of the present application, optionally, the enhanced simulated training images and the real image blocks in the model training data set are input into the discriminator, and the discriminant loss is calculated for back-propagation training to obtain a trained generator, including: inputting the enhanced simulated training images and the real image blocks into the discriminator, and calculating the discriminant loss; using the discriminant loss to back-propagate the G-buffer encoder, generator, and discriminator to obtain the trained G-buffer encoder, generator, and discriminator.
[0169] That is, the method of the present application trains a network system including a G-buffer encoder, a generator, and a discriminator end-to-end, and uses enhanced simulated training images and real image blocks as inputs of the discriminator, so that it can calculate the discrimination loss. And use the calculated discrimination loss to back-propagate the entire network system, optimize the parameters of the network system, and minimize the discrimination loss. In the whole process, the generator and the discriminator compete and cooperate with each other, which can effectively improve the performance of both, so that the model performance meets the actual needs.
[0170] Specifically, the discriminator in the method of the present application is based on PatchGAN, and the network backbone consists of 5 layers of Conv-GroupNorm-LeakyReLU. On the basis of adversarial loss, the present application additionally adds LPIPS loss, which calculates the perceptual image block similarity between the simulated image and the image generated by the generator, ensuring that the simulated image is generated with reference to the real image in the overall semantic structure of the image, and preventing the generator from adding additional content irrelevant to the scene to the image in order to reduce the discrimination. At the same time, in terms of adversarial, the optimization goal of the present application draws on the work of LSGAN, but the input is no longer Gaussian distributed noise but an image generated by the generator.
[0171] LPIPS loss is based on the VGG-19 network, and the output of the last convolutional layer of each stage of the network is selected as the feature. The network has 5 stages in total, so it can output five features. After splicing these features, the perceptual feature vector y can be obtained. Then, the virtual simulation image block and the generator output are input into the VGG network respectively, and the perceptual feature vectors y1 and y2 are obtained respectively. The LPIPS similarity index between two images can be expressed as:
[0172]
[0173] Furthermore, the model reasoning process of the present application is: perform normalization operations on the new simulated image and G-buffer image, load the weights of the trained generator and G-buffer encoder, build a graph generator and a G-buffer encoder, input the simulated image into the generator, input the G-buffer image into the G-buffer encoder, and obtain the output of the generator as an enhanced image.
[0174] In summary, the deep learning-based autonomous driving simulation data enhancement method of this application does not rely on image pairs, but can still achieve image quality enhancement and style transfer effects based on image pairs, which reduces the difficulty and cost of data collection compared to existing image pair-based algorithms. At the same time, the method of this application can greatly improve the realism of the image, and is independent of the source of the simulated image, and is compatible with a variety of simulation software based on graphics engines. Compared with methods such as NeRF, it has higher flexibility and scalability.
[0175] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned control methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk (Hard Disk Drive, abbreviated as: HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0176] Example 2
[0177] Furthermore, in another aspect, the present application provides a device for implementing any of the above-mentioned deep learning-based autonomous driving simulation image enhancement methods, comprising:
[0178] A G-buffer feature determination module is configured to input a G-buffer image corresponding to the simulation image into a G-buffer encoder to obtain a G-buffer feature;
[0179] The simulation image enhancement module is configured to input the G-buffer features and the simulation image into the trained generator and output the enhanced simulation image.
[0180] Example 3
[0181] In another aspect, the present application provides an electronic device, including:
[0182] processor;
[0183] a memory for storing processor-executable instructions;
[0184] Among them, the processor is configured to implement any of the above-mentioned deep learning-based autonomous driving simulation data enhancement methods when executing executable instructions.
[0185] The electronic device of the embodiment of the present disclosure includes a processor and a memory for storing processor executable instructions. The processor is configured to implement any of the above-mentioned deep learning-based autonomous driving simulation image enhancement methods when executing the executable instructions.
[0186] Here, it should be noted that the number of processors can be one or more. At the same time, the electronic device in the embodiment of the present disclosure may also include an input device and an output device. Among them, the processor, memory, input device and output device may be connected through a bus or in other ways, which are not specifically limited here.
[0187] The memory, as a computer-readable storage medium, can be used to store software programs, computer executable programs and various modules, such as the program or module corresponding to the deep learning-based autonomous driving simulation image enhancement method of the embodiment of the present disclosure. The processor executes various functional applications and data processing of the electronic device by running the software programs or modules stored in the memory.
[0188] The input device can be used to receive input numbers or signals. The signal can be a key signal related to user settings and function control of the device / terminal / server. The output device can include a display device such as a display screen.
[0189] Example 4
[0190] On the other hand, the present application provides a non-volatile computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement any of the above-mentioned deep learning-based autonomous driving simulation image enhancement methods.
[0191] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for enhancing an autonomous driving simulation image based on deep learning, characterized in that: The steps include: Inputting the G-buffer image corresponding to the simulation image into the G-buffer encoder to obtain the G-buffer feature; The step of inputting the G-buffer image corresponding to the simulation image into a G-buffer encoder to obtain a G-buffer feature comprises: Extracting a target buffer in the G-buffer image; Inputting the target buffer into the trained G buffer encoder and performing normalization processing to obtain a normalized buffer result; Obtain a depth buffer in the G-buffer image, and refer to the internal parameters of the RGB virtual camera example to project each pixel of the depth buffer into a three-dimensional space according to a preset projection method to obtain a three-dimensional point cloud; The normalized buffer result, the depth buffer and the normal buffer in the G buffer image are superimposed and mapped to the three-dimensional point cloud to obtain a point feature point cloud; Inputting the point feature point cloud into a preset point cloud network to obtain point cloud features; According to the preset projection method, the point cloud feature is projected onto a 2D plane to obtain the G buffer feature; Inputting the G-buffer feature and the simulated image into a trained generator, and outputting an enhanced simulated image; The method further comprises: Obtaining the trained generator specifically includes: Get the simulated data set and the real data set respectively; Separately dividing the simulated data set and the real data set into image blocks, and performing image block matching in a preset manner to obtain a model training data set; Inputting the G-buffer image block corresponding to each divided simulation image block in the simulation data set into the G-buffer encoder to obtain training G-buffer features; Input the training G buffer features and the simulated image blocks in the model training data set into the pre-trained generator, and output an enhanced simulated training image; The enhanced simulated training image and the real image blocks in the model training data set are input into the discriminator, the discriminant loss is calculated, and back-propagation training is performed to obtain the trained generator.
2. The deep learning-based autonomous driving simulation image enhancement method according to claim 1, characterized in that: When obtaining the real data set, it includes: Set key frame extraction indicators; Calculating the key frame extraction index between the key frame image and the current frame image; Determine whether the key frame extraction index is less than a key frame threshold; If so, updating the current frame image to a key frame image, and extracting the updated key frame image to form the real data set; If not, recalculate the key frame extraction index between the key frame image and the next frame image until the calculation of all video frame images in the road sampling video is completed; The next frame image is a frame image after the current frame image.
3. The method for enhancing the image of an autonomous driving simulation based on deep learning according to claim 2, characterized in that: The calculation process of the key frame threshold includes: Determining the maximum and minimum values of the key frame extraction index; A preset number of intervals are set on average between the maximum value and the minimum value, and the number and probability density of values in each of the intervals are counted; Traversing each of the intervals, respectively calculating the total probability and variance of the left interval and the current interval, and the total probability and variance of the right interval, and correspondingly obtaining a first calculation result and a second calculation result of each of the intervals; After adding the first calculation result and the second calculation result, the intra-group variance of each interval is obtained; The maximum intra-group variance among all the intra-group variances is determined, and the median value of the interval corresponding to the maximum intra-group variance is obtained to obtain the key frame threshold.
4. The method for enhancing the image of an autonomous driving simulation based on deep learning according to claim 1, characterized in that: The step of dividing the simulated data set and the real data set into image blocks respectively and performing image block matching in a preset manner to obtain a model training data set includes: Preset an image selection interval, and randomly extract a two-dimensional point in the image selection interval; Extracting a set of virtual image blocks from the simulation data set and a set of real image blocks from the real data set based on the two-dimensional points; Presetting an image block matching index, and using the image block matching index to respectively calculate a feature tensor of a virtual image block in the virtual image block set and a feature tensor of a real image block in the real image block set; A virtual image block feature tensor that matches the distance of the real image block feature tensor is calculated, an image pair is constructed, and the image pairs are combined into a model training data set.
5. The method for enhancing the image of an autonomous driving simulation based on deep learning according to claim 1, characterized in that: The step of inputting the training G-buffer features and the simulated image blocks in the model training data set into a pre-trained generator and outputting an enhanced simulated training image comprises: Pre-training a generator to obtain pre-trained weights of the generator; The G-buffer feature and the simulated image block are input into the generator loaded with the pre-trained weights, and an enhanced simulated training image is output.
6. The deep learning-based autonomous driving simulation image enhancement method according to claim 5, characterized in that: The pre-training generator obtains the pre-training weight of the generator, including: Preset random mask of image; The real data set is subjected to random mask processing of the image to obtain a generator training set; The generator is self-supervised trained based on the generator training set to obtain pre-trained weights of the generator.
7. The method for enhancing the image of an autonomous driving simulation based on deep learning according to claim 1, characterized in that: The step of inputting the enhanced simulated training image and the real image blocks in the model training data set into the discriminator, calculating the discrimination loss, and performing back propagation training to obtain the trained generator includes: Inputting the enhanced simulated training image and the real image block into a discriminator to calculate the discrimination loss; The G-buffer encoder, the generator, and the discriminator are back-propagated using the discriminant loss to obtain the trained G-buffer encoder, the generator, and the discriminator.
8. A device for implementing the deep learning-based autonomous driving simulation image enhancement method according to any one of claims 1 to 7, characterized in that: include: A G-buffer feature determination module is configured to input a G-buffer image corresponding to the simulation image into a G-buffer encoder to obtain a G-buffer feature; The step of inputting the G-buffer image corresponding to the simulation image into a G-buffer encoder to obtain a G-buffer feature comprises: Extracting a target buffer in the G-buffer image; Inputting the target buffer into the trained G buffer encoder and performing normalization processing to obtain a normalized buffer result; Obtain a depth buffer in the G-buffer image, and refer to the internal parameters of the RGB virtual camera example to project each pixel of the depth buffer into a three-dimensional space according to a preset projection method to obtain a three-dimensional point cloud; The normalized buffer result, the depth buffer and the normal buffer in the G buffer image are superimposed and mapped to the three-dimensional point cloud to obtain a point feature point cloud; Inputting the point feature point cloud into a preset point cloud network to obtain point cloud features; According to the preset projection method, the point cloud feature is projected onto a 2D plane to obtain the G buffer feature; A simulation image enhancement module is configured to input the G-buffer feature and the simulation image into a trained generator and output an enhanced simulation image; and further includes: Obtaining the trained generator specifically includes: Get the simulated data set and the real data set respectively; Separately dividing the simulated data set and the real data set into image blocks, and performing image block matching in a preset manner to obtain a model training data set; Inputting the G-buffer image block corresponding to each divided simulation image block in the simulation data set into the G-buffer encoder to obtain training G-buffer features; Input the training G buffer features and the simulated image blocks in the model training data set into the pre-trained generator, and output an enhanced simulated training image; The enhanced simulated training image and the real image blocks in the model training data set are input into the discriminator, the discriminant loss is calculated, and back-propagation training is performed to obtain the trained generator.
