Three-dimensional wing generative model training method and device
Through the generative learning of the three-dimensional wing generation model, the independent variational codec adversarial generation network and the self-attention encoder network are used to solve the problems of large parameter dimensions and insufficient design space in the three-dimensional wing design in the traditional method, and realizes the The nonlinear dimension reduction and rapid generation of three-dimensional wing aerodynamic shapes are used to directly output NURBS wing surfaces, improving the design optimization speed.
Patent Information
- Application Number
- CN202411219400.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-24
AI Technical Summary
The traditional parametric method lacks effective parametric methods in three-dimensional wing design, resulting in large parameter dimensions, slow design optimization speed, and need to start design from two-dimensional wing stacking, and insufficient design space without filtering.
Using a three-dimensional wing generation model, through the combination of discriminator, encoder and decoder, the independent variational codec adversarial generation network and self-attention encoder network are used to perform generative learning, realizing the nonlinearity of the aerodynamic shape of the three-dimensional wing Dimension reduction and appearance surfaces are quickly generated, and NURBS wing surfaces are directly output to complete end-to-end CAD model generation.
The three-dimensional wing parameterization dimension is effectively reduced, the design optimization speed is improved, and the problems of many parameters and insufficient design space in traditional methods are solved, so as to quickly generate reasonable and real wing shapes.
Smart Images

