A multi-stage structural topology optimization method based on latent diffusion model
By combining the potential diffusion model and the traditional SIMP method for multi-stage optimization, the problems of low computational efficiency and high resource consumption in topology optimization are solved, generating high-quality, manufacturable topological structures suitable for fields such as aerospace, automotive, construction, and biomedicine.
Patent Information
- Application Number
- CN202411451786.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-10-17
AI Technical Summary
Existing topology optimization methods have low computational efficiency, high resource consumption, and insufficient manufacturability and performance optimization of the generated structures, which limits their application in practical engineering.
A multi-stage structural topology optimization method based on the latent diffusion model is adopted, combined with the traditional SIMP method and the diffusion model. Through a multi-stage optimization process, the cross-attention mechanism and few-step SIMP direct optimization are used to generate high-quality topological structures.
The computational efficiency and fidelity of the generation process are significantly improved. The generated topology structure meets both design requirements and manufacturing standards, is suitable for various resolutions and design needs, and achieves a balance between performance and resource consumption.
Smart Images

Figure CN119417716B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of engineering design and structural design optimization, and particularly relates to a multi-stage structural topology optimization method based on a latent diffusion model. BACKGROUND
[0002] Topology optimization, as an efficient engineering design method, aims to maximize performance indicators by optimizing material distribution under given constraints. This technology is widely used in aerospace, automotive, construction and biomedicine, etc. for designing lightweight and high-performance structural components.
[0003] Currently, topology optimization methods mainly include traditional optimization methods and deep learning-based methods. Traditional topology optimization methods, such as Solid Isotropic Material with Penalization (SIMP), require a large number of finite element iterative calculations. These methods usually maximize structural stiffness or minimize flexibility by gradually adjusting material distribution. However, these traditional methods have problems such as high computational resource consumption and easy to fall into local minimum when dealing with large-scale or complex structures.
[0004] In recent years, the application of deep learning-based generative models in topology optimization has gradually attracted attention. Generative Adversarial Network (GAN) and Denoising Diffusion Probabilistic Model (DDPM) have been introduced into this field, showing potential advantages. For example, TopologyGAN improves the accuracy and adaptability of generated samples by introducing physical fields (such as Von Mises stress, strain energy density, and displacement field) as conditions. However, this method requires a large number of Finite Element Analysis (FEA), which is computationally expensive, and the generated topology structure fails to fully consider manufacturability and performance goals. In addition, GAN networks are difficult to train and have limited generalization ability.
[0005] To overcome these problems, diffusion models have gradually become a new choice. TopoDiff uses diffusion models to balance the demand for manufacturability and high-performance design by introducing physical fields as additional guidance mechanisms. However, existing diffusion model-based methods still have problems such as slow iterative sampling process and high computational resource consumption. In addition, these methods usually rely on a large number of pre-processing and proxy models to improve performance, limiting their practical application.
[0006] Traditional methods and diffusion model-based methods have achieved certain success in topology optimization, but still have problems such as low computational efficiency, high resource consumption, insufficient manufacturability and performance optimization of generated structures, etc.
[0007] Traditional topology optimization methods, such as the solid isotropic material penalization (SIMP) method, have a solid theoretical and application foundation, but have the following defects:
[0008] 1. High computational resource consumption: The SIMP method requires a large number of finite element iteration calculations, and the stiffness matrix and stress distribution of the structure need to be recalculated each time, resulting in a large consumption of computational resources. This high computational load makes the SIMP method inefficient in handling large-scale or complex structural problems, making it difficult to meet the high efficiency requirements in actual engineering applications.
[0009] 2. Prone to local minimum: Since the SIMP method relies on the selection of the initial design, it may fall into a local minimum during the optimization process, rather than a global optimal solution. This limitation makes the optimization result may not be the optimal material distribution, limiting its application in complex design space.
[0010] Existing deep generative model-based topology optimization methods, such as generative adversarial networks (GAN) and diffusion models (DDPM), provide new ideas for topology optimization, but also have obvious defects:
[0011] 1. Complex training and limited generalization ability: GAN models are prone to instability and mode collapse during training, requiring careful parameter adjustment and training strategies. At the same time, GAN has limited generalization ability, and the generated results may not be accurate and practical when dealing with unseen design conditions and complex structures.
[0012] 2. High computational cost: Methods such as TopologyGAN require a large number of finite element analysis (FEA) for preprocessing and condition generation, and each load and boundary condition configuration needs to run the FEA solver, resulting in high computational cost and difficulty in widespread application in actual engineering.
[0013] 3. Slow iterative sampling process: Existing methods, such as TopoDiff, have made some progress in balancing manufacturability and performance design, but their iterative sampling process is slow and still requires a large amount of computational resources. This high computational demand limits its efficiency in large-scale engineering applications.
[0014] 4. Strong dependence on preprocessing and proxy models: These methods usually rely on a large number of preprocessing steps and proxy models to improve performance. However, this dependence increases the computational complexity and implementation difficulty, making the model difficult to adapt flexibly to different design conditions and constraints in actual applications.
[0015] In summary, the existing topology optimization methods, whether traditional SIMP method or deep generative model-based method, have defects such as large consumption of computing resources, complex training, limited generalization ability, high computational cost and slow iterative process. These defects limit the wide application and efficiency of topology optimization technology in practical engineering. Therefore, an innovative topology optimization method is needed to improve the computational efficiency, reduce resource consumption, and optimize the feasibility and manufacturability of the generated structure. SUMMARY
[0016] The present application aims to solve the problems of low computational efficiency, large resource consumption, insufficient manufacturability and performance optimization of the generated structure of the existing topology optimization method, and proposes a multi-stage structure topology optimization method based on latent diffusion model.
[0017] To solve the above technical problems, the technical solution adopted by the present application is: a multi-stage structure topology optimization method based on latent diffusion model, comprising the following steps:
[0018] Step 1: Determine the research object, create the structure topology optimization image dataset based on the traditional SIMP method and perform preprocessing;
[0019] Step 1.1: Select a classic rectangular beam as the research object;
[0020] Step 1.2: Establish a material interpolation model of design variables in the design domain based on the traditional SIMP method to punish intermediate density values and ensure the rationality and accuracy of material distribution;
[0021] The material interpolation model based on SIMP format is shown in the following formula:
[0022]
[0023] Where, ρ e is the relative density of the unit in the design domain, E e (ρ e ) represents the elastic modulus of the unit after interpolation, E0 represents the elastic modulus of the solid part material, E min is the elastic modulus of the design domain hole part, and p is the penalty factor;
[0024] Step 1.3: Define the objective function and constraint conditions of the generated structure topology optimization image dataset;
[0025] The objective function is the minimization of the flexibility of the topology structure, as shown in the following formula:
[0026]
[0027] subject to: V(ρ) / V0 = f
[0028] K(ρ)U = F
[0029] 0 < ρ min ≤ ρ ≤ 1
[0030] where C(ρ) is the compliance value of the optimized structure, ρ is the density value of the design variables in the design domain, U and F are the displacement vector and the load vector respectively, k0 is the initial element stiffness matrix, u e is the displacement vector of the element, N is the number of elements in the design domain, V0 and V(ρ) are the initial volume and the optimized volume of the design domain respectively, f is the reserved fraction of the design domain volume, K(ρ) is the structural stiffness matrix of the design domain, ρ min is the lower limit of the density value of the design variables;
[0031] Step 1.4: Set physical parameters using random conditions for the design domain, encode the design domain, obtain a structure topology optimization image dataset, and use data augmentation techniques to expand the number of data samples for the structure topology optimization image dataset, obtaining an expanded structure topology optimization image dataset;
[0032] Step 1.5: Preprocess the expanded structure topology optimization image dataset to obtain a preprocessed structure topology optimization image dataset;
[0033] Step 1.6: Divide the preprocessed structure topology optimization image dataset into a training set, a validation set, and a test set;
[0034] Step 2: Design an encoder network to map each multi-channel high-resolution structure topology optimization image in the structure topology optimization image dataset obtained in step 1 to a low-dimensional latent space representation, obtaining the initial latent variables corresponding to each multi-channel high-resolution structure topology optimization image;
[0035] Step 3: Implement a forward diffusion process on the initial latent variables obtained in step 2 in the low-dimensional latent space to obtain noisy latent variables and store them;
[0036] By gradually adding Gaussian noise, the encoded initial latent variables are converted into pure noise variables, and the noisy latent variables generated at each step are stored for subsequent training of the reverse diffusion process;
[0037] Step 4: Train the reverse diffusion model based on the noisy latent variables, optimize the denoising model parameters in the reverse diffusion model by minimizing the error between the true noise and the predicted noise;
[0038] Step 4.1: Design and train a denoising model to predict the noise component at each step of the reverse diffusion process, outputting the predicted value of the noise at each step.
[0039] Step 4.2: Establishing the reverse diffusion target, optimizing the parameters of the denoising model by minimizing the error between the real noise and the predicted value of the noise output by the denoising model through the loss function;
[0040] Step 4.3: Updating the denoising model parameters using the loss function to train the reverse diffusion model;
[0041] Step 4.3.1: Input the noisy latent variable and the diffusion step number into the denoising model to obtain the predicted value of the denoising model output noise;
[0042] Step 4.3.2: Calculate the error between the real noise and the predicted value of the noise output by the denoising model using the loss function, and adjust the denoising model parameters to minimize the loss by propagating the gradient of the loss function from the output layer of the denoising model back to the input layer through the backpropagation technique;
[0043] Step 5: Using the denoising model to perform the reverse diffusion process on the pure noise variable, gradually removing the noise, and generating a new latent variable until a new noise-free latent variable is generated;
[0044] Using the denoising model trained in step 4 to perform the reverse diffusion process on the pure noise variable obtained in step 3, generating a new latent variable by gradually removing the noise, and the reverse diffusion formula is:
[0045]
[0046] where t is the diffusion step number, z t ′ -1 is the new latent variable obtained when the reverse diffusion step number is t, z t ′ is the new latent variable obtained when the reverse diffusion step number is t+1, p θ (z t ′ -1 |z t ′) represents the conditional probability distribution of the reverse process, i.e. the probability distribution of the latent variable z t ′ t ′ -1 μ θ (z t ′,t) and Σ θ (z t ′,t) are the predicted mean and predicted variance of the denoising model, respectively;
[0047] In each step t, the predicted mean and predicted variance of the denoising model are used to generate the new latent variable z t ′ -1 corresponding to the current diffusion step t by sampling from the conditional distribution, and the sampling formula is as follows:
[0048]
[0049] wherein, denotes the predictive mean μ of the denoising model θ (z t ′,t) and the predictive variance Σ θ (z t ′,t) of the normal distribution;
[0050] Step 6: Introduce cross-attention mechanism and conditional mechanism in the reverse diffusion process to guide the reverse diffusion process.
[0051] Step 6.1: Encode the physical condition information through the pre-trained conditional encoder to obtain the conditional embedding.
[0052] Step 6.2: Use the cross-attention mechanism to combine the conditional embedding with the new latent variable obtained in step 5 to guide the topology generation.
[0053] Step 6.3: Use the FiLM layer to introduce the conditional information into the normalization layer of the denoising model to strengthen the role of the conditional information.
[0054] Step 7: Design a decoder network to decode the new noise-free latent variable obtained through the reverse diffusion process in step 5, map it back to the pixel space, and generate a topology structure similar to the topology structure generated by the traditional SIMP method.
[0055] Step 8: Use the approximate topology structure generated in step 7 as the starting point to perform few-step SIMP direct optimization to obtain the optimal topology structure.
[0056] Step 8.1: Use the approximate topology structure generated through the diffusion process as input to perform few-step SIMP direct optimization.
[0057] Step 8.2: Set fixed boundary conditions and mechanical loads on the design domain as initial conditions for few-step SIMP direct optimization.
[0058] Step 8.3: Use finite element analysis method to perform mechanical analysis on the current input topology structure to calculate the displacement and stress distribution of each design element.
[0059] Step 8.4: According to the design update rule in the SIMP method, set the objective function of the few-step SIMP direct optimization, adjust the material distribution by updating the design variables to maximize the stiffness of the topology structure under volume or mass constraints, and then minimize the flexibility of the topology structure.
[0060] The objective function formula is as follows:
[0061]
[0062] where, is the approximate topology generated in step 7, is the softness value of the approximate topology, k e is the stiffness matrix of the design unit;
[0063] The design variable update formula is as follows:
[0064]
[0065] where, is the density of the unit at the kth iteration, and η is the learning rate, is the gradient of the objective function with respect to the density;
[0066] Step 8.5: Give a volume constraint to the optimization process, so that the material volume of the topology structure does not exceed the volume of the design domain;
[0067] Step 8.6: Repeat the finite element analysis and design variable update until the preset number of iterations is reached, and output the final optimized topology structure.
[0068] The beneficial effects produced by the above technical solutions are that the multi-stage structure topology optimization method based on the latent diffusion model provided by the present application combines the latent diffusion model with traditional structure optimization technology. This innovation enables the topology optimization process to reduce data dimension and computational demand while enhancing the model's ability to handle complex designs. In addition, the introduction of the cross-attention mechanism in the present application allows the latent diffusion model to adjust the design according to physical and functional requirements during the generation process, which is difficult to achieve directly in existing deep learning-based methods.
[0069] Specifically embodied in the following aspects:
[0070] 1. Significant improvement in computational efficiency and speed: The diffusion process is transferred from a high-dimensional image space to a lower-dimensional latent space, significantly reducing the dimensionality of data processing, memory usage, and computational demand, making the generation of high-quality topology structures faster and reducing the consumption of computing resources.
[0071] 2. Fidelity and diversity of the generation process: By combining the diffusion model with U-Net denoising technology, the generated results not only meet the design requirements but also have high structural fidelity. By introducing the cross-attention mechanism, combined with physical conditions, it is ensured that the generated topology structure not only performs excellently in performance but also meets manufacturing standards.
[0072] 3. Balance between performance and resource consumption: The present application uses the approximate optimal topology generated by the potential diffusion model as the starting point of optimization, refines the structure quickly and directly injects physical information into the design to adapt to the given boundary conditions through the integration of the traditional topology optimization method SIMP, few-step direct optimization. This framework not only improves the diversity and efficiency of the structure, but also realizes the balance between performance and resource consumption.
[0073] 4. Wide applicability: The method proposed by the present application is suitable for various resolutions and design requirements, and has good universality and practical application value in different engineering fields. BRIEF DESCRIPTION OF DRAWINGS
[0074] Figure 1 A flowchart of a multi-stage structure topology optimization method based on a potential diffusion model is provided for an embodiment of the present application.
[0075] Figure 2 A topology structure diagram generated by a multi-stage structure topology optimization method based on a potential diffusion model provided for an embodiment of the present application under different resolutions and iteration steps. DETAILED DESCRIPTION
[0076] The specific embodiments of the present application will be further described in detail below in combination with the drawings and examples. The following examples are used to illustrate the present application, but not to limit the scope of the present application.
[0077] In this embodiment, a multi-stage structure topology optimization method based on a potential diffusion model is provided. The method maps the high-dimensional topology optimization problem to the low-dimensional potential space, and uses the diffusion model to generate an approximate optimal structure step by step. Combined with the few-step SIMP optimization technology, the physical performance and manufacturing feasibility of the structure are further improved, so as to significantly reduce the calculation cost while ensuring the design accuracy. As shown in Figure 1 includes the following steps:
[0078] Step 1: Determine the research object, create the structure topology optimization image data set based on the traditional SIMP method and perform pretreatment;
[0079] Step 1.1: Select a classic rectangular beam as the research object;
[0080] Step 1.2: Based on the traditional SIMP method, establish a material interpolation model of the design variable in the design domain to punish the intermediate density value and ensure the rationality and accuracy of the material distribution;
[0081] The material interpolation model based on the SIMP format is shown in the following formula:
[0082]
[0083] wherein, ρe For the relative density of the design domain, the value of 1 indicates that there is material, and the value of 0 indicates that there is no material, i.e. a hole; E e (ρ e ) represents the elastic modulus of the design unit after interpolation, E0 represents the elastic modulus of the solid part material, E min is the elastic modulus of the design domain hole part, and p is a penalty factor, usually p = 3 is selected as the penalty factor;
[0084] Step 1.3: Define the objective function and constraint condition of the generated structure topology optimization image dataset;
[0085] The objective function is to minimize the flexibility of the topology structure, as shown in the following formula:
[0086]
[0087] subject to:V(ρ) / V0=f
[0088] K(ρ)U=F
[0089] 0<ρ min ≤ρ≤1
[0090] Where C(ρ) is the flexibility value of the optimized structure, ρ is the density value of the design variable in the design domain, U and F are displacement vector and load vector respectively, k0 is the initial element stiffness matrix, u e is the displacement vector of the element, N is the number of elements in the design domain, V0 and V(ρ) are the initial volume and optimized volume of the design domain respectively, f is the reserved fraction of the design domain volume, K(ρ) is the structural stiffness matrix of the design domain, ρ min is the lower limit of the design variable density value;
[0091] Step 1.4: After determining the research object and the objective function, different physical parameters including displacement boundary, load condition and volume fraction are set by using random conditions for the design domain, and the design domain is coded. By setting random conditions, the design domain is converted into a multi-channel high-resolution structure topology optimization image that can be processed by a neural network, a corresponding structure topology optimization image dataset is generated, and data augmentation techniques are used to expand the number of data samples of the structure topology optimization image dataset, to obtain an expanded structure topology optimization image dataset Where N is the number of image data samples, x i represents a single image data sample, and each image data sample x i contains the density distribution of each element in the design domain, i.e. the density value of each element in the design domain;
[0092] In this embodiment, the random conditions used when generating the dataset include:
[0093] (1) The resolution of the rectangular beam design domain is set to 64x64 and 256x256;
[0094] (2) The volume fraction ranges from 0.2 to 0.8 with a step size of 0.02;
[0095] (3) The filter radius randomly varies from 1.5 to 6.0;
[0096] (4) The filtering method uses both sensitivity filtering and density filtering;
[0097] (5) The number of forces applied to the research object ranges from 1 to 10, randomly distributed;
[0098] (6) The forces are randomly applied to any node within the design domain;
[0099] Data augmentation techniques are important means to improve the generalization ability of deep learning models, especially in the field of image processing. In this embodiment, the main data augmentation techniques used are as follows:
[0100] (1) Geometric transformation of topological structure image data, including rotation, translation, scaling, and flipping;
[0101] Among them, rotation is to randomly rotate the image by a certain angle, translation is to randomly move the image horizontally or vertically, scaling is to enlarge or reduce the image, and flipping is to horizontally or vertically flip the image;
[0102] (2) Cropping and padding of topological structure image data, including random cropping and boundary padding;
[0103] Among them, random cropping is to randomly crop a region from the image, and boundary padding is to add background color or mirror expansion at the image edge;
[0104] (3) Color transformation of topological structure image data, including brightness adjustment, contrast adjustment, saturation adjustment, and hue change;
[0105] Among them, brightness adjustment is to randomly change the brightness of the image, contrast adjustment is to adjust the contrast of the image, saturation adjustment is to randomly change the saturation of the image, and hue change is to adjust the hue of the image;
[0106] (4) Adding noise to topological structure image data, including Gaussian noise and salt and pepper noise;
[0107] Among them, Gaussian noise is to add random noise to the image, and salt and pepper noise is to randomly add black and white points to the image.
[0108] Step 1.5: Preprocess the augmented structural topology optimization image dataset obtained in step 1.4 to obtain a preprocessed structural topology optimization image dataset;
[0109] The preprocessing method is to standardize the high-resolution structural topology optimization images in the dataset, and map the image pixel values uniformly to the interval [0, 1]. The standardization formula is as follows:
[0110]
[0111] Where, x i The high-resolution structural topology optimization images in the dataset, x i The structural topology optimization image obtained after standardization, mean(x i ) and std(x i ) represent the mean and standard deviation of the image data sample, respectively;
[0112] Step 1.6: In order to effectively train the neural network and accurately evaluate its performance, the preprocessed structural topology optimization image dataset obtained in step 1.5 is divided into training set, validation set and test set, and the division ratio is 8:1:1;
[0113] Step 2: Design an encoder network to map each multi-channel high-resolution structural topology optimization image in the structural topology optimization image dataset obtained in step 1 to a low-dimensional latent space representation, obtaining the initial latent variable z0 corresponding to each multi-channel high-resolution structural topology optimization image.
[0114] The encoder network converts the high-dimensional multi-channel high-resolution topology optimization image into a low-dimensional latent space representation by reducing the dimension of the input image, preserving the key features of the topology structure while significantly reducing the data dimension and processing complexity. Through this process, the most important information for optimization can be effectively extracted from the complex high-dimensional topology structure, providing support for subsequent optimization steps.
[0115] The structure of the encoder network is as follows:
[0116] z0=E φ (x0)
[0117] Where x0 represents a single multi-channel high-resolution structural topology optimization image sample in the structural topology optimization image dataset X input to the encoder, E φ is the encoding function, and z0 represents the initial latent variable; φ is the learnable parameter of the encoder; where H and W represent the height and width of the initial multi-channel high-resolution structural topology optimization image data, respectively, and C represents the number of input channels.
[0118] Step 3: Perform a forward diffusion process on the initial latent variable z0 obtained in Step 2 within a low-dimensional latent space, and convert the encoded initial latent variable z0 into a pure noise variable z by adding Gaussian noise step by step T and store each step of the generated noisy latent variable z t for subsequent reverse diffusion process training;
[0119] The forward diffusion formula is:
[0120]
[0121] where q(z t |z t-1 ) represents the probability distribution of z t-1 under the condition that z t , represents a normal distribution with mean and covariance t β t t, z t-1 is the current latent variable, z t is the latent variable of the previous step, and β t is the noise coefficient of the t-th step in the forward diffusion process, representing the proportion of Gaussian noise added in each step of the diffusion process, t = 1, 2, 3, …, T, T is the number of diffusion steps, and I is the identity matrix;
[0122] In this embodiment, for each step t, the noisy latent variable z t is generated according to the forward diffusion formula, and the calculation formula of z t is:
[0123]
[0124] where ∈ t represents noise, which is normally distributed with mean 0 and covariance identity matrix.
[0125] Step 4: Train the reverse diffusion model based on the noisy latent variable, optimize the denoising model parameters in the reverse diffusion model by minimizing the error between the actual noise and the predicted noise, to achieve efficient and accurate noise removal;
[0126] Step 4.1: Design a denoising model ∈ θ and train it to predict the noise component at each step of the reverse diffusion process, outputting the predicted value of the noise at each step The input of the denoising model is the current step number t and the noisy latent variable z t , and the output is the predicted value of the noise at each step for approximating the actual noise at each step;
[0127] Step 4.2: Establish the reverse diffusion target and minimize the predicted value of the real noise ∈ and the noise output by the denoising model through the loss function The error between them is used to optimize the parameters of the denoising model;
[0128] The inverse diffusion model optimization process uses a loss function to measure the difference between the noise predicted by the denoising model and the actual noise. The loss function used in this embodiment is the mean square error:
[0129]
[0130] in, is the mean square error loss function, θ is the parameter of the denoising model, ∈ is the real noise sampled from the Gaussian distribution, ∈ θ (z t ,t) is the prediction of the noise by the denoising model.
[0131] Step 4.3: Use the loss function to update the denoising model parameters θ and train the inverse diffusion model;
[0132] Step 4.3.1: Substitute the noisy latent variable z t And the diffusion step number t is input into the denoising model to obtain the predicted value of the denoising model output for the noise
[0133] The formula for the predicted value of noise is:
[0134]
[0135] Among them, ∈ θ It is a denoising model with parameter θ, and its output is an estimate of the noise
[0136] Step 4.3.2: Use the mean squared error loss function Calculate the predicted value of the real noise ∈ and the noise output by the denoising model The error between them is calculated and the gradient of the loss function is propagated from the output layer of the denoising model back to the input layer through the back-propagation technique, and the denoising model parameters θ are adjusted to minimize the loss.
[0137] Backpropagation is an important technology for optimizing machine learning models. It calculates the gradient of the loss function relative to the model parameters through the chain rule, thereby determining the adjustment direction and size of each parameter in the current step. Backpropagation can propagate error signals layer by layer and apply optimization algorithms such as gradient descent to update model parameters to better fit the training data.
[0138] Step 5: Use the denoising model to perform a reverse diffusion process on the pure noise variable, gradually remove the noise, and generate new latent variables until a new noise-free latent variable z′0 is generated;
[0139] Using the trained denoising model in step 4 to process the pure noise variable z obtained in step 3 T Performing the reverse diffusion process to generate new latent variables z by gradually removing noise t ′, the reverse diffusion formula is:
[0140]
[0141] where p θ (z t ′ -1 |z t ′) represents the conditional probability distribution of the reverse process, that is, the probability distribution of the latent variable z t ′ t ′ -1 under the condition of given z θ (z t ′,t) and Σ θ (z t ′,t) are the predicted mean and predicted variance of the denoising model, respectively, defined as follows:
[0142] The predicted mean μ θ (z t ′,t) of the denoising model has the formula:
[0143]
[0144] The predicted variance Σ θ (z t ′,t) of the denoising model has the formula:
[0145]
[0146] where is the noise variance corresponding to time step t, which can be represented as β t , i.e., the noise coefficient at each step in the forward diffusion process, and I is the identity matrix to ensure equal variance in each dimension;
[0147] At each step t, the predicted mean and variance of the denoising model are used to generate the new latent variable z t ′ -1 corresponding to the current step t by sampling from the conditional distribution, with the sampling formula as follows:
[0148]
[0149] where represent the predicted mean μ θ (z t ′,t) and the predicted variance Σ θ (zt a normal distribution of (t).
[0150] Step 6: Introduce cross-attention and conditional mechanisms in the reverse diffusion process to guide the reverse diffusion process.
[0151] In the reverse diffusion process, physical condition information (such as displacement boundary, load condition, and volume fraction) is integrated into the topology optimization generation process through cross-attention and conditional mechanisms. These two mechanisms ensure that the generated topology structure meets the design requirements (such as minimum flexibility, volume constraint, and boundary condition), thereby accurately controlling the physical properties of the generated structure.
[0152] Step 6.1: Encode physical condition information (including displacement boundary, load condition, and volume fraction) through a pre-trained conditional encoder to obtain a conditional embedding τ θ ; this embedding contains key information about the topology structure in a specific physical environment, such as boundary constraints and force conditions;
[0153] Step 6.2: In the reverse diffusion process, use cross-attention mechanism to combine conditional embedding τ θ with new latent variable z t ′ to guide topology structure generation;
[0154] Conditional embedding τ θ is taken as key K and value V, and new latent variable z t ′ is taken as query Q, by calculating the similarity between query Q and key K, to guide topology structure generation and ensure it meets physical conditions;
[0155] The calculation formula of cross-attention is as follows:
[0156]
[0157] where d k is the dimension of the key, Q is the query vector of latent representation z t , K is the key vector of conditional information, and V is the value vector of conditional information.
[0158] Q, K, V can be represented as follows:
[0159]
[0160] where W Q , W K , W V are linear transformation matrices for query, key, and value, respectively, represents the (flattened) intermediate feature representation used to implement the U-Net network in the denoising model ∈ θ .
[0161] Through the cross-attention mechanism, the conditional information is fused with the latent variable, controlling the influence of physical conditions on the geometric and mechanical characteristics in the generation process. Cross-attention ensures that the generated topology gradually meets the design goals such as minimum compliance and volume constraints.
[0162] Step 6.3: Introduce conditional information into the normalization layer of the denoising model using the FiLM layer to strengthen the role of conditional information.
[0163] The FiLM layer adjusts the features in the denoising model, allowing conditional information to flexibly affect the structure generation at each step. The calculation formula is as follows:
[0164] FiLM(h(z t ′))=γ(τ θ )·h(z t ′)+β(τ θ )
[0165] Where γ(τ θ ) and β(τ θ ) are scaling and offset parameters generated by conditional embedding, and h(z t ′) represents the input latent variable z t ′ with noise.
[0166] Through the FiLM layer, the feature response is further adjusted to ensure that the generated structure gradually meets the optimization goals. The final generated structure not only meets the requirement of minimum compliance, but also meets the given boundary conditions and volume constraints, ensuring its design performance and manufacturing feasibility.
[0167] In the process of inverse diffusion, the latent variable z t ′ generated at each step is fused with the physical condition τ θ through the cross-attention mechanism, ensuring that the generation process of the topology structure can gradually meet the design goals. The final generated structure not only meets the optimization goal of minimum compliance, but also meets the given boundary conditions and volume constraints, ensuring its design performance and manufacturing feasibility.
[0168] Step 7: Design the decoder network D ψ , decode the new noise-free latent variable z′0 obtained through the inverse diffusion process in step 5, and map it back to the pixel space to generate a topology structure similar to the topology structure generated by the traditional SIMP method, ensuring that the generated topology structure can preserve the details in the design and have high fidelity; the decoder uses a deconvolutional neural network to realize the reconstruction of the topology structure.
[0169] The specific decoding process is as follows: input the new latent variable z'0 generated by the inverse diffusion, perform an inverse convolution operation through the decoder, reconstruct the spatial structure of the latent variable layer by layer, and output a topological structure similar to the topological structure generated by the traditional SIMP method And ensure that its details are accurately presented, the decoder network structure is:
[0170]
[0171] Where D ψ is the decoding function.
[0172] Step 8: Use the approximate topological structure generated in step 7 as the starting point for a few-step SIMP direct optimization (FS-SIMP) to obtain the optimal topological structure As a starting point, a few-step SIMP direct optimization (FS-SIMP) is performed to obtain the optimal topological structure
[0173] The topological structure generated in step 7 has been visually highly approximated to the original high-resolution optimal topological structure x0. However, in order to ensure that the generated topological structure minimizes the compliance under given boundary conditions while satisfying volume or mass constraints to ensure the efficiency and manufacturability of the structure design, further few-step SIMP iterative optimization is required.
[0174] Few-step SIMP direct optimization (FS-SIMP) is based on the SIMP (Solid Isotropic Material with Penalization) topological optimization strategy, which further optimizes the generated approximate optimal topological structure. Through a small number of iterative steps, the material distribution is optimized to maximize the structural stiffness under the premise of satisfying the boundary conditions and volume constraints, ultimately achieving optimal structure design.
[0175] Step 8.1: Use the approximate topological structure generated by the diffusion process as input As input, perform a few-step SIMP direct optimization;
[0176] Step 8.2: Set fixed boundary conditions and mechanical loads on the design domain as initial conditions for the few-step SIMP direct optimization, which define the physical constraint conditions of the topological structure, such as constraint positions and loading methods;
[0177] Step 8.3: Use finite element analysis method (FEA) to perform mechanical analysis on the current input topological structure, calculate the displacement and stress distribution of each design element;
[0178] The finite element equation is as follows:
[0179]
[0180] where K is the global stiffness matrix composed of individual design element stiffness matrices k e U is the displacement vector of the structure; and F is the external loading vector.
[0181] Step 8.4: According to the design update rule in the SIMP method, set the objective function of the few-step SIMP direct optimization, adjust the material distribution by updating the design variable (element density), so as to maximize the stiffness of the topology structure under the volume or mass constraint, and then minimize the flexibility of the topology structure (i.e. maximize the stiffness);
[0182] The objective function formula is as follows:
[0183]
[0184] where, is the approximate topology structure generated in step 7, is the flexibility value of the approximate topology structure, k e is the stiffness matrix of the design element;
[0185] The design variable update formula is as follows:
[0186]
[0187] where, is the element density at the kth iteration, η is the learning rate (update step), is the gradient of the objective function with respect to the density;
[0188] Step 8.5: Give a volume constraint to the optimization process, so that the material volume of the topology structure does not exceed the volume of the design domain;
[0189] The material volume calculation formula of the topology structure is:
[0190]
[0191] where, is the material volume of the topology structure, v e is the material volume of the design element e, and V0 is the volume of the design domain;
[0192] Step 8.6: Repeat the finite element analysis and design variable update until the preset number of iterations is reached, and output the final optimized topology structure
[0193] This step not only significantly improves the performance and manufacturability of the generated topology structure, but also achieves a good balance between computational efficiency and optimization accuracy, fully demonstrating the great potential of topology optimization in practical applications.
[0194] In this embodiment, the topology optimization method based on latent diffusion model multi-stage (TOLDM) proposed by the present application utilizes the generated approximate optimal topology structure As a starting point, high-quality topology structures are generated on datasets of 64x64 and 256x256 resolutions by few-step SIMP direct optimization, as shown in Figure 2 In Figure 2 , the left and right sides are visualization results of different resolutions of 64x64 and 256x256, respectively. The first column in the visualization results of the two resolutions shows the true benchmark result (GT) obtained using the traditional SIMP method. TOLDM(0), TOLDM(5), and TOLDM(10) show the topology structures at different optimization steps, respectively. TOLDM(0) is the topology structure without SIMP method optimization iteration, TOLDM(5) is the result after 5-step SIMP method iteration optimization, and TOLDM(10) is the result after 10-step SIMP method iteration optimization. From these visualization results, it can be observed that compared with the benchmark result (GT), the topology structures generated by TOLDM(5) and TOLDM(10) are increasingly close to GT in boundary conditions and overall structure. This shows that the topology optimization method of the present application performs well in flexibility minimization and volume constraint objectives, and proves that TOLDM can generate topology optimization structures that meet the constraints and are of high quality, fully verifying the effectiveness of the method proposed by the present application.
[0195] To comprehensively evaluate the performance of the method of the present application and compare it with similar works, a series of evaluation indicators are used in this embodiment, covering key requirements of physics, engineering, and modeling. These indicators not only measure the overall performance of the proposed method, but also reflect its ability to generate feasible topology structures. The following is a detailed description of the key evaluation indicators:
[0196] 1. Compliance error (CE): flexibility error: evaluate the relative error between the TOLDM generated result and the traditional SIMP method, and its calculation formula is:
[0197]
[0198] Wherein, is the flexibility result of the TOLDM of the present application, and C(x0) is the flexibility result of the traditional method SIMP. We also introduce the average flexibility error (CE%AVG) and the median flexibility error (CE%MDN) to comprehensively evaluate the model performance.
[0199] 2、Volume Fraction Error (VFE) : This metric is used to evaluate the deviation between the volume fraction of the topology generated by TOLDM and the actual input volume fraction. To more comprehensively assess the volume fraction accuracy of TOLDM, we also introduce the average volume fraction error (VFE%AVG) and median volume fraction error (VFE%MDN), with the calculation formula as follows:
[0200]
[0201] wherein, is the volume fraction result of the TOLDM of the present application, and V(x0) is the volume fraction structure of the conventional method SIMP.
[0202] 3、Inference Time: Measures the inference efficiency of the TOLDM model, including preprocessing and sampling time, focusing on evaluating its speed and efficiency in generating topology optimization structures.
[0203] In Table 1 and Table 2, we show the performance evaluation results of TOLDM on 64x64 and 256x256 resolution datasets. Table 1 details the performance of each model on the 64x64 dataset. Comprehensive comparison is made with TopologyGAN, cDDPM, Consistency Model, TopoDiff, TopoDiffw / G, DOM w / TA, etc. The results show that:
[0204] In contrast, TopologyGAN and cDDPM show higher average compliance error (CE%AVG) values of 48.51 and 60.79, respectively, mainly due to the convergence difficulties and lack of effective physical constraints in these models, resulting in larger deviations in manufacturability and practicality of the generated topology. It is worth noting that when the few-step SIMP direct optimization (FS-SIMP) step value is 5 and 10, TOLDM shows the lowest values in CE%AVG and CE%MDN, from 4.23 to 2.46 and from 0.65 to 0.29, respectively, showing the smallest average error and median error in topology optimization generation tasks, demonstrating excellent performance and stability. Similarly, the VFE%AVG and VFE%MDN values of TOLDM also decrease with the increase of FS-SIMP, reaching 0.83 and 0.46, respectively, when the FS-SIMP step value is set to 10, which is the best performance among all models. Overall, the TOLDM model with FS-SIMP step value set to 5 and 10 consistently demonstrates superior performance in all indicators, highlighting its efficiency and robustness in generating topology optimization structures, with significant advantages over other models.
[0205] Table 2 clearly shows that our TOLDM framework outperforms significantly on the 256x256 resolution dataset. Even in the higher resolution setting, TOLDM successfully achieves a balance between computational complexity and model performance. When the FS-SIMP step value of TOLDM is set to 5 and 10, the model maintains the lowest average volume fraction error (VFE%AVG) while achieving extremely low average compliance error (CE%AVG), significantly outperforming other models. After 5 steps of direct optimization, the performance of TOLDM is significantly better than other methods. In particular, when the FS-SIMP value is set to 10, the values of average compliance error (CE%AVG) and average volume fraction error (VFE%AVG) are reduced to 2.73 and 1.07, while the median compliance error (CE%MDN) and median volume fraction error (VFE%MDN) are also reduced to 0.39 and 0.72, respectively. The optimized topology of the invention shows a significant leading advantage in these two key performance indicators, which demonstrates the stability and reliability of the TOLDM method. These results not only demonstrate the stability and reliability of the TOLDM method, but also strengthen its practicality as an optimization framework, proving that the model can achieve high-precision optimization from low to high complexity.
[0206] Through these quantitative analyses, it can be seen that the TOLDM model performs well in multiple evaluation indicators, especially with minimal error in compliance and volume fraction indicators, further confirming the high efficiency and robustness of the model in topology optimization tasks.
[0207] Overall, TOLDM can achieve accurate and stable performance under both higher and lower model complexity settings. Whether on 64x64 or 256x256 resolution datasets, the performance of TOLDM significantly improves as the number of direct optimization iterations increases. These results show that TOLDM can adapt to different resolutions and optimization requirements, providing a framework with strong adaptability and optimization accuracy in image generation and reconstruction tasks. The outstanding performance of TOLDM in these indicators shows significant advantages in reducing average and median errors, reflecting its excellent ability to generate high-fidelity topology optimization structures. Compared with other models, experimental results show the potential practicality and superiority of TOLDM in the field of topology optimization generation. In particular, when the FS-SIMP step is 10, TOLDM outperforms other models in all indicators, highlighting its ability to significantly improve the performance of topology structures through few-step SIMP iterations.
[0208] One of the main concerns of data-driven design methods is the inference time and generation efficiency. In Table 3, we compare the inference time of the traditional SIMP method and the existing diffusion model-based method. The main goal of these deep learning schemes for data-driven design is to generate topology faster than traditional optimization. Table 3 mainly compares the average inference time of different models at low resolution 64x64 and high resolution 256x256. TOLDM includes 10 SIMP iterations when calculating the inference time. In the experimental results of Table 3, we see that at 64x64 and 256x256 resolutions, TOLDM is significantly faster than other state-of-the-art models. In particular, for 64x64 resolution, TOLDM is 96.63% faster than the classic SIMP method and 25.61% faster than DOM. It is 26% faster than the current state-of-the-art diffusion model-based model DOM for solving topology optimization problems. This proves that the proposed method TOLDM can balance efficiency and performance when generating topology structures. At the same time, in order to further demonstrate the superiority of our method, we analyze the test results at high resolution 256x256. According to the experimental results in Table 3, it can be clearly seen that at 256x256 resolution, TOLDM is still the most efficient compared to other methods, and the advantage is more obvious in high resolution than in low resolution, which further proves the efficiency and scalability of TOLDM.
[0209] The multi-stage topology optimization method based on latent diffusion model (TOLDM) proposed by the present application is a new deep learning framework for topology optimization, which can effectively improve the accuracy and show good results in meeting constraints, manufacturability and performance. TOLDM performs significantly better than similar diffusion model-based methods in multiple resolutions and fields.
[0210] Numerical experimental results show that TOLDM significantly outperforms similar diffusion model-based methods in performance. This method not only can be easily extended to higher-dimensional data, but also significantly improves computational efficiency and speed. In addition, it optimizes the feasibility and manufacturability of generated structures, achieving an effective balance between performance and resource consumption. TOLDM also introduces physical constraints through its latent space characteristics and cross-attention mechanism, making it easier to introduce novel, feasible, and manufacturing requirement-compliant topology structures during the generation process.
[0211] These results prove that the TOLDM model not only generates high-quality topology structures, but also has significant advantages in computational efficiency, especially in high resolution, where its performance and speed are optimized.
[0212] Table 1 Quantitative evaluation results in 64x64 resolution dataset
[0213]
[0214] Quantitative evaluation results of 256x256 resolution dataset
[0215]
[0216]
[0217] Average inference time of different resolutions in different methods
[0218]
[0219] Finally, it should be noted that: the above examples are used to illustrate the technical solutions of the present application, but not limited to them; although the present application has been described in detail with reference to the foregoing examples, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing examples, or make equivalent substitution for part or all of the technical features; and these modifications or substitutions do not make the essence of the corresponding technical solutions deviate from the scope defined by the claims of the present application.
Claims
1. A multi-stage structural topology optimization method based on a potential diffusion model, characterized by: Step 1: Determine the research object, create a structural topology optimization image dataset based on the traditional SIMP method, and perform preprocessing; Step 2: Design an encoder network to map the multi-channel high-resolution structural topology optimization images in the structural topology optimization image dataset obtained in step 1 to a low-dimensional latent space representation, and obtain the initial latent variables corresponding to each multi-channel high-resolution structural topology optimization image; Step 3: Perform a forward diffusion process on the initial latent variables obtained in step 2 in the low-dimensional latent space to obtain and store the noisy latent variables; Step 4: Train the inverse diffusion model based on the noisy latent variables and optimize the denoising model parameters in the inverse diffusion model by minimizing the error between the real noise and the predicted noise; Step 5: Use the denoising model to perform a reverse diffusion process on the pure noise variable, gradually remove the noise, and generate new latent variables until a new noise-free latent variable is generated; Step 6: Introduce the cross-attention mechanism and conditional mechanism in the reverse diffusion process to guide the reverse diffusion process; Step 6.1: Encode the physical condition information through the pre-trained conditional encoder to obtain the conditional embedding; Step 6.2: Use the cross-attention mechanism to combine the conditional embedding with the new latent variable obtained in step 5 to guide the topology generation; Step 6.3: Use the FiLM layer to introduce the conditional information into the normalization layer of the denoising model to enhance the effect of the conditional information; The FiLM layer adjusts the features in the denoising model so that the conditional information flexibly affects the structure generation at each step. The calculation formula is as follows: ; in, and are the scaling and offset parameters generated by the conditional embedding, is conditional embedding; represents the latent variable with noisy input , is the new latent variable obtained when the number of reverse diffusion steps is t+1; Step 7: Design a decoder network to decode the new noise-free latent variables obtained by the inverse diffusion process in step 5 and map them back to the pixel space, thereby generating a topology that is similar to the topology generated by the traditional SIMP method; Step 8: Using the approximate topology generated in step 7 as a starting point, perform a few-step SIMP direct optimization to obtain the optimal topology. Step 8.1: Use the approximate topology generated by the diffusion process as input and perform a few-step SIMP direct optimization. Step 8.2: Set fixed boundary conditions and mechanical loads for the design domain as initial conditions for the few-step SIMP direct optimization. Step 8.3: Use the finite element analysis method to perform mechanical analysis on the currently input topology structure and calculate the displacement and stress distribution of each design unit; Step 8.4: According to the design update rule in the SIMP method, set the objective function of the few-step SIMP direct optimization and adjust the material distribution by updating the design variables to maximize the topological stiffness and minimize the topological flexibility under the volume or mass constraint. The objective function is set as shown in the following formula: ; in, The approximate topology generated for step 7, is the flexibility value of the approximate topological structure, is the stiffness matrix of the design element, is the relative density of elements in the design domain, represents the elastic modulus of the interpolated element, is the penalty factor, is the displacement vector of the element, is the number of cells in the design domain; The update of design variables is shown in the following formula: ; in, is the cell density at the kth iteration, is the learning rate, is the gradient of the objective function with respect to density; Step 8.5: Give the optimization process a volume constraint so that the material volume of the topology does not exceed the volume of the design domain; Step 8.6: Repeat the finite element analysis and design variable update until the preset number of iterations is reached, and output the final optimized topology structure.
2. The multi-stage structural topology optimization method based on the potential diffusion model according to claim 1, characterized in that: The specific method of step 1 is: Step 1.1: Select a classic rectangular beam as the research object; Step 1.2: Establish a material interpolation model for the design variables in the design domain based on the traditional SIMP method to penalize intermediate density values and ensure the rationality and accuracy of material distribution; The material interpolation model based on SIMP format is shown in the following formula: ; in, is the relative density of elements in the design domain, represents the elastic modulus of the interpolated element, represents the elastic modulus of the material of the solid part, is the elastic modulus of the hole part of the design domain, is the penalty factor; Step 1.3: Define the objective function and constraints for generating the structural topology optimization image dataset; The objective function is to minimize the flexibility of the topological structure, as shown in the following formula: ; in, is the flexibility value of the optimized structure, is the density value of the design variable in the design domain, and are the displacement vector and the load vector, is the initial element stiffness matrix, is the displacement vector of the element, is the number of cells in the design domain, and are the initial volume and optimized volume of the design domain, is the retained fraction of the design domain volume, is the structural stiffness matrix of the design domain, is the lower limit of the design variable density; Step 1.4: Use random conditions to set physical parameters for the design domain and encode the design domain to obtain a structural topology optimization image dataset. Then, use data augmentation technology to expand the number of data samples in the structural topology optimization image dataset to obtain an expanded structural topology optimization image dataset. Step 1.5: Preprocess the expanded structural topology optimization image dataset to obtain a preprocessed structural topology optimization image dataset; Step 1.6: Divide the preprocessed structural topology optimization image dataset into training set, validation set, and test set.
3. The multi-stage structural topology optimization method based on the potential diffusion model according to claim 1, characterized in that: The step 3 converts the encoded initial latent variable into a pure noise variable by gradually adding Gaussian noise, and stores the noisy latent variable generated in each step for subsequent training of the reverse diffusion process.
4. The multi-stage structural topology optimization method based on a potential diffusion model according to claim 1, characterized in that: The specific method of step 4 is: Step 4.1: Design and train a denoising model to predict the noise component at each step in the reverse diffusion process and output the predicted value of the noise at each step; Step 4.2: Establish the reverse diffusion objective and minimize the error between the actual noise and the predicted value of the noise output by the denoising model through the loss function to optimize the parameters of the denoising model; Step 4.3: Use the loss function to update the denoising model parameters and train the inverse diffusion model.
5. The multi-stage structural topology optimization method based on the potential diffusion model according to claim 4, characterized in that: The specific method of step 4.3 is: Step 4.3.1: Input the noisy latent variable and the number of diffusion steps into the denoising model to obtain the predicted value of the denoising model output noise; Step 4.3.2: Use the loss function to calculate the error between the true noise and the predicted value of the noise output by the denoising model, and propagate the gradient of the loss function from the output layer of the denoising model back to the input layer through the backpropagation technique, and adjust the denoising model parameters to minimize the loss.
6. The multi-stage structural topology optimization method based on a potential diffusion model according to claim 1, characterized in that: Step 5 uses the denoising model trained in step 4 to perform a reverse diffusion process on the pure noise variable obtained in step 3, and generates a new latent variable by gradually removing the noise. The reverse diffusion formula is: ; Where t is the number of diffusion steps, is the new potential variable obtained when the number of reverse diffusion steps is t, is the new potential variable obtained when the reverse diffusion step is t+1, Represents the conditional probability distribution of the reverse process, that is, given Under the condition of The probability distribution of and are the predicted mean and predicted variance of the denoising model respectively; At each step t, the predicted mean and predicted variance of the denoising model are used to generate a new latent variable corresponding to the current diffusion step t by sampling from the conditional distribution , and its sampling formula is as follows: ; in, Represents the predicted mean of the denoising model and the prediction variance Normal distribution.