A method and device for reverse generation of microstructure based on diffusion model

By adopting a diffusion model-based method in the reverse design of microstructures, the connectivity and quality problems in reverse generation of microstructures in the prior art are solved, and effective reverse generation of multiple structures is achieved.

CN119181442BActive Publication Date: 2025-02-28ZHEJIANG LAB
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411682969.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-28
Estimated Expiration
2044-11-22

AI Technical Summary

Technical Problem

The existing microstructure reverse design methods based on deep learning and machine learning have shortcomings in the reverse generation of microstructures, such as connectivity quality, and most of them rely on iterative optimization methods rather than direct reverse design methods.

Method used

Using a microstructure inverse generation method based on diffusion model, data of truss structure, shell structure and tubular structure are obtained and modeled, hidden space features are extracted using variational autoencoder and conditional encoder, and diffusion model is trained on hidden space to achieve direct reverse generation.

Benefits of technology

Direct microstructure reverse generation is realized to ensure the effectiveness and quality of the generated structure, to cover the reverse generation of multiple structures, and to ensure the connectivity and symmetry of the generated structure through the representation of graph structure data and modeling parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for reverse generation of microstructure based on diffusion model, the method comprising: in the training stage, firstly using graph structure and modeling parameters to represent the three-dimensional microstructure, then training the variational autoencoder to encode and decode the three-dimensional structure, and extracting the potential features of the three-dimensional microstructure at the same time, and finally training the diffusion model on the extracted potential features, and adding properties and modeling parameters as conditional constraints; in the inference stage, inputting the target properties and modeling parameters into the trained diffusion model, and then the diffusion model performs diffusion denoising according to the input conditions to obtain the corresponding potential features, and inputting the potential features into the decoder of the variational autoencoder to decode the corresponding graph representation, and finally obtaining the final three-dimensional microstructure according to the graph representation and modeling parameters. The present invention innovatively uses a method combining diffusion model and graph representation to realize reverse generation from properties to microstructure, so that the quality of the generated microstructure is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of deep learning generation technology and microstructure reverse generation technology, and in particular to a microstructure reverse generation method and device based on a diffusion model. Background Art

[0002] Microstructure property analysis is to evaluate the equivalent macroscopic material properties based on microstructure geometry information. The property-driven reverse generation design of microstructures is an inverse process. However, the optimization design of geometric microstructures with specific property requirements in a specified space is an NP-hard problem. Microstructure reverse design methods based on deep learning and machine learning are gradually emerging, especially generative models such as variational autoencoders and generative adversarial networks. However, most of the reverse generation design methods based on such models are based on iterative optimization methods, not direct reverse design methods. Moreover, the generated microstructures have great defects in terms of connectivity quality, etc. Therefore, a new microstructure reverse generation method based on diffusion model is urgently needed. Summary of the invention

[0003] The purpose of the present invention is to provide a method and device for reverse generation of microstructure based on diffusion model in view of the deficiencies of the prior art.

[0004] The objective of the present invention is achieved through the following technical solutions: In a first aspect, an embodiment of the present invention provides a method for reverse generation of microstructures based on a diffusion model, comprising the following steps:

[0005] (1) Obtain a public truss structure data set, model shell structures and tubular structures based on the truss structure data, and calculate the mechanical property stiffness matrix corresponding to the shell structure and tubular structure; use graph structures and modeling parameters to represent truss structures, shell structures, and tubular structures to construct training sets of truss structures, shell structures, and tubular structures;

[0006] (2) Using the training sets of truss structures, shell structures, and tubular structures, the encoder and decoder of the variational autoencoder are trained to obtain the trained encoder and decoder;

[0007] (3) Using the trained encoder to extract the latent space features of the truss structure, shell structure and tubular structure, the modeling parameter vector and mechanical property stiffness matrix of the corresponding structure in the training set are input into the conditional encoder as conditions, and the diffusion model is trained on the latent space features to obtain the trained conditional encoder and diffusion model;

[0008] (4) Based on the target mechanical property stiffness matrix and modeling parameter vector, the trained conditional encoder is used to obtain the encoded conditional features; based on the encoded conditional features and completely normally distributed noise, the trained diffusion model is used to obtain the denoised latent space features; based on the denoised latent space features, the trained decoder is used to obtain the decoded graph structure data; according to the decoded graph structure data and modeling parameters, a three-dimensional structure is modeled in the 3D modeling software to obtain the STP model file of the structure.

[0009] Furthermore, the method of obtaining a public truss structure data set, modeling a shell structure and a tubular structure according to the truss structure data therein, and calculating a mechanical property stiffness matrix corresponding to the shell structure and the tubular structure specifically includes the following sub-steps:

