Diffusion model-based automatic driving algorithm training data synthesis method
By training a data generation system for autonomous driving algorithms based on a diffusion model, and combining data preprocessing and generation methods of semantic segmentation and depth estimation, the problems of insufficient controllability and poor versatility in the generation process are solved, thereby improving the realism and generalization of the generated data and reducing additional annotation costs.
Patent Information
- Application Number
- CN202411239185.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2044-09-05
AI Technical Summary
Existing image generation technologies lack control over the generation process in autonomous driving training data, the generated results are not realistic enough, it is difficult to achieve accurate control at the object level, and the versatility and generalization are poor, requiring additional costs for screening and annotation.
An autonomous driving algorithm training data generation system based on a diffusion model is adopted, which includes a data preprocessing module, a data generation module, and a data verification module. Data preprocessing extracts supervision signals through semantic segmentation and depth estimation. The data generation module uses the diffusion model and combines semantic and depth information to generate images. The data verification module evaluates the generated results through semantic segmentation and depth estimation algorithms.
It improves the controllability of the generation process and the realism of the generated data, reduces the generation of low-quality data, lowers the additional annotation cost, and enhances the universality and generalization of the generated data.
Smart Images

Figure CN119131731B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of autonomous driving technology, specifically an autonomous driving algorithm training data generation system based on a diffusion model. Background Technology
[0002] For autonomous driving technologies, the quality of training data largely determines the model's performance. As autonomous driving technology advances, the demand for challenging examples is increasing. However, commonly used open-source datasets, compared to real-world road environments, typically offer relatively homogenous road conditions and lack comprehensive scenario coverage. This results in network models trained on such data being unable to generalize to other complex environments, failing to achieve satisfactory results on various data in real-world business scenarios. With the continuous development of artificial intelligence (AI) technology, generative AI (AI Generative Functional Groups) has significantly impacted production across various industries. Data generation is a rapidly developing field that aims to generate realistic or creative new images through deep learning. With the continuous iteration of data generation algorithms, using this technology to generate more data to address the problems of limited and challenging examples in existing training data has become a viable solution.
[0003] The most similar existing solution to this invention implements an image generation algorithm based on a diffusion model. This algorithm is essentially a U-shaped network framework that iteratively transforms noise from a standard Gaussian distribution into a true image through a denoising process. This method predicts noise guided by the classification label map, ensuring that the denoised image has a classification layout similar to the input label distribution.
[0004] This method comprises an encoder and a decoder. The encoder uses a diffusion-coded residual block and an attention module to encode the noisy data. The diffusion-coded residual block consists of convolutional layers, the SiLU activation function, and a group normalization layer. A time step is introduced as a parameter to enable the network to estimate noise at different time steps t. The attention module is a self-attention layer with skip connections. In the decoder, the method uses a classification label map as input to guide the denoising process and designs a diffusion-coded residual block. Unlike the diffusion-coded residual block, the diffusion-coded residual block replaces the group normalization layer with a spatially adaptive normalization layer, embedding the classification label map into the denoising network through a multi-layer spatial adaptive approach.
[0005] However, existing technologies lack sufficient controllability in the generation process. Current image generation techniques primarily control the process through a single guiding signal, such as text prompts. This leads to excessive freedom in the generation process, resulting in unrealistic and imprecise object-level control, making the generated results unsuitable for direct use as training data for autonomous driving. There is also a lack of quality verification for the generated results. Existing image generation technologies cannot automatically evaluate the generated results. Due to the randomness of the generation process, unsatisfactory results may occur, requiring additional costs for filtering. Furthermore, their versatility and generalization are poor. Existing image generation techniques typically use open-source datasets for training. While these datasets provide accurate and diverse label information, making data generation more convenient, the lack of labels makes them unusable for more general data. Therefore, such data generation methods have poor versatility and insufficient generalization of the generated data. Finally, the randomness of the generation process in existing image generation technologies means that some labeling results are inapplicable to the generated results, requiring additional costs for labeling the generated data. Summary of the Invention
[0006] The purpose of this invention is to provide a system for generating training data for autonomous driving algorithms based on a diffusion model in order to solve the problems mentioned above.
[0007] The technical solution adopted in this invention is as follows: an autonomous driving algorithm training data generation system based on a diffusion model, the system comprising a data preprocessing module, a data generation module, and a data verification module;
[0008] The data preprocessing module comprises four parts. The semantic segmentation within this module is crucial for extracting the semantic distribution of the input image. The semantic guidance signal obtained through the semantic segmentation network guides and supervises the overall distribution of the generated data. This system selects the InternImage-H model.
[0009] The data generation module uses a diffusion model to generate data. It includes a forward process and a backward process. In the forward process, random noise is slowly and sequentially added to the samples, and then in the backward process, parameters are learned and fitted to the noise to recover the samples from the noise.
[0010] The data verification module uses the aforementioned semantic segmentation and depth estimation algorithms to evaluate the generated results. It calculates semantic error and depth error based on the semantic pre-annotation and depth pre-annotation results of the original data, and uses these two errors to determine whether the current generated results meet the requirements.
[0011] In a preferred embodiment, the InternImage-H model is a general-purpose large-scale visual model based on multi-task learning. The core idea of multi-task learning is to learn multiple related tasks by sharing model parameters. Compared to the traditional single-task learning method of training a model separately for each task, multi-task learning uses a single model to train data from multiple tasks simultaneously, sharing some or all of the model parameters. In this way, different tasks can influence each other through shared parameters, and this sharing and transfer allows the model to better adapt to different tasks. This improves the generalization performance on different data and tasks. The foreground / background separation module mainly utilizes the results of semantic segmentation and separates the foreground and background according to the set semantic categories. After extracting the foreground objects in the image, the pixel values of these locations need to be filled to obtain a complete background image; this function is implemented in the image inpainting module.
[0012] In a preferred embodiment, the data preprocessing module uses the LaMa method, which is based on Fast Fourier Convolution. This algorithm not only improves the model's restoration quality but also reduces the number of model parameters. Furthermore, it can generate high-resolution restoration results using only low-resolution images, demonstrating good versatility. In existing data generation schemes, using only semantic maps for data generation can lead to depth ambiguity in the same semantic regions, meaning the relative depth relationships of objects cannot be determined, resulting in inconsistent depth in the generated images. Therefore, this application incorporates a depth estimation module to address this issue, using the MiDaS method for monocular depth estimation to constrain the relative depth relationships of foreground objects. This method is trained using a hybrid dataset and exhibits good generalization ability.
[0013] In a preferred embodiment, to ensure the generation quality of both the foreground and background, the data generation module uses two diffusion models with non-shared weights for data generation. In the background generation part, background cue words and a semantic map guide the generation process. The semantic map determines the semantic distribution of the entire image, while the background cue words change the style of image generation based on the determined semantic distribution, for example, guiding the generation of images for different weather conditions or seasons. Since there may be few images taken at a particular time in the original data, this method can supplement scene data for the corresponding environment. Experiments have shown that background generation generally has fewer semantic ambiguities and produces better results, thus eliminating the need for depth information guidance. In the foreground generation part, foreground objects with different appearances, such as vehicles of various colors or models, are mainly generated using foreground cue words.
[0014] In a preferred embodiment, the data generation module incorporates a depth map as a guiding signal to constrain the relative depth relationships of foreground objects in semantically similar regions. When using prompt words, a text encoding network is required; this application uses the CLIP method, a model for matching text and images. Its encoder part can be used to obtain high-dimensional features encoded from the text, which are then fused with features within the diffusion model.
[0015] In a preferred embodiment, the specific implementation of the system includes the following steps:
[0016] S101 acquires data for generating an image, which includes the image and annotation results consistent with the annotation task. For example, for an object detection task, the center coordinates of the bounding box and the length and width of the bounding box, or the coordinates of the diagonal points of the bounding box, are provided.
[0017] S102 inputs the image into the semantic segmentation network to obtain a semantic segmentation map.
[0018] S103 inputs the obtained semantic segmentation map into the foreground / background segmentation module. In this module, the foreground semantics are defined to include pedestrians, cyclists, cars, trucks, buses, motorcycles, and bicycles, while the remaining semantics are defined as background. Based on the defined foreground / background semantics, foreground and background images are obtained respectively.
[0019] S104 inputs the background image into the image inpainting network to obtain the inpainted background image.
[0020] S105 re-feeds the repaired background image into the semantic segmentation network to obtain the semantic segmentation map of the repaired background image. The semantic segmentation map of the background image is one of the inputs of the background generation part of the data generation module, and the pixel value is the category label value.
[0021] S106 feeds the input image into the depth estimation network to obtain a depth prediction map. The depth prediction map has the same resolution as the input image, and its pixel values are the predicted distances of the current pixel to the camera.
[0022] S107 obtains the maximum value of the depth prediction map, and divides all values in the depth prediction map by this maximum value to obtain a normalized depth prediction map. The pixel values of the normalized depth prediction map range from 0 to 1. This normalized depth prediction map is one of the inputs to the foreground generation section of the data generation module.
[0023] S201 constructs the foreground and background diffusion model networks for the data generation module and reads the model weight parameters.
[0024] S202 selects a prompt word and sends the prompt word to the text encoding module to obtain text features.
[0025] S203 initializes a Gaussian noise, which is then input into the diffusion model. The noise is first encoded in an encoder consisting of three residual blocks and an attention module. During this process, textual features are input into the attention module for feature guidance. The features are then fed into a decoder consisting of three residual blocks, where the semantic segmentation map is directly fed into the residual blocks for feature aggregation. For foreground generation, the normalized depth prediction map and the semantic segmentation map are concatenated along the feature dimension before being fed into the residual blocks. The decoder ultimately outputs a new, denoised image.
[0026] S204 stitches the foreground generated image and the background generated image together to obtain the complete generated image.
[0027] S301 inputs the generated result into the semantic segmentation network to obtain a semantic segmentation map, and calculates the category-weighted pixel accuracy with the semantic segmentation map of the input image.
[0028] S302 inputs the generated results into the depth estimation network to obtain a depth prediction map, and calculates the mean square error between the depth prediction map of the input image and the depth prediction map of the input image.
[0029] The root mean square error is calculated as follows: Iterate through all pixel positions, sequentially calculating the depth difference between the input image depth prediction map and the generated image depth prediction map at that position, and accumulate these differences. Then, square the accumulated difference and divide it by the total number of pixels in the input image.
[0030] S303 determines whether the semantic category pixel accuracy and depth mean square error meet the set thresholds. If both are met, the generated image and the corresponding annotation results of its input image are input into the training dataset; otherwise, the generated data is discarded.
[0031] In a preferred embodiment, in step S102, the semantic segmentation map has the same resolution as the input image, and each pixel location stores a category label value, indicating the category to which the pixel belongs. Pixels with the same category label value belong to the same category. The mapping relationship between the category label values and the true semantic meaning is shown in Table 1, which includes a total of 19 categories.
[0032] In a preferred embodiment, in step S103, the foreground image and the background image have the same resolution as the input image. The foreground image is one of the inputs to the foreground generation section of the data generation module, and its pixel values are category label values. The background image is sampled from the input image based on a semantic segmentation map, and its pixel values are the input image pixel values. The foreground object pixel portion is padded with 0s.
[0033] In a preferred embodiment, in step S104, the repaired background image supplements the pixels in the background image that are filled with 0 based on the pixels around them.
[0034] In a preferred embodiment, in step S301, the category-weighted pixel accuracy is calculated as follows: Iterate through all pixel positions, sequentially comparing the category predictions of the semantic segmentation map of the input image and the semantic segmentation map of the generated image at that position. If they match, the number of correct pixels for that category is incremented by 1. After all pixel calculations are completed, iterate through all appearing categories. For each category, count the total number of pixels of that category in the semantic segmentation map of the input image. The pixel accuracy of that category = the number of correct pixels of that category / the total number of pixels of that category. A weighted sum is then calculated for the pixel accuracy of all categories. The weights are calculated as follows: for each category, its pixel area ratio = the number of pixels of that category / the total area of the input image. For the pixel area ratios of all categories, the Softmax function is used to calculate their weights, and the sum of the weights of all categories is 1.
[0035] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:
[0036] 1. In order to improve the controllability of the data generation process, this solution uses various forms of supervision signals, such as semantics, depth, and text prompts, as auxiliary inputs during the generation process to constrain the generation process from multiple dimensions. While maintaining a certain degree of randomness, it ensures that the semantic distribution and depth relationship of the generated image are consistent.
[0037] 2. In order to ensure that the generated data meets expectations and reduce data that may be harmful to training, this solution uses some effective methods to automatically evaluate the generated results and filter out low-quality data.
[0038] 3. In order to ensure that the generated data has sufficient generalization, this solution does not rely on various forms of labels in open source datasets, but chooses more general semantic segmentation and depth estimation for data pre-labeling, and then generates data based on these labels.
[0039] 4. In order to make effective use of tags, this solution generates data based on tags (such as location, category, etc.) provided by relevant methods. Furthermore, these tags are always stored during the generation process. Since the tags play a certain role in constraining the generation process, they are also basically applicable to the generated results, thereby reducing the labeling cost of newly generated data. Attached Figure Description
[0040] Figure 1 This is a flowchart of the present invention;
[0041] Figure 2 This is a structural diagram of the data preprocessing framework in this invention;
[0042] Figure 3 This is a diagram of the data generation framework structure in this invention;
[0043] Figure 4 This is a structural diagram of the diffusion model in this invention;
[0044] Figure 5 This is a structural diagram of the data verification framework in this invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0046] Reference Figure 1-5 ,
[0047] Example:
[0048] The autonomous driving algorithm training data generation system based on the diffusion model includes a data preprocessing module, a data generation module, and a data verification module.
[0049] First, let's introduce the components of each module. The data preprocessing module is structured as follows: Figure 2 As shown, it mainly consists of four parts. Semantic segmentation is used to extract the semantic distribution of the input image, and it is the most important step. The semantic guidance signal obtained through the semantic segmentation network will guide and supervise the overall distribution of the generated data. This application chooses the currently advanced InternImage-H model, which is a general-purpose large-scale vision model based on multi-task learning. The core idea of multi-task learning is to learn multiple related tasks by sharing model parameters. Compared with the traditional single-task learning method of training a model separately for each task, multi-task learning uses a single model to train data from multiple tasks simultaneously, sharing some or all of the model parameters. In this way, different tasks can influence each other through shared parameters. This sharing and transfer allows the model to better adapt to different tasks, thereby improving the generalization performance on different data and tasks. The foreground and background separation module mainly utilizes the results of semantic segmentation and separates the foreground and background according to the set semantic categories.
[0050] After extracting the foreground objects from the image, the pixel values of these locations need to be filled to obtain a complete background image. This function is implemented in the image inpainting module, which uses the LaMa method. This algorithm is based on Fast Fourier Convolution, which not only improves the model's inpainting quality but also reduces the number of model parameters. Furthermore, it can produce high-resolution inpainting results using only low-resolution images, demonstrating good versatility. In existing data generation schemes, using only semantic maps for data generation can lead to depth ambiguity in the same semantic regions, i.e., the relative depth relationships of objects cannot be determined, resulting in inconsistent depth in the generated images. Therefore, this application incorporates a depth estimation module to address this issue, using the MiDaS method for monocular depth estimation to constrain the relative depth relationships of foreground objects. This method is trained using a hybrid dataset and exhibits good generalization ability.
[0051] The data generation module structure is as follows: Figure 3 As shown in the diagram. This module primarily uses a diffusion model for data generation. The diffusion model is a relatively advanced generation technique that defines a diffusion step based on a Markov chain. It includes a forward process and a backward process. In the forward process, random noise is slowly and sequentially added to the samples. Then, in the backward process, parameters are learned and fitted to the noise to recover the samples from the noise. The diffusion model structure used in this application is shown below. Figure 4 As shown. For the foreground and background, to ensure their respective generation quality, this application uses two diffusion models with non-shared weights for data generation. In the background generation part, background cue words and semantic maps are used to guide the generation process. The semantic map is used to determine the semantic distribution of the entire image, and the background cue words change the style of image generation when the semantic distribution is determined. For example, it guides the generation of images with different weather or different seasons. In the original data, there may be few images taken at a certain time. Therefore, this method can supplement the scene data of the corresponding environment. Experiments show that the generation of background usually has fewer semantic ambiguities and the generation effect is better. Therefore, depth information guidance is not required.
[0052] In the foreground generation section, foreground objects with different appearances, such as vehicles of various colors or models, are generated primarily through foreground cues. Furthermore, compared to background generation, foreground objects typically occupy fewer pixels and are prone to depth ambiguity, thus requiring more precise generation. This application incorporates depth maps as guiding signals to constrain the relative depth relationships of foreground objects in semantically similar regions. During the use of cues, a text encoding network is employed. This application uses the CLIP method, a model for matching text and images. Its encoder part encodes the text into high-dimensional features, which are then fused with features within the diffusion model.
[0053] Data verification module, such as Figure 5 As shown in the diagram, this module primarily uses the aforementioned semantic segmentation and depth estimation algorithms to evaluate the generated results. It calculates semantic error and depth error based on the semantic pre-annotation and depth pre-annotation results of the original data, and uses these two errors to determine whether the current generated result meets the requirements.
[0054] Specific implementation steps:
[0055] The specific implementation of this application includes the following steps:
[0056] S101 acquires data for generating an image, which includes the image and annotation results consistent with the annotation task. For example, for an object detection task, the center coordinates of the bounding box and the length and width of the bounding box, or the coordinates of the diagonal points of the bounding box, are provided.
[0057] S102 inputs the image into the semantic segmentation network to obtain a semantic segmentation map.
[0058] The semantic segmentation map has the same resolution as the input image, and each pixel location stores a category label value, indicating the category to which the pixel belongs. Pixels with the same category label value belong to the same category. The mapping relationship between category label values and true semantics is shown in Table 1, which contains a total of 19 categories.
[0059] Category label value Semantics Category label value Semantics 0 the way 9 ramp 1 sidewalk 10 Sky 2 architecture 11 pedestrian 3 wall 12 Cyclists 4 fence 13 small cars 5 Column 14 truck 6 Traffic lights 15 bus 7 Traffic signs 16 train 8 vegetation 17 motorcycle 18 bike
[0060] Table 1. Semantic segmentation category label values and semantic mapping relationships
[0061] S103 inputs the obtained semantic segmentation map into the foreground / background segmentation module. In this module, the foreground semantics are defined to include pedestrians, cyclists, cars, trucks, buses, motorcycles, and bicycles, while the remaining semantics are defined as background. Based on the defined foreground / background semantics, foreground and background images are obtained respectively.
[0062] The foreground and background images have the same resolution as the input image. The foreground image is one of the inputs to the foreground generation part of the data generation module, and its pixel values are category label values. The background image is sampled from the input image based on the semantic segmentation map, and its pixel values are the pixel values of the input image. The foreground object pixels are padded with 0.
[0063] S104 inputs the background image into the image inpainting network to obtain the inpainted background image.
[0064] The repaired background image fills in the pixels that were filled with 0s in the background image based on the pixels around them.
[0065] S105 feeds the repaired background image back into the semantic segmentation network to obtain a semantic segmentation map of the repaired background image.
[0066] The semantic segmentation map of the background image is one of the inputs to the background generation part of the data generation module, and the pixel value is the category label value.
[0067] S106 feeds the input image into the depth estimation network to obtain a depth prediction map.
[0068] The depth prediction map has the same resolution as the input image, and its pixel values are the predicted distances of the current pixel to the camera.
[0069] S107 obtains the maximum value of the depth prediction map, and divides all values of the depth prediction map by this maximum value to obtain a normalized depth prediction map.
[0070] The pixel values of the normalized depth prediction map range from 0 to 1. This normalized depth prediction map is one of the inputs to the foreground generation part of the data generation module.
[0071] S201 constructs the foreground and background diffusion model networks for the data generation module and reads the model weight parameters.
[0072] S202 selects a prompt word and sends the prompt word to the text encoding module to obtain text features.
[0073] S203 initializes a Gaussian noise and inputs it into the diffusion model, such as... Figure 4 As shown, the noise is first input into an encoder consisting of three residual blocks and an attention module for encoding. During this process, textual features are input into the attention module for feature guidance. The features are then fed into a decoder consisting of three residual blocks, where the semantic segmentation map is directly fed into the residual blocks for feature aggregation. For foreground generation, the normalized depth prediction map and the semantic segmentation map are concatenated along the feature dimension before being fed into the residual blocks. The decoder ultimately outputs a new, denoised image.
[0074] S204 stitches the foreground generated image and the background generated image together to obtain the complete generated image.
[0075] S301 inputs the generated result into the semantic segmentation network to obtain a semantic segmentation map, and calculates the category-weighted pixel accuracy with the semantic segmentation map of the input image.
[0076] The category-weighted pixel accuracy is calculated as follows: Iterate through all pixel positions, comparing the category predictions of the input image's semantic segmentation map and the generated image's semantic segmentation map at that position. If they match, the number of correct pixels for that category is incremented by 1. After all pixels have been calculated, iterate through all occurrences of a category. For each category, count the total number of pixels of that category in the input image's semantic segmentation map. The pixel accuracy for that category = number of correct pixels for that category / total number of pixels for that category. The pixel accuracy of all categories is then weighted and summed. The weights are calculated as follows: for each category, its pixel area ratio = number of pixels in that category / total area of the input image. The Softmax function is used to calculate the weight of each category's pixel area ratio, and the sum of all category weights is 1.
[0077] S302 inputs the generated results into the depth estimation network to obtain a depth prediction map, and calculates the mean square error between the depth prediction map of the input image and the depth prediction map of the input image.
[0078] The root mean square error (RMSE) is calculated as follows: Iterate through all pixel positions, calculating the depth difference between the predicted depth map of the input image and the predicted depth map of the generated image at each position, and accumulate these differences. Then, square the accumulated difference and divide it by the total number of pixels in the input image.
[0079] S303 determines whether the semantic category pixel accuracy and depth mean square error meet the set thresholds. If both are met, the generated image and the corresponding annotation results of its input image are input into the training dataset; otherwise, the generated data is discarded.
[0080] 1. In order to improve the controllability of the data generation process, this solution uses various forms of supervision signals, such as semantics, depth, and text prompts, as auxiliary inputs during the generation process to constrain the generation process from multiple dimensions. While maintaining a certain degree of randomness, it ensures that the semantic distribution and depth relationship of the generated image are consistent.
[0081] 2. In order to ensure that the generated data meets expectations and reduce data that may be harmful to training, this solution uses some effective methods to automatically evaluate the generated results and filter out low-quality data.
[0082] 3. In order to ensure that the generated data has sufficient generalization, this solution does not rely on various forms of labels in open source datasets, but chooses more general semantic segmentation and depth estimation for data pre-labeling, and then generates data based on these labels.
[0083] 4. In order to make effective use of tags, this solution generates data based on tags (such as location, category, etc.) provided by relevant methods. Furthermore, these tags are always stored during the generation process. Since the tags play a certain role in constraining the generation process, they are also basically applicable to the generated results, thereby reducing the labeling cost of newly generated data.
[0084] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0085] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A system for generating training data for autonomous driving algorithms based on a diffusion model, characterized in that: The system includes a data preprocessing module, a data generation module, and a data verification module; The data preprocessing module includes a semantic segmentation network, a foreground / background separation module, an image inpainting module, and a depth estimation module. The semantic segmentation network is an InternImage-H model, used to extract the semantic distribution of the input image and output a semantic segmentation map, which serves as the semantic guidance signal for the data generation module. The data generation module uses a diffusion model to generate data. The diffusion model includes a forward process and a backward process. In the forward process, random noise is added to the samples sequentially. In the backward process, parameters are learned and fitted to the noise to recover the samples from the noise. The data verification module uses the semantic segmentation network and the depth estimation module to evaluate the generated results. It calculates semantic error and depth error based on the semantic pre-labeling and depth pre-labeling results of the original data, and determines whether the current generated result meets the requirements based on the semantic error and the depth error. The data generation module includes a foreground diffusion model and a background diffusion model that do not share weights; The background diffusion model generates a background image using background cue words and a semantic map as control conditions. The semantic map is used to determine the semantic distribution of the entire image, and the background cue words are used to change the style of image generation when the semantic distribution is determined. The foreground diffusion model generates a foreground image using foreground cue words, a semantic map, and a depth map as control conditions. The data generation module also includes a text encoding module, which uses an encoder based on the CLIP model to encode prompt words into text features. The depth map serves as a guiding signal to constrain the relative depth relationships of foreground objects in semantically similar regions. The text features are used to fuse with features within the diffusion model.
2. The autonomous driving algorithm training data generation system based on diffusion model according to claim 1, characterized in that: The InternImage-H model is a general visual large model based on multi-task learning; the foreground and background separation module is used to separate the foreground and background using the semantic segmentation map and according to the set semantic category to obtain the foreground image and background image. The image inpainting module is used to fill in the pixels in the background image that were filled with 0 due to the removal of the foreground object, so as to obtain a complete background image.
3. The autonomous driving algorithm training data generation system based on diffusion model according to claim 1, characterized in that: The image inpainting module uses the LaMa method, which is based on Fast Fourier Convolution; the depth estimation module uses the MiDaS method for monocular depth estimation to constrain the relative depth relationship of foreground objects.
4. The autonomous driving algorithm training data generation system based on diffusion model according to claim 1, characterized in that: The specific implementation of the system includes the following steps: S101 acquires data for generating an image, which includes the image and annotation results consistent with the annotation task; S102 The image is input into the semantic segmentation network to obtain a semantic segmentation map; S103 inputs the obtained semantic segmentation map into the foreground-background separation module. In the foreground-background separation module, the foreground semantics are set to include pedestrians, cyclists, cars, trucks, buses, motorcycles, and bicycles, and the remaining semantics are background. Based on the set foreground semantics and background semantics, the foreground image and background image are obtained respectively. S104 Input the background image into the image insulation module to obtain the insulated background image; S105 The repaired background image is re-input into the semantic segmentation network to obtain the semantic segmentation map of the repaired background image. The semantic segmentation map of the repaired background image is one of the inputs of the background generation part of the data generation module, and the pixel value is the category label value. S106 The input image is sent to the depth estimation module to obtain a depth prediction map; the depth prediction map has the same resolution as the input image, and its pixel value is the predicted distance of the current pixel from the camera. S107 obtains the maximum value of the depth prediction map, and divides all pixel values of the depth prediction map by the maximum value to obtain a normalized depth prediction map; the pixel values of the normalized depth prediction map range from 0 to 1; the normalized depth prediction map is one of the inputs of the foreground generation part of the data generation module. S201 Construct the foreground diffusion model and background diffusion model networks of the data generation module respectively, and read the model weight parameters; S202 Select a prompt word and send the prompt word to the text encoding module to obtain text features; S203 initializes a Gaussian noise and inputs it into the diffusion model. The noise is first input into an encoder consisting of three layers of residual blocks and an attention module for encoding. During this process, text features are input into the attention module for feature guidance. The features are then fed into a decoder consisting of three layers of residual blocks. In this part, the semantic segmentation map is directly fed into the residual blocks for feature aggregation. For the foreground generation part, the normalized depth prediction map and the semantic segmentation map need to be concatenated along the feature dimension before being fed into the residual block; the decoder part finally outputs a new image after denoising. S204 stitches the foreground generated image and the background generated image together to obtain a complete generated image; S301 inputs the generated result into the semantic segmentation network to obtain a semantic segmentation map, and calculates the category-weighted pixel accuracy with the semantic segmentation map of the input image; S302 inputs the generated result into the depth estimation module to obtain a depth prediction map, and calculates the mean square error between the depth prediction map of the input image and the depth prediction map of the input image. The mean square error is calculated by looping through all pixel positions, sequentially calculating the depth difference between the input image depth prediction map and the generated image depth prediction map at that position, and accumulating the difference. The accumulated difference is squared and then divided by the total number of pixels in the input image. S303 determines whether the semantic category pixel accuracy and depth mean square error meet the set thresholds. If both are met, the generated image and the corresponding annotation results of its input image are input into the training dataset; otherwise, the generated data is discarded.
5. The autonomous driving algorithm training data generation system based on the diffusion model according to claim 4, characterized in that: In step S102, the semantic segmentation map has the same resolution as the input image, and each pixel position stores a category label value, indicating the category to which the pixel belongs. Pixels with the same category label value belong to the same category. The mapping relationship between the category label value and the real semantics is as follows: 0 road, 1 sidewalk, 2 building, 3 wall, 4 fence, 5 pillar, 6 traffic light, 7 traffic sign, 8 vegetation, 9 ramp, 10 sky, 11 pedestrian, 12 cyclist, 13 car, 14 truck, 15 bus, 16 train, 17 motorcycle, 18 bicycle, which includes a total of 19 categories.
6. The autonomous driving algorithm training data generation system based on the diffusion model according to claim 4, characterized in that: In step S103, the foreground image and the background image have the same resolution as the input image. The foreground image is one of the inputs of the foreground generation part of the data generation module, and the pixel value is the category label value. The background image is obtained by sampling the input image based on the semantic segmentation map, and the pixel value is the pixel value of the input image. The pixel part of the foreground object is filled with 0.
7. The autonomous driving algorithm training data generation system based on the diffusion model according to claim 4, characterized in that: In step S104, the image inpainting module supplements the zero-filled pixel portion based on the pixels surrounding the zero-filled pixel portion in the background image to obtain the inpainted background image.
8. The autonomous driving algorithm training data generation system based on the diffusion model according to claim 4, characterized in that: In step S301, the calculation method of the category-weighted pixel accuracy is as follows: loop through all pixel positions, and compare the category predictions of the semantic segmentation map of the input image and the semantic segmentation map of the generated image at that position. If they are consistent, the number of correct pixels of that category is incremented by 1. After all pixel calculations are completed, iterate through all occurrences of the category. For each category, count the total number of pixels of that category in the semantic segmentation map of the input image. The pixel accuracy of that category = number of correct pixels of that category / total number of pixels of that category. The pixel accuracy of all categories is then weighted and summed. The weights are calculated as follows: for each category, its pixel area ratio = number of pixels of that category / total number of pixels in the input image. For the pixel area ratio of all categories, the Softmax function is used to calculate its weight. The sum of the weights of all categories is 1.
Citation Information
Patent Citations
Image generation method and device, equipment and storage medium
CN116721174A
All-weather automatic driving data generation method and system based on diffusion model
CN117079248A
