A fluid force field simulation and prediction method based on a lightweight conditional diffusion model

By employing a multi-level pruning technique in a lightweight conditional diffusion model, low-contribution weights and invalid channels are removed, solving the computational redundancy problem of the diffusion model. This enables fluid force field simulation on low-power devices, improving inference speed and accuracy.

CN120974942BActive Publication Date: 2025-12-23ZHONGKE HUACHUANG (HANGZHOU) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511500089.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2025-12-23
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Existing diffusion models suffer from computational redundancy in convolutional layers during fluid force field simulations, resulting in a large number of model parameters and high computational costs, making them difficult to deploy in low-power devices and real-time fluid force field simulation scenarios.

Method used

A fluid force field simulation prediction method based on a lightweight conditional diffusion model is adopted. Through multi-level pruning techniques, including convolution kernel pruning and channel pruning, low contribution weights and invalid output channels are removed. Combined with weight update and gradient deactivation mechanisms, the number of model parameters and computational cost are optimized.

Benefits of technology

It significantly reduces the number of model parameters and computational load, improves inference speed, meets the deployment requirements of edge devices and mobile terminals, and maintains the physical accuracy of fluid force field simulation, making it suitable for real-time fluid force field simulation and low-power applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120974942B_ABST
    Figure CN120974942B_ABST
Patent Text Reader

Abstract

The application discloses a fluid force field simulation prediction method based on a lightweight conditional diffusion model, comprising the following steps: S1, acquiring fluid force field image data sets and dividing them into a training set, a verification set and a test set; S2, constructing a basic framework of a fluid force field simulation model based on a conditional diffusion neural network, and pre-training the model through the training set; S3, performing lightweight improvement on the fluid force field simulation model pre-trained in step S2 based on multi-level pruning, wherein the multi-level pruning comprises convolution kernel pruning and channel pruning; S4, fine-tuning the unpruned parameters in the fluid force field simulation model improved in step S3 through the training set, and monitoring the model performance change in the fine-tuning process in combination with the verification set; after the fine-tuning is completed, calculating the fluid force field prediction performance index of the model through the test set, and screening the fluid force field simulation model with the optimal performance to generate the fluid force field prediction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of deep learning, in particular to a fluid force field simulation prediction method based on a lightweight conditional diffusion model. BACKGROUND

[0002] Diffusion models have gradually been applied to the field of fluid force field simulation due to their high fidelity characteristics in generative tasks. By learning the time evolution law and physical quantity distribution characteristics of the fluid force field, the prediction of the future time step flow field state is realized, which provides technical support for industrial flow field analysis, fluid equipment optimization, etc. The core architecture of existing diffusion models is mostly based on U-Net, which includes multi-scale downsampling, upsampling path and a large number of convolution layers. The convolution layer is the key component for the model to extract the characteristics of the fluid force field and complete the reverse denoising process.

[0003] However, when applying diffusion models to fluid force field simulation, there are two significant computational redundancy problems in the convolution layer calculation:

[0004] Convolution summation calculation redundancy: In the sliding convolution process of the convolution layer, the convolution kernel performs weighted summation on the kernel size window of the input feature map to generate a new feature map. However, the contribution of some convolution kernel parameters to the output feature is very low. The existence of these low-contribution parameters not only does not improve the accuracy of fluid force field feature extraction, but also increases a large number of invalid weighted summation calculations, causing waste of computational resources and decrease of inference efficiency.

[0005] Channel summation calculation redundancy: The feature map of the output channel of the convolution layer is obtained by summing the new feature maps completed by all convolutions in the same group. However, the overall contribution of some convolution kernels corresponding to the output channels to the prediction of the fluid force field is limited. The existence of these redundant channels leads to redundant calculations in the channel summation process, further increasing the model calculation and memory occupation.

[0006] These two problems directly lead to large model parameter quantity, high calculation cost and slow inference speed, which seriously restricts the deployment of the model in low-power devices (such as embedded systems, mobile terminals) and real-time fluid force field simulation scenarios. SUMMARY