[0010] (1.1) Obtain a public truss structure dataset; wherein the truss structure dataset includes the graph structure data of the truss three-dimensional structure and its corresponding mechanical property stiffness matrix, and the graph structure data includes the adjacency matrix and the connection node coordinates;

[0011] (1.2) The modeling parameters of the truss structure are the rod diameter, and the modeling parameters of the shell structure include the rod diameter, shell thickness and smoothness. Different shell thicknesses and different smoothness are set on the basis of the truss three-dimensional structure to model the shell structure. Different shell structures are modeled according to different values ​​of the above modeling parameters using 3D modeling software to obtain the corresponding STP model file, which is used to record the three-dimensional structure of the shell after modeling.

[0012] (1.3) The modeling parameters of the truss structure are the rod diameter, and the modeling parameters of the tubular structure include the rod diameter and the thickness of the circular tube. Different circular tube thicknesses are set on the basis of the truss three-dimensional structure to model the tubular structure. Different tubular structures are modeled according to different values ​​of the above modeling parameters using 3D modeling software to obtain the corresponding STP model file, which is used to record the modeled tubular three-dimensional structure.

[0013] (1.4) Based on the modeled three-dimensional shell structure, the mechanical property stiffness matrix corresponding to the three-dimensional shell structure is calculated using the finite element simulation in the Comsol property calculation software; based on the modeled three-dimensional tubular structure, the mechanical property stiffness matrix corresponding to the three-dimensional tubular structure is calculated using the finite element simulation in the Comsol property calculation software.

[0014] Furthermore, the method of using the graph structure and modeling parameters to represent the truss structure, the shell structure and the tubular structure to construct a training set of the truss structure, the shell structure and the tubular structure specifically includes:

[0015] The connection nodes of the truss three-dimensional structure are numbered in sequence, and the adjacency matrix of the graph structure is determined based on whether there is a connection relationship between the connection nodes. , where n is the total number of connected nodes; the three-dimensional coordinates of the connected nodes are the node features in the graph structure, expressed as ; According to the adjacency matrix of the graph structure and node features in the graph structure Obtain the graph structure data of the truss structure; obtain the graph structure data of the shell structure according to the graph structure data of the corresponding modeled truss structure; obtain the graph structure data of the tubular structure according to the graph structure data of the corresponding modeled truss structure; the modeling parameters of the truss structure, the shell structure and the tubular structure all use the modeling parameter vector Represents the modeling parameter vector Including rod diameter, thickness and smoothness, where the thickness and smoothness of the truss structure are both 0, and the smoothness of the tubular structure is 0; a training set of the corresponding structure is constructed based on the graphical structure data, modeling parameter vectors and mechanical property stiffness matrix corresponding to the truss structure, shell structure and tubular structure.

[0016] Furthermore, the step (2) includes the following sub-steps:

[0017] (2.1) Pre-process each sample in the training set of truss structure, shell structure and tubular structure, specifically: convert the graph structure data of each sample Transformed into corresponding one-dimensional column vectors , two one-dimensional column vectors With the modeling parameter vector Concatenate to obtain the concatenated column vector ;

[0018] (2.2) The concatenated column vector Input into the encoder of the variational autoencoder for encoding, and split the encoded features into mean values ​​on average and variance Variable; use resampling method to adjust the mean and variance The variables are resampled to obtain latent space features; the latent space features are input into the decoder of the variational autoencoder to obtain decoded features;

[0019] (2.3) Post-process the decoded features, specifically: The dimensions of the three column vectors are split into three column vectors, and the first two column vectors are transformed into The shape of the sample is finally obtained by decoding the graph structure data corresponding to the sample. and the modeling parameter vector ;

[0020] (2.4) Graph structure data based on each sample in the training set and the modeling parameter vector And its corresponding decoded graph structure data and the modeling parameter vector As well as latent space features, the loss function of the variational autoencoder is calculated, and the network parameters of the variational autoencoder are adjusted with the minimization of the loss function of the variational autoencoder as the optimization goal until the preset training rounds are reached to obtain the trained encoder and decoder.

[0021] Furthermore, the calculation formula of the loss function of the variational autoencoder is expressed as:

[0022]

[0023] in, represents the loss function of the variational autoencoder, represents the mean square error loss, represents the Kullback-Leibler divergence loss, represents a normal distribution, , , and They represent the weight coefficients of the corresponding losses respectively.

[0024] Furthermore, the step (3) includes the following sub-steps:

[0025] (3.1) Based on the training sets of truss structures, shell structures and tubular structures, the trained encoder is used to extract the latent space features of each sample of the truss structure, shell structure and tubular structure, denoted as z;

