Model training method and device, image generation method and device, equipment and storage medium

By diffusion processing of sample data and context semantic correlation reconstruction of the diffusion model and adjusting the model parameters, the problem of insufficient sample data in diffusion model training is solved, the quality and coherence of image generation are improved, and the user experience is improved.

CN119068311APending Publication Date: 2024-12-03PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411190777.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

During the training process, the existing diffusion model has few sample data, lack of patterns and lack of diversity, resulting in low quality of generated images and inability to generate detailed features, which affects the user's perception.

Method used

By obtaining the sample data set, selecting the target sample data for diffusion processing, generating Gaussian noise data, and performing context semantic correlation reconstruction, inputting it into the diffusion generation model to denoise, adjusting the model parameters until the model converges, and training efficient and high-quality Image generation model.

Benefits of technology

It improves the consistency and authenticity of the image generation model, greatly improving the user's image generation experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068311A_ABST
    Figure CN119068311A_ABST
Patent Text Reader

Abstract

The invention provides a model training method and device, an image generation method and device, equipment and a storage medium, and belongs to the field of data processing, and the method comprises the steps: obtaining a sample data set, and selecting one piece of sample data from the sample data set as target sample data, the target sample data comprising a feature map; performing diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data; performing context semantic association reconstruction on the Gaussian noise data according to the feature map to obtain target Gaussian noise data; and training a preset diffusion generation model according to the target Gaussian noise data and the sample data set until convergence to obtain the diffusion generation model. Diffusion processing is carried out based on the feature map of the sample data, Gaussian noise data corresponding to the feature map can be generated, diffusion generation model training is carried out based on the Gaussian noise data, and a diffusion generation model can be obtained. The invention further relates to a block chain technology, and the diffusion generation model can be stored in a block chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a model training method, image generation method, device, equipment and storage medium. Background Art

[0002] With the development of computer technology, the generation of text images is increasingly dependent on computer technology. At present, text images can usually be generated based on rules: a variety of fonts and image background materials are collected, and the text images are rendered and synthesized according to the arrangement rules of the text in the text image. For example, in banking or insurance business, when the salesperson talks with the customer, by synthesizing the product files into corresponding product pictures and product scenes, the product can be introduced in a concrete way, thereby increasing product sales and improving the customer's purchasing experience.

[0003] Currently, images are generally generated by diffusion models. However, the training process of diffusion models has problems such as small sample data, scarce patterns, and lack of diversity. As a result, the quality of the generated images is significantly damaged, and detailed features cannot be generated, making the image readability poor, which seriously affects the user's perception.

[0004] Therefore, how to train an image generation model with high generation efficiency and quality is a problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a model training method, image generation method, device, equipment and storage medium, aiming to train an image generation model with high generation efficiency and generation quality to improve image quality.

[0006] In a first aspect, the present application provides a model training method, the model training method comprising the following steps:

[0007] Acquire a sample data set, and select a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map;

[0008] Performing diffusion processing on the characteristic graph of the target sample data to obtain Gaussian noise data corresponding to the target sample data;

[0009] Reconstructing the contextual semantic association of the Gaussian noise data according to the feature graph to obtain target Gaussian noise data;

[0010] Input the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map;

[0011] Determining whether the preset diffusion generation model converges according to the predicted feature map and the feature map;

[0012] When the preset diffusion generation model fails to converge, the model parameters of the preset diffusion generation model are adjusted, and the step of selecting a sample data from the sample data set as the target sample data is continued until the preset diffusion generation model is obtained.

[0013] In a second aspect, the present application further provides an image generation method, the method comprising:

[0014] Obtain noise data to be denoised;

[0015] The noise data is input into a diffusion generation model to obtain a target image corresponding to the noise data, wherein the diffusion generation model is trained based on the model training method described in the embodiment of the present application.

[0016] In a third aspect, the present application further provides a model training device, the model training device comprising an acquisition module, a generation module, a determination module and a parameter adjustment module, wherein:

[0017] The acquisition module is used to acquire a sample data set and select a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map;

