Method and apparatus for energy guidance of diffusion models

The Gaussian mixture diffusion posterior (GMDP) with a substitute gradient strategy addresses the inefficiencies in existing energy guidance methods by enhancing the approximation of multi-modal distributions, enabling more accurate and flexible energy guidance in diffusion models for multimedia data generation.

WO2025236279A1PCT designated stage Publication Date: 2025-11-20ROBERT BOSCH GMBH +1

Patent Information

Application Number
PCT/CN2024/093920
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-11-20

AI Technical Summary

Technical Problem

Existing methods for energy guidance in diffusion models face challenges in providing flexible and controllable generation due to the need for paired noisy data and the divergence of approximate diffusion posteriors from true multi-modal distributions, leading to inefficiencies in energy function application across different scales and tasks.

Method used

A Gaussian mixture diffusion posterior (GMDP) is proposed to approximate the diffusion posterior, using high-order moment matching and a substitute gradient strategy to compute intermediate energy guidance, allowing for better capture of multi-modal distributions and enabling efficient plug-and-play energy guidance.

Benefits of technology

The GMDP approach allows for more accurate and flexible energy guidance in diffusion models, improving the controllability and efficiency of multimedia data generation by capturing higher-order moments and reducing computational overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024093920_20112025_PF_FP_ABST
    Figure CN2024093920_20112025_PF_FP_ABST
Patent Text Reader

Abstract

A method for multimedia data generation by energy guidance of diffusion model is disclosed. The method comprises obtaining a Gaussian mixture distribution of K components for approximating a diffusion posterior, wherein K is an integer greater than 1, and the diffusion posterior is a distribution of multimedia data to be generated given intermediate noisy multimedia data; estimating an intermediate energy for guiding the multimedia data generation, by a plurality of samples drawn from the obtained Gaussian mixture distribution; and generating the multimedia data with a pre-trained noise prediction network and an intermediate energy guidance computed based on the estimated intermediate energy.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD AND APPARATUS FOR ENERGY GUIDANCE OF DIFFUSION MODELSFIELD

[0001] The present disclosure relates generally to artificial intelligence technology, and more particularly, to energy guidance of diffusion models.BACKGROUND

[0002] Diffusion models have demonstrated remarkable generative modeling ability and have been successfully applied to the synthesis of images, audio, videos, 3D objects, and time series. To enable flexible and controllable generation as well as leveraging the original generative power of diffusion models, guided sampling is a common technique by adding task-specific guidance terms in the sampling process, such as classifier guidance, classifier-free guidance, and more general energy (loss) guidance. The successful application cases of guided sampling include text-to-image generation, image-to-image translation, inverse molecular design, and inverse problem solving. Guided sampling is a vital application of diffusion models by leveraging the unconditional diffusion model as a powerful data prior and adding extra guidance terms during the sampling process for controllable generation.

[0003] The general energy guidance may be in a form of p (x) ∝q (x) e-βε (x) , where p (x) is a target distribution we want to sample from, q (x) is a data distribution modeled by diffusion, ε (·) is a differentiable energy function, and β is a guidance scale for controlling the energy strength. Such formulation not only involves conditional generation defined by a condition variable such as the class label in classifier guidance and the degenerated image in inverse problems (e.g. super-resolution) , but also applies to any human-designed smooth energy functions for flexible control. Leveraging the long sampling process of diffusion models to sufficiently mix the signals, energy-guided sampling can be conducted by adding intermediate guidance terms. However, since diffusion models are composed of noising and de-noising processes, the guidance terms in the intermediate time-steps need to cope with noisy data, while the energy function is usually defined on clean data.

[0004] Existing methods use energy-specific or plug-and-play approaches to bridge such a gap. Energy-specific approaches such as classifier guidance and contrastive  energy prediction require paired noisy data and corresponding energies for training an extra guidance model, hence cannot be directly transferred to other energy functions or even other guidance scales at inference. In contrast, plug-and-play approaches can only have access to the energy function at test time and are more convenient for controllable generation. In this case, the intermediate guidance terms involve an expectation under the diffusion posterior (i.e., distribution of clean data given noisy data) . Different plug-and-play guided-sampling methods can be subsumed into different choices of the approximate diffusion posterior, including point estimation, and Gaussian distribution with tuned variance as a hyper-parameter or moment projected variance. However, the true diffusion posterior is usually a complicated multi-modal (i.e., more than one local maximum) distribution and existing choices diverge from it.