[0026] (3.2) The modeling parameter vector of each sample and the mechanical property stiffness matrix W are respectively input into the first conditional encoder and the second conditional encoder to obtain the encoded first conditional feature and the second conditional feature; the encoded first conditional feature and the second conditional feature are spliced ​​to obtain the spliced ​​conditional feature;

[0027] (3.3) A diffusion model is trained on the latent space feature z, where the diffusion model includes a noise diffusion process and a conditional denoising process; in the noise diffusion process, noise is gradually added to the initial latent space feature z extracted in step (3.1) to obtain the latent space feature after noise addition ,in, represents the latent space feature after noise addition at time t, represents the weight coefficient of the latent space feature z at time t, represents the weight coefficient of noise at time t, is from a Gaussian distribution The sampled noise, T represents the total time step of the noise diffusion process, Represents the latent space features of completely normally distributed noise; in the conditional denoising process, the latent space features after noise addition are The corresponding time t and the concatenated conditional features are input into the time conditional UNet network to predict the added noise and latent space features. Subtract the predicted noise to obtain the denoised latent space features;

[0028] (3.4) Based on the denoised latent space features and the noise at the corresponding time, the loss function of the diffusion model is calculated. Taking minimizing the loss function of the diffusion model as the optimization goal, the network parameters of the time conditional UNet network, the first conditional encoder and the second conditional encoder are adjusted until the preset training rounds are reached to obtain the trained time conditional UNet network, the first conditional encoder and the second conditional encoder.

[0029] Furthermore, the calculation formula of the loss function of the diffusion model is expressed as:

[0030]

[0031] in, represents the loss function of the diffusion model, is the noise added to the latent space feature z at time t, represents the noise predicted by the time-condition UNet network, are the network parameters of the time-conditioned UNet network, represents the vector concatenation operation, represents the encoded first conditional feature output by the first conditional encoder, represents the network parameters of the first conditional encoder, represents the second conditional feature output by the second conditional encoder, Represents the network parameters of the second conditional encoder.

[0032] Furthermore, the step (4) includes the following sub-steps:

[0033] (4.1) The target mechanical property stiffness matrix W and the modeling parameter vector Input them into the trained second conditional encoder and the first conditional encoder respectively to obtain the encoded first conditional feature and the second conditional feature; concatenate the encoded first conditional feature and the second conditional feature to obtain the concatenated conditional feature;

[0034] (4.2) Using completely normally distributed noise as the noisy latent space feature, the noisy latent space feature and the concatenated conditional feature are input into the trained temporal conditional UNet network to obtain the denoised latent space feature;

[0035] (4.3) Input the denoised latent space features into the trained decoder to obtain the decoded features; post-process the decoded features to obtain the decoded graph structure data and the modeling parameter vector ;

[0036] (4.4) According to the decoded graph structure data and the input modeling parameter vector Model a three-dimensional structure in 3D modeling software and obtain the STP model file of the structure.

[0037] A second aspect of an embodiment of the present invention provides a microstructure inverse generation device based on a diffusion model, comprising one or more processors and a memory, wherein the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the above-mentioned microstructure inverse generation method based on the diffusion model.

[0038] A third aspect of an embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, is used to implement the above-mentioned microstructure inverse generation method based on a diffusion model.

[0039] The beneficial effect of the present invention is that the present invention adopts a method based on a diffusion model to combine graph structure data with modeling parameters to represent the microstructure. On the one hand, the diffusion model can be used to realize direct reverse generation of the microstructure. On the other hand, the use of graph structure data and modeling parameters can cover the reverse generation of various structures such as truss structures and tubular structures. At the same time, the microstructure is represented by graph structure data and modeling parameters, which can ensure the effectiveness and quality of the generated structure when the structure is generated. The present invention innovatively uses a method combining a diffusion model and a graph representation to realize the reverse generation from properties to microstructure. On the one hand, the diffusion model can be used to realize direct reverse generation. On the other hand, the use of the graph representation of the microstructure can make judgments on the symmetry, connectivity, etc. of the microstructure, so that the quality of the generated microstructure is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 A training flow chart of the microstructure reverse generation method based on the diffusion model of the present invention;

[0041] Figure 2 The network architecture flow chart of the variational autoencoder of the present invention;

[0042] Figure 3 A flow chart of the network architecture of the diffusion model of the present invention;

[0043] Figure 4 A test flow chart of the microstructure reverse generation method based on the diffusion model of the present invention;

[0044] Figure 5 An example diagram of a test generation structure for the present invention;

[0045] Figure 6 A schematic diagram of the structure of the microstructure reverse generation device based on the diffusion model of the present invention. DETAILED DESCRIPTION

[0046] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0047] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0048] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0049] The present invention is described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the features of the following embodiments and implementations can be combined with each other.