[0018] The generating module is used to perform diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data;

[0019] The generating module is further used to reconstruct the contextual semantic association of the Gaussian noise data according to the feature map to obtain target Gaussian noise data;

[0020] The generation module is further used to input the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map;

[0021] The determination module is used to determine whether the preset diffusion generation model converges according to the predicted feature map and the feature map;

[0022] The parameter adjustment module is used to adjust the model parameters of the preset diffusion generation model when the preset diffusion generation model has not converged;

[0023] The generation module is further used to continue to execute the step of selecting a sample data from the sample data set as the target sample data until the preset diffusion generation model is obtained to obtain the diffusion generation model.

[0024] In a fourth aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the model training method as described above and / or implements the steps of the image generation method as described above.

[0025] In a fifth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, it implements the steps of the model training method described above and / or the steps of the image generation method described above.

[0026] The present application provides a model training method, an image generation method, an apparatus, a device and a storage medium. The present application obtains a sample data set, and selects a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map; performs diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data; performs context semantic association reconstruction on the Gaussian noise data according to the feature map to obtain target Gaussian noise data; inputs the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map; determines whether the preset diffusion generation model converges according to the predicted feature map and the feature map; if the preset diffusion generation model does not converge, adjusts the model parameters of the preset diffusion generation model, and continues to perform the step of selecting a sample data from the sample data set as the target sample data until the preset diffusion generation model is obtained, thereby obtaining the diffusion generation model. The present application performs diffusion processing based on the feature map of sample data, can accurately generate Gaussian noise data corresponding to the feature map, reconstruct the contextual semantic association of the Gaussian noise data, retain the semantic connection of the feature value context in the feature map, and train the diffusion model based on the Gaussian noise data with semantic connection, so that the image generated by the trained diffusion model is more coherent and more realistic, greatly improving the user experience of image diffusion. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0028] Figure 1 A flowchart of a model training method provided in an embodiment of the present application;

[0029] Figure 2A schematic diagram of a flow chart of an image generation method provided in an embodiment of the present application;

[0030] Figure 3 A schematic block diagram of a model training device provided in an embodiment of the present application;

[0031] Figure 4 A schematic block diagram of an image generating device provided in an embodiment of the present application;

[0032] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0033] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0035] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0036] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0037] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0038] With the development of computer technology, the generation of text images is increasingly dependent on computer technology. At present, text images can usually be generated based on rules: a variety of fonts and image background materials are collected, and the text images are rendered and synthesized according to the arrangement rules of the text in the text image. For example, in banking or insurance business, when the salesperson talks with the customer, by synthesizing the product files into corresponding product pictures and product scenes, the product can be introduced in a concrete way, thereby increasing product sales and improving the customer's purchasing experience.

[0039] Currently, images are generally generated by diffusion models. However, the training process of diffusion models has problems such as small sample data, scarce patterns, and lack of diversity. As a result, the quality of the generated images is significantly damaged, and detailed features cannot be generated, making the image readability poor, which seriously affects the user's perception.

[0040] To solve the above problems, the embodiments of the present application provide a model training method, an image generation method, an apparatus, a device and a storage medium. The model training method includes obtaining a sample data set, and selecting a sample data from the sample data set as the target sample data, wherein the target sample data includes a feature map; performing diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data; reconstructing the context semantic association of the Gaussian noise data according to the feature map to obtain the target Gaussian noise data; inputting the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map; determining whether the preset diffusion generation model converges according to the predicted feature map and the feature map; if the preset diffusion generation model does not converge, adjusting the model parameters of the preset diffusion generation model, and continuing to perform the step of selecting a sample data from the sample data set as the target sample data until the preset diffusion generation model is obtained.

[0041] Among them, the model training method can be applied to computer devices, which can be electronic devices such as mobile phones, tablet computers, laptops, desktop computers, personal digital assistants and wearable devices.

[0042] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0043] Please refer to Figure 1 , Figure 1 A flowchart of a model training method provided in an embodiment of the present application.

[0044] like Figure 1 As shown, the model training method includes steps S101 to S106.