[0005] Therefore, there exists a need of improved methods for energy guidance of diffusion models for flexible and controllable generation.SUMMARY

[0006] The following presents a simplified summary of one or more aspects according to the present disclosure in order to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.

[0007] This disclosure relates to a general energy guidance defined by a differentiable energy function in a plug-and-play fashion, which is based on an approximation of the diffusion posterior. In this disclosure, a Gaussian mixture diffusion posterior (GMDP) is proposed in seek of better approximation compared to previous point estimation or Gaussian distribution, as well as capturing the posterior multi-modality. The disclosed method requires minimal modification of the pre-trained diffusion model and can be efficiently realized by high-order moment matching. To solve the intractable gradient propagation when calculating the intermediate guidance, a strategy called substitute gradient is also disclosed, which applies to any approximate posterior and is theoretically equivalent to the first-order Taylor approximation of an energy function.

[0008] In an aspect of the disclosure, a method for multimedia data generation by energy guidance of diffusion model is disclosed. The method comprises obtaining a Gaussian mixture distribution of K components for approximating a diffusion posterior, wherein K is an integer greater than 1, and the diffusion posterior is a distribution of  multimedia data to be generated given intermediate noisy multimedia data; estimating an intermediate energy for guiding the multimedia data generation, by a plurality of samples drawn from the obtained Gaussian mixture distribution; and generating the multimedia data with a pre-trained noise prediction network and an intermediate energy guidance computed based on the estimated intermediate energy.

[0009] In another aspect of the disclosure, an apparatus for multimedia data generation by energy guidance of diffusion model is disclosed. The apparatus may comprise a memory and at least one processor coupled to the memory. The at least one processor may be configured to obtain a Gaussian mixture distribution of K components for approximating a diffusion posterior, wherein K is an integer greater than 1, and the diffusion posterior is a distribution of multimedia data to be generated given intermediate noisy multimedia data; estimate an intermediate energy for guiding the multimedia data generation, by a plurality of samples drawn from the obtained Gaussian mixture distribution; and generate the multimedia data with a pre-trained noise prediction network and an intermediate energy guidance computed based on the estimated intermediate energy.

[0010] In another aspect of the disclosure, a computer readable medium storing computer code for multimedia data generation by energy guidance of diffusion model is disclosed. The computer code, when executed by a processor, may cause the processor to obtain a Gaussian mixture distribution of K components for approximating a diffusion posterior, wherein K is an integer greater than 1, and the diffusion posterior is a distribution of multimedia data to be generated given intermediate noisy multimedia data; estimate an intermediate energy for guiding the multimedia data generation, by a plurality of samples drawn from the obtained Gaussian mixture distribution; and generate the multimedia data with a pre-trained noise prediction network and an intermediate energy guidance computed based on the estimated intermediate energy.

[0011] In another aspect of the disclosure, a computer program product for multimedia data generation by energy guidance of diffusion model is disclosed. The computer program product may comprise processor executable computer code for obtaining a Gaussian mixture distribution of K components for approximating a diffusion posterior, wherein K is an integer greater than 1, and the diffusion posterior is a distribution of multimedia data to be generated given intermediate noisy multimedia data; estimating an intermediate energy for guiding the multimedia data generation, by a plurality of samples drawn from the obtained Gaussian mixture distribution; and generating the multimedia data with a pre-trained noise prediction network and an intermediate energy  guidance computed based on the estimated intermediate energy.

[0012] Other aspects or variations of the disclosure will become apparent by consideration of the following detailed description and accompanying drawings.BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The following figures depict various embodiments of the present disclosure for purposes of illustration only. One skilled in the art will readily recognize from the following description that alternative embodiments of the methods and structures disclosed herein may be implemented without departing from the spirit and principles of the disclosure described herein.

[0014] FIG. 1 illustrates diffusion processes of diffusion models in accordance with one aspect of the present disclosure.

[0015] FIG. 2 illustrates an energy guidance on 1-d Gaussian distribution in accordance with one aspect of the present disclosure.

[0016] FIG. 3 illustrates a network architecture of diffusion model with extra heads in accordance with one aspect of the present disclosure.