[0050] The microstructure inverse generation method based on the diffusion model of the present invention includes a training phase and a testing phase. Figure 1 As shown, the specific steps include:

[0051] (1) Obtain a public truss structure dataset, model shell structures and tubular structures based on the truss structure data, and calculate the mechanical property stiffness matrix corresponding to the shell structure and tubular structure; use graph structures and modeling parameters to represent truss structures, shell structures, and tubular structures to construct training sets of truss structures, shell structures, and tubular structures.

[0052] Furthermore, a public truss structure data set is obtained, and a shell structure and a tubular structure are modeled according to the truss structure data therein, and a mechanical property stiffness matrix corresponding to the shell structure and the tubular structure is calculated, which specifically includes the following sub-steps:

[0053] (1.1) Obtain a public truss structure dataset, which includes the graph structure data of the truss three-dimensional structure and its corresponding mechanical property stiffness matrix. The graph structure data includes the adjacency matrix and the coordinates of the connection nodes.

[0054] Specifically, a public truss structure dataset Truss Dataset is obtained, which contains 965736 samples in total. Each sample includes graph structure data of the truss three-dimensional structure and its corresponding mechanical property stiffness matrix, where the graph structure data includes the adjacency matrix and the coordinates of the connection nodes.

[0055] (1.2) The modeling parameters of the truss structure are the rod diameter, and the modeling parameters of the shell structure include the rod diameter, shell thickness and smoothness. Different shell thicknesses and different smoothness are set on the basis of the truss three-dimensional structure to model the shell structure. Different shell structures are modeled according to different values ​​of the above modeling parameters using 3D modeling software to obtain the corresponding STP model file, which is used to record the three-dimensional structure of the shell after modeling. Among them, the value range of the shell thickness is [0.1mm, 0.5mm], and the value range of the smoothness is [0.5, 0.1].

[0056] It should be understood that after the modeling is completed, the corresponding three-dimensional structural model is obtained, which is saved as an STP model file; the STP model file is a file format in three-dimensional modeling and is used to calculate its mechanical property stiffness matrix in subsequent steps.

[0057] (1.3) The modeling parameters of the truss structure are the rod diameter, and the modeling parameters of the tubular structure include the rod diameter and the thickness of the circular tube. Different circular tube thicknesses are set on the basis of the truss three-dimensional structure to model the tubular structure. Different tubular structures are modeled according to different values ​​of the above modeling parameters using 3D modeling software to obtain the corresponding STP model file, which is used to record the modeled tubular three-dimensional structure. Among them, the value range of the circular tube thickness is [0.1mm, 0.5mm].

[0058] (1.4) Based on the modeled three-dimensional shell structure, the mechanical property stiffness matrix corresponding to the three-dimensional shell structure is calculated using the finite element simulation in the Comsol property calculation software; based on the modeled three-dimensional tubular structure, the mechanical property stiffness matrix corresponding to the three-dimensional tubular structure is calculated using the finite element simulation in the Comsol property calculation software.

[0059] Furthermore, the graph structure and modeling parameters are used to represent the truss structure, shell structure and tubular structure to construct training sets of truss structure, shell structure and tubular structure, specifically including: numbering the connection nodes of the truss three-dimensional structure in sequence, determining the adjacency matrix of the graph structure according to whether there is a connection relationship between the connection nodes , where n is the total number of connected nodes; the three-dimensional coordinates of the connected nodes are the node features in the graph structure, expressed as ; According to the adjacency matrix of the graph structure and node features in the graph structure Obtain the graph structure data of the truss structure; obtain the graph structure data of the shell structure according to the graph structure data of the corresponding modeled truss structure; obtain the graph structure data of the tubular structure according to the graph structure data of the corresponding modeled truss structure; the modeling parameters of the truss structure, the shell structure and the tubular structure all use the modeling parameter vector Represents the modeling parameter vector Including rod diameter, thickness and smoothness, where the thickness and smoothness of the truss structure are both 0, and the smoothness of the tubular structure is 0; a training set of the corresponding structure is constructed based on the graphical structure data, modeling parameter vectors and mechanical property stiffness matrix corresponding to the truss structure, shell structure and tubular structure.