[0007] The purpose of the present application is to provide a fluid force field simulation prediction method based on a lightweight conditional diffusion model to solve the computational redundancy problem in the above fluid force field simulation model.

[0008] To achieve the above purpose, the present application adopts the following technical solutions:

[0009] A fluid force field simulation prediction method based on a lightweight conditional diffusion model, comprising the following steps:

[0010] S1. Obtain the fluid force field image dataset and divide it into training set, validation set and test set;

[0011] S2. The basic architecture for constructing a fluid force field simulation model based on a conditional diffusion neural network is to pre-train the model using the training set and adjust the model training parameters in real time in conjunction with the validation set during the pre-training process to generate a pre-trained fluid force field simulation model.

[0012] S3. The fluid force field simulation model pre-trained in step S2 is improved by multi-level pruning. The multi-level pruning includes convolution kernel pruning and channel pruning. The convolution kernel pruning evaluates the importance of the convolution kernel parameters of the convolutional layer and removes the mask. The channel pruning evaluates the importance of the channel convolution kernels and removes the mask. The weights of the original convolutional network layer are updated by combining the results of convolution kernel pruning and channel pruning, and the gradients of the pruned parameters are removed.

[0013] S4. Fine-tune the unpruned parameters in the lightweight improved fluid force field simulation model of step S3 using the training set, and monitor the model performance changes in conjunction with the validation set during the fine-tuning process. After the fine-tuning is complete, calculate the fluid force field prediction performance index of the model using the test set, and select the fluid force field simulation model with the best performance for fluid force field prediction generation.

[0014] Preferably, the total number of samples in the dataset is n, and each data sample is represented as ( , ), where 1≤ ≤n, As the initial input and used as a condition for model training and prediction, The target output is used as the predicted label for model training.

[0015] Preferably, the diffusion neural network in step S2 adopts a denoising diffusion model with a preceding time step sequence condition. It is based on U-Net and includes multi-scale downsampling, upsampling paths, and skip residual connections to preserve the spatial information of the fluid force field image.

[0016] Preferably, the model pre-training process in step S2 specifically involves: each data sample in the dataset represents the fluid force field state of a fixed time step total sequence T, and the previous... Step sequence The fluid force field state is used as a condition, and the remaining T- The fluid force field state of the time step sequence is taken as the target. During training, data is selected from the training set, and the state of the continuous T-1 time step sequence is taken as the condition. The remaining single state is noise-processed, and the processed result is combined with the condition as the model input. The model outputs the predicted noise through the forward process of encoding and decoding, calculates the loss value, and learns the denoising path in the backward process to complete one round of training iteration.

[0017] Preferably, during the model pre-training process, the denoising effect and flow field prediction error of the model are evaluated using a validation set after each round of training, and the training parameters are adjusted according to the evaluation results to ensure that the performance of the pre-trained model on the validation set meets the preset standard.

[0018] Preferably, the convolution kernel pruning in step S3 specifically involves:

[0019] S311. For the convolutional kernel weights in the convolutional layers of the pre-trained model, calculate the mean and standard deviation of each convolutional kernel weight. , ,in, Indicates the first The output channel, the first The size corresponding to each input channel is The average weight of the convolution kernel, Indicates the first The output channel, the first The standard deviation of the convolutional kernel weights corresponding to each input channel These represent the output channel and input channel indices, respectively. Represents the pixel index inside the convolution kernel, 1≤ ≤ ,1≤ ≤ Iterate through all positions of the convolution kernel; This represents the weight parameters of the convolution kernel at the corresponding position. Indicates the kernel size. This represents the total number of parameters in the convolution kernel;