[0017] FIG. 4 illustrates a flow chart of a method for energy guidance of diffusion models in accordance with one aspect of the present disclosure.

[0018] FIG. 5 illustrates a block diagram of an apparatus for energy guidance of diffusion models in accordance with one aspect of the present disclosure.DETAILED DESCRIPTION

[0019] Before any embodiments of the present disclosure are explained in detail, it is to be understood that the disclosure is not limited in its application to the details of construction and the arrangement of features set forth in the following description. The disclosure is capable of other embodiments and of being practiced or of being carried out in various ways.

[0020] In this disclosure, a Gaussian mixture diffusion posterior (GMDP) is used for better diffusion posterior approximation, in expectation of more accurate plug-and-play energy guidance. In contrast to previous uni-modal approximate posteriors, the Gaussian mixture distribution may better capture the multi-modality of both synthetic and real-world data. The parameters of the Gaussian mixture diffusion posterior may be estimated by moment matching methods, while it is still plug-and-play since the posterior remains independent of the energy function for guiding generations with a  pre-trained diffusion model. Moreover, the moments of diffusion posterior can be obtained by adding extra heads to the pre-trained diffusion model, which introduces small extra overhead at inference. After deriving the Gaussian mixture diffusion posterior, the subsequent challenge is to compute the energy guidance terms, which require an intractable gradient of the intermediate energy. To solve this problem, a substitute gradient strategy which replaces the original gradient part with a tractable one is proposed. This method is theoretically validated as the first-order Taylor approximation of the energy function. Furthermore, it can be proved that employing the substitute gradient ensures a bounded approximation error of the energy guidance terms.

[0021] The disclosed methods are built on diffusion models and the framework of energy guidance, which will be described first below.

[0022] Diffusion models are a type of generative model that may generate data by progressively adding noise to a dataset and then learning to reverse this process for generating data by de-noising. Diffusion models may be trained to generate various data in the real world. For example, diffusion models may generate image, video (each frame of video may also be construed as an image) , audio, speech, text, 3-D objects, etc. that can be recognized by humans. All these kinds of data than can be generated by diffusion models are collectively referred to as multimedia data herein.

[0023] FIG. 1 illustrates diffusion processes of diffusion models in accordance with one aspect of the present disclosure. Given a d-dimensional data distribution q0 (x0) , diffusion models may build a forward diffusion process by defining a forward stochastic differential equation (SDE) starting from x0~q0 : dxt=f (t) xt dt+g (t) dwt         (1)

[0024] where t∈ [0, T] for some finite horizon T, f,  is the scalar-valued drift and diffusion term, and is a standard Wiener process. Although the clean data x0 as shown in FIG. 1 is an image, x0 may be any type of data as described above. As a linear SDE, the forward diffusion process is based on an analytic Gaussian transition kernel by formula ( On a formula concerning stochastic differentials, Nagoya Mathematical Journal, 3: 55–65, 1951) , where are called noise schedules. The forward SDE is accompanied by a series of marginal distributions of and f, g are properly designed so that the terminal distribution is approximately a pure Gaussian, i.e.,  as shown by xT in FIG. 1.

[0025] To sample from the data distribution q0 (x0) , such as, generate the image x0  as shown in FIG. 1, the reverse SDE or probability flow ODE (Song et al., 2021b) from t=T to t=0 may be solved in a reverse diffusion process as:

[0026] Equations (2) and (3) share the same marginal distributions with the forward SDE, where is the reverse-time Wiener process, and the only unknown term is the score function of the marginal density qt. By denoising score matching (DSM) , a noise prediction network ∈θ (xt, t) parameterized by θ is usually used to predict the noise ∈ by minimizing  where w (t) is a positive weighting function, and is the transition kernel. After training ∈θ (xt, t) , we have which can be then plugged into the reverse SDE and probability flow ODE to obtain the parameterized diffusion SDE and diffusion ODE. There are various dedicated solvers for diffusion SDE or ODE. In one example, the disclosed method may rely on the first-order solver DDIM (Song et al., Denoising diffusion implicit models, In International Conference on Learning Representations, 2021a) .

[0027] Next, the formulation of energy guidance and how to perform energy guidance in a principled way in diffusion models will be described.

[0028] Let q0 (x0) be a d-dimensional data distribution, we aim to sample from