[0060] Specifically, the three structures of truss structure, shell structure and tubular structure are all represented by graph structure and modeling parameters. The connection nodes of the truss three-dimensional structure are numbered in sequence, and the adjacency matrix of the graph structure is obtained according to whether there is a connection relationship between the connection nodes. , where n is the total number of connected nodes, in this embodiment n=27, the adjacency matrix When the matrix element in is 0, it means that there is no connection relationship between the connected nodes, and when the matrix element is 1, it means that there is a connection relationship between the connected nodes; the three-dimensional coordinates of the connected nodes are node features, which are expressed as . Since the shell structure and the tubular structure are modeled on the basis of the truss structure, the truss structure is represented by the graphical structure representation of the truss structure plus the modeling parameter rod diameter, the shell structure is represented by using the graphical structure representation of the corresponding modeled truss structure plus the three modeling parameters of rod diameter, shell thickness and smoothness, and the tubular structure is represented by using the graphical structure representation of the corresponding modeled truss structure plus the two modeling parameters of rod diameter and circular tube thickness. For convenience, the three structures are all represented by the graphical structure plus the three modeling parameters of rod diameter, thickness and smoothness, where the thickness and smoothness of the truss structure are both 0, and the smoothness of the tubular structure is 0, so the modeling parameters are recorded as .

[0061] (2) The encoder and decoder of the variational autoencoder are trained using the training sets of truss structures, shell structures, and tubular structures to obtain trained encoders and decoders. The encoder and decoder are composed of five fully connected layers and activation function layers, and each fully connected layer is followed by an activation function layer. Figure 2 As shown, it specifically includes the following sub-steps:

[0062] (2.1) Pre-process each sample in the training set of truss structure, shell structure and tubular structure, specifically: convert the graph structure data of each sample Transformed into corresponding one-dimensional column vectors , two one-dimensional column vectors With the modeling parameter vector Concatenate to obtain the concatenated column vector .

[0063] (2.2) The concatenated column vector Input into the encoder E of the variational autoencoder for encoding, and the encoded features are evenly split into means and variance Variable; use resampling method to adjust the mean and variance The variables are resampled to obtain latent space features; the latent space features are input into the decoder D of the variational autoencoder to obtain the decoded features.

[0064] It should be understood that the encoded features are split into two halves, with the first half of the features being taken as the mean , the second half of the feature is used as the variance .

[0065] Furthermore, the mean is adjusted by resampling and variance The variables are resampled as follows:

[0066]

[0067] in, represents the latent space features, is a standard normal distribution .

[0068] (2.3) Post-process the decoded features, specifically: The dimensions of the three column vectors are split into three column vectors, and the first two column vectors are transformed into The shape of the sample is finally obtained by decoding the graph structure data corresponding to the sample. and the modeling parameter vector .

[0069] (2.4) Graph structure data based on each sample in the training set and the modeling parameter vector And its corresponding decoded graph structure data and the modeling parameter vector As well as latent space features, calculate the loss function of the variational autoencoder, take minimizing the loss function of the variational autoencoder as the optimization goal, adjust the network parameters of the variational autoencoder until the preset training rounds are reached to obtain the trained encoder and decoder. Here, the loss function of the variational autoencoder trained using the SGD optimizer can be used to optimize its network parameters.

[0070] Furthermore, the calculation formula of the loss function of the variational autoencoder is expressed as:

[0071]

[0072] in, represents the loss function of the variational autoencoder, represents the mean square error loss, represents the Kullback-Leibler divergence loss, represents a normal distribution, , , and They respectively represent the weight coefficients of the corresponding losses, and in this embodiment, they are 0.2, 0.2, 0.2 and 0.4 respectively.

[0073] (3) Use the trained encoder to extract the latent space features of the truss structure, shell structure and tubular structure, input the modeling parameter vector and mechanical property stiffness matrix of the corresponding structure in the training set as conditions into the conditional encoder, and train the diffusion model on the latent space features to obtain the trained conditional encoder and diffusion model. Figure 3 As shown, it specifically includes the following sub-steps:

[0074] (3.1) Based on the training sets of truss structures, shell structures and tubular structures, the trained encoder is used to extract the latent space features of each sample of truss structure, shell structure and tubular structure, denoted as z.

[0075] (3.2) The modeling parameter vector of each sample The first conditional encoder and the second conditional encoder are respectively input into the first conditional encoder and the second conditional encoder to obtain the encoded first conditional feature and the second conditional feature; the encoded first conditional feature and the second conditional feature are concatenated to obtain the concatenated conditional feature. The first conditional encoder and the second conditional encoder are both composed of two fully connected layers and a ReLU activation function, and each fully connected layer is connected to a ReLU activation function.