[0045] Step S101: Obtain a sample data set, and select a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map.

[0046] The sample data set includes multiple sample data, each sample data includes a feature map, and the feature map can be a feature vector of the sample data map. In some embodiments, the sample data can also include an image, that is, it can be understood that the sample data uses an image as a sample.

[0047] In some embodiments, multiple images are acquired, image feature vectors are extracted for each image to obtain image features corresponding to each image, and each sample data is established according to the image features of each image.

[0048] In some embodiments, a sample data is selected from the sample data set as the target sample data, wherein the method of selecting the sample data can be set according to the actual situation, and the embodiment of the present invention does not specifically limit this. For example, the method of selecting can be randomly selected from the sample data set, or the target sample data can be selected from the sample data set according to the order in which the sample data is generated. By selecting the target sample data from the sample data set and performing model training based on the target sample data, the efficiency and accuracy of the generated model training can be improved.

[0049] Step S102: performing diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data.

[0050] Gaussian noise is gradually added to the target sample data to perform forward diffusion on the target sample data to obtain Gaussian noise data corresponding to the target sample data. By performing forward diffusion on the target sample data, the Gaussian noise data corresponding to the target sample data can be accurately obtained.

[0051] It should be noted that the method of adding noise to the target sample data can be selected according to actual conditions, and the embodiments of the present invention do not specifically limit this. For example, the noise adding method can be a random differential equation method, that is, Gaussian noise is gradually added to the target sample data through a random differential equation to perform forward diffusion on the target sample data to obtain Gaussian noise data corresponding to the target sample data.

[0052] Step S103: reconstruct the contextual semantic association of the Gaussian noise data according to the feature map to obtain target Gaussian noise data.

[0053] The context semantic association is performed on the Gaussian noise data so that adjacent Gaussian noises have semantic association.

[0054] In some embodiments, the feature value of each feature point in the feature map is obtained, and the contextual semantic relationship of each feature point is determined according to the feature value of each feature point; the Gaussian noise data is feature reconstructed according to the contextual semantic relationship of each feature point to obtain the target Gaussian noise data. The target Gaussian noise data can be accurately obtained by feature reconstructing the Gaussian noise data through the contextual semantic relationship of the feature value of each feature point.

[0055] In some embodiments, according to the feature value of each feature point, the contextual semantic relationship of each feature point can be determined by associating the feature value of each feature point through a preset context decoder to obtain the contextual semantic relationship of each feature point. Among them, the preset context decoder can be set according to actual conditions, and the embodiment of the present invention does not make specific limitations on this. By associating the feature value of each feature point through a preset context decoder, the contextual semantic relationship of each feature point can be obtained, which greatly improves the efficiency and accuracy of determining the semantic relationship.

[0056] In some embodiments, the Gaussian noise data is feature reconstructed according to the contextual semantic relationship of each feature point, and the target Gaussian noise data can be obtained by: obtaining the Gaussian noise value corresponding to each feature point; performing contextual semantic association processing on the matched Gaussian noise values ​​according to the contextual semantic relationship of each feature point to perform feature reconstruction on each Gaussian noise value to obtain standard Gaussian noise data. By performing contextual semantic association processing on the Gaussian noise values ​​to perform feature reconstruction on each Gaussian noise value, the correlation between each Gaussian noise value is made closer, so that the image generated by the trained diffusion model during image denoising has coherence and authenticity.

[0057] In some embodiments, after the target sample data is diffused, the feature map of the target sample data is diffused to obtain Gaussian noise data corresponding to the target sample data; the context semantic association of the Gaussian noise data is reconstructed according to the feature map to obtain the target Gaussian noise data; and the step of selecting a sample data from the sample data set as the target sample data is continued until the number of target Gaussian noise data reaches a preset number. The preset number can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the preset number can be set to 100,000. By training a large amount of target Gaussian noise data, the efficiency of subsequent training diffusion generation model can be improved.

[0058] Step S104: input the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map.