[0029] where β>0 is the guidance scale,  is an energy function, and the normalizing factor of the distribution p0 may be omitted. The term increases the density of q0 where the energy ε is low, and decreases the density where the energy is high.

[0030] Suppose q0 is learned by a diffusion model, the diffusion process of p0 may be built by the same Gaussian transition kernel The exact form of the score function of pt may be:

[0031] Therefore, it can be sampled from p0 by solving the diffusion SDE or ODE  with the new score which can be viewed as adding extra guidance term  to the original learned score in the sampling process. εt (xt) is called intermediate energy, and is called intermediate energy guidance. xt is the intermediate noisy data.  is called the diffusion posterior, which is complex and intractable. Since qt0 (x0∣xt) is irrelevant to the energy function ε, it can be approximated in order to approximate εt in a plug-and-play approach.

[0032] Inverse problems may be treated as special energy guidance. For example, inverse problems on image may comprise image De-noising / De-blurring, image Restoration, image Zooming, image Inpainting, image De-mosaicing, and image Super-resolution, etc. Inverse problems consider the retrieval of data x0 from its partial measurement y (e.g. downsampled image, or blurry image) . As the mapping y→x0 is many-to-one and ill-posed, the Bayesian framework may be used, where we have data prior q0 (x0) and define a conditional degeneration process

[0033] where is the forward measurement operator such as downsampling. By Bayes' rule, we can sample from the posterior p (x0∣y) ∝q0 (x0) p (y∣x0) , which corresponds to the energy function when compared to Equation (4) . Therefore, inverse problems can be seen as a special case of energy guidance and solved with Equation (5) . In practice, since the energy ε is different for every y, plug-and-play methods are preferred for inverse problems.

[0034] To conduct energy guidance in a plug-and-play fashion, the disclosed method does not learn εt directly, but cope with the expectation in εt with the Monte-Carlo approach. Specifically, εt (xt) can be estimated by N independent and identically distributed (i.i.d. ) samples drawn from the posterior qt0 (x0∣xt) :

[0035] Since the true posterior qt0 is intractable and hard to sample from, a solution is to approximate it with a tractable one Correspondingly, the approximate intermediate energy may be denoted as and its  Monte-Carlo version as

[0036] The approximation error of the intermediate energy εt can be bounded by the divergence of  and qt0. It can be proofed that (theorem 1) : suppose ε (x0) is bounded in [c1, c2] for all x0, then we have

[0037] where TV denotes the total variation distance between two distributions.

[0038] Therefore, it is promising to seek for better approximation of the diffusion posterior qt0, in order to conduct more accurate energy guidance.

[0039] Previous choices of the approximate diffusion posterior can be subsumed into point estimation (Chung et al., 2022) and Gaussian distribution (Song et al., 2022; 2023; Boys et al., 2023) . They diverge from the true posterior in obvious aspects.

[0040] Choosing the approximate diffusion posterior as point estimation or Gaussian distribution suffers from two significant defects. Firstly, they can only utilize up to the second-order moment of the true posterior qt0. As moments are statistics that depict the distribution, it is beneficial to incorporate the information of higher-order moments for better approximation. Secondly, they are all uni-modal, while the true posterior qt0 generally has multiple modes.

[0041] To illustrate the importance of posterior multi-modality in capturing the modes of the true posterior, a simple toy example may be considered. For example, let the data distribution be a 1-dimensional Gaussian mixture distribution, and the energy function ε (x) =x2 / 2, guidance scale β=1. In this case, we have the target energy-guided distribution

[0042] Since the data distribution q0 is a Gaussian mixture, and the transition kernel  is a Gaussian, the true posterior qt0∝q0q0t is also a Gaussian mixture. However, if we consider a uni-modal Gaussian posterior to approximate qt0, the approximate intermediate energy guidance can be analytically computed as which is also uni-modal.

[0043] FIG. 2 illustrates an energy guidance on 1-d Gaussian distribution example as described. The guidance is visualized with arrows. The white arrows  represent the right direction, since in the ranges where xt<-1 or xt>1, according to the direction of white arrows the energy decreases and the target distribution p0increases; while the black arrows represent the wrong direction, since in the ranges where -1<xt<1 according to the direction of black arrows the energy decreases but the target distribution p0 also decreases. Therefore, as shown in FIG. 2, the guidance term  based on the uni-modal posterior cannot guide xtto the target distribution p0 which is multi-modal (e.g., with multiple peaks) .