[0076] (3.3) A diffusion model is trained on the latent space feature z, where the diffusion model includes a noise diffusion process and a conditional denoising process. In the noise diffusion process, noise is gradually added to the initial latent space feature z extracted in step (3.1) to obtain the latent space feature after noise addition ,in, represents the latent space feature after noise addition at time t, , represents the weight coefficient of the latent space feature z at time t, represents the weight coefficient of noise at time t, and The value guarantee That's it, is from a Gaussian distribution The sampled noise, T represents the total time step of the noise diffusion process, here T=1000, gradually adding noise from the latent space feature without any noise, as the time step increases, the noise ratio becomes larger and larger, and finally becomes the latent space feature of completely normal distribution noise In the conditional denoising process, the latent space features after noise addition are The corresponding time t and the concatenated conditional features are input into the time conditional UNet network to predict the added noise and latent space features. Subtract the predicted noise to obtain the denoised latent space features.

[0077] (3.4) Based on the denoised latent space features and the noise at the corresponding time, the loss function of the diffusion model is calculated. Taking minimizing the loss function of the diffusion model as the optimization goal, the network parameters of the time conditional UNet network, the first conditional encoder and the second conditional encoder are adjusted until the preset training rounds are reached to obtain the trained time conditional UNet network, the first conditional encoder and the second conditional encoder. Here, the loss function of the diffusion model of the AdamW optimizer can be used to optimize the network parameters of the time conditional UNet network, the first conditional encoder and the second conditional encoder.

[0078] Furthermore, the calculation formula of the loss function of the diffusion model is expressed as:

[0079]

[0080] in, represents the loss function of the diffusion model, is the noise added to the latent space feature z at time t, represents the noise predicted by the time-condition UNet network, are the network parameters of the time-conditioned UNet network, represents the vector concatenation operation, represents the encoded first conditional feature output by the first conditional encoder, represents the network parameters of the first conditional encoder, represents the second conditional feature output by the second conditional encoder, Represents the network parameters of the second conditional encoder.

[0081] It should be understood that the role of the temporal conditional UNet network is to predict the added noise and then restore the latent space features after denoising. Adjust the network parameters of the time conditional UNet network, the first conditional encoder, and the second conditional encoder. The goal is to learn whether the noise model can predict the added noise, where the noise added to the latent space feature z at time t can be considered as the target label, so through Training optimization can eventually obtain the trained time-conditional UNet network, the first conditional encoder and the second conditional encoder.

[0082] (4) Based on the target mechanical property stiffness matrix and modeling parameter vector, the trained conditional encoder is used to obtain the encoded conditional features; based on the encoded conditional features and completely normal distribution noise, the trained diffusion model is used to obtain the denoised latent space features; based on the denoised latent space features, the trained decoder is used to obtain the decoded graph structure data; according to the decoded graph structure data and modeling parameters, a three-dimensional structure is modeled in the 3D modeling software to obtain the STP model file of the structure. Figure 4 As shown, it specifically includes the following sub-steps:

[0083] (4.1) The target mechanical property stiffness matrix W and the modeling parameter vector The first conditional features and the second conditional features are respectively input into the trained second conditional encoder and the trained first conditional encoder to obtain the encoded first conditional features and the second conditional features; the encoded first conditional features and the second conditional features are concatenated to obtain the concatenated conditional features.

[0084] (4.2) The completely normally distributed noise is used as the latent space feature of the noise, and the latent space feature of the noise and the concatenated conditional feature are input into the trained time conditional UNet network to obtain the denoised latent space feature. Sampling, the dimension of the sampled vector is consistent with.

[0085] (4.3) Input the denoised latent space features into the trained decoder D to obtain the decoded features, and post-process the decoded features to obtain the decoded graph structure data and the modeling parameter vector .

[0086] (4.4) According to the decoded graph structure data and the input modeling parameter vector Model the three-dimensional structure in the 3D modeling software and obtain the STP model file of the structure. The result is as follows Figure 5 As shown, it can be used for subsequent 3D printing and other needs.

[0087] See also Figure 6 An embodiment of the present invention provides a microstructure reverse generation device based on a diffusion model, including one or more processors and a memory, and the memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the microstructure reverse generation method based on the diffusion model in the above embodiment.

[0088] The embodiment of the microstructure reverse generation device based on the diffusion model of the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The device embodiment can be implemented through software, or through hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capabilities in which it is located reading the corresponding computer program instructions in the non-volatile memory into the internal memory for execution. From the hardware level, if Figure 6 As shown, it is a hardware structure diagram of any device with data processing capability where the microstructure reverse generation device based on the diffusion model of the present invention is located, except Figure 6 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiments is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.

[0089] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0090] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.

[0091] An embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the microstructure inverse generation method based on the diffusion model in the above embodiment is implemented.

[0092] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of any device with data processing capability and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.