[0059] The target Gaussian noise data is input into the preset diffusion generation model for denoising to obtain a predicted feature map. By denoising the target Gaussian noise data using the preset diffusion generation model, the predicted feature map can be accurately obtained.

[0060] Step S105: Determine whether the preset diffusion generation model converges according to the predicted feature map and the feature map.

[0061] In some embodiments, the loss value of the preset diffusion generation model is determined based on the predicted feature map and the feature map; if the loss value is less than or equal to the preset loss value, it is determined that the preset diffusion generation model has converged; if the loss value is greater than the preset loss value, it is determined that the preset diffusion generation model has not converged. Among them, the preset loss value can be set according to actual conditions, and the present invention does not make specific limitations on this. For example, the preset loss value can be set to 0.02. Through the preset loss value of the diffusion generation model, it is possible to accurately know whether the model has converged, which greatly improves the efficiency and accuracy of model training.

[0062] In some embodiments, the loss value of the preset diffusion generation model can be determined according to the predicted feature map and the feature map by: calculating the Wasserstein distance between the predicted feature map and the feature map to obtain the Wasserstein distance value; and determining the Wasserstein distance value as the loss value of the preset diffusion generation model. By calculating the Wasserstein distance between the predicted feature map and the feature map to obtain the Wasserstein distance value, the loss value of the diffusion generation model can be accurately obtained, which greatly improves the efficiency and accuracy of diffusion model training.

[0063] In some embodiments, the target Gaussian noise data is input into a preset diffusion generation model for denoising to obtain a predicted feature map; the Wasserstein distance between the predicted feature map and the feature map is calculated to obtain a Wasserstein distance value; the Wasserstein distance value is determined as a loss value of the preset diffusion generation model; if the loss value is less than or equal to the preset loss value, it is determined that the preset diffusion generation model converges.

[0064] Step S106, when the preset diffusion generation model has not converged, adjusting the model parameters of the preset diffusion generation model, and continuing to execute the step of selecting a sample data from the sample data set as the target sample data, until the preset diffusion generation model is obtained.

[0065] In some embodiments, if the loss value is greater than a preset loss value, it is determined that the preset diffusion generation model has not converged, the model parameters of the preset diffusion generation model are adjusted, and the steps of selecting a sample data from the sample data set as the target sample data are continued; performing diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data; reconstructing the contextual semantic association of the Gaussian noise data according to the feature map to obtain the target Gaussian noise data; inputting the target Gaussian noise data into the preset diffusion generation model for denoising to obtain a predicted feature map; and determining whether the preset diffusion generation model has converged according to the predicted feature map and the feature map, until the preset diffusion generation model is obtained.

[0066] The model training method provided in the above embodiment obtains a sample data set and selects a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map; performs diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data; performs context semantic association reconstruction on the Gaussian noise data according to the feature map to obtain target Gaussian noise data; inputs the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map; determines whether the preset diffusion generation model converges according to the predicted feature map and the feature map; if the preset diffusion generation model does not converge, adjusts the model parameters of the preset diffusion generation model, and continues to execute the step of selecting a sample data from the sample data set as the target sample data until the preset diffusion generation model is obtained. The present application performs diffusion processing based on the feature map of sample data, can accurately generate Gaussian noise data corresponding to the feature map, reconstruct the contextual semantic association of the Gaussian noise data, retain the semantic connection of the feature value context in the feature map, and train the diffusion model based on the Gaussian noise data with semantic connection, so that the image generated by the trained diffusion model is more coherent and more realistic, greatly improving the user experience of image diffusion.

[0067] Please refer to Figure 2 , Figure 2 A flowchart of an image generation method provided in an embodiment of the present application.

[0068] like Figure 2 As shown, the model training method includes steps S201 to S202.

[0069] Step S201: Obtain noise data to be denoised.

[0070] The noise data to be denoised is obtained, where the noise data is random Gaussian noise.

[0071] Step S202: input the noise data into a diffusion generation model to obtain a target image corresponding to the noise data, wherein the diffusion generation model is trained based on the model training method described in an embodiment of the present application.