[0044] For the reasons above, the previous choices of approximate diffusion posterior in energy-guided sampling and those used in inverse problems need to be improved, to provide better and multi-modal posterior approximation.

[0045] In this disclosure, it is proposed to approximate the diffusion posterior qt0 with a Gaussian mixture distribution of K components:

[0046] where the component weights λi≥0 and K is an integer greater than 1. For simplicity, the number K may be 2 or 3, and the different components may have shared and diagonal covariance matrix diag (σ2) since the means determine the modes of and are more important.

[0047] With the form of approximate posterior in Equation (10) , in case that the component weights are pre-defined, it is needed to estimate the mean and variance parameters σ so that the approximate diffusion posterior is close to the true diffusion posterior qt0. In one example, the disclosed method may estimate the parameters of the Gaussian mixture diffusion posterior by matching the moments of and the moments of qt0.

[0048] The moments are quantitative measures that summarize various characteristics (e.g. shape, location) of a distribution. For a d-dimensional distribution p (x) , the n-th order moment is defined as

[0049] where is the abbreviation of  (n times) , and is the outer product. Therefore, the n-th order moment which has exploding dimensionality as n increases and makes the scaling to high-dimensional data impossible. For simplicity and scalability, we only consider as the diagonal of the moments. In the following discussions, we assume all products between vectors are element-wise, and thus may be replaced by xn.

[0050] The moments of in Eqn. (10) may be expressed by its parameters  As is a Gaussian mixture, its moments possess a closed form:

[0051] Since the moments of qt0 are determined by the data distribution q0 and the forward transition q0t, they can be learnt (instead of "computed" because they are functions of xt and t) in advance, while they still apply to arbitrary energy functions at inference. Note that the n-the order moment is the optimal solution of

[0052] where xt=αtx0+σt∈ is equivalent to the forward transition kernel Therefore, M (n) (xt, t) can be learned by parameterizing a network  to predict Amore effective way in diffusion models is to learn noise predictors. In one example, the disclosed method may learn high order noise predictors  to predict ∈n by optimizing (which is the original noise-prediction diffusion model when n=1, in other words the noise ∈ may be predicted by the noise prediction network ∈θ (xt, t) as described above with respect to Equations (2) and (3) ) .

[0053] Since x0= (xt-σt∈)  / αt, by binomial theorem, the learned moments of qt0 may be obtained as:

[0054] Finally, the Gaussian mixture moments may be matched to the learned true posterior moments to obtain the parameters Since are K+1 d-dimensional variables, matching the first K+1 moments may form a system of K+1 d-dimensional equations:

[0055] To solve the equations which contain high-order polynomials of the sum of squared errors may be minimized by optimizers:

[0056] Therefore, to learn the moments of true diffusion posterior for obtaining the parameters of the Gaussian mixture diffusion posterior of K components, the disclosed method may train K extra high-order noise prediction networks at training stage and call these trained high-order noise prediction networks at inference stage. To mitigate the extra overhead, in one example, a parameter sharing strategy may be adopted by adding extra small heads to the pre-trained diffusion model.

[0057] FIG. 3 illustrates a network architecture of diffusion model with extra heads in accordance with one aspect of the present disclosure. As shown in FIG. 3, a number K of heads 320-k are added to the branch before the output block 314 of the pre-trained noise prediction network 310, where K is the number of components of the Gaussian mixture diffusion posterior and is an integer greater than or equal to 2, k=2, 3, …, K+1. The pre-trained parameters of block 312 of the pre-trained noise prediction network 310 may be shared with the extra high-order noise prediction networks for obtaining the moments of the true diffusion posterior. In other words, each of the extra high-order noise prediction networks may comprise the block 312 of the pre-trained noise prediction network, the block 322-k and the output block 324-k. Thus, the complexity of the high-order noise prediction networks may be reduced. In addition, since the first-order noise prediction is important to high generation quality, the original parameters of the pre-trained noise prediction network 310 may be froze and only the extra heads 320-k need to be trained. In comparison to the original diffusion model, the extra memory cost and computation time for each head at inference are within 10%of the original diffusion module. As shown in FIG. 3, the input of the network 300 may be a noisy image 330 (i.e., xt) , and the outputs of the network 300 may comprise the noise 340-1 (i.e., ∈) and high-order noise (s) 340-k (k=2, 3, …, K+1) (i.e., ∈k) .