[0093] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A microstructure inverse generation method based on a diffusion model, characterized in that: The following steps are involved: (1) Obtain a public truss structure data set, model the shell structure and tubular structure based on the truss structure data, and calculate the mechanical property stiffness matrix corresponding to the shell structure and tubular structure; Utilizing graph structures and modeling parameters to represent truss structures, shell structures and tubular structures, so as to construct training sets of truss structures, shell structures and tubular structures; (2) Using the training sets of truss structures, shell structures, and tubular structures, the encoder and decoder of the variational autoencoder are trained to obtain the trained encoder and decoder; (3) Using the trained encoder to extract the latent space features of the truss structure, shell structure and tubular structure, the modeling parameter vector and mechanical property stiffness matrix of the corresponding structure in the training set are input into the conditional encoder as conditions, and the diffusion model is trained on the latent space features to obtain the trained conditional encoder and diffusion model; (4) Based on the target mechanical property stiffness matrix and modeling parameter vector, the trained conditional encoder is used to obtain the encoded conditional features; based on the encoded conditional features and completely normally distributed noise, the trained diffusion model is used to obtain the denoised latent space features; based on the denoised latent space features, the trained decoder is used to obtain the decoded graph structure data; according to the decoded graph structure data and modeling parameters, a three-dimensional structure is modeled in the 3D modeling software to obtain the STP model file of the structure.

2. The microstructure inverse generation method based on the diffusion model according to claim 1 is characterized in that: The method of obtaining a public truss structure data set, modeling a shell structure and a tubular structure according to the truss structure data therein, and calculating the mechanical property stiffness matrix corresponding to the shell structure and the tubular structure specifically includes the following sub-steps: (1.1) Obtain a public truss structure dataset; wherein the truss structure dataset includes the graph structure data of the truss three-dimensional structure and its corresponding mechanical property stiffness matrix, and the graph structure data includes the adjacency matrix and the connection node coordinates; (1.2) The modeling parameters of the truss structure are the rod diameter, and the modeling parameters of the shell structure include the rod diameter, shell thickness and smoothness. Different shell thicknesses and different smoothness are set on the basis of the truss three-dimensional structure to model the shell structure. Different shell structures are modeled according to different values ​​of the above modeling parameters using 3D modeling software to obtain the corresponding STP model file, which is used to record the three-dimensional structure of the shell after modeling. (1.3) The modeling parameters of the truss structure are the rod diameter, and the modeling parameters of the tubular structure include the rod diameter and the thickness of the circular tube. Different circular tube thicknesses are set on the basis of the truss three-dimensional structure to model the tubular structure. Different tubular structures are modeled according to different values ​​of the above modeling parameters using 3D modeling software to obtain the corresponding STP model file, which is used to record the modeled tubular three-dimensional structure. (1.4) Based on the modeled three-dimensional shell structure, the mechanical property stiffness matrix corresponding to the three-dimensional shell structure is calculated using the finite element simulation in the Comsol property calculation software; based on the modeled three-dimensional tubular structure, the mechanical property stiffness matrix corresponding to the three-dimensional tubular structure is calculated using the finite element simulation in the Comsol property calculation software.

3. The microstructure inverse generation method based on the diffusion model according to claim 1 is characterized in that: The method of using graph structures and modeling parameters to represent truss structures, shell structures and tubular structures to construct training sets of truss structures, shell structures and tubular structures specifically includes: The connection nodes of the truss three-dimensional structure are numbered in sequence, and the adjacency matrix of the graph structure is determined based on whether there is a connection relationship between the connection nodes. , where n is the total number of connected nodes; the three-dimensional coordinates of the connected nodes are the node features in the graph structure, expressed as ; According to the adjacency matrix of the graph structure and node features in the graph structure Obtain the graph structure data of the truss structure; obtain the graph structure data of the shell structure according to the graph structure data of the corresponding modeled truss structure; obtain the graph structure data of the tubular structure according to the graph structure data of the corresponding modeled truss structure; the modeling parameters of the truss structure, the shell structure and the tubular structure all use the modeling parameter vector Represents the modeling parameter vector Including rod diameter, thickness and smoothness, where the thickness and smoothness of the truss structure are both 0, and the smoothness of the tubular structure is 0; a training set of the corresponding structure is constructed based on the graphical structure data, modeling parameter vectors and mechanical property stiffness matrix corresponding to the truss structure, shell structure and tubular structure.