[0072] Among them, the diffusion generation model is trained based on the model training method described in the embodiment of the present application.

[0073] In some embodiments, the noise data is input into the diffusion generation model to obtain a target image corresponding to the noise data. The noise data is denoised by the diffusion generation model to accurately obtain the target image.

[0074] The image generation method in the above embodiment obtains noise data to be denoised; inputs the noise data into a diffusion generation model to obtain a target image corresponding to the noise data, wherein the diffusion generation model is trained based on the model training method described in the embodiment of the present application. De-noising the noise data by using the diffusion generation model can accurately obtain the target image, greatly improving the user experience.

[0075] See also Figure 3 , Figure 3 A schematic block diagram of a model training device provided in an embodiment of the present application.

[0076] like Figure 3 As shown, the model training device 300 includes an acquisition module 310, a generation module 320, a determination module 330 and a parameter adjustment module 340, wherein:

[0077] The acquisition module 310 is used to acquire a sample data set and select a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map;

[0078] The generating module 320 is used to perform diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data;

[0079] The generating module 320 is further used to reconstruct the context semantic association of the Gaussian noise data according to the feature map to obtain target Gaussian noise data;

[0080] The generation module 320 is further used to input the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a prediction feature map;

[0081] The determination module 330 is used to determine whether the preset diffusion generation model converges according to the predicted feature map and the feature map;

[0082] The parameter adjustment module 340 is used to adjust the model parameters of the preset diffusion generation model when the preset diffusion generation model has not converged;

[0083] The generation module 320 is further used to continue to execute the step of selecting a sample data from the sample data set as the target sample data until the preset diffusion generation model is obtained to obtain the diffusion generation model.

[0084] In some embodiments, the generating module 320 is further configured to:

[0085] Acquire a feature value of each feature point in the feature map, and determine a contextual semantic relationship of each feature point according to the feature value of each feature point;

[0086] The Gaussian noise data is feature reconstructed according to the contextual semantic relationship of each feature point to obtain target Gaussian noise data.

[0087] In some embodiments, the generating module 320 is further configured to:

[0088] The feature value of each feature point is associated with each other through a preset context decoder to obtain a context semantic relationship of each feature point.

[0089] In some embodiments, the generating module 320 is further configured to:

[0090] Obtaining the Gaussian noise value corresponding to each of the feature points;

[0091] Contextual semantic association processing is performed on the matched Gaussian noise values ​​according to the contextual semantic relationship of each of the feature points, so as to perform feature reconstruction on each of the Gaussian noise values ​​to obtain the standardized Gaussian noise data.

[0092] In some embodiments, the determining module 330 is further configured to:

[0093] Determining a loss value of the preset diffusion generation model according to the predicted feature map and the feature map;

[0094] If the loss value is less than or equal to a preset loss value, determining that the preset diffusion generation model converges;

[0095] If the loss value is greater than a preset loss value, it is determined that the preset diffusion generation model has not converged.

[0096] In some embodiments, the determining module 330 is further configured to:

[0097] Calculating the Wasserstein distance between the predicted feature map and the feature map to obtain a Wasserstein distance value;

[0098] The Wasserstein distance value is determined as the loss value of the preset diffusion generation model.

[0099] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned model training device can refer to the corresponding process in the aforementioned model training method embodiment, and will not be repeated here.

[0100] See also Figure 4 , Figure 4 A schematic block diagram of an image generating device provided in an embodiment of the present application.

[0101] like Figure 4 As shown, the image generating device 400 includes an acquisition module 410 and a generation module 420, wherein:

[0102] The acquisition module 410 is used to acquire noise data to be denoised;

[0103] The generation module 420 is used to input the noise data into a diffusion generation model to obtain a target image corresponding to the noise data, wherein the diffusion generation model is trained based on the model training method described in the embodiment of the present application.

[0104] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned image generating device can refer to the corresponding process in the aforementioned image generating device embodiment, and will not be repeated here.

[0105] See also Figure 5 , Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application.

