Image generation method, system, terminal and storage medium based on group Dirichlet diffusion
By adopting an image generation method based on grouped Dirichlet diffusion, the problem that the existing technology cannot effectively capture the dependencies and hierarchical structures within multi-channel image groups is solved, and a more stable and high-quality image generation effect is achieved.
Patent Information
- Application Number
- CN202510733549.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Existing diffusion generative models cannot effectively capture intra-group dependencies and hierarchical structures when processing multi-channel images, resulting in poor stability of image data.
This method uses a grouped Dirichlet diffusion-based image generation method. The image data is partitioned using a grouped Dirichlet distribution and then subjected to noise diffusion using a concentration parameter, outputting multiple noise data. These noise data are then mapped into logit space to generate latent embedding vectors, which are used to train the encoder and decoder, ultimately generating the target image data.
It effectively captures the intra-group dependencies and hierarchical structures of multi-channel images, improves the stability and quality of image generation, and enhances the convergence speed and generation effect of training.
Smart Images

Figure CN120259477B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image generation technology, and in particular to an image generation method, system, terminal and computer-readable storage medium based on grouped Dirichlet diffusion. Background Art
[0002] Image generation is a core research area in artificial intelligence and computer vision, aiming to automatically generate images with visual realism or semantic consistency through algorithms. In recent years, diffusion models have rapidly emerged as a mainstream approach to image generation, owing to their superior performance in image clarity, diversity, and training stability. Their fundamental principle is to gradually recover a realistic image from the noise by gradually adding noise to the image (the forward process) and learning to remove the noise (the reverse process).
[0003] The current mainstream diffusion generation models are mostly based on Gaussian noise distribution. Although these methods have achieved remarkable results in the field of image generation, they have certain limitations when processing high-dimensional bounded data (such as multi-channel images), especially in modeling intra-group dependencies and inter-group structures. They cannot effectively capture the intra-group dependencies and hierarchical structures of multi-channel data.
[0004] In addition, although the diffusion of the Beta distribution has a certain range control capability, it lacks the adaptive regulation capability between multiple groups of structures and has limited numerical stability.
[0005] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention
[0006] The main purpose of the present invention is to provide an image generation method, system, terminal and computer-readable storage medium based on grouped Dirichlet diffusion, aiming to solve the problem in the prior art that existing diffusion models are unable to effectively capture the intra-group dependencies and hierarchical structures of multi-channel data in terms of modeling intra-group dependencies and inter-group structures, thereby resulting in poor stability of image data.
[0007] To achieve the above object, the present invention provides an image generation method based on grouped Dirichlet diffusion, the image generation method based on grouped Dirichlet diffusion comprising the following steps:
[0008] Acquire image data, input the image data into the constructed grouped Dirichlet generative model for forward diffusion, and output a plurality of noise data of the image data;
[0009] Mapping all the noise data into the logit space, outputting a potential embedding vector, and training the constructed initial encoder and initial decoder using the potential embedding vector to obtain a target encoder and a target decoder;
[0010] Inputting the image data into the target encoder for downsampling, and outputting low-resolution bottleneck features and skip connection features;
[0011] The low-resolution bottleneck features and the skip connection features are input into the target decoder for upsampling, and target image data is output.
[0012] Optionally, the image generation method based on grouped Dirichlet diffusion, wherein the acquiring of image data, inputting the image data into a constructed grouped Dirichlet generation model for forward diffusion, and outputting a plurality of noise data of the image data, specifically comprises:
[0013] Obtain image data input by the user and construct a grouped Dirichlet generative model;
[0014] The image data is input into the grouped Dirichlet generative model, which divides the image data into multiple independent groups:
[0015] ;
[0016] in, represents the number of independent groups, represents the index of the independent group, Indicates the independent groups, Indicates the The concentration parameters of the independent groups, represents the process of noise perturbation on image data, represents grouped Dirichlet distribution;
[0017] Using the concentration parameters of each independent group, noise diffusion is performed on each independent group, and noise data at different time steps are output:
[0018] ;
[0019] ;
[0020] in, Indicates the The probability distribution of the noise data in time steps, Indicates the The probability distribution of the noise data in time steps, represents the grouped Dirichlet generative model, Indicates the Noisy data for time steps, Indicates the Noisy data for time steps, Represents input data, Indicates the The noise intensity of each time step, Indicates the The noise intensity of each time step, Represents the global concentration parameter.
[0021] Optionally, the image generation method based on grouped Dirichlet diffusion, wherein the concentration parameter of each independent group is used to perform noise diffusion on each independent group, and noise data at different time steps is output, further comprises:
[0022] Using a nonlinear strategy, the noise intensity at each time step is obtained:
[0023] ;
[0024] ;
[0025] in, Indicates the The noise intensity of each time step, Express Using nonlinear strategies, Indicates the The concentration parameter for each time step, and All represent constants, Represents normalized time.
[0026] Optionally, the image generation method based on grouped Dirichlet diffusion, wherein the mapping of all the noise data into a logit space, outputting a potential embedding vector, and training the constructed initial encoder and initial decoder using the potential embedding vector to obtain a target encoder and target decoder, specifically includes:
[0027] According to the time step encoding of all the noise data, all the noise data are mapped to the logit space to convert all the noise data into a high-dimensional vector:
[0028] ;
[0029] in, express Representation in logit space, Indicates the Independent group Noisy data for time steps, Indicates the Independent group Noisy data for time steps, express Representation in logit space, express The log odds ratio, Indicates the An independent group from time step to the Noise perturbation data of time steps, Indicates the An independent group from time step to the The representation in logit space at time steps is: express The log odds ratio, express and The log odds ratio;
[0030] All the converted high-dimensional noise data are transformed through multiple layers of linear transformation to obtain the potential embedding vector;
[0031] The potential embedding vector is input into the constructed initial encoder and initial decoder for training to obtain the target encoder and target decoder.
[0032] Optionally, the image generation method based on grouped Dirichlet diffusion, wherein the step of inputting the image data into the target encoder for downsampling and outputting low-resolution bottleneck features and skip connection features, specifically includes:
[0033] Inputting the image data into the target encoder, wherein the initial convolutional layer of the target encoder converts the image data into a basic feature map;
[0034] Through the multiple downsampling modules of the target encoder, the long-range dependency of the basic feature map is captured, and low-resolution bottleneck features and skip connection features corresponding to each downsampling module are output.
[0035] Optionally, the image generation method based on grouped Dirichlet diffusion, wherein the inputting the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling and outputting target image data, specifically includes:
[0036] Inputting the low-resolution bottleneck features and all the skip connection features into the target decoder;
[0037] The multiple upsampling modules of the target decoder perform transposed convolution on the low-resolution bottleneck features to restore spatial resolution and obtain high-resolution bottleneck features;
[0038] After fusing the high-resolution bottleneck feature with each of the jump connection features, the feature is mapped to the target data dimension to obtain target image data.
[0039] Optionally, the image generation method based on grouped Dirichlet diffusion, wherein the low-resolution bottleneck features and the skip connection features are input into the target decoder for upsampling, and target image data is output, further comprises:
[0040] Obtaining a true distribution and a predicted distribution of the image data in a grouped Dirichlet distribution, and calculating a forward-backward KL divergence and a marginal KL divergence based on the true distribution and the predicted distribution;
[0041] According to the forward-backward KL divergence and the marginal KL divergence, the loss function under the grouped Dirichlet distribution is calculated:
[0042] ;
[0043] in, represents the loss function, represents the weight coefficient, represents the true distribution of image data, represents the predicted distribution of image data, represents the true distribution in the grouped Dirichlet distribution, represents the predicted distribution in a grouped Dirichlet distribution, represents the number of independent groups, represents the index of the independent group, Represents There are significant differences in the true distribution of image data, In the grouped Dirichlet distribution, There are significant differences in the true distribution of image data, represents the forward-backward KL divergence, represents the marginal KL divergence;
[0044] The grouped Dirichlet generative model is optimized and trained using the loss function.
[0045] In addition, to achieve the above-mentioned object, the present invention further provides an image generation system based on grouped Dirichlet diffusion, wherein the image generation system based on grouped Dirichlet diffusion comprises:
[0046] a noise addition module, configured to acquire image data, input the image data into a constructed grouped Dirichlet generative model for forward diffusion, and output a plurality of noise data of the image data;
[0047] A mapping module is used to map all the noise data into a logit space, output a potential embedding vector, and train the constructed initial encoder and initial decoder using the potential embedding vector to obtain a target encoder and a target decoder;
[0048] An encoding module, configured to input the image data into the target encoder for downsampling, and output low-resolution bottleneck features and skip connection features;
[0049] A decoding module is used to input the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling and output target image data.
[0050] In addition, to achieve the above-mentioned objectives, the present invention further provides a terminal, wherein the terminal includes: a memory, a processor, and an image generation program based on group Dirichlet diffusion stored in the memory and executable on the processor, wherein the image generation program based on group Dirichlet diffusion, when executed by the processor, implements the steps of the image generation method based on group Dirichlet diffusion described above.
[0051] In addition, to achieve the above-mentioned object, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an image generation program based on grouped Dirichlet diffusion, and when the image generation program based on grouped Dirichlet diffusion is executed by a processor, the steps of the image generation method based on grouped Dirichlet diffusion are implemented as described above.
[0052] In the present invention, image data is acquired and input into a constructed Grouped Dirichlet generative model for forward diffusion, outputting multiple noise data sets of the image data. All of the noise data sets are mapped into logit space, outputting potential embedding vectors, and using the potential embedding vectors to train a constructed initial encoder and initial decoder to obtain a target encoder and target decoder. The image data is input into the target encoder for downsampling, outputting low-resolution bottleneck features and skip connection features. The low-resolution bottleneck features and skip connection features are input into the target decoder for upsampling, outputting target image data. The present invention controls data to remain within the Grouped Dirichlet distribution family during forward and backward diffusion, ensuring numerical stability and making the model widely applicable to various tasks such as image generation, image restoration, and structural modeling. Furthermore, the KL divergence is introduced to replace the traditional ELBO divergence (Evidence Lower Bound), improving training stability and generation quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is a flow chart of a preferred embodiment of the image generation method based on grouped Dirichlet diffusion of the present invention;
[0054] Figure 2 1 is a structural diagram of the training process of a preferred embodiment of the image generation method based on grouped Dirichlet diffusion of the present invention;
[0055] Figure 3 1 is a schematic diagram of adding noise to a first image according to a preferred embodiment of the image generation method based on grouped Dirichlet diffusion of the present invention;
[0056] Figure 4 2 is a schematic diagram of adding noise to a second image according to a preferred embodiment of the image generation method based on grouped Dirichlet diffusion of the present invention;
[0057] Figure 5 1 is a schematic diagram of a first image denoising method according to a preferred embodiment of the present invention based on grouped Dirichlet diffusion;
[0058] Figure 6 2 is a schematic diagram of a second image denoising method according to a preferred embodiment of the present invention based on grouped Dirichlet diffusion;
[0059] Figure 7 1 is a structural diagram of a preferred embodiment of the image generation system based on grouped Dirichlet diffusion of the present invention;
[0060] Figure 8 FIG. 4 is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0062] In view of the limitations of traditional methods in processing high-dimensional bounded data (such as multi-channel images), especially in modeling intra-group dependencies and inter-group structures, this paper proposes a novel grouped Dirichlet generation model: Grouped Dirichlet Diffusion (GDD). It uses Grouped Dirichlet distribution to introduce a multi-group structure modeling mechanism. By retaining the intra-group probability consistency and adaptively adjusting the inter-group interaction during the diffusion process, it achieves high-quality generation of high-dimensional bounded probabilistic data.
[0063] The image generation method based on grouped Dirichlet diffusion described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the image generation method based on grouped Dirichlet diffusion includes the following steps:
[0064] Step S10: Acquire image data, input the image data into the constructed grouped Dirichlet generative model for forward diffusion, and output a plurality of noise data of the image data.
[0065] Among them, in the process of noise scheduling for each group of semantic channels in the image data, a Sigmoid nonlinear strategy is used (referring to a nonlinear mapping method with the Sigmoid function as the core). Specifically, the nonlinear strategy is used to obtain the noise intensity of each time step:
[0066] ;
[0067] ;
[0068] in, Indicates the The noise intensity of each time step, Express Using nonlinear strategies, Indicates the The concentration parameter for each time step, and All represent constants, Represents the normalized time; through this nonlinear strategy, the noise intensity of each group of data can be ensured to decay smoothly from the initial value to 0, which can effectively avoid the boundary mutation problem of traditional streamline scheduling.
[0069] Specifically, image data input by a user is obtained, and a grouped Dirichlet generative model is constructed; the image data is input into the grouped Dirichlet generative model, and the grouped Dirichlet generative model divides the image data into multiple independent groups:
[0070] ;
[0071] in, represents the number of independent groups, represents the index of the independent group, Indicates the independent groups, Indicates the The concentration parameters of the independent groups, represents the process of noise perturbation on image data, Represents a grouped Dirichlet distribution; using the concentration parameter of each independent group, each independent group is subjected to noise diffusion, and the noise data at different time steps are output:
[0072] ;
[0073] ;
[0074] in, Indicates the The probability distribution of the noise data in time steps, Indicates the The probability distribution of the noise data in time steps, represents the grouped Dirichlet generative model, Indicates the Noisy data for time steps, Indicates the Noisy data for time steps, Represents input data, Indicates the The noise intensity of each time step, Indicates the The noise intensity of each time step, Represents the global concentration parameter.
[0075] Among them, by grouping Dirichlet distribution to represent multiple semantic channels of image data, such as RGB (Red-Green-Blue), the image data can be divided into multiple independent groups and gradually perturbed by Dirichlet noise, that is, the noise of each channel data is gradually increased. In this process, the global concentration parameter can be used to effectively control the degree of noise dispersion, thereby improving the stability of the model during the diffusion process.
[0076] Step S20: Map all the noise data into the logit space (a multidimensional space consisting of the unnormalized raw scores of the model output), output a potential embedding vector, and train the constructed initial encoder and initial decoder using the potential embedding vector to obtain the target encoder and target decoder.
[0077] Among them, the noise data output by the forward diffusion process is used to reconstruct the image data from the noise data, and adaptive denoising is achieved by predicting the Dirichlet parameters. This process can be achieved using the U-Net framework (a symmetrical encoder-decoder structure, such as Figure 2 The U-Net framework includes group normalization, convolutional layers, linear layers, random dropout layers, and skip connection structures. In the mapping stage, position embedding is performed after passing through multiple fully connected layers. A residual block combined with an attention mechanism is added to the encoder part, and a residual block combined with a skip connection is added to the decoder part.
[0078] Specifically, according to the time step encoding of all the noise data, all the noise data are mapped to the logit space to convert all the noise data into a high-dimensional vector:
[0079] ;
[0080] in, express Representation in logit space, Indicates the Independent group Noisy data for time steps, Indicates the Independent group Noisy data for time steps, express Representation in logit space, express The log odds ratio, Indicates the An independent group from time step to the Noise perturbation data of time steps, Indicates the An independent group from time step to the The representation in logit space at time steps is: express The log odds ratio, express and The logarithmic occurrence ratio of the converted high-dimensional noise data is obtained by multi-layer linear transformation to obtain a potential embedding vector; the potential embedding vector is input into the constructed initial encoder and initial decoder for training to obtain the target encoder and target decoder.
[0081] To avoid numerical overflow of probability boundaries, all Dirichlet sampling is performed in the logit space. Before denoising, the noise data is converted into a high-dimensional vector using its inherent positional encoding. Furthermore, a latent embedding vector is generated through a multi-layer linear transformation (where the activation function is SiLU, Sigmoid-Weighted Linear Unit, S-type Weighted Linear Unit). The generated latent embedding vector can be used to modulate the parameters of the encoder and decoder, ensuring that the encoder-decoder can implement grouped Dirichlet diffusion and reconstruction of high-dimensional bounded data (such as multi-channel images).
[0082] Step S30: Input the image data into the target encoder for downsampling, and output low-resolution bottleneck features and skip connection features.
[0083] Specifically, the image data is input into the target encoder, and the initial convolution layer of the target encoder converts the image data into a basic feature map; through multiple downsampling modules of the target encoder, the long-range dependency of the basic feature map is captured, and low-resolution bottleneck features and jump connection features corresponding to each downsampling module are output.
[0084] Among them, in the encoding stage, the initial convolution layer converts the input channels (such as RGB channels) into basic feature maps (such as 64 channels), and then in the multi-level downsampling module, each level of downsampling module contains multiple UNetBlock modules (UNet Building Block, UNet represents the core network architecture, Building Block refers to the basic modular unit that constitutes the network), which are configured in downsampling mode (such as stride 2 convolution). In these modules, residual connections and self-attention mechanisms are used to capture long-range dependencies; among them, long-range dependencies refer to the correlation between elements that are far apart in the data. The self-attention mechanism directly models the global relationship between all elements in the sequence, which is naturally suitable for capturing long-range dependencies. The residual connection adds the input directly to the output of the network layer through the skip connection (Skip Connection), solving the problems of gradient disappearance and network degradation in deep networks. The combination of the two can capture long-range dependencies more efficiently.
[0085] Furthermore, the low-resolution bottleneck features output by each level of downsampling modules can be passed to the decoder through jump connections. This process can preserve the multi-scale details of the image data, thereby improving the accuracy of image generation.
[0086] Step S40: Input the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling, and output target image data.
[0087] Specifically, the low-resolution bottleneck features and all the jump connection features are input into the target decoder; multiple upsampling modules of the target decoder perform transposed convolution on the low-resolution bottleneck features to restore the spatial resolution to obtain high-resolution bottleneck features; the high-resolution bottleneck features are fused with each of the jump connection features and mapped to the target data dimension to obtain target image data.
[0088] Among them, for the bottleneck features and multiple skip connection features input by the target encoder, the multi-level upsampling module in the target decoder restores the spatial resolution of each noise data through transposed convolution or interpolation upsampling, and then fuses each skip connection feature in the encoder to enhance the detail reconstruction capability.
[0089] Furthermore, after fusion, the feature map is mapped to the target data dimension (such as RGB three channels) through the convolution layer. For this process, the Sigmoid activation function can be selected to ensure that the output conforms to the bounded data constraints, such as ensuring that the pixel values of the image are within 0-1, and finally generate the target image data.
[0090] Further, obtaining the true distribution and predicted distribution of the image data in the grouped Dirichlet distribution, and calculating the forward-backward KL divergence and marginal KL divergence according to the true distribution and the predicted distribution;
[0091] According to the forward-backward KL divergence and the marginal KL divergence, the loss function under the grouped Dirichlet distribution is calculated:
[0092] ;
[0093] in, represents the loss function, represents the weight coefficient, represents the true distribution of image data, represents the predicted distribution of image data, represents the true distribution in the grouped Dirichlet distribution, represents the predicted distribution in a grouped Dirichlet distribution, represents the number of independent groups, represents the index of the independent group, Represents There are significant differences in the true distribution of image data, In the grouped Dirichlet distribution, There are significant differences in the true distribution of image data, represents the forward-backward KL divergence, represents the marginal KL divergence; and the grouped Dirichlet generative model is optimized and trained using the loss function.
[0094] The loss function uses the Kullback-Leibler Upper Bound (KLUB) for training optimization, which can effectively improve the convergence and stability of the model. For this process, the forward-backward KL divergence and marginal KL divergence are combined to calculate the loss function of the grouped Dirichlet distribution. The weight coefficient of the calculation process can balance the timing consistency and generation quality. In this embodiment, the weight coefficient is set to 0.97, and then the loss function is used to optimize the training of the grouped Dirichlet generation model.
[0095] Furthermore, in another embodiment, Figure 3 and Figure 4As shown in , the image is noised under the grouped Dirichlet distribution, that is, the image degradation process, as shown in Figure 5 and Figure 6 As shown in Figure 1, the denoising process of an image is demonstrated, which gradually recovers image details from chaotic noise under the grouped Dirichlet distribution.
[0096] On the CIFAR-10 dataset, the FID (Fréchet Inception Distance) metric, a classic metric in deep learning used to evaluate the quality of images generated by generative models, dropped from 16.31 (DDPM, Denoising Diffusion Probabilistic Models) for the traditional diffusion model to 5.13 (GDD), a 68.5% improvement. The Kernel Inception Distance (KID) score also dropped to 0.00403 (an improvement of over 45% compared to the traditional diffusion model), as shown in Table 1 below.
[0097] Table 1: Comparative analysis of FID and KID scores of multiple generation frameworks based on CIFAR-10 training data
[0098]
[0099] Among them, the lower the FID score, the better the image generation effect; VAE stands for Variational Autoencoder; GAN stands for Generative Adversarial Network; AutoGAN stands for Automated Generative Adversarial Network, an automated improvement framework based on Generative Adversarial Network (GAN); DDPM stands for Denoising Diffusion Probabilistic Models; PPOGAN stands for Proximal Policy Optimization Generative Adversarial Network, an improved model that combines the proximal policy optimization algorithm in reinforcement learning with the generative adversarial network; LSGM stands for Latent Score-based Generative Model, a latent space score-based generative model; DDIM stands for Denoising Diffusion Implicit Models; ViTGAN stands for Vision Transformer Generative Adversarial Network, an image processing model based on the Transformer architecture; Consistency Models stands for consistency models; EAGAN stands for Efficient Two-stage Evolutionary Architecture Search for GAN, efficient two-stage evolutionary architecture search generative adversarial network; GENIE stands for Generative Interactive Environments; FM stands for Factorization Machine Generative Adversarial Network; GLR-GAN stands for Generalized Likelihood Ratio Generative Adversarial Network.
[0100] Furthermore, as shown in Table 2, GDD reduces the FID by an average of 30% on datasets such as STL-10 and SVHN:
[0101] Table 2: Comparison of FID scores on different datasets
[0102]
[0103] The present invention controls the data to remain within the grouped Dirichlet distribution family during the forward and backward diffusion processes, ensuring numerical stability and making the model widely applicable to various tasks such as image generation, image restoration, and structural modeling. At the same time, the introduction of KL divergence to replace the traditional ELBO divergence increases the model convergence speed by 50%, further improving the training stability and generation quality.
[0104] Furthermore, if Figure 7 As shown, based on the above-mentioned image generation method based on group Dirichlet diffusion, the present invention also provides an image generation system based on group Dirichlet diffusion, wherein the image generation system based on group Dirichlet diffusion includes:
[0105] The noise addition module 51 is used to obtain image data, input the image data into the constructed grouped Dirichlet generative model for forward diffusion, and output multiple noise data of the image data;
[0106] A mapping module 52 is configured to map all the noise data into a logit space, output a potential embedding vector, and train the constructed initial encoder and initial decoder using the potential embedding vector to obtain a target encoder and target decoder;
[0107] An encoding module 53 is configured to input the image data into the target encoder for downsampling, and output low-resolution bottleneck features and skip connection features;
[0108] The decoding module 54 is configured to input the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling, and output target image data.
[0109] Furthermore, if Figure 8 As shown, based on the above-mentioned image generation method and system based on grouped Dirichlet diffusion, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 8 Only some of the components of the terminal are shown, but it should be understood that implementation of all of the shown components is not required, and more or fewer components may be implemented instead.
[0110] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard drive or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the memory 20 may include both the internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software installed in the terminal and various data, such as program code of the terminal. The memory 20 may also be used to temporarily store data that has been output or is about to be output. In one embodiment, the memory 20 stores an image generation program 40 based on group Dirichlet diffusion. This image generation program 40 based on group Dirichlet diffusion can be executed by the processor 10, thereby implementing the image generation method based on group Dirichlet diffusion described in this application.
[0111] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, configured to execute program codes or process data stored in the memory 20, such as executing the image generation method based on grouped Dirichlet diffusion.
[0112] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface. The components of the terminal communicate with each other via a system bus.
[0113] In one embodiment, when the processor 10 executes the image generation program 40 based on grouped Dirichlet diffusion in the memory 20 , the steps of the image generation method based on grouped Dirichlet diffusion described above are implemented.
[0114] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores an image generation program based on grouped Dirichlet diffusion, and when the image generation program based on grouped Dirichlet diffusion is executed by a processor, the steps of the image generation method based on grouped Dirichlet diffusion are implemented as described above.
[0115] In summary, the present invention provides an image generation method and related equipment based on grouped Dirichlet diffusion, the method comprising: acquiring image data, inputting the image data into a constructed grouped Dirichlet generative model for forward diffusion, and outputting multiple noise data of the image data; mapping all the noise data into logit space, outputting a potential embedding vector, and training a constructed initial encoder and initial decoder using the potential embedding vector to obtain a target encoder and target decoder; inputting the image data into the target encoder for downsampling, outputting low-resolution bottleneck features and skip connection features; inputting the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling, and outputting target image data. The present invention controls the data to remain within the distribution family of the grouped Dirichlet during forward and backward diffusion, ensuring numerical stability, making the model widely applicable to various tasks such as image generation, image restoration, and structural modeling. At the same time, the KL divergence is introduced to replace the traditional ELBO divergence, improving the training stability and generation quality.
[0116] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or terminal comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or terminal comprising the element.
[0117] Of course, those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium that can be read by a computer. When executed, the program can include the processes in the above-described method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.
[0118] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. An image generation method based on grouped Dirichlet diffusion, characterized in that: The image generation method based on grouped Dirichlet diffusion includes: Acquire image data, input the image data into the constructed grouped Dirichlet generative model for forward diffusion, and output a plurality of noise data of the image data; Acquiring image data, inputting the image data into the constructed grouped Dirichlet generative model for forward diffusion, and outputting a plurality of noise data of the image data, specifically including: Obtain image data input by the user and construct a grouped Dirichlet generative model; The image data is input into the grouped Dirichlet generative model, which divides the image data into multiple independent groups: ; in, represents the number of independent groups, represents the index of the independent group, Indicates the independent groups, Indicates the The concentration parameters of the independent groups, represents the process of noise perturbation on image data, represents grouped Dirichlet distribution; Using the concentration parameters of each independent group, noise diffusion is performed on each independent group, and noise data at different time steps are output: ; ; in, Indicates the The probability distribution of the noise data in time steps, Indicates the The probability distribution of the noise data in time steps, represents the grouped Dirichlet generative model, Indicates the Noisy data for time steps, Indicates the Noisy data for time steps, Represents input data, Indicates the The noise intensity of each time step, Indicates the The noise intensity of each time step, represents the global concentration parameter; Mapping all the noise data into the logit space, outputting a potential embedding vector, and training the constructed initial encoder and initial decoder using the potential embedding vector to obtain a target encoder and a target decoder; Inputting the image data into the target encoder for downsampling, and outputting low-resolution bottleneck features and skip connection features; The low-resolution bottleneck features and the skip connection features are input into the target decoder for upsampling, and target image data is output.
2. The image generation method based on grouped Dirichlet diffusion according to claim 1, characterized in that: The method further includes: utilizing the concentration parameter of each independent group to perform noise diffusion on each independent group and outputting noise data at different time steps; Using a nonlinear strategy, the noise intensity at each time step is obtained: ; ; in, Indicates the The noise intensity of each time step, Express Using nonlinear strategies, Indicates the The concentration parameter for each time step, and All represent constants, Represents normalized time.
3. The image generation method based on grouped Dirichlet diffusion according to claim 1, characterized in that: The method maps all the noise data into the logit space, outputs a potential embedding vector, and trains the constructed initial encoder and initial decoder by the potential embedding vector to obtain a target encoder and target decoder, specifically including: According to the time step encoding of all the noise data, all the noise data are mapped to the logit space to convert all the noise data into a high-dimensional vector: ; in, express Representation in logit space, Indicates the Independent group Noisy data for time steps, Indicates the Independent group Noisy data for time steps, express Representation in logit space, express The log odds ratio, Indicates the An independent group from time step to the Noise perturbation data of time steps, Indicates the An independent group from time step to the The representation in logit space at time steps is: express The log odds ratio, express and The log odds ratio; All the converted high-dimensional noise data are transformed through multiple layers of linear transformation to obtain the potential embedding vector; The potential embedding vector is input into the constructed initial encoder and initial decoder for training to obtain the target encoder and target decoder.
4. The image generation method based on grouped Dirichlet diffusion according to claim 1, characterized in that: Inputting the image data into the target encoder for downsampling, and outputting low-resolution bottleneck features and skip connection features, specifically includes: Inputting the image data into the target encoder, wherein the initial convolutional layer of the target encoder converts the image data into a basic feature map; Through the multiple downsampling modules of the target encoder, the long-range dependency of the basic feature map is captured, and low-resolution bottleneck features and skip connection features corresponding to each downsampling module are output.
5. The image generation method based on grouped Dirichlet diffusion according to claim 4, characterized in that: The step of inputting the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling and outputting target image data specifically includes: Inputting the low-resolution bottleneck features and all the skip connection features into the target decoder; The multiple upsampling modules of the target decoder perform transposed convolution on the low-resolution bottleneck features to restore spatial resolution and obtain high-resolution bottleneck features; After fusing the high-resolution bottleneck feature with each of the jump connection features, the feature is mapped to the target data dimension to obtain target image data.
6. The image generation method based on grouped Dirichlet diffusion according to claim 1, characterized in that: The step of inputting the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling and outputting target image data further comprises: Obtaining a true distribution and a predicted distribution of the image data in a grouped Dirichlet distribution, and calculating a forward-backward KL divergence and a marginal KL divergence based on the true distribution and the predicted distribution; According to the forward-backward KL divergence and the marginal KL divergence, the loss function under the grouped Dirichlet distribution is calculated: ; in, represents the loss function, represents the weight coefficient, represents the true distribution of image data, represents the predicted distribution of image data, represents the true distribution in the grouped Dirichlet distribution, represents the predicted distribution in a grouped Dirichlet distribution, represents the number of independent groups, represents the index of the independent group, Represents There are significant differences in the true distribution of image data, In the grouped Dirichlet distribution, There are significant differences in the true distribution of image data, represents the forward-backward KL divergence, represents the marginal KL divergence; The grouped Dirichlet generative model is optimized and trained using the loss function.
7. An image generation system based on grouped Dirichlet diffusion, characterized in that: The image generation system based on group Dirichlet diffusion is applied to the image generation method based on group Dirichlet diffusion according to any one of claims 1 to 6, and the image generation system based on group Dirichlet diffusion includes: a noise addition module, configured to acquire image data, input the image data into a constructed grouped Dirichlet generative model for forward diffusion, and output a plurality of noise data of the image data; A mapping module is used to map all the noise data into a logit space, output a potential embedding vector, and train the constructed initial encoder and initial decoder using the potential embedding vector to obtain a target encoder and a target decoder; An encoding module, configured to input the image data into the target encoder for downsampling, and output low-resolution bottleneck features and skip connection features; A decoding module is used to input the low-resolution bottleneck features and the skip connection features into the target decoder for upsampling and output target image data.
8. A terminal, characterized in that: The terminal includes: a memory, a processor, and an image generation program based on group Dirichlet diffusion stored in the memory and executable on the processor. When the image generation program based on group Dirichlet diffusion is executed by the processor, the steps of the image generation method based on group Dirichlet diffusion according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores an image generation program based on group Dirichlet diffusion, and when the image generation program based on group Dirichlet diffusion is executed by a processor, the steps of the image generation method based on group Dirichlet diffusion according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Spoken language understanding method based on Dirichlet variational auto-encoder and related equipment
CN111724767A
Method and device for generating image based on diffusion model, and storage medium
CN116721179A