[0058] In one example, such as for 2-D toy data, the pre-trained noise prediction network 310 may be is a 7-layer MLP with hidden sizes of [512, 512, 512, 512, 256] and SiLU activations. The noise schedule may be continuous-time linear VP schedule with β0 = 0.1, β1 = 20. Two extra heads may be added to predict the second-order and third-order noise respectively (i.e., K=2) . Each head may be a 2-layer MLP with hidden size 256 and SiLU activation.

[0059] In another example, such as for Flickr-Faces High Quality (FFHQ) -256 data, the pre-trained noise prediction network 310 may be a U-Net with hidden size 128, channel multipliers (1, 1, 2, 2, 4, 4) and 1 residual block per layer. The noise schedule  may be the 1000-step discrete-time linear VP schedule with β1 = 0.0001, βT = 0.02. Two extra heads may be added to predict the second-order and third-order noise respectively (i.e., K=2) . Each head may be a residual block and a convolutional block with group normalization and SiLU activation.

[0060] At the training stage, an exponential moving average (EMA) with a rate of 0.9999 may be used. For 2-D toy data, the Adam optimizer with a learning rate of 10-4 may be used. The batch size may be 2048 and the number of epochs may be 750. For FFHQ-256, the Adan optimizer with a learning rate of 10-4 may be used. The batch size may be 128 and 1M iterations may be trained.

[0061] At the interference stage, 100-step De-noising Diffusion Implicit Model (DDIM) may be adopted to conduct sampling, using a target score function computed by Equation (5) , which is the combination of the original score  and the estimated guidance term The estimated guidance term may be computed under the disclosed approximate diffusion posteriors In one example, for 2-D toy data, the disclosed method may use deterministic DDIM with η=0.0, and N=100 Monte Carlo samples in Equation (7) . For the optimization of Equation (16) , the disclosed method may use 50-step Adan optimizer with a learning rate of 0.1. In another example, for FFHQ-256, the disclosed method may use De-noising Diffusion Probabilistic Model (DDPM) -type DDIM with η=1.0. The disclosed method may use N=20 Monte Carlo samples in Equation (7) . For the optimization of Equation (16) , the disclosed method may use 25-step Adan optimizer with a learning rate of 0.1, and the cosine learning rate schedule of 18 steps to warm up.

[0062] After obtaining the Gaussian mixture parameters (denoted as ) by solving Equation (15) , N i.i.d. samples may be drawn from and plugged into to obtain the Monte-Carlo estimation of the approximate intermediate energy However, as described below, the guidance term  (i.e., the approximate intermediate energy guidance) cannot be directly obtained.

[0063] The guidance term requires propagation of the gradient with  regard to (w.r.t. ) xt through the computation process of Specifically, we have

[0064] where is a vector Jacobian product (VJP) . In the expression of all the terms are tractable except for the Jacobian which means it is needed to propagate the gradient through the samples

[0065] The gradient propagation chain may be illustrated as follows:

[0066] In this chain, the gradient of is available through the high-order noise networks in Equation (14) ; by reparamterization trick, the gradient of can be reached through the gradients of the Gaussian mixture parameters Therefore, the key problem is whether the gradients of can be obtained from the gradients of since are implicitly defined by  in Equation (15) . However, it is both theoretically and empirically unfeasible.

[0067] To solve this problem, in one example, the Jacobian in Equation (17) may be replaced with which is a gradient of moments of Gaussian mixture distribution diffusion posterior (i.e., the approximate diffusion posterior ) and may be called as substitute gradient herein.  may be the first-order moment of and satisfies  Therefore,  approximately reflects the mean of the Monte-Carlo samples

[0068] Denote the guidance term with substitute gradient as and with true posterior and approximate posterior, respectively, and assume they converge to and as the number N of Monte-Carlo samples tends to infty. The substitute gradient strategy may be equivalent to Taylor approximation of the exponential energy It can be proofed that (theorem 2) ,  is equal to under the following first-order Taylor approximation:

[0069] where x0, x′0~qt0 (x0∣xt) .