[0020] S312. Combining the maximum value of the convolutional kernel weights, the number of input channels, the convolutional kernel pruning hyperparameters, and the standard deviation of the convolutional kernel weights, calculate the importance threshold of the convolutional kernel parameters to balance the pruning ratio with model performance. ,in, This represents the threshold indicating the importance of the convolution kernel parameters. Indicates the first The maximum value of all convolutional kernel weights corresponding to each output channel. Indicates the number of input channels. This represents the hyperparameters for kernel pruning. Indicates the first a sum of standard deviations of all input channel convolution kernels under each output channel;

[0021] S313, based on the difference between the convolution kernel weight parameter and the convolution kernel weight mean, measure the importance of each parameter in the convolution kernel, generate a mask matrix through a mask function, and set the convolution kernel parameters with a difference less than the importance threshold to 0, wherein, indicates the 0-1 mask matrix of convolution kernel pruning, and Where(·) indicates a mask function.

[0022] Preferably, the channel pruning in step S3 is specifically:

[0023] S321, for all convolution kernel weights of each output channel of the pre-trained model, calculate the channel weight mean and channel weight standard deviation of each channel, and quantify the overall contribution of the channel, , wherein, indicates the channel weight mean of the i-th output channel, indicates the channel weight standard deviation corresponding to the i-th output channel, indicates the total weight parameter quantity corresponding to the i-th output channel; S322, combining the global weight maximum value, the number of output channels, the channel pruning hyperparameter and the channel convolution kernel weight standard deviation, calculating the channel importance threshold, controlling the channel pruning ratio, wherein,

[0024] indicates the channel importance threshold, indicates the global maximum value of all output channel weights, indicates the number of output channels, indicates the channel pruning hyperparameter, indicates the sum of standard deviations of all output channels; S323, based on the difference between the convolution kernel weight mean and the channel weight mean, measure the importance of each convolution kernel in the channel, generate a mask matrix through a mask function, and set the channel convolution kernel with a difference less than the importance threshold to 0, wherein,

[0025] indicates the 0-1 mask matrix of channel pruning, indicates the mask function value of the convolution kernel weight corresponding to the i-th output channel and the j-th input channel, i.e. the convolution kernel weight mean in the channel. Preferably, step S3 further comprises:

[0026]

[0027] ​​​​​S33, the convolution kernel pruning mask matrix and the channel pruning mask matrix are combined to update the parameters of the original convolution kernel weight, only when the channel mask value is 1 and the convolution kernel mask value is also 1, the original convolution kernel weight parameter is retained as an effective parameter, and the rest of the parameters are pruned as redundant parameters and set to 0, to generate the pruned and updated convolution kernel weight parameter, wherein, represents the pruned and updated convolution kernel weight parameter, represents the mask value of the i-th output channel and the j-th input channel in the channel mask matrix, represents the mask value of the i-th output channel and the j-th input channel in the channel mask matrix, represents the mask value of the i-th output channel and the j-th input channel in the channel mask matrix, represents the mask value of the i-th output channel and the j-th input channel in the channel mask matrix.

[0028] Preferably, in the parameter updating process of step S3, to prevent the redundant parameters pruned in the pruning from being reactivated in the fine-tuning, the gradient of the redundant parameters pruned is set to 0 by gradient deactivation using the same mask combination, and only the gradient of the effective parameters is retained for fine-tuning update, wherein, represents the gradient value of the pruned parameter, represents the original gradient calculation result when not pruned, represents the model prediction loss value, represents the partial differential symbol, X represents the input feature map, and Y represents the output feature map, and respectively represent the height and width of the input feature map, represents the parameter value of the input feature map, represents the partial derivative of the model prediction loss value with respect to the output feature map of the convolution layer.

[0029] Preferably, step S4 is specifically:

[0030] S41, the training set is used to iteratively train the fluid force field simulation model improved by step S3 light weight, an initial learning rate and an iteration number are set, the effective parameters in the model that are not pruned are fine-tuned, and the performance of the model is monitored through the validation set to avoid overfitting and reduce the prediction error of the model;

[0031] S42, the test set is used to measure and evaluate the prediction performance of the fine-tuned fluid force field simulation model, and the fluid force field simulation model with the optimal performance is selected to generate the fluid force field prediction.