Figure CN119180200A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent design / generative technology, and in particular to a training method and device for a three-dimensional wing generative model. Background Art
[0002] In the optimization of aerodynamic shape design, parametric methods are often used to express the geometric shape of airfoils and wings, so as to obtain accurate aerodynamic shape data. Parametric methods provide a more compact parametric dimensional space than directly describing hundreds or even more shape scattered points. In aerodynamic optimization problems, the dimensions of parameters and design variables directly affect the optimization speed, especially when using genetic algorithms. Therefore, it is necessary to find a suitable dimensionality reduction method to reduce the parameterization dimension and accelerate the optimization process. At present, traditional parametric methods often only describe two-dimensional airfoil truncation, while the description of three-dimensional wings is mostly based on the interpolation of span-wise stacked two-dimensional airfoil sections, lacking a convenient and effective three-dimensional wing parameterization method. Summary of the invention
[0003] The embodiments of the present application provide a training method and device for a three-dimensional wing generative model, which are used to achieve parameterized nonlinear dimensionality reduction and rapid generation of shape surfaces of a three-dimensional wing aerodynamic shape through the trained three-dimensional wing generative model.
[0004] An embodiment of the present invention provides a training method for a three-dimensional wing generative model, wherein the three-dimensional wing generative model includes: a discriminator, an encoder, and a decoder. The method includes:
[0005] Inputting the wing three-dimensional training data x into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder;
[0006] The encoder randomly encodes the feature sequence into a latent space code z and reparameterizes it to form a code Vector sampling in latent space Gaussian noise coding Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noise latent space encoding vector needs to be generated;
[0007] The encoding and the encoding Input the decoder to obtain the reconstructed wing data and wing data generated from noise
[0008] The wing data The wing data The three-dimensional training data x of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
[0009] An embodiment of the present invention provides a training device for a three-dimensional wing generative model, the device comprising:
[0010] An encoding module, used for inputting the three-dimensional training data of the wing into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder;
[0011] The noise coding module is used to randomly encode the feature sequence into a latent space vector code and add Gaussian noise to form a code Vector sampling in latent space Gaussian noise coding Represents the latent space encoding vector that needs to be reconstructed after the input data is re-parameterized; Indicates that a randomly sampled noise latent space encoding vector needs to be generated;
[0012] A reconstruction module is used to convert the encoding and the encoding Input the decoder to obtain the reconstructed wing data and wing data generated from noise
[0013] A training module is used to convert the wing data The wing data The three-dimensional training data of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
[0014] A computer program product, comprising a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned training method for a three-dimensional wing generative model.
[0015] The present invention provides a training method and device for a three-dimensional wing generative model. The three-dimensional wing generative model comprises: a discriminator, an encoder and a decoder. The three-dimensional training data x of the wing is input into the discriminator to obtain an encoded feature token sequence. The discriminator outputs the feature token sequence to the encoder. The encoder randomly encodes the feature sequence into a latent space code z and re-parameterizes it to form a code. Vector sampling in latent space Gaussian noise coding Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noise latent space encoding vector needs to be generated; the encoding and encoding Input decoder to obtain reconstructed wing data and wing data generated from noise The wing data Wing data And the three-dimensional training data x of the wing is input into the discriminator, and the generative adversarial training of the three-dimensional wing generative model is performed according to the loss function of each part. This application uses the three-dimensional training data of the wing as training data, and performs generative learning on the three-dimensional wing generative model based on the combination of the self-variational encoding and decoding adversarial generative network and the self-attention encoder network. By using the trained three-dimensional wing generative model, the NURBS parameter space is controlled to complete the low-dimensional latent space parametric expression of the wing shape, which solves the problem that the traditional wing parameterization needs to start the design from the two-dimensional airfoil stack, requires large parameters, and the design space is not filtered and insufficient. At the same time, the NURBS wing surface is directly output to complete the end-to-end CAD model generation. It can empower and accelerate the design optimization of new wings and solve the problem that the traditional wing parameterization has large dimensions and many design optimization parameters. Therefore, through this application, the nonlinear dimensionality reduction and shape surface of the three-dimensional wing aerodynamic shape parameterization can be quickly generated. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 An internal structural architecture diagram of a three-dimensional wing generative model provided in this application;
[0017] Figure 2 A flow chart of a training method for a three-dimensional wing generative model provided in this application;
[0018] Figure 3 An internal architecture diagram of a discriminator provided in this application;
[0019] Figure 4 An internal architecture diagram of an encoder provided in this application;
[0020] Figure 5 An internal architecture diagram of a decoder provided in this application;
[0021] Figure 6 A decoder provided in this application automatically outputs a generated three-dimensional CAD modeling diagram of the wing;
[0022] Figure 7 A hidden space parameterized force-empowered aerodynamic optimization flow chart is provided for this application. DETAILED DESCRIPTION
[0023] In order to better understand the above-mentioned technical scheme, the technical scheme of the embodiments of the present application is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present application and the specific features in the embodiments are detailed descriptions of the technical scheme of the embodiments of the present application, rather than limitations on the technical scheme of the present application. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments may be combined with each other.
[0024] See also Figure 1 and Figure 2 , a training method for a three-dimensional wing generative model provided by an embodiment of the present invention, wherein the three-dimensional wing generative model comprises: a discriminator, an encoder and a decoder, and the method specifically comprises S101-S104:
[0025] S101, input the wing three-dimensional training data x into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder.
[0026] like Figure 3 The figure shows the internal architecture of a discriminator provided in this embodiment. The discriminator in this application includes: two parallel convolutional networks, two parallel Transformer encoders, and one fusion discriminant MLP. In this application, the three-dimensional training data x of the wing is input into the discriminator to obtain the encoded feature token sequence, including:
[0027] S1011, the discriminator performs a convolutional network data feature extraction operation on the three-dimensional training data x of the wing according to the chord-wise section and the span-wise section, and flattens the last dimension of the extracted data features to form a first token sequence and a second token sequence respectively.
[0028] In this embodiment, first, the three-dimensional training data x of the wing is subjected to feature extraction operations using a convolutional neural network according to the chord-wise section and the span-wise section, and then the last dimension of the data is flattened to form a first token sequence and a second token sequence, respectively.
[0029] S1012, neural network parameter classification tokens are respectively spliced in front of the first token sequence and the second token sequence, and one-dimensional position codes that can be learned and updated during training are added to each of them.
[0030] The two sequences (the first token sequence and the second token sequence) are respectively concatenated with learnable neural network parameters cls token (classification token) to summarize the global token features during the learning process, and one-dimensional position encoding vector parameters that can be learned and updated during training are also added.
[0031] S1013, the first token sequence and the second token sequence with added classification tokens and one-dimensional position codes are input into the first Transformer encoder and the second Transformer encoder respectively, the classification tokens extracted after encoding are added and fused, and then input into the fusion discriminant MLP, and the true and false probability distribution of the corresponding input data is output; at the same time, the remaining two groups of token sequences are added to obtain the encoded feature token sequence.
[0032] In this implementation, the processed data is then input into two Transformer encoder sequences in parallel for deep learning encoding. After encoding, the processed cls token is extracted, added and fused, and then input into the fusion discriminant MLP (multi-layer perceptron), which outputs the true / false probability distribution of the corresponding input data. At the same time, the remaining two groups of tokens are added to obtain the encoded feature token sequence, forming a feature token sequence for input into the encoder for latent space encoding.
[0033] S102, the encoder randomly encodes the feature sequence into a latent space code z and re-parameterizes it to form a code Vector sampling in latent space Gaussian noise coding
[0034] in, Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noisy latent space encoding vector needs to be generated.
[0035] like Figure 4 The figure shows the internal architecture of an encoder provided by this embodiment, and the encoder comprises a Transformer encoder, a self-attention pooling layer, and an output multi-layer perceptron MLP connected in series. The encoder adds a one-dimensional position code to the feature token sequence output by the discriminator and inputs it into the Transformer encoder, and the Transformer encoder inputs its output data into the self-attention pooling layer; the self-attention pooling layer summarizes the input data and inputs it into the output multi-layer perceptron MLP, and the output multi-layer perceptron MLP outputs a latent space code z and a corresponding latent space code index z.exp, and the latent space code index z.exp is used to calculate the KL divergence.
[0036] It should be noted that for the encoder, its task is to make the reconstructed data as close to the original data as possible while deceiving the discriminator. Secondly, KL divergence is used to ensure the continuity and Gaussian distribution of the latent space. Therefore, its loss function is:
[0037]
[0038] Among them, D KL (Q(z|x)||p(z)) is the KL divergence, Q(z|x) refers to the probability distribution of the encoder's output corresponding to the input x, and p(z) means that z should follow the Gaussian normal distribution N(0,I). D KL The gap between these two distributions is calculated to promote the latent space continuity and Gaussian distribution of the encoder output, achieving feature extraction and decoupling effects.
[0039] S103, the encoding and the encoding Input the decoder to obtain the reconstructed wing data and wing data generated from noise
[0040] like Figure 5 The figure shows an internal architecture diagram of a decoder provided in this embodiment, which includes: 1 fully connected network, two series-connected Transformer encoders, two Sin activation function networks, and 1 NURBS dual-base parameter network.
[0041] Specifically, in this embodiment, the decoder passes the latent space code z input by the encoder through the fully connected network to form a token sequence, and inputs it into the first Transformer encoder together with the learnable one-dimensional position code; the first Transformer encoder passes the encoded token sequence through the first Sin activation function network, and outputs the NURBS control point P ij ; The first Transformer encoder passes the encoded token sequence through the second Transformer and the second Sin activation function network, and outputs NURBS weight information w ij ; Input the NURBS control points and the NURBS weight information into the NURBS double-base parameter network to obtain the NURBS continuous surface information of the wing shape.
[0042] In this embodiment, it is mainly composed of two series-connected Transformers. The input latent space code z is passed through a fully connected network to form a token sequence, which is input into the Transformer encoder together with the learnable 1D position code. The encoded sequence passes through a Sin activation function network to output NURBS (non-uniform rational B-spline) control points. At the same time, the output sequence continues to pass through a Transformer and Sin activation function network to output the weight information of the NURBS control points. The control points and weights are input into the NURBS double-base parameterized function network to output the NURBS continuous surface information of the wing shape, and at the same time, the surface is sampled to form structured wing three-dimensional coordinate data similar to that in the data set.
[0043] Specifically, in this embodiment, a NURBS double-base-like parameterized layer can be created. The double-base-like NURBS surface is defined as a function of two parameters u and v. The two parameters control the shape of the surface through a set of control points and corresponding weights. The following is a mathematical expression of the double-base-like NURBS surface:
[0044]
[0045] Where: S(u,v) is a NURBS surface;
[0046] N i,p (u) and M j,q (v) are the B-spline basis functions in the u and v directions respectively;
[0047] w ij is the control point P ij The weight of
[0048] n and m are known parameters, respectively, the number of control points in the u and v directions;
[0049] p and q are the degrees of the basis spline with known parameters in the u and v directions respectively.
[0050] It should be noted that for the decoder, its task is to generate samples that can deceive the discriminator as much as possible, so the loss function of the decoder is: in, Represents the noise latent space encoding vector The sampling probability sampling.
[0051] S104, the wing data The wing data The three-dimensional training data x of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
[0052] In order to solve the instability problem of most previous GANs (generative adversarial networks) during training, this embodiment uses Wasserstein distance instead of the traditional GAN loss function, even in VAEGAN (autovariational generative adversarial network). In this case, for the discriminator, it is necessary to maximize the probability distribution distance between the real data and the false data. In VAEGAN, the false data comes from the reconstructed data and the generated data. Therefore, the Wasserstein distance loss function used by the discriminator in this embodiment is:
[0053]
[0054] Among them, D represents the discriminator, G represents the decoder, and Q represents the encoder. The above formula represents the expected output probability of the discriminator for the real data and the distance between the generated data and the reconstructed data. The discriminator will try to reduce this loss. E represents the mathematical symbol expectation, x~P r Represents the three-dimensional training data x of the wing sampled by the real sample sampling probability Pr; represents the generator latent space vector, p g represent The generator samples with the corresponding sampling probability Pg; represents the expected value of the probability distribution of the discriminator's output for the wing's three-dimensional training data x, which belongs to the distribution of the original real data; Represents the wing data generated by the discriminator to the decoder noise The expected value of the output probability distribution belongs to the distribution that generates false data; Represents the discriminator to restore the wing data encoded by the encoder to the decoder The expected value of the output probability distribution belongs to the distribution that generates false data.
[0055] It should be noted that directly using Wasserstein loss may make the discriminator loss uncontrollable, so gradient-penalty must be added to achieve 1-Lipschitz continuity. Therefore, the discriminator of this embodiment calculates the loss value through the following formula:
[0056]
[0057] Among them, λ1 and λ2 are trade-off coefficients used to control the intensity of qradient penalty. Represents the reconstructed wing data The sampling probability sampling, Wing data representing noise generation The sampling probability sampling, Represents the discriminator for reconstructing the wing data The Euclidean norm (L2 norm) of the output probability gradient, Represents the discriminator for reconstructing the wing data The Euclidean norm (L2 norm) of the output probability gradient of .
[0058] Among them, the gradient of the discriminator output from the false data is used as a penalty term to ensure the smoothness and continuity of the discriminator output from real data to false data. Therefore, the final discriminator loss function is:
[0059] By using a suitable training method, the above loss functions of each component are minimized, and the minimization among the decoder G, encoder Q and discriminator D is competitively optimized. Then, the model can be trained to minimize the distribution distance between the false data and the real data formed by the decoder of the latent space vector z, so as to achieve high-quality data output.
[0060] In this embodiment, after the training of the three-dimensional wing generative model is completed, the encoder and discriminator in the three-dimensional wing generative model are removed, and the latent space vector of the specified length in the training is input into the decoder to directly generate the wing shape. Among them, the specified length can be set to 15. Specifically, this embodiment inputs the latent space vector of the specified length into the three-dimensional wing generative model, obtains the NURBS control points and NURBS weight information through the decoder in the model, and then the wing shape can be calculated based on the mathematical expression of the double base NURBS surface.
[0061] This embodiment completes the wing feature training by innovatively combining the Transformer+VAEGAN architecture, and uses the Transformer to learn the wing's three-dimensional shape surface as sequence data, thereby obtaining a better training effect than the traditional method. During the training process, the networks are constantly confronting each other, eliminating the generation of low-quality data, effectively filtering the wing design space, and the parameterized combination will only generate reasonable and realistic wings. By using the trained three-dimensional wing generative model, the NURBS parameter space is controlled to complete the low-dimensional latent space parametric expression of the wing shape, solving the problem that the traditional wing parameterization needs to start the design from the two-dimensional airfoil stacking, requiring large parameters, and insufficient design space without filtering. At the same time, the NURBS wing surface is directly output to complete the end-to-end CAD model generation. It can empower and accelerate the design optimization of new wings and solve the problem that the traditional wing parameterization has large dimensions and many design optimization parameters.
[0062] The embodiment of the present invention provides a training method for a three-dimensional wing generative model, wherein the three-dimensional wing generative model comprises: a discriminator, an encoder and a decoder, wherein the three-dimensional wing training data x is input into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder; the encoder randomly encodes the feature sequence into a latent space code z and re-parameterizes it to form a code Vector sampling in latent space Gaussian noise coding Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noise latent space encoding vector needs to be generated; the encoding and encoding Input decoder to obtain reconstructed wing data and wing data generated from noise The wing data Wing data And the three-dimensional training data x of the wing is input into the discriminator, and the generative adversarial training of the three-dimensional wing generative model is performed according to the loss function of each part. This application uses the three-dimensional training data of the wing as training data, and performs generative learning on the three-dimensional wing generative model based on the combination of the self-variational encoding and decoding adversarial generative network and the self-attention encoder network. By using the trained three-dimensional wing generative model, the NURBS parameter space is controlled to complete the low-dimensional latent space parametric expression of the wing shape, which solves the problem that the traditional wing parameterization needs to start the design from the two-dimensional airfoil stack, requires large parameters, and the design space is not filtered and insufficient. At the same time, the NURBS wing surface is directly output to complete the end-to-end CAD model generation. It can empower and accelerate the design optimization of new wings and solve the problem that the traditional wing parameterization has large dimensions and many design optimization parameters. Therefore, through this application, the nonlinear dimensionality reduction and shape surface of the three-dimensional wing aerodynamic shape parameterization can be quickly generated.
[0063] The present application proposes a specific example based on the training method of the above three-dimensional wing generative model:
[0064] 1. Create a 3D database of aircraft wings
[0065] The wing data used in the implementation of the present invention is in the form of three-dimensional structural coordinate points, and its data size is 200x200x3, which means that there are 200 sections in the span direction and 200 sections in the chord direction, and each section point has three dimensions of x, y, and z. In the implementation, 3200 types of wing shape data were collected using empirical data, past designs, and random perturbations.
[0066] Second, create a NURBS double-base parameterized layer
[0067] The double-basic NURBS surface is defined as a function of two parameters u and v, which control the shape of the surface through a set of control points and corresponding weights. The following is the mathematical expression of the double-basic NURBS surface:
[0068]
[0069] Where: S(u,v) is a NURBS surface;
[0070] N i,p (u) and M j,q (v) are the B-spline basis functions in the u and v directions respectively;
[0071] w ij is the control point P ij The weight of
[0072] n and m are known parameters, respectively, the number of control points in the u and v directions;
[0073] p and q are the degrees of the basis spline with known parameters in the u and v directions respectively.
[0074] In this implementation, a third-order basis spline degree of p=q=3 is used, the u direction is the chord direction, 9 control points are used, and the v direction is the span direction, 15 groups of u control points are used. The total number of control points is uxv=135. At the same time, each of the 135 control points corresponds to a control point weight w. These control points Pi,j and control point weights wi,j will be output by the generator.
[0075] 3. Create a discriminator
[0076] The training data x of the three-dimensional wing exists in the form of bx 200x 200x 3, where b is the batch size. For each sample, convolution operations are performed on the 200 sections in the span direction and the 200 sections in the chord direction and flattened to 600 dimensions. Finally, two bx 200x 600 token sequence data are formed. A cls token is connected to the front of each token to form a bx 201x600 sequence data. After adding their own learnable 1-dimensional absolute position encoding (bx 201x 600 size), two Transformer encoders with 10 attention heads and 15 blocks are used to process the two sequences. The first cls token of the two processed sequences is extracted, fused, and input into a 600->1 multi-layer perceptron output layer to output the true and false probability distribution of the data. The remaining sequences are added up to form a feature token sequence and input into the encoder.
[0077] Fourth, create an encoder
[0078] The feature token sequence bx 200x 600 output from the discriminator is added with 1D absolute position encoding and processed by a Transformer with a length of 8 blocks and 10 attention heads. After processing, the data is compressed into a form of bx 600 using self-attention pooling. In this implementation, the wing features will be encoded into a latent space vector of length 15, so the pooled data will be output into a data form of bx 30 through a fully connected network. The first 15 dimensions are the latent space code z, and the last 15 dimensions are the index corresponding to z.
[0079] 5. Create a decoder
[0080] Use a latent space vector z of length 15 as the generator input, the data length is bx 15, and b is the batch size. z will first pass through a multi-layer perceptron to upgrade from 15 dimensions to 300*15 dimensions, and then reshape the data into the form of bx 15x 300. Add 1D absolute position encoding, and use a Transformer encoder with 12 blocks and 8 attention heads to process the sequence. The processed data will pass through a fully connected layer with a Sin function as the activation function, and reshape the dimensions into the form of bx 15x8x 3, representing that the u direction is the chord direction, using 9 control points, and the v direction is the span direction using 15 sets of u control points.
[0081] The token output by the first Transformer is added with a one-dimensional position code and then input into a Transformer with 10 blocks and 8 attention heads. After passing through the Sin layer, it is reshaped into the form of bx 15x 8x 1, which corresponds to the weight of the previously generated control point. The control points and weights are input into the NURBS parameterization layer mentioned above to output a NURBS surface, such as Figure 6 Take the decoder for example to automatically output and generate a 3D CAD model of the wing.
[0082] 6. Model Training
[0083] The Adam optimizer is used, the learning rate is 5e-7, the batch size is 20, and the number of training iterations is 40000.
[0084] The Wasserstein distance loss function used for the discriminator is:
[0085]
[0086] Add gradient-penalty to achieve 1-Lipschitz continuity.
[0087]
[0088] Therefore, the loss function of the final discriminator is:
[0089]
[0090] For the generator (decoder) loss function is:
[0091]
[0092] For the encoder, the loss function is:
[0093]
[0094] 7. Parameter dimensionality reduction optimization usage process
[0095] The lift-to-drag ratio of the wing under specific working conditions (angle of attack, Mach number, altitude, Reynolds number) is used as the optimization objective function, and the genetic algorithm + Nelder-Mead simplex algorithm is used for design optimization. The genetic algorithm population size is set to 36, and the gene encoding / design variables are 15-dimensional feature latent vectors obtained after Transformer-VAEGAN training. The initial population genes are initialized with N(0, I) Gaussian distribution, the crossover ratio is 0.5, and the mutation probability is 0.3. The objective function value is returned by CFD calculation. Each generation of the population evolves according to the set crossover and mutation probabilities, and the optimal gene of that generation is saved. By crossover between high-scoring genes and having mutation probabilities, the genetic algorithm can be used as an excellent global optimization algorithm to avoid falling into the local optimal solution.
[0096] After 100 generations of the genetic algorithm, the algorithm saves the optimal gene latent vector as the initial solution of the Nelder-Mead simplex algorithm. The NM algorithm uses the simplex method to determine the target direction through the movement strategy and retraction of four analysis points. It can imitate the ability of gradient optimization in gradient-free CFD calculations and has good local optimization effects. By combining the global optimization function of the genetic algorithm and the local optimization function of the NM algorithm, the wing is optimized in the reduced-dimensional latent space vector.
[0097] After training, the generator (decoder) is retained to generate the wing shape parameters through the latent space encoding vector with a length of 15. The 15-dimensional latent space encoding can be used as the gene / solution vector of the genetic algorithm and the NM algorithm, which greatly reduces the shape design dimension space in the three-dimensional wing optimization and accelerates the optimization process.
[0098] like Figure 7As shown, a latent space parameterized empowered aerodynamic optimization flow chart provided in this embodiment, by combining a decoder, an optimization algorithm, and currently commonly used CFD mesh generation and CFD solver, the decoder can complete the wing shape description modeling from the low-dimensional latent space code z returned by the optimizer, form an IGES surface file, and input the mainstream CFD mesh and solver (such as ANSYS Meshing / Fluent) based on the CAD modeling surface.
[0099] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0100] In one embodiment, a training device for a three-dimensional wing generative model is provided, and the training device for the three-dimensional wing generative model corresponds one-to-one to the training method for the three-dimensional wing generative model in the above embodiment. The functional modules of the training device for the three-dimensional wing generative model are described in detail as follows:
[0101] A discriminator, used for inputting the three-dimensional training data of the wing into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder;
[0102] Encoder, used to randomly encode the feature sequence into a latent space vector code and add Gaussian noise to form a code Vector sampling in latent space Gaussian noise coding Represents the latent space encoding vector that needs to be reconstructed after the input data is re-parameterized; Indicates that a randomly sampled noise latent space encoding vector needs to be generated;
[0103] A decoder for converting the encoded and the encoding Input decoder to obtain reconstructed wing data and wing data generated from noise
[0104] A discriminator is used to transform the wing data The wing data The three-dimensional training data of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
[0105] In an optional embodiment, the discriminator includes: two parallel convolutional networks, two parallel Transformer encoders, and a fused discriminant MLP.
[0106] In an optional embodiment, the discriminator performs a convolutional network on the three-dimensional training data x of the wing according to the chord-wise section and the span-wise section to extract data features, and flattens the last dimension of the extracted data features to form a first token sequence and a second token sequence respectively;
[0107] The neural network parameter classification tokens are respectively spliced in front of the first token sequence and the second token sequence, and a one-dimensional position code that can be learned and updated during training is added to each of them;
[0108] The first token sequence and the second token sequence with added classification tokens and one-dimensional position codes are input into the first Transformer encoder and the second Transformer encoder respectively. The classification tokens extracted after encoding are added and fused and then input into the fusion discriminant MLP to output the true and false probability distribution of the corresponding input data. At the same time, the remaining two groups of token sequences are added to obtain the encoded feature token sequence.
[0109] In an optional embodiment, the encoder includes a Transformer encoder, a self-attention pooling layer, and an output multi-layer perceptron MLP connected in series.
[0110] In an optional embodiment, the encoder adds a one-dimensional position encoding to the feature token sequence output by the discriminator and inputs it into the Transformer encoder, and the Transformer encoder inputs its output data into the self-attention pooling layer;
[0111] The self-attention pooling layer summarizes the input data and inputs it into the output multi-layer perceptron MLP, and the output multi-layer perceptron MLP outputs the latent space code z and the corresponding latent space code index z.exp, and the latent space code index z.exp is used to calculate the KL divergence.
[0112] In an optional embodiment, the decoder includes: a fully connected network, two serially connected Transformer encoders, two Sin activation function networks, and a NURBS dual-base parameter network.
[0113] In an optional embodiment, the decoder passes the latent space code z input by the encoder through the fully connected network to form a token sequence, and inputs it into the first Transformer encoder together with the learnable one-dimensional position code;
[0114] The first Transformer encoder passes the encoded token sequence through a first Sin activation function network to output NURBS control points;
[0115] The first Transformer encoder passes the encoded token sequence through the second Transformer and the second Sin activation function network in sequence, and outputs NURBS weight information;
[0116] The NURBS control points and the NURBS weight information are input into the NURBS double-base sample parameter network to obtain the NURBS continuous surface information of the wing shape.
[0117] In an optional embodiment, the discriminator calculates the loss value by the following formula:
[0118]
[0119] Among them, E represents the mathematical symbol expected value, x~P r Represents the three-dimensional training data x of the wing sampled by the real sample sampling probability Pr; represents the generator latent space vector, p g represent The generator samples with the corresponding sampling probability Pg; Represents the expected value of the probability distribution of the discriminator output for the wing three-dimensional training data x; Represents the wing data generated by the discriminator to the decoder noise Output the expected value of the probability distribution; Represents the discriminator to restore the wing data encoded by the encoder to the decoder Output the expected value of the probability distribution.
[0120] In an optional embodiment, after the training of the three-dimensional wing generative model is completed, the encoder and discriminator in the three-dimensional wing generative model are removed, and the latent space vector of a specified length in the training is input into the decoder to directly generate the wing shape.
[0121] For the specific definition of the training device of the three-dimensional wing generative model, please refer to the definition of the training method of the three-dimensional wing generative model in the above text, which will not be repeated here. Each module in the above-mentioned device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0122] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a training method for a three-dimensional wing generative model is implemented.
[0123] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0124] Inputting the wing three-dimensional training data x into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder;
[0125] The encoder randomly encodes the feature sequence into a latent space code z and reparameterizes it to form a code Vector sampling in latent space Gaussian noise coding Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noise latent space encoding vector needs to be generated;
[0126] The encoding and the encoding Input the decoder to obtain the reconstructed wing data and the wing data x generated from the noise;
[0127] The wing data The wing data The three-dimensional training data x of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
[0128] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0129] Inputting the wing three-dimensional training data x into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder;
[0130] The encoder randomly encodes the feature sequence into a latent space code z and reparameterizes it to form a code Vector sampling in latent space Gaussian noise coding Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noise latent space encoding vector needs to be generated;
[0131] The encoding and the encoding Input the decoder to obtain the reconstructed wing data and the wing data x generated from the noise;
[0132] The wing data The wing data The three-dimensional training data x of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
[0133] In one embodiment, a computer program product is provided, the computer program product comprising a computer program, the computer program being executed by a processor to implement the following steps:
[0134] Inputting the wing three-dimensional training data x into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder;
[0135] The encoder randomly encodes the feature sequence into a latent space code z and reparameterizes it to form a code Vector sampling in latent space Gaussian noise coding Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noise latent space encoding vector needs to be generated;
[0136] The encoding and the encoding Input the decoder to obtain the reconstructed wing data and wing data generated from noise
[0137] The wing data The wing data The three-dimensional training data x of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0139] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0140] 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. Such 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, and should be included in the protection scope of the present invention.
Claims
1. A training method for a three-dimensional wing generative model, characterized in that: The three-dimensional wing generative model includes: a discriminator, an encoder and a decoder, and the method includes: Inputting the wing three-dimensional training data x into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder; The encoder randomly encodes the feature sequence into a latent space code z and reparameterizes it to form a code Vector sampling in latent space Gaussian noise coding Represents the reconstructed latent space encoding vector after re-parameterization of the input data; Indicates that a randomly sampled noise latent space encoding vector needs to be generated; The encoding and the encoding Input the decoder to obtain the reconstructed wing data and wing data generated from noise The wing data The wing data The three-dimensional training data x of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
2. The method according to claim 1, characterized in that The discriminator includes: two parallel convolutional networks, two parallel Transformer encoders, and a fusion discriminant MLP.
3. The method according to claim 1, characterized in that The step of inputting the wing three-dimensional training data x into the discriminator to obtain an encoded feature token sequence includes: The discriminator performs a convolutional network on the three-dimensional training data x of the wing according to the chord-wise section and the span-wise section to extract data features, and flattens the last dimension of the extracted data features to form a first token sequence and a second token sequence respectively; The neural network parameter classification tokens are respectively spliced in front of the first token sequence and the second token sequence, and a one-dimensional position code that can be learned and updated during training is added to each of them; The first token sequence and the second token sequence with added classification tokens and one-dimensional position codes are input into the first Transformer encoder and the second Transformer encoder respectively. The classification tokens extracted after encoding are added and fused and then input into the fusion discriminant MLP to output the true and false probability distribution of the corresponding input data. At the same time, the remaining two groups of token sequences are added to obtain the encoded feature token sequence.
4. The method according to claim 1, characterized in that: The encoder includes a Transformer encoder, a self-attention pooling layer, and an output multi-layer perceptron MLP connected in series.
5. The method according to claim 4, characterized in that The encoder adds one-dimensional position encoding to the feature token sequence output by the discriminator and inputs it into the Transformer encoder, and the Transformer encoder inputs its output data into the self-attention pooling layer; The self-attention pooling layer summarizes the input data and inputs it into the output multi-layer perceptron MLP, and the output multi-layer perceptron MLP outputs the latent space code z and the corresponding latent space code index z.exp, and the latent space code index z.exp is used to calculate the KL divergence.
6. The method according to claim 1, characterized in that The decoder includes: a fully connected network, two serially connected Transformer encoders, two Sin activation function networks, and a NURBS dual-base parameter network.
7. The method according to claim 6, characterized in that The decoder passes the latent space code z input by the encoder through the fully connected network to form a token sequence, and inputs it into the first Transformer encoder together with the learnable one-dimensional position code; The first Transformer encoder passes the encoded token sequence through a first Sin activation function network to output NURBS control points; The first Transformer encoder passes the encoded token sequence through the second Transformer and the second Sin activation function network in sequence, and outputs NURBS weight information; The NURBS control points and the NURBS weight information are input into the NURBS double-base sample parameter network to obtain the NURBS continuous surface information of the wing shape.
8. The method according to claim 1, characterized in that The discriminator calculates the loss value by the following formula: Among them, E represents the mathematical symbol expected value, x~P r Represents the three-dimensional training data x of the wing sampled by the real sample sampling probability Pr; represents the generator latent space vector, p g represent The generator samples with the corresponding sampling probability Pg; Represents the expected value of the probability distribution of the discriminator output for the wing three-dimensional training data x; Represents the wing data generated by the discriminator to the decoder noise Output the expected value of the probability distribution; Represents the discriminator to restore the wing data encoded by the encoder to the decoder Output the expected value of the probability distribution.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: After the training of the three-dimensional wing generative model is completed, the encoder and the discriminator in the three-dimensional wing generative model are removed, and the latent space vector of the specified length in the training is input into the decoder to directly generate the wing shape.
10. A training device for a three-dimensional wing generative model, characterized in that: The device comprises: A discriminator, used for inputting the three-dimensional training data of the wing into the discriminator to obtain an encoded feature token sequence, and the discriminator outputs the feature token sequence to the encoder; Encoder, used to randomly encode the feature sequence into a latent space vector code and add Gaussian noise to form a code Vector sampling in latent space Gaussian noise coding Represents the latent space encoding vector that needs to be reconstructed after the input data is re-parameterized; Indicates that a randomly sampled noise latent space encoding vector needs to be generated; A decoder for converting the encoded and the encoding Input decoder to obtain reconstructed wing data and wing data generated from noise A discriminator is used to transform the wing data The wing data The three-dimensional training data of the wing is input into the discriminator, and the three-dimensional wing generative model is trained by generative adversarial training according to the loss function of each part.
Citation Information
Cited By
Transform-based three-dimensional editing model training method, three-dimensional editing method and device
CN122435223A
Training method of three-dimensional editing model based on transformer, three-dimensional editing method and device thereof
CN122435223B