[0070] Under the substitute gradient strategy, the approximation error of the intermediate energy guidance can also be bounded by the divergence of and qt0. It can be proofed that (theorem 3, which is an extension of theorem 1) , suppose ε (x0) is bounded for all x0, given the Lipschitz continuity of ε (·) , then for any xt, there exists a constant C>0, such that

[0071] where TV denotes the total variation distance between two distributions.

[0072] Considering that to use substitute gradient, it is needed to compute the Jacobian  which requires cost and cannot scale up to high-dimensional data, in another , the disclosed method may use a simple hack:

[0073] which changes the reliance of on xt and enables computation of with typical grad operator in complexity. In addition, the disclosed method may use logsumexp to compute to avoid numerical instability, where the coefficient can be omitted since it will be canceled out by

[0074] An example procedure 1 for estimating the intermediate energy guidance  based on the disclosed Gaussian mixture diffusion posterior is shown below.

[0075] After obtaining the intermediate energy guidance, a controllable generation of multimedia data may be implemented based on the pre-trained noise prediction network (i.e., a pre-trained unconditional diffusion model) and the intermediate energy guidance, for example, as described regarding equations (2) and (3) .

[0076] FIG. 4 illustrates a flow chart of a method 400 for generating multimedia data by energy guidance of diffusion models in accordance with one aspect of the present disclosure. The multimedia data comprises at least one of image, video, audio, speech, text, and 3-D object. Through the energy guidance of diffusion models, the method 400 may generate desired multimedia data, such as, generating a clear image based on a blurry image, or generating a high resolution image based on a low resolution image, etc. The desired multimedia data may be generated under the control of an energy function defined according to different generation tasks.

[0077] In block 410, the method 400 may comprise obtaining a Gaussian mixture distribution of K components for approximating a diffusion posterior, wherein K is an integer greater than 1, and the diffusion posterior is a distribution of multimedia data to  be generated given intermediate noisy multimedia data. For example, as shown in FIG. 1, the image x0 may be the multimedia data to be generated, and the image xt may be the intermediate multimedia data.

[0078] The Gaussian mixture distribution may be defined as Equation (10) , which may be a weighted sum of K Gaussian distribution components and have a plurality of mean and variance parameters. In one example, the K components of the Gaussian mixture distribution comprise shared diagonal covariance matrix.

[0079] The obtaining the Gaussian mixture distribution may comprise estimating mean and variance parameters of the Gaussian mixture distribution by matching moment of the Gaussian mixture distribution and moment of the diffusion posterior, e.g., based on Equations (11) - (16) . In the example procedure 1 as shown above, obtaining the Gaussian mixture distribution may correspond to the operations in lines 7-10. In one example, the moment of the diffusion posterior may be obtained based on noises (such as, the in Equation (14) ) predicted by the pre-trained noise prediction network and a plurality of high order noise prediction network.

[0080] As shown in FIG. 3, the pre-trained noise prediction network and the plurality of high order noise prediction network may comprise shared parameters (such as, the parameters in block 312) by adding a plurality of heads (such as, 320-k) to the pre-trained noise prediction network (such as, 310) . At the training stage, parameters of the pre-trained noise prediction network are froze when training the plurality of heads. In one embodiment, each of the plurality of heads may comprise Multilayer Perceptron (MLP) with a plurality of hidden layers. In another embodiment, each of the plurality of heads may comprise a residual block and a convolutional block with group normalization. Each of the plurality of heads may also comprise SiLU (Sigmoid Linear Unit) activations.

[0081] In block 420, the method 400 may comprise estimating an intermediate energy for guiding the multimedia data generation, by a plurality of samples drawn from the obtained Gaussian mixture distribution. The intermediate energy may be designed manually according to a specific task. For example, an energy function may be designed for inverse problems (see above description on Equation (6) for details) . The estimated intermediate energy may be a Monte-Carlo version of intermediate energy based on Equation (7) . In the example procedure 1 as shown above, the estimating an intermediate energy may correspond to the operations in lines 11-14, where logsumexp is used to compute the Monte-Carlo version of intermediate energy.

[0082] In block 430, the method 400 may comprise generating the multimedia data with a pre-trained noise prediction network and an intermediate energy guidance computed based on the estimated intermediate energy. The intermediate energy guidance may be computed, such as, based on Equation (17) . In one embodiment, the intermediate energy guidance may be computed based on the estimated intermediate energy with a gradient of moments of the Gaussian mixture distribution. The intermediate energy guidance may be computed through the example procedure 1 as shown above (such as, using a typical gran operator in line 15) . For example, according to Equation (5) , a new score may be obtained based on the intermediate energy guidance and the original score learned by the pre-trained noise prediction network. Then, the multimedia data may be generated by sampling from the data distribution p0 (x0) similarly as described above on Equations (2) and (3) .