[0032] After the above technical solution is adopted, the present application has the following advantages compared with the background art:

[0033] 1. The application provides a fluid force field simulation prediction method based on a lightweight conditional diffusion model. Through the convolution kernel pruning and channel pruning of step S3, the convolution sum redundancy and channel sum redundancy of the convolution layer can be eliminated respectively. The convolution kernel pruning removes low contribution weights through parameter importance evaluation, and the channel pruning removes invalid output channels through channel importance evaluation. Combined with weight updating and gradient inactivation mechanism, while retaining effective parameters, the model parameter quantity and calculation quantity are greatly reduced, and the memory occupation and computing power requirement are reduced.

[0034] 2. The application provides a fluid force field simulation prediction method based on a lightweight conditional diffusion model. The improved lightweight model effectively reduces redundant calculations, and the inference speed is significantly improved compared with the pre-trained model. At the same time, the reduction of model parameter quantity and calculation cost makes it possible to deploy on resource-constrained devices such as edge devices and mobile terminals, meeting the real-time simulation and low-power application requirements of fluid force field, and expanding the practical application range of the technology.

[0035] 3. The application provides a fluid force field simulation prediction method based on a lightweight conditional diffusion model. The fine-tuning process optimizes the effective parameters that have not been pruned, and real-time monitoring of the validation set can make up for the precision loss caused by pruning. At the same time, by selecting the performance-optimal model through the test set, it ensures that the model can accurately predict the time evolution rule and physical quantity distribution of the fluid force field while reducing cost and improving speed, meeting the physical precision requirements of fluid force field simulation. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 The method flowchart of the application;

[0037] Figure 2 The model architecture diagram of the conditional diffusion model of the application;

[0038] Figure 3 The convolution kernel pruning method diagram of the application;

[0039] Figure 4 The channel pruning method diagram of the application;

[0040] Figure 5 The fluid force field diagram generated by the sample prediction of the application. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical scheme and advantages of the application more clear, the application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the application and do not limit the application.

[0042] Please refer to Figures 1 to 5As shown, this invention discloses a method for simulating and predicting fluid force fields based on a lightweight conditional diffusion model, comprising the following steps:

[0043] S1. Obtain the fluid force field image dataset and divide it into training set, validation set and test set. The dataset covers the fluid force field state under different flow field conditions and different time step sequences to ensure that the constructed dataset has diversity and representativeness. The sample division ratio of training set, validation set and test set should be adapted to the model training requirements. The sample ratio of training set should not be less than 70%, and the sample ratio of validation set and test set should be allocated according to the actual evaluation requirements.

[0044] The dataset has a total of n samples, and each data sample is represented as ( , ), where 1≤ ≤n, As the initial input and used as a condition for model training and prediction, The target output is used as the predicted label for model training.

[0045] S2. The basic architecture for constructing a fluid force field simulation model based on a conditional diffusion neural network is to pre-train the model using a training set and adjust the model training parameters in real time by combining the validation set during the pre-training process to generate a pre-trained fluid force field simulation model.

[0046] In step S2, the diffusion neural network is trained and inferred using a denoising diffusion model with a preceding time step sequence condition. It is based on U-Net and includes multi-scale downsampling, upsampling paths and skip residual connections to preserve the spatial information of the fluid force field image, adapting to the accuracy requirements of fluid force field simulation. During the inference process, autoregressive single-step prediction is performed.

[0047] The model pre-training process in step S2 is as follows: each data sample in the dataset represents the fluid force field state of a fixed time step total sequence T. Step sequence The fluid force field state is used as a condition, and the remaining T- The fluid force field state of the time step sequence is taken as the target. During training, data is selected from the training set, and the state of the continuous T-1 time step sequence is taken as the condition. The remaining single state is noise-processed, and the processed result and the condition are used as the model input. The model outputs the predicted noise through the forward process of encoding and decoding, calculates the loss value, and learns the denoising path in the backward process to complete one round of training iteration.