[0106] like Figure 5 As shown, the computer device 500 includes a processor 502 and a memory 503 connected via a system bus 501 , wherein the memory 503 may include a storage medium and an internal memory.

[0107] The storage medium may store a computer program. The computer program includes program instructions, which, when executed, may cause the processor to execute any one of the model training methods and / or image generation methods.

[0108] The processor 502 is used to provide computing and control capabilities and support the operation of the entire computer device.

[0109] The internal memory provides an environment for the operation of the computer program in the storage medium. When the computer program is executed by the processor, the processor can execute any model training method.

[0110] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0111] It should be understood that the processor 502 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0112] In one embodiment, the processor 502 is used to run a computer program stored in the memory to implement the following steps:

[0113] Acquire a sample data set, and select a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map;

[0114] Performing diffusion processing on the characteristic graph of the target sample data to obtain Gaussian noise data corresponding to the target sample data;

[0115] Reconstructing the contextual semantic association of the Gaussian noise data according to the feature graph to obtain target Gaussian noise data;

[0116] Input the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map;

[0117] Determining whether the preset diffusion generation model converges according to the predicted feature map and the feature map;

[0118] When the preset diffusion generation model fails to converge, the model parameters of the preset diffusion generation model are adjusted, and the step of selecting a sample data from the sample data set as the target sample data is continued until the preset diffusion generation model is obtained.

[0119] In one embodiment, when the processor 502 performs context semantic association reconstruction on the Gaussian noise data according to the feature map to obtain target Gaussian noise data, it is configured to implement:

[0120] Acquire a feature value of each feature point in the feature map, and determine a contextual semantic relationship of each feature point according to the feature value of each feature point;

[0121] The Gaussian noise data is feature reconstructed according to the contextual semantic relationship of each feature point to obtain target Gaussian noise data.

[0122] In one embodiment, when the processor 502 determines the contextual semantic relationship of each feature point according to the feature value of each feature point, it is configured to implement:

[0123] The feature value of each feature point is associated with each other through a preset context decoder to obtain a context semantic relationship of each feature point.

[0124] In one embodiment, when the processor 502 performs feature reconstruction on the Gaussian noise data according to the contextual semantic relationship of each feature point to obtain target Gaussian noise data, it is configured to implement:

[0125] Obtaining the Gaussian noise value corresponding to each of the feature points;

[0126] Contextual semantic association processing is performed on the matched Gaussian noise values ​​according to the contextual semantic relationship of each of the feature points, so as to perform feature reconstruction on each of the Gaussian noise values ​​to obtain the standardized Gaussian noise data.

[0127] In one embodiment, when the processor 502 implements the step of determining whether the preset diffusion generation model converges according to the predicted feature graph and the feature graph, it is configured to implement:

[0128] Determining a loss value of the preset diffusion generation model according to the predicted feature map and the feature map;

[0129] If the loss value is less than or equal to a preset loss value, determining that the preset diffusion generation model converges;

[0130] If the loss value is greater than a preset loss value, it is determined that the preset diffusion generation model has not converged.

[0131] In one embodiment, when the processor 502 determines the loss value of the preset diffusion generation model according to the predicted feature map and the feature map, it is used to implement:

[0132] Calculating the Wasserstein distance between the predicted feature map and the feature map to obtain a Wasserstein distance value;

[0133] The Wasserstein distance value is determined as the loss value of the preset diffusion generation model.

[0134] In one embodiment, the processor 502 is further configured to implement:

[0135] Obtain noise data to be denoised;

[0136] The noise data is input into a diffusion generation model to obtain a target image corresponding to the noise data, wherein the diffusion generation model is trained based on the model training method described in any embodiment of the present application.

[0137] It should be noted that those skilled in the art can clearly understand that, for the sake of convenience and conciseness of description, the specific working process of the computer device described above can refer to the corresponding process in the aforementioned model training method and / or image generation method embodiments, and will not be repeated here.

[0138] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions. The method implemented when the program instructions are executed can refer to the various embodiments of the model training method of the present application.