4. The method for inverse generation of microstructure based on diffusion model according to claim 1, characterized in that: The step (2) includes the following sub-steps: (2.1) Pre-process each sample in the training set of truss structure, shell structure and tubular structure, specifically: convert the graph structure data of each sample Transformed into corresponding one-dimensional column vectors , two one-dimensional column vectors With the modeling parameter vector Concatenate to obtain the concatenated column vector ; (2.2) The concatenated column vector Input into the encoder of the variational autoencoder for encoding, and split the encoded features into mean values ​​on average and variance Variable; use resampling method to adjust the mean and variance The variables are resampled to obtain latent space features; the latent space features are input into the decoder of the variational autoencoder to obtain decoded features; (2.3) Post-process the decoded features, specifically: The dimensions of the three column vectors are split into three column vectors, and the first two column vectors are transformed into The shape of the sample is finally obtained by decoding the graph structure data corresponding to the sample. and the modeling parameter vector ; (2.4) Graph structure data based on each sample in the training set and the modeling parameter vector And its corresponding decoded graph structure data and the modeling parameter vector As well as latent space features, the loss function of the variational autoencoder is calculated, and the network parameters of the variational autoencoder are adjusted with the minimization of the loss function of the variational autoencoder as the optimization goal until the preset training rounds are reached to obtain the trained encoder and decoder.

5. The microstructure inverse generation method based on the diffusion model according to claim 4 is characterized in that: The calculation formula of the loss function of the variational autoencoder is expressed as: ; in, represents the loss function of the variational autoencoder, represents the mean square error loss, represents the Kullback-Leibler divergence loss, represents a normal distribution, , , and They represent the weight coefficients of the corresponding losses respectively.

6. The microstructure inverse generation method based on the diffusion model according to claim 1 is characterized in that: The step (3) includes the following sub-steps: (3.1) Based on the training sets of truss structures, shell structures and tubular structures, the trained encoder is used to extract the latent space features of each sample of the truss structure, shell structure and tubular structure, denoted as z; (3.2) The modeling parameter vector of each sample and the mechanical property stiffness matrix W are respectively input into the first condition encoder and the second condition encoder to obtain the encoded first condition feature and the second condition feature; splicing the encoded first conditional feature and the second conditional feature to obtain a spliced ​​conditional feature; (3.3) Training a diffusion model on the latent space feature z, where the diffusion model includes a noise diffusion process and a conditional denoising process; In the process of noise diffusion, noise is gradually added to the initial latent space feature z extracted in step (3.1) to obtain the latent space feature after noise addition ,in, represents the latent space feature after noise addition at time t, represents the weight coefficient of the latent space feature z at time t, represents the weight coefficient of noise at time t, is from a Gaussian distribution The sampled noise, T represents the total time step of the noise diffusion process, Represents the latent space features of completely normally distributed noise; in the conditional denoising process, the latent space features after noise addition are The corresponding time t and the concatenated conditional features are input into the time conditional UNet network to predict the added noise and latent space features. Subtract the predicted noise to obtain the denoised latent space features; (3.4) Based on the denoised latent space features and the noise at the corresponding time, the loss function of the diffusion model is calculated. Taking minimizing the loss function of the diffusion model as the optimization goal, the network parameters of the time conditional UNet network, the first conditional encoder and the second conditional encoder are adjusted until the preset training rounds are reached to obtain the trained time conditional UNet network, the first conditional encoder and the second conditional encoder.

7. The method for inverse generation of microstructure based on diffusion model according to claim 6, characterized in that: The calculation formula of the loss function of the diffusion model is expressed as: ; in, represents the loss function of the diffusion model, is the noise added to the latent space feature z at time t, represents the noise predicted by the time-condition UNet network, are the network parameters of the time-conditioned UNet network, represents the vector concatenation operation, represents the encoded first conditional feature output by the first conditional encoder, represents the network parameters of the first conditional encoder, represents the second conditional feature output by the second conditional encoder, Represents the network parameters of the second conditional encoder.

8. The method for inverse generation of microstructure based on diffusion model according to claim 1, characterized in that: The step (4) includes the following sub-steps: (4.1) The target mechanical property stiffness matrix W and the modeling parameter vector Input them into the trained second conditional encoder and the first conditional encoder respectively to obtain the encoded first conditional features and the second conditional features; splicing the encoded first conditional feature and the second conditional feature to obtain a spliced ​​conditional feature; (4.2) Using completely normally distributed noise as the noisy latent space feature, the noisy latent space feature and the concatenated conditional feature are input into the trained temporal conditional UNet network to obtain the denoised latent space feature; (4.3) Input the denoised latent space features into the trained decoder to obtain the decoded features; Post-process the decoded features to obtain the decoded graph structure data and the modeling parameter vector ; (4.4) According to the decoded graph structure data and the input modeling parameter vector Model a three-dimensional structure in 3D modeling software and obtain the STP model file of the structure.

9. A microstructure inverse generation device based on a diffusion model, comprising one or more processors and a memory, characterized in that: The memory is coupled to the processor; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the microstructure inverse generation method based on the diffusion model according to any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, it is used to implement the microstructure inverse generation method based on a diffusion model as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • CLIP-based property-to-microstructure reverse generation method

    CN119206098A