[0048] During the model pre-training process, the denoising effect and flow field prediction error of the model are evaluated through the validation set after each round of training, and the training parameters are adjusted according to the evaluation results to ensure that the performance of the pre-trained model on the validation set meets the preset standard.

[0049] As shown in Figure 2 , for the calculation process in the l-th layer convolution layer, the model input image , the convolution kernel , and the input image perform convolution calculation to obtain the output channel value, which involves two summation operations. First, each convolution kernel performs sliding convolution on the corresponding position input feature map, each convolution kernel performs weighted summation on the feature map in the kernel size window, and finally a new feature map is obtained. Secondly, the new feature maps obtained by all convolutions in the same group are summed to obtain the feature map of the output channel.

[0050] , wherein represents the feature value of the l-th output channel, coordinate (x, y) position, which is the final result of convolution calculation, represents the feature value of the l-th input channel, coordinate (x, y) position, represents the feature value of the l-th input channel, coordinate (x, y) position, represents the feature value of the l-th input channel, coordinate (x, y) position, represents the feature value of the l-th input channel, coordinate (x, y) position, represents the feature value of the l-th input channel, coordinate (x, y) position, represents the feature value of the l-th input channel, coordinate (x, y) position,

[0051] From the above convolution layer calculation formula and step disassembly, it can be known that there is a calculation redundancy of kernel convolution process and output channel process in the l-th layer image convolution. In order to reduce the calculation redundancy, reduce the model parameters and improve the inference speed, the following step S3 uses a multi-level pruning method to optimize and improve the original diffusion model.

[0052] S3, based on multi-level pruning, the fluid field simulation model pre-trained in step S2 is improved to be lightweight, multi-level pruning includes convolution kernel pruning and channel pruning, convolution kernel pruning is performed by importance evaluation and mask pruning on the convolution kernel parameters of the convolution layer, channel pruning is performed by importance evaluation and mask pruning on the channel convolution kernel, the original convolution network layer weight is updated combined with the convolution kernel pruning and channel pruning results, and the gradient of the pruned parameters is removed;

[0053] S4, the unpruned parameters in the fluid field simulation model improved to be lightweight in step S3 are fine-tuned through the training set, and the model performance change is monitored in the fine-tuning process combined with the validation set. After fine-tuning is completed, the fluid field prediction performance index of the model is calculated through the test set, and the fluid field simulation model with the best performance is selected to generate the fluid field prediction.

[0054] The convolution kernel pruning in step S3 is as follows:

[0055] S311, for the convolution kernel weight of the convolution layer in the pre-trained model, the mean value and the standard deviation of each convolution kernel weight are calculated, , , wherein, Indicates the first The output channel, the first The size corresponding to each input channel is The average weight of the convolution kernel, Indicates the first The output channel, the first The standard deviation of the convolutional kernel weights corresponding to each input channel These represent the output channel and input channel indices, respectively. Represents the pixel index inside the convolution kernel, 1≤ ≤ ,1≤ ≤ Iterate through all positions of the convolution kernel; This represents the weight parameters of the convolution kernel at the corresponding position. Indicates the kernel size. This represents the total number of parameters in the convolution kernel;

[0056] S312. Combining the maximum value of the convolutional kernel weights, the number of input channels, the convolutional kernel pruning hyperparameters, and the standard deviation of the convolutional kernel weights, calculate the importance threshold of the convolutional kernel parameters to balance the pruning ratio with model performance. ,in, This represents the threshold indicating the importance of the convolution kernel parameters. Indicates the first The maximum value of all convolutional kernel weights corresponding to each output channel. Indicates the number of input channels. This represents the hyperparameters for kernel pruning. Indicates the first The sum of the standard deviations of the convolution kernels of all input channels under each output channel;