[0083] FIG. 5 illustrates a block diagram of an apparatus 500 for energy guidance of diffusion models in accordance with one aspect of the present disclosure. The apparatus 500 may comprise a memory 510 and at least one processor 520. The processor 520 may be coupled to the memory 510 and configured to perform the method 400 described above with reference to FIG. 4. The processor 520 may be a general-purpose processor, or may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. The memory 510 may store the input data, output data, data generated by processor 520, and / or instructions executed by processor 520.

[0084] The various operations, modules, and networks described in connection with the disclosure herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. According an embodiment of the disclosure, a computer program product for energy guidance of diffusion models may comprise processor executable computer codes for performing the method 400 described above with reference to FIG. 4. According to another embodiment of the disclosure, a computer readable medium may store computer codes for energy guidance of diffusion models, the computer codes when executed by a processor may cause the processor to perform the method 400 described above with reference to FIG. 4. Computer-readable medium includes both non-transitory computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. Any connection may be properly termed as a  computer-readable medium. Other embodiments and implementations are within the scope of the disclosure.

[0085] The preceding description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the various embodiments. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the scope of the various embodiments. Thus, the claims are not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the following claims and the principles and novel features disclosed herein.

Claims

1.A method for multimedia data generation by energy guidance of diffusion model, comprising:obtaining a Gaussian mixture distribution of K components for approximating a diffusion posterior, wherein K is an integer greater than 1, and the diffusion posterior is a distribution of multimedia data to be generated given intermediate noisy multimedia data;estimating an intermediate energy for guiding the multimedia data generation, by a plurality of samples drawn from the obtained Gaussian mixture distribution; andgenerating the multimedia data with a pre-trained noise prediction network and an intermediate energy guidance computed based on the estimated intermediate energy.2.The method of claim 1, wherein the multimedia data comprises at least one of image, video, audio, speech, text, and 3-D object.3.The method of claim 1, wherein the K components of the Gaussian mixture distribution comprise shared diagonal covariance matrix.4.The method of claim 1, wherein obtaining the Gaussian mixture distribution comprises estimating mean and variance parameters of the Gaussian mixture distribution by matching moment of the Gaussian mixture distribution and moment of the diffusion posterior.5.The method of claim 4, wherein the moment of the diffusion posterior is obtained based on noises predicted by the pre-trained noise prediction network and a plurality of high order noise prediction network.6.The method of claim 5, wherein the pre-trained noise prediction network and the plurality of high order noise prediction network comprise shared parameters by  adding a plurality of heads to the pre-trained noise prediction network.7.The method of claim 6, wherein parameters of the pre-trained noise prediction network are froze when training the plurality of heads.8.The method of claim 6, wherein each of the plurality of heads comprises Multilayer Perceptron (MLP) with a plurality of hidden layers.9.The method of claim 6, wherein each of the plurality of heads comprises a residual block and a convolutional block with group normalization.10.The method of claim 1, wherein the intermediate energy guidance is computed based on the estimated intermediate energy with a gradient of moments of the Gaussian mixture distribution.11.An apparatus for multimedia data generation by energy guidance of diffusion model, comprising:a memory; andat least one processor coupled to the memory and configured to perform the method of one of claims 1-10.12.A computer readable medium, storing computer code for multimedia data generation by energy guidance of diffusion model, the computer code when executed by a processor, causing the processor to perform the method of one of claims 1-10.13.A computer program product for multimedia data generation by energy guidance of diffusion model, comprising: processor executable computer code for performing the method of one of claims 1-10.

Citation Information

Patent Citations

  • Image feature analysis and generation method based on fast denoising diffusion probability model

    CN115908187A

  • Image processing method, system and device based on covariance optimization diffusion model

    CN117115042A

  • Face model fine tuning method based on image generation

    CN117557879A

  • Generation of image corresponding to input text using dynamic value clipping

    US20240153152A1

Cited By

  • COPD complication prediction model training method and COPD complication prediction method and device

    CN122025112A