Image generation method and system based on diffusion model time step pruning
By employing a representation-aware structured pruning framework and a phased selection mechanism in the diffusion model, the asymmetric characteristics of the diffusion model in the time dimension are addressed, achieving efficient compression and preservation of generation quality, ensuring the accuracy of importance measurement for key time steps, and reducing redundant computation.
Patent Information
- Application Number
- CN202511508301.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-10-22
AI Technical Summary
Existing diffusion models exhibit asymmetric characteristics in the time dimension, making it difficult for existing uniform sampling or uniformly weighted time step evaluation methods to accurately capture the differentiated contributions of different stages to the generation quality. This results in insufficient measurement of the importance of key time steps during pruning, thereby affecting the model's image generation performance.
A representation-aware structured pruning framework is adopted. By calculating the denoising loss difference and loss change of each image time step and combining the temperature-scaled Gaussian kernel and discrete loss, time steps are selected in stages. The importance score is calculated by the first-order Taylor expansion method based on the cumulative gradient, and the time step selection strategy is dynamically adjusted.
While effectively compressing the diffusion model, it maintains the quality of generation, can more accurately capture information-rich time steps, reduce redundancy, improve efficiency, and maintain the model's representational ability.
Smart Images

Figure CN120976358A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image generation, and particularly relates to an image generation method and system based on diffusion model time step pruning. BACKGROUND
[0002] In recent years, diffusion models have made significant breakthroughs in image, speech and cross-modal generation tasks, and have shown excellent ability to generate high-fidelity data. However, such models are usually accompanied by a large parameter size and extremely high computational overhead, which poses strict requirements on storage space and computing resources in actual deployment. This problem is particularly prominent in resource-constrained application scenarios, such as mobile end inference, embedded devices or real-time generation systems. To alleviate the above challenges, structured pruning, as a classic model compression and acceleration method, is widely used in convolutional neural networks and Transformer architectures, which can effectively reduce the model size and inference delay while trying to maintain the original performance. Therefore, it is of great significance to introduce structured pruning into diffusion models.
[0003] At present, the diffusion process of the existing diffusion model has significant heterogeneity in the time dimension, and the early time steps mainly determine the construction of overall semantic and structural information, while the later time steps are responsible for the modification and improvement of local texture and fine details. The asymmetric characteristics of the early structure-driven and later detail-oriented make it difficult for the existing uniform sampling or uniform weighting time step evaluation methods to accurately capture the differentiated contributions of different stages to the generation quality, leading to the underestimation of the importance of key time steps in the pruning process, thereby causing the decline of the model image generation performance. Therefore, it is necessary to design an image generation method and system based on diffusion model time step pruning. SUMMARY
[0004] The purpose of the present application is to overcome the shortcomings of the prior art, to better effectively solve the asymmetric characteristics of the early structure driving and the late detail guiding of the diffusion process of the existing diffusion model, so that the existing uniform sampling or uniform weighting time step evaluation method is difficult to accurately capture the differentiated contribution of different stages to the generation quality, thereby causing the importance of key time steps to be underestimated in the pruning process, and further causing the model image generation performance to decline. A diffusion model time step pruning based image generation method and system is provided, which realizes efficient compression of the diffusion model using a perception structured pruning framework while maintaining generation quality, and also realizes the function of dynamically adjusting the time step screening strategy according to the stage characteristics of the diffusion process using a phased time step selection mechanism. Not only can it focus on the most representative key time steps within the stage, but also can reduce redundancy and improve efficiency. At the same time, after selecting the time steps with rich information, the importance score of pruning is calculated using the first-order Taylor expansion method based on cumulative gradient, which can accumulate gradient information under key signals.
[0005] In order to achieve the above purpose, the technical scheme adopted by the present application is: A diffusion model time step pruning based image generation method, comprising the following steps, Step A, calculate the denoising loss of each image time step and obtain the diffusion loss difference, and then use the diffusion loss difference to calculate the continuous time step loss change; Step B, spatially average pool the predicted noise map of the batch image sample and obtain the image feature representation, and then use the image feature representation to calculate the pairwise distance between image sample features; Step C, use the temperature scaled Gaussian kernel to soft aggregate the pairwise distance between all image sample features and obtain the discrete loss; Step D, combine the continuous time step loss change and the discrete loss into a unified scoring function; Step E, divide the diffusion time steps into non-overlapping stages of the same size; Step F, use the scoring function to introduce a phased selection time step selection mechanism in the obtained non-overlapping stages, and then use different strategies to select the corresponding time steps in the early stage and the late stage in the non-overlapping stages and obtain a time step set; Step G, perform backpropagation on the time steps in the obtained time step set and calculate the importance score, and then remove the parameter weights with an importance score lower than a threshold from the image sample and generate a pruned image.
[0006] The foregoing diffusion model time step pruning based image generation method, step A, calculates the denoising loss of each image time step and obtains the diffusion loss difference, and then uses the diffusion loss difference to calculate the continuous time step loss change, the specific steps are as follows, Step A1: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, as shown in formula (1). (1) in, for Diffusion loss difference at time step To predict noise, Real noise; Step A2: Calculate the change in loss over consecutive time steps using the difference in diffusion loss, as shown in formula (2). (2) in, Loss changes over consecutive time steps for Diffusion loss at time step is poor.
[0007] In the aforementioned image generation method based on time-step pruning of a diffusion model, step B involves performing spatial average pooling on the predicted noise map of a batch of image samples to obtain image feature representations. These image feature representations are then used to calculate pairwise distances between image sample features. The specific steps are as follows: Step B1 involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain the image feature representation. Specifically, this involves performing spatial average pooling on the predicted noise map of the i-th image sample in each batch of size B. Spatial average pooling is performed, as shown in formula (3). (3) in, Let i be the image feature representation of the i-th image sample. For feature map height, The width of the feature map. To extract the i-th image sample at position ( All channel vectors of ) Step B2 involves calculating the pairwise distances between image sample features using image feature representation, as shown in formula (4). (4) in, For the i-th image sample and the i-th... The pairwise distance between image samples For the first Image feature representation of an image sample.
[0008] In the aforementioned image generation method based on diffusion model time-step pruning, step C involves using a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between features of all image samples and obtain a discrete loss, as shown in formula (5). (5) in, For discrete loss, This refers to temperature hyperparameters.
[0009] In the aforementioned image generation method based on diffusion model time-step pruning, step D combines the continuous time-step loss variation and discrete loss into a unified scoring function, as shown in formula (6). (6) in, The overall score for time step t. This is the balance coefficient.
[0010] In the aforementioned image generation method based on diffusion model time step pruning, step E involves dividing the diffusion time step into non-overlapping stages of the same size, as shown in formula (7). (7) in, For the first The set of time steps contained in each window The size of the non-overlapping stages.
[0011] The aforementioned image generation method based on diffusion model time-step pruning, in step F, introduces a phased time-step selection mechanism in the obtained non-overlapping stages using a scoring function. Then, different strategies are employed in the early and late stages of the non-overlapping stages to select corresponding time steps and obtain a set of time steps. The specific steps are as follows. Step F1 involves using a scoring function to introduce a phased selection time step mechanism within the obtained non-overlapping phases, specifically by setting a dividing point. The dividing point Used to distinguish between early and late stages; Step F2 involves selecting appropriate time steps and obtaining a set of time steps using different strategies in the early and late stages of the non-overlapping stages. The specific steps are as follows. Step F21, if the dividing point Then, the selection set is formed by selecting all time steps within the early stage whose scores exceed a specific threshold of the stage, as shown in formula (8). (8) in, for The set of time steps within the window that meet the threshold condition. It is a hyperparameter that controls the threshold. for; Step F22, if the dividing point Then, the time step with the most information content in the late stage is retained using the top-k strategy, as shown in formula (9). ; (9) in, To select the proportion, Choose the sparsity of time steps within each stage. To obtain the maximum value; Step F23: Obtain the set of time steps, as shown in formula (10). ; (10) in, To divide the number of windows, The number of diffusion time steps. Let U be the set of time steps, and U be the union of the sets.
[0012] In the aforementioned image generation method based on diffusion model time-step pruning, step G involves performing backpropagation on the time steps in the obtained time-step set and calculating importance scores. Then, the weights of parameters with importance scores below a threshold are removed from the image samples to generate pruned images. The importance score calculation process is shown in formula (11). (11) in, This is the parameter set corresponding to the c-th channel in the model network. In time step Updiffusion loss on parameters gradient, It is the first derivative.
[0013] An image generation system based on time-step pruning using a diffusion model includes a diffusion loss calculation module, a distance calculation module, a discrete loss acquisition module, a scoring function construction module, a stage partitioning module, a time-step set acquisition module, and an importance score calculation module. The diffusion loss calculation module calculates the denoising loss for each image time step and obtains the diffusion loss difference, then uses this difference to calculate the loss change across consecutive time steps. The distance calculation module performs spatial average pooling on the predicted noise map of a batch of image samples to obtain image feature representations, then uses these representations to calculate pairwise distances between image sample features. The discrete loss acquisition module uses a temperature-scaled Gaussian kernel to calculate pairwise distances between all image sample features. The algorithm performs soft aggregation to obtain discrete loss; the scoring function construction module combines the continuous time step loss variation and discrete loss into a unified scoring function; the stage division module divides the diffusion time step into non-overlapping stages of the same size; the time step set acquisition module introduces a stage-based time step selection mechanism in the obtained non-overlapping stages using the scoring function, and then selects corresponding time steps in the early and late stages of the non-overlapping stages using different strategies to obtain a time step set; the importance score calculation module performs backpropagation on the time steps in the obtained time step set and calculates the importance score, and then removes the parameter weights with importance scores below a threshold from the image samples to generate pruned images.
[0014] The beneficial effects of this invention are: (1) This invention first calculates the denoising loss for each image time step and obtains the diffusion loss difference. Then, it uses the diffusion loss difference to calculate the loss change in consecutive time steps. Next, it performs spatial average pooling on the predicted noise map of a batch of image samples to obtain image feature representations. Then, it uses the image feature representations to calculate the pairwise distances between image sample features. Subsequently, it uses a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between all image sample features and obtains discrete loss. Finally, it combines the loss change in consecutive time steps and discrete loss into a unified scoring function, effectively realizing that the image generation method and system can efficiently compress the diffusion model while maintaining the representation-aware structured pruning framework. This method maintains the quality of data generation, and by measuring the perturbation of the loss function at a specific time step through the diffusion loss difference, it reflects the importance of that time step to the overall denoising process. Simultaneously, by evaluating the dispersion of the model's predicted features in a small batch of samples through discrete loss, it characterizes the semantic variability provided by that time step in the representation space. The combination of diffusion loss difference and discrete loss ensures that the scoring mechanism considers not only the strength of the optimized signal but also the richness of the semantic representation, thus more accurately capturing information-rich time steps. This provides a more comprehensive measure of the importance of different time steps in the diffusion process, avoiding the underestimation of the contribution of key time steps seen in traditional methods. (2) This invention divides the diffusion time step into non-overlapping stages of the same size, then uses a scoring function to introduce a phased selection mechanism for time steps in the obtained non-overlapping stages. Different strategies are then used to select corresponding time steps in the early and late stages of the non-overlapping stages to obtain a set of time steps. Backpropagation is then performed on the time steps in the obtained set to calculate importance scores. Parameter weights with importance scores below a threshold are removed from the image samples to generate pruned images. This effectively realizes that the image generation method and system have the function of dynamically adjusting the time step selection strategy according to the phased characteristics of the diffusion process using a phased time step selection mechanism, and in the early stages of generation… Since gradient signals are often noisy and fluctuate greatly, threshold-based screening methods can overcome the problem of high gradient signal noise. In the later stages of generation, as the denoising process gradually converges and the signal becomes more stable, and more precise decision-making is required, switching to a top-k selection mechanism can ensure efficient and accurate pruning decisions. This not only allows focusing on the most representative key time steps within a stage, but also reduces redundancy and improves efficiency. Furthermore, after selecting information-rich time steps, the importance score of pruning is calculated using the first-order Taylor expansion method based on cumulative gradients, which accumulates gradient information under key signals. This not only enables efficient and reasonable structured pruning, but also maintains the model's representational ability while reducing redundant computation. Attached Figure Description
[0015] Figure 1 This is an overall flowchart of an image generation method based on diffusion model time-step pruning according to the present invention; Figure 2 This is a comparison chart of the model generation effects of various pruning methods with a pruning rate of 5% in the embodiments of the present invention, without fine-tuning. Detailed Implementation
[0016] The present invention will now be further described with reference to the accompanying drawings.
[0017] like Figure 1 As shown, an image generation method based on diffusion model time-step pruning according to the present invention includes the following steps: Step A: Calculate the denoising loss for each image time step and obtain the diffusion loss difference. Then, use the diffusion loss difference to calculate the loss change at consecutive time steps. The specific steps are as follows. Step A1: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, as shown in formula (1). (1) in, for Diffusion loss difference at time step To predict noise, Real noise; Step A2: Calculate the change in loss over consecutive time steps using the difference in diffusion loss, as shown in formula (2). (2) in, Loss changes over consecutive time steps for Diffusion loss at time step is poor.
[0018] Step B involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain image feature representations, and then using these image feature representations to calculate pairwise distances between image sample features. The specific steps are as follows. Step B1 involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain the image feature representation. Specifically, this involves performing spatial average pooling on the predicted noise map of the i-th image sample in each batch of size B. Spatial average pooling is performed, as shown in formula (3). (3) in, Let i be the image feature representation of the i-th image sample. For feature map height, The width of the feature map. To extract the i-th image sample at position ( All channel vectors of ) Step B2 involves calculating the pairwise distances between image sample features using image feature representation, as shown in formula (4). (4) in, For the i-th image sample and the i-th... The pairwise distance between image samples For the first Image feature representation of an image sample.
[0019] Step C involves using a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between all image sample features and obtain the discrete loss, as shown in formula (5). (5) in, For discrete loss, This refers to temperature hyperparameters.
[0020] Step D combines the continuous-time step loss variation and discrete loss into a unified scoring function, as shown in formula (6). (6) in, The overall score for time step t. This is the balance coefficient.
[0021] Step E involves dividing the diffusion time step into non-overlapping stages of the same size, as shown in formula (7). (7) in, For the first The set of time steps contained in each window The size of the non-overlapping stages.
[0022] Step F involves introducing a phased selection mechanism for time steps within the obtained non-overlapping stages using a scoring function. Different strategies are then employed to select appropriate time steps in the early and late stages of the non-overlapping stages, resulting in a set of time steps. The specific steps are as follows. Step F1 involves using a scoring function to introduce a phased selection time step mechanism within the obtained non-overlapping phases, specifically by setting a dividing point. The dividing point Used to distinguish between early and late stages; Step F2 involves selecting appropriate time steps and obtaining a set of time steps using different strategies in the early and late stages of the non-overlapping stages. The specific steps are as follows. Step F21, if the dividing point Then, the selection set is formed by selecting all time steps within the early stage whose scores exceed a specific threshold of the stage, as shown in formula (8). (8) in, for The set of time steps within the window that meet the threshold condition. It is a hyperparameter that controls the threshold. for; Step F22, if the dividing point Then, the time step with the most information content in the late stage is retained using the top-k strategy, as shown in formula (9). ; (9) in, To select the proportion, Choose the sparsity of time steps within each stage. To obtain the maximum value; Step F23: Obtain the set of time steps, as shown in formula (10). ; (10) in, To divide the number of windows, The number of diffusion time steps. Let U be the set of time steps, and U be the union of the sets.
[0023] Step G involves performing backpropagation on the time steps in the obtained time step set and calculating their importance scores. Then, the weights of parameters with importance scores below a threshold are removed from the image samples to generate pruned images. The importance score calculation process is shown in formula (11). (11) in, This is the parameter set corresponding to the c-th channel in the model network. In time step Updiffusion loss on parameters gradient, It is the first derivative.
[0024] An image generation system based on time-step pruning using a diffusion model includes a diffusion loss calculation module, a distance calculation module, a discrete loss acquisition module, a scoring function construction module, a stage partitioning module, a time-step set acquisition module, and an importance score calculation module. The diffusion loss calculation module calculates the denoising loss for each image time step and obtains the diffusion loss difference, then uses this difference to calculate the loss change across consecutive time steps. The distance calculation module performs spatial average pooling on the predicted noise map of a batch of image samples to obtain image feature representations, then uses these representations to calculate pairwise distances between image sample features. The discrete loss acquisition module uses a temperature-scaled Gaussian kernel to calculate pairwise distances between all image sample features. The algorithm performs soft aggregation to obtain discrete loss; the scoring function construction module combines the continuous time step loss variation and discrete loss into a unified scoring function; the stage division module divides the diffusion time step into non-overlapping stages of the same size; the time step set acquisition module introduces a stage-based time step selection mechanism in the obtained non-overlapping stages using the scoring function, and then selects corresponding time steps in the early and late stages of the non-overlapping stages using different strategies to obtain a time step set; the importance score calculation module performs backpropagation on the time steps in the obtained time step set and calculates the importance score, and then removes the parameter weights with importance scores below a threshold from the image samples to generate pruned images.
[0025] To better illustrate the effects of the present invention, an embodiment comparing the image generation method and system of the present invention with existing diffusion model pruning methods is described below.
[0026] Tables 1, 2, and 3 show the performance comparison results of each pruning method on the CIFAR-10, LSUN-bedroom, and LSUN-church datasets, respectively. As can be seen from the results in Tables 1, 2, and 3, the pruning method proposed in this invention maintains excellent performance after model compression, regardless of whether the image is low-resolution (CIFAR-10 dataset) or high-resolution (LSUN dataset). On the CIFAR-10 dataset, except for a pruning rate of 16% which failed to achieve state-of-the-art (SOTA) performance, all other pruning rates achieved SOTA performance. Furthermore, the advantages of the proposed method become more pronounced as the pruning rate increases, maintaining good generation results even when the model is compressed by 70%. On the LSUN-bedroom and LSUN-church datasets, the method of this invention also outperforms other comparative methods, with the improvement on the LSUN-bedroom dataset being particularly significant.
[0027] Table 1. Performance comparison results of various pruning methods on the CIFAR10 dataset.
[0028] Table 2. Performance comparison results of various pruning methods on the LSUN-bedroom dataset.
[0029] Table 3. Performance comparison results of various pruning methods on the LSUN-church dataset.
[0030] Figure 2 shows the comparison results of each method under a 5% pruning rate and without fine-tuning. The first row shows the original graph, the second row shows the pruning effect using the random pruning method, the third row shows the pruning effect using the weighted pruning method, the fourth row shows the pruning effect using the Taylor pruning method, the fifth row shows the pruning effect using the Diff pruning method, and the sixth row shows the pruning effect using the method of this invention. Figure 2 The results show that the method of the present invention can still maintain higher image quality, further verifying the effectiveness of the method. The present invention can accurately select the most representative diffusion time step, providing precise guidance for structured pruning, thereby maximizing performance while significantly compressing the model.
[0031] In summary, the image generation method and system based on diffusion model time-step pruning of the present invention first calculates the denoising loss for each image time step and obtains the diffusion loss difference, then uses the diffusion loss difference to calculate the loss change in consecutive time steps, next performs spatial average pooling on the predicted noise map of a batch of image samples to obtain image feature representations, then uses the image feature representations to calculate the pairwise distances between image sample features, subsequently uses a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between all image sample features to obtain discrete loss, and finally combines the loss change in consecutive time steps and discrete loss into a unified scoring function, effectively realizing that the image generation method and system employs representation-aware structured pruning. The branched framework efficiently compresses the diffusion model while maintaining generation quality. Furthermore, by measuring the diffusion loss difference, the magnitude of the perturbation in the loss function at a specific time step reflects the importance of that time step to the overall denoising process. Simultaneously, by evaluating the dispersion of predicted features in small batches of samples using discrete loss, it characterizes the semantic variability provided by that time step in the representation space. The combination of diffusion loss difference and discrete loss ensures that the scoring mechanism considers not only the strength of the optimized signal but also the richness of the semantic representation, thus more accurately capturing information-rich time steps. This allows for a more comprehensive measurement of the importance of different time steps in the diffusion process, avoiding the underestimation of the contribution of key time steps in traditional methods. The system then divides the diffusion time step into non-overlapping stages of equal size. A scoring function is then used to introduce a phased selection mechanism for time steps within these non-overlapping stages. Different strategies are employed to select appropriate time steps in the early and late stages of the non-overlapping stages, resulting in a set of time steps. Finally, backpropagation is performed on the time steps in this set, and importance scores are calculated. Parameters with importance scores below a threshold are removed from the image samples, generating pruned images. This effectively realizes the function of dynamically adjusting the time step selection strategy based on the phased characteristics of the diffusion process using a phased time step selection mechanism, and in the early stages of generation... Since gradient signals are often noisy and fluctuate greatly, threshold-based screening methods can overcome the problem of high gradient signal noise. In the later stages of generation, as the denoising process gradually converges and the signal becomes more stable, and more precise decision-making is required, switching to a top-k selection mechanism can ensure the efficiency and accuracy of pruning decisions. This not only allows focusing on the most representative key time steps within a stage, but also reduces redundancy and improves efficiency. Furthermore, after selecting information-rich time steps, the importance score of pruning is calculated using the first-order Taylor expansion method based on cumulative gradients, which can accumulate gradient information under key signals. This not only enables efficient and reasonable structured pruning, but also maintains the model's representational ability while reducing redundant computation.
[0032] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. An image generation method based on time-step pruning using a diffusion model, characterized in that: Includes the following steps, Step A: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, then use the diffusion loss difference to calculate the loss change for consecutive time steps; Step B involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain image feature representations, and then using the image feature representations to calculate the pairwise distances between the features of the image samples. Step C: Use a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between features of all image samples and obtain discrete loss; Step D combines the continuous time step loss variation and discrete loss into a unified scoring function; Step E: Divide the diffusion time step into non-overlapping phases of the same size; Step F involves using a scoring function to introduce a phased selection mechanism for time steps in the obtained non-overlapping stages, and then using different strategies to select the corresponding time steps in the early and late stages of the non-overlapping stages to obtain a set of time steps. Step G involves performing backpropagation on the time steps in the obtained time step set and calculating importance scores. Then, the weights of parameters with importance scores below a threshold are removed from the image samples and pruned images are generated.
2. The image generation method based on diffusion model time-step pruning according to claim 1, characterized in that: Step A: Calculate the denoising loss for each image time step and obtain the diffusion loss difference. Then, use the diffusion loss difference to calculate the loss change at consecutive time steps. The specific steps are as follows. Step A1: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, as shown in formula (1). (1) in, for Diffusion loss difference at time step To predict noise, Real noise; Step A2: Calculate the change in loss over consecutive time steps using the difference in diffusion loss, as shown in formula (2). (2) in, Loss changes over consecutive time steps for Diffusion loss at time step is poor.
3. The image generation method based on diffusion model time-step pruning according to claim 2, characterized in that: Step B involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain image feature representations, and then using these image feature representations to calculate pairwise distances between image sample features. The specific steps are as follows. Step B1 involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain the image feature representation. Specifically, this involves performing spatial average pooling on the predicted noise map of the i-th image sample in each batch of size B. Spatial average pooling is performed, as shown in formula (3). (3) in, Let i be the image feature representation of the i-th image sample. For feature map height, The width of the feature map. To extract the i-th image sample at position ( All channel vectors of ) Step B2 involves calculating the pairwise distances between image sample features using image feature representation, as shown in formula (4). (4) in, For the i-th image sample and the i-th The pairwise distance between image samples For the first Image feature representation of an image sample.
4. The image generation method based on diffusion model time-step pruning according to claim 3, characterized in that: Step C involves using a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between all image sample features and obtain the discrete loss, as shown in formula (5). (5) in, For discrete loss, This refers to temperature hyperparameters.
5. The image generation method based on diffusion model time-step pruning according to claim 4, characterized in that: Step D combines the continuous-time step loss variation and discrete loss into a unified scoring function, as shown in formula (6). (6) in, The overall score for time step t. This is the balance coefficient.
6. The image generation method based on diffusion model time-step pruning according to claim 5, characterized in that: Step E involves dividing the diffusion time step into non-overlapping stages of the same size, as shown in formula (7). (7) in, For the first The set of time steps contained in each window The size of the non-overlapping stages.
7. The image generation method based on diffusion model time-step pruning according to claim 6, characterized in that: Step F involves introducing a phased selection mechanism for time steps within the obtained non-overlapping stages using a scoring function. Different strategies are then employed to select appropriate time steps in the early and late stages of the non-overlapping stages, resulting in a set of time steps. The specific steps are as follows. Step F1 involves using a scoring function to introduce a phased selection time step mechanism within the obtained non-overlapping phases, specifically by setting a dividing point. The dividing point Used to distinguish between early and late stages; Step F2 involves selecting appropriate time steps and obtaining a set of time steps using different strategies in the early and late stages of the non-overlapping stages. The specific steps are as follows. Step F21, if the dividing point Then, the selection set is formed by selecting all time steps within the early stage whose scores exceed a specific threshold of the stage, as shown in formula (8). (8) in, for The set of time steps within the window that meet the threshold condition. It is a hyperparameter that controls the threshold. for; Step F22, if the dividing point Then, the time step with the most information content in the late stage is retained using the top-k strategy, as shown in formula (9). ; (9) in, To select the proportion, Choose the sparsity of time steps within each stage. To obtain the maximum value; Step F23: Obtain the set of time steps, as shown in formula (10). ; (10) in, To divide the number of windows, The number of diffusion time steps. Let U be the set of time steps, and U be the union of the sets.
8. The image generation method based on diffusion model time-step pruning according to claim 7, characterized in that: Step G involves performing backpropagation on the time steps in the obtained time step set and calculating their importance scores. Then, the weights of parameters with importance scores below a threshold are removed from the image samples to generate pruned images. The importance score calculation process is shown in formula (11). (11) in, This is the parameter set corresponding to the c-th channel in the model network. In time step Updiffusion loss on parameters gradient, It is the first derivative.
9. An image generation system based on diffusion model time-step pruning, wherein the specific generation process of the image generation system is based on the image generation method according to any one of claims 1-8, characterized in that: It includes a diffusion loss calculation module, a distance calculation module, a discrete loss acquisition module, a scoring function construction module, a stage division module, a time step set acquisition module, and an importance score calculation module. The diffusion loss calculation module is used to calculate the denoising loss of each image time step and obtain the diffusion loss difference, and then use the diffusion loss difference to calculate the loss change of consecutive time steps. The distance calculation module is used to perform spatial average pooling on the predicted noise map of batch image samples to obtain image feature representation, and then use the image feature representation to calculate the pairwise distance between image sample features; The discrete loss acquisition module is used to perform soft aggregation on the pairwise distances between features of all image samples using a temperature-scaled Gaussian kernel to obtain discrete loss. The scoring function construction module is used to combine the continuous time step loss variation and discrete loss into a unified scoring function; The stage division module is used to divide the diffusion time step into non-overlapping stages of the same size; The time step set acquisition module is used to introduce a phased selection mechanism for time steps in the obtained non-overlapping stages using a scoring function, and then use different strategies to select the corresponding time steps in the early and late stages of the non-overlapping stages to obtain the time step set. The importance score calculation module is used to perform backpropagation on the time steps in the obtained time step set and calculate the importance score. Then, the parameter weights with importance scores below the threshold are removed from the image samples and pruned images are generated.
Citation Information
Patent Citations
Image processing method, training method of image processing model and image generation method
CN118365510A
Image super-resolution reconstruction method and system based on mixed experts and stable diffusion
CN119444578A
Diffusion model LoRA fine tuning optimization method and system based on CLIP loss and perception loss
CN119478587A
Diffusion Models Having Improved Accuracy and Reduced Consumption of Computational Resources
US20230267315A1