[0057] S313. The importance of each parameter in the convolution kernel is measured based on the difference between the kernel weight parameters and the mean of the kernel weights. A mask matrix is ​​generated using a masking function, and convolution kernel parameters with differences less than an importance threshold are pruned and set to 0. ,in, represents the 0-1 mask matrix for kernel pruning, and Where(·) represents the mask function.

[0058] The channel pruning in step S3 specifically involves:

[0059] S321. For each output channel of the pre-trained model, calculate the mean and standard deviation of all convolutional kernel weights for each channel to quantify the overall contribution of the channels. , ,in, Indicates the first The average channel weight of each output channel. Indicates the first The standard deviation of the channel weights corresponding to each output channel Indicates the first The total number of weight parameters corresponding to each output channel;

[0060] S322. Combining the global maximum weight, the number of output channels, channel pruning hyperparameters, and the standard deviation of channel convolution kernel weights, calculate the channel importance threshold to control the channel pruning ratio. ,in, Indicates the channel importance threshold, This represents the global maximum value of the weights of all output channels. Indicates the number of output channels. This represents the channel pruning hyperparameters. This represents the sum of the standard deviations of all output channels;

[0061] S323. The importance of each convolutional kernel in a channel is measured based on the difference between the mean weight of the convolutional kernel within the channel and the mean weight of the channel. A mask matrix is ​​generated using a mask function, and convolutional kernels in channels with a difference less than the importance threshold are pruned and set to 0. ,in, The 0-1 mask matrix representing channel pruning. The mask function represents the first The output channel, the first The kernel weight representation value corresponding to each input channel, that is, the average kernel weight within that channel.

[0062] First, channel pruning (coarse-grained) quickly removes channels with extremely low contribution, reducing the computational scope of subsequent convolution kernel pruning. Then, for the important channels that are retained, convolution kernel pruning (fine-grained) removes redundant parameters within the channels, achieving layer-by-layer stripping of redundancy. Ultimately, this addresses the two types of core redundancy in the convolution operation of the diffusion model, maintaining the quality of fluid force field simulation while reducing the number of parameters and improving inference speed.

[0063] The remaining parameters are pruned and set to 0, generating the pruned kernel weights that are then updated. ,in, This represents the updated convolutional kernel weight parameters after pruning. Indicating the channel mask matrix The output channel, the first The mask value for each input channel, where the mask value is either 0 or 1. This represents the mask value at the corresponding position in the convolution kernel pruning mask matrix; the mask value is either 0 or 1.

[0064] In step S3, during parameter update, to prevent pruned redundant parameters from being reactivated during fine-tuning, gradient deactivation is used to set the gradients of pruned redundant parameters to 0 using the same mask combination, retaining only the gradients of valid parameters for fine-tuning updates. ,in, This represents the gradient value of the parameters after pruning. This represents the original gradient calculation result without pruning. This represents the model's predicted loss value. Let X represent the partial derivative sign, X represent the input feature map, and Y represent the output feature map. and These represent the height and width of the input feature map, respectively. This represents the parameter values ​​of the input feature map. This represents the partial derivative of the model's predicted loss value with respect to the feature map output by the convolutional layer.

[0065] Step S4 is as follows:

[0066] S41. Iteratively train the fluid force field simulation model after the lightweight improvement in step S3 using the training set. The Adam optimizer is used, with an initial learning rate of 0.0001 and 3100 iterations. Fine-tune the effective parameters of the unpruned model and monitor the model performance through the validation set to avoid overfitting and reduce model prediction error.

[0067] S42. The performance of the fine-tuned fluid force field simulation model is evaluated using a test set. The evaluation is based on three aspects: physical quantity error (such as velocity and pressure prediction deviation), temporal coherence (multi-time step flow field evolution logic), and inference efficiency (computation time and memory usage). The best-performing fluid force field simulation model is then selected for fluid force field prediction.

[0068] The prediction generation specifically involves: combining the dataset from step S1... Before the fluid force field state with consistent format Step sequence Input the optimal model and generate the flow field results for subsequent time steps through autoregressive single-step inference; the prediction generation of the fluid force field includes the prediction of the fluid force field state for multiple consecutive time steps in the future. The prediction results are output in the form of distribution images of physical quantities such as flow field velocity and pressure, which are used to intuitively show the dynamic evolution process of the fluid force field.

