Neural subspace deformable body simulation acceleration method based on Lipschitz optimization
Optimizing neural subspace mapping through Lipschitz optimization and Cubature methods, the problem of high cost in nonlinear subspace methods is solved, and efficient deformable body simulation acceleration is achieved, suitable for animation, clothing design and games and other fields.
Patent Information
- Application Number
- CN202510221878.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-07-25
AI Technical Summary
The nonlinear subspace method based on neural networks introduces nonlinearity in deformable body simulation, resulting in increased solution cost and cannot meet the needs of real-time applications.
The neural subspace method optimized by Lipschitz is adopted to optimize the subspace mapping by designing a second-order Lipschitz loss function, and combined with the Cubature method to approximate the potential energy gradient, and build an autoencoder for subspace mapping training.
It has achieved the realization that the neural subspace deformable body simulation is significantly accelerated while ensuring simulation accuracy, reduces training time and video memory consumption, is highly adaptable, and is suitable for a wide range of simulation scenarios.
Smart Images

Figure CN120372710A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deformable body simulation, and particularly to an acceleration method for neural subspace deformable body simulation based on Lipschitz optimization. Background Art
[0002] Deformable body simulation is an important research direction in computer graphics and is widely used in animation, fashion design, and games. However, high-precision simulation incurs a large amount of computational overhead and cannot be used for real-time applications. Recently, great progress has been made in the technology of accelerating deformable body physical simulation, and the subspace physical simulation method is one of the effective simulation acceleration methods. The key to the subspace method is to find a subspace mapping from a low-dimensional subspace to a high-dimensional full space to reduce the dimension of the original optimization problem and thus improve the simulation efficiency. The subspace method can be divided into two categories, which are: 1. Methods based on linear mapping, where the linear mapping function is selected through modal analysis, subspace mapping of principal component analysis (PCA), or linear blend skinning. However, linear methods usually require a large subspace dimension to effectively handle complex non-linear deformations; 2. Non-linear methods based on neural networks, which use a large amount of data for supervised learning and can capture complex non-linear deformations with a smaller subspace dimension. Due to its smaller subspace dimension, its simulation efficiency is usually higher than that of the linear subspace method.
[0003] The non-linear subspace method based on neural networks solves the problem that the linear subspace method requires a large subspace dimension to effectively handle complex non-linear deformations, but the non-linearity introduced by it increases the solution cost, and there is still a large room for acceleration. Summary of the Invention
[0004] The purpose of the present invention is to overcome the above-mentioned shortcomings and deficiencies of the prior art and provide an acceleration method for neural subspace deformable body simulation based on Lipschitz optimization.
[0005] The present invention uses a deep learning strategy to design a second-order Lipschitz loss function and introduces the Lipschitz loss to optimize the second-order Lipschitz constant of the subspace mapping during the learning process, thereby achieving the acceleration of neural subspace deformable body simulation.
[0006] The present invention is realized through the following technical solutions:
[0007] An acceleration method for neural subspace deformable body simulation based on Lipschitz optimization, comprising the following steps:
[0008] 1) Construct a training data set;
[0009] 2) Perform principal component analysis on the training data to construct the PCA basis;
[0010] 3) Obtain the key units and their non - negative weights for the approximate potential energy gradient through the Cubature method;
[0011] 4) Construct the subspace mapping network and train it;
[0012] 5) Use the network as a subspace mapping for subspace deformable body simulation.
[0013] In step 1), save the position information of the grid vertices at each time step from the simulation with random interactions. These trajectory data serve as the training data; for the grid vertices, it is expressed as:
[0014]
[0015] where, v i refers to the i - th vertex of the grid, x i , y i and z i represent the x - axis, y - axis, and z - axis coordinates in the world coordinate system respectively, and there are N vertices in total;
[0016] The position information of the grid refers to the positions of all grid vertices and can be expressed in the form of a vector:
[0017]
[0018] where, q is a 3N * 1 row vector representing the positions of all vertices, and it represents the simulation state of the current frame. The training data is a collection of a large number of simulation frames:
[0019]
[0020] where, represents the entire training set, which contains T simulation states.
[0021] In step 2), construct the PCA basis according to the training data and reduce the dimension of the training data; perform the centering process on the training data:
[0022] q i = q i - q0, i = 1, 2, 3……, T
[0023] where, q i represents the i - th frame of data, and q0 represents the position of the grid without deformation; for the centered training data perform SVD decomposition:
[0024]
[0025] Among them, U is the left singular vector matrix, Σ is the singular value matrix, and V is the right singular vector matrix; the first d column vectors of the right singular vector matrix are taken to obtain the PCA basis matrix U, where d is the dimension after PCA dimensionality reduction of the data.
[0026] In step 3), the key cells and their non - negative weights for approximating the potential energy gradient are obtained through the Cubature method. Cubature is a method for approximating the exact gradient, which approximates the exact gradient calculation by selecting a subset from the entire set:
[0027]
[0028] Among them, is the gradient of the potential energy function, q is the position vector, f θ is the subspace mapping, w e is the non - negative weight of cell e; the subset is selected using the greedy algorithm, and the non - negative weight w e is obtained by non - negative least squares method, specifically as follows:
[0029] Select a part of the unselected cells as candidate cells, traverse the candidate cells, and select the cell that reduces the estimation error the most to add to the subset Construct a linear equation system:
[0030]
[0031] Among them, T represents the number of training data frames, n represents the number of cells that have been selected currently, represents the gradient of cell e in the t - th frame, f t represents the exact gradient in the t - th frame. Solve the above equation by non - negative least squares method to obtain the non - negative weight w e . Repeat the above steps of selecting cells and solving the linear equation system until n is equal to the maximum number of selectable cells or the relative error is less than the set value.
[0032] In step 4), construct a subspace mapping network and train it, specifically as follows:
[0033] 4.1) Construct a subspace mapping network
[0034] The subspace mapping network adopts an auto - encoder structure. The auto - encoder includes two parts: an encoder and a decoder. The encoder is used to encode the simulation state and transform the feature space, and the decoder is used to restore the simulation state from the feature space. Both parts use a multi - layer perceptron (MLP) with 2 hidden layers;
[0035] The encoder adopts a structure with two hidden layers. Each layer is a fully connected layer, and the ELU is used as the activation function. The width of both layers is 256. A non-learnable linear layer U is added before the input layer of the encoder. T , U T is the transpose of the PCA basis constructed in step 2). Adding a non-learnable linear layer to perform preliminary dimensionality reduction on the training data and then input it into the encoder for further dimensionality reduction to obtain a more compact subspace.
[0036] The decoder also adopts a structure with two hidden layers. Each layer is a fully connected layer, and the ELU is used as the activation function. The width of both layers is 256. A non-learnable linear layer U is added after the output layer of the decoder, and U is the PCA basis constructed in step 2).
[0037] 4.2) Train the subspace mapping network
[0038] The autoencoder is trained using the reconstruction loss function:
[0039]
[0040] where B is the batch size, q i represents the position vector of the i-th data in the batch, represents the position vector after reconstruction by the autoencoder;
[0041] To obtain a smoother subspace mapping to accelerate the solution of the simulation, a second-order Lipschitz loss function is added on this basis:
[0042]
[0043] where z represents the subspace coordinates, represents the second derivative of the potential function at z, represents the expectation, z1, z2 are any two points in the batch, and they follow a certain distribution Π(z). The above formula describes the smoothness of the derivative of the potential function in the subspace distribution; to reduce the computational amount and video memory consumption of to accelerate the training, the key units and their non-negative weights obtained in step 3) are used to approximately calculate the second derivative
[0044] Finally, the loss function of the subspace mapping network is a linear combination of the reconstruction loss function and the Lipschitz loss function:
[0045]
[0046] Here λ is a hyperparameter, and the Adam optimizer is used to optimize the loss function to obtain the trained network.
[0047] In step 5), the trained decoder is used as a subspace mapping for deformable body simulation. The simulation requires time integration of the position, and the time integration can be transformed into the form of an optimization problem:
[0048]
[0049] where f θ is the subspace mapping, Δt is the time step, M is the mass matrix, is the predicted position at the (k + 1)-th time step, v is the current velocity, and P is the potential energy function related to the position;
[0050] Using Newton's method to solve the above equation to obtain the subspace coordinate z k+1 at the (k + 1)-th time step, and then through f θ to obtain the position vector at the (k + 1)-th time step:
[0051] q k+1 = f θ (z k+1 )
[0052] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0053] 1. The present invention first considers the second-order Lipschitz constant in the learning of neural subspace mapping, further accelerating the neural subspace deformable body simulation.
[0054] 2. Compared with the neural subspace method without Lipschitz optimization, the present invention achieves obvious simulation acceleration without sacrificing simulation accuracy.
[0055] 3. The present invention uses the Cubature method to approximately calculate the second derivative of the potential energy function, avoiding the problems of high video memory consumption and long training time during training.
[0056] 4. The method of the present invention has a wide range of applications in neural subspace physical simulation, is simple to operate and highly adaptable, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 is a schematic diagram of the logic flow of the present invention.
[0058] Figure 2 is a schematic diagram of an example of the subspace mapping network structure designed by the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0059] The following further describes the present invention in detail with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.
[0060] As Figure 1-2 shown. The present invention discloses a method for accelerating the simulation of a neural subspace deformable body based on Lipschitz optimization, which uses an autoencoder and comprises the following steps:
[0061] Step 1: Construct a training data set
[0062] Save the position information of the grid vertices at each time step from the full-space simulation with random interactions. For the grid vertices, it is expressed as:
[0063]
[0064] where v i refers to the i-th vertex of the grid, and x i , y i and z i respectively represent the x-axis, y-axis and z-axis coordinates in the world coordinate system, and there are N vertices in total;
[0065] The position information of the grid refers to the positions of all grid vertices, which can be expressed in the form of a vector:
[0066]
[0067] where q is a 3N×1 row vector representing the positions of all vertices, which represents the simulation state of the current frame. The training data is a set of a large number of simulation frames:
[0068]
[0069] where
[0070]
[0071]
[0072] In step 2), construct a PCA basis according to the training data and reduce the dimension of the training data; perform a centering process on the training data:
[0073] q i = q i - q0, i = 1, 2, 3 ……, T where q i represents the i-th frame of data, and q0 represents the position where the grid has not deformed; for the centered training data
[0074] perform an SVD decomposition:
[0075] Among them, U is the left singular vector matrix, ∑ is the singular value matrix, and V is the right singular vector matrix; take the first d column vectors of the right singular vector matrix to obtain the PCA basis matrix U, where d is the dimension after PCA dimensionality reduction of the data, and set d = 150.
[0076] Step 3: Obtain the key cells and their non - negative weights for approximating the potential energy gradient through the Cubature method. Cubature is a method for approximating the exact gradient, which approximates the exact gradient calculation by selecting a subset from the entire set:
[0077]
[0078] Among them, is the gradient of the potential energy function, q is the position vector, f θ is the subspace mapping, w e is the non - negative weight of cell e; the subset is selected using the greedy algorithm, and the non - negative weight w e is obtained by non - negative least squares, as follows:
[0079] Select a part of the unselected cells as candidate cells, traverse the candidate cells, and select the cell that reduces the estimation error the most to add to the subset Construct a linear equation system:
[0080]
[0081] Among them, T represents the number of training data frames, n represents the number of cells that have been selected currently, represents the gradient of cell e in the t - th frame, f t represents the exact gradient in the t - th frame. Solve the above equation by non - negative least squares to obtain the non - negative weight w e ; repeat the above steps of selecting cells and solving the linear equation system until n is greater than the preset maximum number of selected cells 500 or the relative error is less than 0.1.
[0082] Step 4: Construct a subspace mapping network and train it
[0083] 4.1) Construct a subspace mapping network
[0084] The subspace mapping network adopts an auto - encoder structure. The auto - encoder includes two parts: an encoder and a decoder. The encoder is used to encode the simulation state and transform the feature space, and the decoder is used to restore the simulation state from the feature space. Both parts use a multi - layer perceptron (MLP) with 2 hidden layers;
[0085] The encoder adopts a structure with two hidden layers. Each layer is a fully connected layer, and the ELU is used as the activation function. The width of both layers is 256. A non-learnable linear layer U is added before the input layer of the encoder. T , U T is the transpose of the PCA basis constructed in step 2). Adding a non-learnable linear layer to perform preliminary dimensionality reduction on the training data and then input it into the encoder for further dimensionality reduction to obtain a more compact subspace. The output dimension of the encoder is set to 40.
[0086] The decoder also adopts a structure with two hidden layers. Each layer is a fully connected layer, and the ELU is used as the activation function. The width of both layers is 256. A non-learnable linear layer U is added after the output layer of the decoder. U is the PCA basis constructed in step 2).
[0087] 4.2) Train the subspace mapping network
[0088] The autoencoder is trained using the reconstruction loss function:
[0089]
[0090] where B is the batch size, q i represents the position vector of the i-th data in the batch, represents the position vector after reconstruction by the autoencoder;
[0091] To obtain a smoother subspace mapping to accelerate the solution of the simulation, a second-order Lipschitz loss function is added on this basis:
[0092]
[0093] where z represents the subspace coordinates, represents the second derivative of the potential function at z, represents the expectation, z1, z2 are any two points in the batch, and they follow a certain distribution Π(z). The above formula describes the smoothness of the derivative of the potential function in the subspace distribution. To reduce the computational amount and video memory consumption of to accelerate the training, the key units and their non-negative weights obtained in step 3) are used to approximately calculate the second derivative
[0094] Finally, the loss function of the subspace mapping network is a linear combination of the reconstruction loss function and the Lipschitz loss function:
[0095]
[0096] Here λ is a hyperparameter, set to 0.001;
[0097] For network training, it is trained for 20,000 batches with a batch size of 256 and a learning rate of 0.001. The Adam optimizer is used to optimize the loss function, and finally a trained network is obtained. The device processor used is an Intel Xeon Silver 4216, and the graphics card is an NVIDIA RTX 3090.
[0098] Step 5: Conduct subspace deformable body simulation
[0099] In step 5), the trained decoder is used as a subspace mapping for deformable body simulation. The simulation requires time integration of the position, and the time integration can be converted into the form of an optimization problem:
[0100]
[0101] where f θ is the subspace mapping, Δt is the time step, M is the mass matrix, is the predicted position at the (k + 1)-th time step, v is the current velocity, P is the potential energy function related to the position, and here the neo - hookean elastic energy is used.
[0102] The Newton method is used to solve the above equation to obtain the subspace coordinates z k+1 at the (k + 1)-th time step, and then through f θ the position vector at the (k + 1)-th time step is obtained:
[0103] q k+1 = f θ (z k+1 )
[0104] As described above, the present invention performs Lipschitz optimization on the neural subspace mapping of the deformable body simulation, alleviates the problem that the non - linearity introduced by the neural network will increase the solution cost, and further accelerates the neural subspace deformable body simulation on the premise of ensuring the simulation accuracy.
[0105] The implementation manners of the present invention are not limited by the above - mentioned embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement manners and are all included in the protection scope of the present invention.
Claims
1. A method for accelerating the simulation of neural subspace deformable bodies based on Lipschitz optimization, characterized in that It includes the following steps: 1) Construct a training dataset; 2) Perform principal component analysis on the training data to construct a PCA basis; 3) Obtain the key units approximating the potential energy gradient and their non - negative weights through the Cubature method; 4) Construct a subspace mapping network and train it; 5) Use the network as a subspace mapping for subspace deformable body simulation.
2. The method for accelerating subspace deformable body simulation of a neural network based on Lipschitz optimization according to claim 1, wherein: In step 1), save the position information of the grid vertices at each time step from the simulation with random interactions, and these trajectory data serve as the training data; for the grid vertices, it is expressed as: where, v i refers to the i-th vertex of the grid, x i , y i and z i respectively represent the x-axis, y-axis and z-axis coordinates in the world coordinate system, and there are N vertices in total; The position information of the grid refers to the positions of all grid vertices, represented in the form of a vector: where q is a 3N*1 row vector representing the positions of all vertices, which represents the simulation state of the current frame; the training data is a set of a large number of simulation frames: Among them, represents the entire training set, which contains T simulation states.
3. The method for accelerating subspace deformable body simulation of a neural network based on Lipschitz optimization according to claim 1, wherein: In step 2), construct a PCA basis according to the training data and reduce the dimension of the training data; perform a centering process on the training data: q i = q i -q0, i = 1, 2, 3……, T Among them, q i represents the data of the i-th frame, and q0 represents the position where the grid has not deformed; for the training data after decentralization perform SVD decomposition: where U is the left singular vector matrix, Σ is the singular value matrix, and V is the right singular vector matrix; take the first d column vectors of the right singular vector matrix to obtain the PCA basis matrix U, where d is the dimension after PCA dimension reduction of the data.
4. The method for accelerating subspace deformable body simulation of a neural network based on Lipschitz optimization according to claim 1, wherein: In step 3), obtain the key units approximating the potential energy gradient and their non - negative weights through the Cubature method. Cubature is a method for approximating the exact gradient, which approximates the exact gradient calculation by selecting a subset from the entire set: Among them, is the gradient of the potential energy function, q is the position vector, f θ is the subspace mapping, w e is the non - negative weight of element e; the subset is selected by the greedy algorithm, and the non - negative weight w e is obtained by non - negative least squares as follows: Select a part of the unselected cells as candidate cells, traverse the candidate cells, and select the cell that reduces the estimation error the most to add to the subset Construct a system of linear equations: where T represents the number of frames of training data, and n represents the number of units that have been selected currently. represents the gradient of unit e at the t-th frame, and f t represents the exact gradient at the t-th frame. Solving the above equation by non - negative least squares method, the non - negative weight w e is obtained; Repeat the above steps of selecting units and solving the linear equations until n is equal to the maximum number of selected units or the relative error is less than the set value.
5. The method for accelerating subspace deformable body simulation of a neural network based on Lipschitz optimization according to claim 1, wherein: In step 4), construct a subspace mapping network and train it, including the following sub - steps: 4.1) Construct a subspace mapping network The subspace mapping network adopts an auto - encoder structure. The auto - encoder includes two parts: an encoder and a decoder. The encoder is used to encode the simulation state and transform the feature space, and the decoder is used to restore the simulation state from the feature space. Both parts use a multi - layer perceptron with two hidden layers; The encoder adopts a structure with two hidden layers. Each layer is a fully connected layer, and ELU is used as the activation function. The width of both layers is 256. A non-learnable linear layer U is added before the input layer of the encoder. T , U T is the transpose of the PCA basis constructed in step 2). Adding a non-learnable linear layer to perform preliminary dimensionality reduction on the training data and then inputting it into the encoder for further dimensionality reduction to obtain a more compact subspace. The decoder also adopts a structure with two hidden layers. Each layer is a fully - connected layer and uses ELU as the activation function. The width of both layers is 256; after the output layer of the decoder, add a non - learnable linear layer U, and U is the PCA basis constructed in step 2); 4.2) Train the subspace mapping network The training of the auto - encoder uses a reconstruction loss function: Among them, B is the batch size, and q i represents the position vector of the i-th data in the batch, and represents the position vector after reconstruction by the autoencoder; To obtain a smoother subspace mapping to accelerate the solution of the simulation, on this basis, add a second - order Lipschitz loss function: where z represents the subspace coordinate, represents the second derivative of the potential energy function at z, represents the expectation, z1, z2 are any two points in the batch, and they follow a certain distribution Π(z). The above equation describes the smoothness of the derivative of the potential energy function in the subspace distribution; in order to reduce the computational amount and video memory consumption to accelerate the training, the key units obtained in step 3) and their non - negative weights are used to approximately calculate the second derivative Finally, the loss function of the subspace mapping network is a linear combination of the reconstruction loss function and the Lipschitz loss function: Here, λ is a hyperparameter, and the Adam optimizer is used to optimize the loss function to obtain the trained network.
6. The method for accelerating the simulation of a neural subspace deformable body based on Lipschitz optimization according to claim 1, characterized in that: In step 5), the trained decoder is used as a subspace mapping for the simulation of the deformable body. The simulation requires temporal integration of the positions, and the temporal integration can be converted into the form of an optimization problem: where f θ is a subspace mapping, Δt is the time step, M is the mass matrix, is the predicted position at the (k + 1)-th time step, v is the current velocity, and P is the potential energy function related to the position; Using Newton's method to solve the above equation to obtain the subspace coordinates z at the (k + 1)-th time step k+1 , and then through f θ to obtain the position vector at the (k + 1)-th time step: q k+1 = f θ (z k+1 )。