[0139] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may be non-volatile or volatile. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0140] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0141] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0142] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0143] It should also be understood that the term "and / or" used in the present specification refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0144] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation mode of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application.

Claims

1. A model training method, characterized in that: include: Acquire a sample data set, and select a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map; Performing diffusion processing on the characteristic graph of the target sample data to obtain Gaussian noise data corresponding to the target sample data; Reconstructing the contextual semantic association of the Gaussian noise data according to the feature graph to obtain target Gaussian noise data; Input the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map; Determining whether the preset diffusion generation model converges according to the predicted feature map and the feature map; When the preset diffusion generation model fails to converge, the model parameters of the preset diffusion generation model are adjusted, and the step of selecting a sample data from the sample data set as the target sample data is continued until the preset diffusion generation model is obtained.

2. The model training method according to claim 1, characterized in that: The step of reconstructing the contextual semantic association of the Gaussian noise data according to the feature graph to obtain target Gaussian noise data includes: Acquire a feature value of each feature point in the feature map, and determine a contextual semantic relationship of each feature point according to the feature value of each feature point; The Gaussian noise data is feature reconstructed according to the contextual semantic relationship of each feature point to obtain target Gaussian noise data.

3. The model training method according to claim 2, characterized in that: Determining the contextual semantic relationship of each feature point according to the feature value of each feature point includes: The feature value of each feature point is associated with each other through a preset context decoder to obtain a context semantic relationship of each feature point.

4. The model training method according to claim 2, characterized in that: The step of reconstructing the features of the Gaussian noise data according to the contextual semantic relationship of each feature point to obtain target Gaussian noise data includes: Obtaining the Gaussian noise value corresponding to each of the feature points; Contextual semantic association processing is performed on the matched Gaussian noise values ​​according to the contextual semantic relationship of each of the feature points, so as to perform feature reconstruction on each of the Gaussian noise values ​​to obtain the standardized Gaussian noise data.

5. The model training method according to claim 1, characterized in that: The step of determining whether the preset diffusion generation model converges according to the predicted feature graph and the feature graph includes: Determining a loss value of the preset diffusion generation model according to the predicted feature map and the feature map; If the loss value is less than or equal to a preset loss value, determining that the preset diffusion generation model converges; If the loss value is greater than a preset loss value, it is determined that the preset diffusion generation model has not converged.

6. The model training method according to claim 5, characterized in that: Determining the loss value of the preset diffusion generation model according to the predicted feature map and the feature map includes: Calculating the Wasserstein distance between the predicted feature map and the feature map to obtain a Wasserstein distance value; The Wasserstein distance value is determined as the loss value of the preset diffusion generation model.

7. An image generation method, characterized in that: include: Obtain noise data to be denoised; The noise data is input into a diffusion generation model to obtain a target image corresponding to the noise data, wherein the diffusion generation model is trained based on the model training method according to any one of claims 1 to 6.

8. A model training device, characterized in that: The model training device includes an acquisition module, a generation module, a determination module and a parameter adjustment module, wherein: The acquisition module is used to acquire a sample data set and select a sample data from the sample data set as target sample data, wherein the target sample data includes a feature map; The generating module is used to perform diffusion processing on the feature map of the target sample data to obtain Gaussian noise data corresponding to the target sample data; The generating module is further used to reconstruct the contextual semantic association of the Gaussian noise data according to the feature map to obtain target Gaussian noise data; The generation module is further used to input the target Gaussian noise data into a preset diffusion generation model for denoising to obtain a predicted feature map; The determination module is used to determine whether the preset diffusion generation model converges according to the predicted feature map and the feature map; The parameter adjustment module is used to adjust the model parameters of the preset diffusion generation model when the preset diffusion generation model has not converged; The generation module is further used to continue to execute the step of selecting a sample data from the sample data set as the target sample data until the preset diffusion generation model is obtained to obtain the diffusion generation model.

9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the model training method as described in any one of claims 1 to 6 and / or implements the steps of the image generation method as described in claim 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the model training method according to any one of claims 1 to 6 and / or the steps of the image generation method according to claim 7 are implemented.