[0069] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for simulating and predicting fluid force fields based on a lightweight conditional diffusion model, characterized in that: Includes the following steps: S1. Obtain the fluid force field image dataset and divide it into training set, validation set and test set; S2. The basic architecture for constructing a fluid force field simulation model based on a conditional diffusion neural network is to pre-train the model using the training set and adjust the model training parameters in real time in conjunction with the validation set during the pre-training process to generate a pre-trained fluid force field simulation model. S3. The fluid force field simulation model pre-trained in step S2 is improved by multi-level pruning. The multi-level pruning includes convolution kernel pruning and channel pruning. The convolution kernel pruning evaluates the importance of the convolution kernel parameters of the convolutional layer and removes the mask. The channel pruning evaluates the importance of the channel convolution kernels and removes the mask. The weights of the original convolutional network layer are updated by combining the results of convolution kernel pruning and channel pruning, and the gradients of the pruned parameters are removed. The convolution kernel pruning described in step S3 specifically involves: S311. For the convolutional kernel weights in the convolutional layers of the pre-trained model, calculate the mean and standard deviation of each convolutional kernel weight. , ,in, Indicates the first The output channel, the first The size corresponding to each input channel is The average weight of the convolution kernel, Indicates the first The output channel, the first The standard deviation of the convolutional kernel weights corresponding to each input channel These represent the output channel and input channel indices, respectively. Represents the pixel index inside the convolution kernel, 1≤ ≤ ,1≤ ≤ Iterate through all positions of the convolution kernel; This represents the weight parameters of the convolution kernel at the corresponding position. Indicates the kernel size. This represents the total number of parameters in the convolution kernel; S312. Combining the maximum value of the convolutional kernel weights, the number of input channels, the convolutional kernel pruning hyperparameters, and the standard deviation of the convolutional kernel weights, calculate the importance threshold of the convolutional kernel parameters to balance the pruning ratio with model performance. ,in, This represents the threshold indicating the importance of the convolution kernel parameters. Indicates the first The maximum value of all convolutional kernel weights corresponding to each output channel. Indicates the number of input channels. This represents the hyperparameters for kernel pruning. Indicates the first The sum of the standard deviations of the convolution kernels of all input channels under each output channel; S313. The importance of each parameter in the convolutional kernel is measured based on the difference between the kernel weight parameters and the mean of the kernel weights. A mask matrix is ​​generated using a masking function, and convolutional kernel parameters with differences less than an importance threshold are pruned and set to 0. ,in, The 0-1 mask matrix represents the kernel pruning, and Where(·) represents the mask function; S4. Fine-tune the unpruned parameters in the lightweight improved fluid force field simulation model of step S3 using the training set, and monitor the model performance changes in conjunction with the validation set during the fine-tuning process. After the fine-tuning is completed, calculate the fluid force field prediction performance index of the model using the test set, and select the best-performing fluid force field simulation model for fluid force field prediction generation.

2. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 1, characterized in that: The dataset has a total of n samples, and each data sample is represented as ( , ), where 1≤ ≤n, As the initial input and used as a condition for model training and prediction, The target output is used as the predicted label for model training.

3. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 2, characterized in that: The conditional diffusion neural network described in step S2 adopts a denoising diffusion model with a preceding time step sequence condition. It is based on U-Net and connects multi-scale downsampling, upsampling paths and jump residuals to preserve the spatial information of the fluid force field image.

4. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 3, characterized in that: The model pre-training process in step S2 specifically involves: each data sample in the dataset represents the fluid force field state of a fixed time step total sequence T, and the previous... Step sequence The fluid force field state is used as a condition, and the remaining T- The fluid force field state of the time step sequence is taken as the target. During training, data is selected from the training set, and the state of the continuous T-1 time step sequence is taken as the condition. The remaining single state is noise-processed, and the processed result is combined with the condition as the model input. The model outputs the predicted noise through the forward process of encoding and decoding, calculates the loss value, and learns the denoising path in the backward process to complete one round of training iteration.

5. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 3, characterized in that: During the model pre-training process, the denoising effect and flow field prediction error of the model are evaluated through the validation set after each round of training, and the training parameters are adjusted according to the evaluation results to ensure that the performance of the pre-trained model on the validation set meets the preset standard.

6. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 3, characterized in that: The channel pruning described in step S3 specifically involves: S321. For each output channel of the pre-trained model, calculate the mean and standard deviation of all convolutional kernel weights for each channel to quantify the overall contribution of the channels. , ,in, Indicates the first The average channel weight of each output channel. Indicates the first The standard deviation of the channel weights corresponding to each output channel Indicates the first The total number of weight parameters corresponding to each output channel; S322. Combining the global maximum weight, the number of output channels, channel pruning hyperparameters, and the standard deviation of channel convolution kernel weights, calculate the channel importance threshold to control the channel pruning ratio. ,in, Indicates the channel importance threshold, This represents the global maximum value of the weights of all output channels. Indicates the number of output channels. This represents the channel pruning hyperparameters. This represents the sum of the standard deviations of all output channels; S323. The importance of each convolutional kernel in a channel is measured based on the difference between the mean weight of the convolutional kernel within the channel and the mean weight of the channel. A mask matrix is ​​generated using a mask function, and convolutional kernels in channels with a difference less than the importance threshold are pruned and set to 0. ,in, The 0-1 mask matrix representing channel pruning. The mask function represents the first The output channel, the first The kernel weight representation value corresponding to each input channel, that is, the average kernel weight within that channel.

7. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 6, characterized in that: Step S3 also includes: S33. The convolution kernel pruning mask matrix and the channel pruning mask matrix are jointly applied to the original convolution kernel weights for parameter update processing. Only when the channel mask value is 1 and the convolution kernel mask value is also 1, the original convolution kernel weight parameters are retained as valid parameters, and the remaining parameters are pruned and set to 0 as redundant parameters, generating the pruned and updated convolution kernel weight parameters. ,in, This represents the updated convolutional kernel weight parameters after pruning. Indicating the channel mask matrix The output channel, the first The mask value for each input channel, where the mask value is either 0 or 1. This represents the mask value at the corresponding position in the convolution kernel pruning mask matrix; the mask value is either 0 or 1.

8. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 7, characterized in that: In step S3, during parameter update, to prevent pruned redundant parameters from being reactivated during fine-tuning, gradient deactivation is used to set the gradients of pruned redundant parameters to 0 using the same mask combination, retaining only the gradients of valid parameters for fine-tuning updates. ,in, This represents the gradient value of the parameters after pruning. This represents the original gradient calculation result without pruning. This represents the model's predicted loss value. Let X represent the partial derivative sign, X represent the input feature map, and Y represent the output feature map. and These represent the height and width of the input feature map, respectively. This represents the parameter values ​​of the input feature map. This represents the partial derivative of the model's predicted loss value with respect to the feature map output by the convolutional layer.

9. The fluid force field simulation and prediction method based on a lightweight conditional diffusion model as described in claim 1, characterized in that: Step S4 is as follows: S41. Iteratively train the lightweight improved fluid force field simulation model from step S3 using the training set, set the initial learning rate and number of iterations, fine-tune the effective parameters of the model that have not been pruned, and monitor the model performance using the validation set to avoid overfitting and reduce model prediction errors. S42. The test set is used to measure and evaluate the predictive performance of the fine-tuned fluid force field simulation model, and the fluid force field simulation model with the best performance is selected for fluid force field prediction generation.

Citation Information

Patent Citations

  • Structured pruning method for deep pedestrian search model

    CN117217282A

  • Image restoration method and device, equipment and storage medium

    CN118469871A