A method for accelerating a graph neural network for cloth physical simulation
Patent Information
- Application Number
- CN202610980319.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-02
- Publication Date
- 2026-09-18
AI Technical Summary
[0002]在涉及高分辨以及复杂碰撞的布料仿真相关技术中,传统物理约束方法依赖多轮迭代与全局约束传播,其计算复杂度随网格规模和碰撞约束数量快速增长,导致推理速度难以满足实时性需求
[0031] The beneficial effects of adopting the above technical solution are as follows: by constructing a multi-scale graph structure including fine-layer graphs with high-dimensional features and coarse-layer graphs with multiple layers of low-dimensional features, both global dynamics and local details are taken into account, thereby maintaining high accuracy in cloth simulation. Furthermore, during the downsampling interval in the inference phase, a skip-sampling processing method is used to update the features of the multi-layer coarse-layer graphs, effectively preserving the local detail accuracy of the fine-layer graphs while reducing the number of nodes to be processed and the number of message passes, thereby reducing the system's computational load and improving iteration efficiency. Therefore, the graph neural network acceleration method for cloth physics simulation proposed in this invention can maintain high accuracy and significantly improve processing speed under high-resolution meshes and complex collision scenarios.
Smart Images

Figure CN122779162A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fabric simulation technology, specifically a graph neural network acceleration method for fabric physical simulation. Background Technology
[0002] In cloth simulation technologies involving high resolution and complex collisions, traditional physics-based constraint methods rely on multiple iterations and global constraint propagation. Their computational complexity increases rapidly with mesh size and the number of collision constraints, making it difficult to meet real-time inference requirements. While data-driven methods reduce iterative solutions, their end-to-end prediction using implicit or geometric encoding fails to adequately represent detailed collisions, wrinkle stability, and topological changes, leading to decreased accuracy and limited generalization ability. Therefore, current cloth simulation technologies struggle to balance processing speed with maintaining accuracy. Summary of the Invention
[0003] To address the shortcomings of existing technologies, the present invention aims to propose a graph neural network acceleration method for cloth physics simulation, which can maintain high accuracy and significantly improve processing speed in high-resolution meshes and complex collision scenarios.
[0004] A graph neural network acceleration method for fabric physics simulation includes:
[0005] Identify the structure of the fabric simulation image, which includes a fine-layer image and multiple coarse-layer images. The mesh precision of each coarse-layer image is different. Both the fine-layer image and the coarse-layer image include feature nodes and feature edges.
[0006] Determine whether the current execution stage is the inference stage. The inference stage includes a downsampling process. The downsampling interval refers to the feature update process from a high-grid-precision layer to a low-grid-precision layer.
[0007] In the case where the processing object is the coarse graph within the downsampling interval, the coarse graph is traversed, and every few processing blocks, the processing block is controlled to execute downsampling message passing. The processing block is a computational unit of the graph neural network, and the processing block is used to update the feature nodes and the feature edges.
[0008] Furthermore, the structure for constructing the fabric simulation diagram includes:
[0009] Read the initial cloth mesh set and the human body collider, wherein the initial cloth mesh set includes multiple cloth meshes and the human body collider includes multiple collision nodes;
[0010] The fine layer graph is constructed using the vertices of the multiple cloth meshes, the adjacent edges of the adjacent cloth meshes, and the collision edges between the vertices of the multiple cloth meshes and the multiple collision nodes;
[0011] The fine-layer graph is coarsened to obtain the multi-layer coarse-layer graph. During the coarsening process, the feature parameters of the feature edges in the fine-layer graph are retained.
[0012] Furthermore, the downsampling message transmission process includes:
[0013] Based on the node features of the source feature node, the node features of the target feature node, and the edge features between the source feature node and the target feature node, calculate the message vector transmitted by each source feature node to the target feature node, where the source feature node is a neighbor node of the target feature node;
[0014] Aggregate the message vectors corresponding to all source feature nodes of the target feature node;
[0015] The state of the target feature node is updated based on the aggregation result.
[0016] Further, the message vector corresponding to all the source feature nodes that aggregate the target feature node includes:
[0017] The normalized weights of the edge features between the source feature node and the target feature node are calculated as follows:
[0018] ;
[0019] in, This represents the source feature node. This refers to the target feature node. This represents the normalized weights of the edge features between the source feature node and the target feature node. This represents the connectivity of the source feature node. It is a stable term and is not equal to 0;
[0020] Based on the normalized weights, the message vectors corresponding to all the source feature nodes are weighted and aggregated as follows:
[0021] ;
[0022] in, This represents the neighborhood information after the target feature nodes are aggregated. This represents the neighborhood of the target feature node. This represents the message vector that the source feature node transmits to the target feature node.
[0023] Furthermore, in the case where the downsampling interval is during the inference phase and the processing object is the coarse graph, traversing the coarse graph and controlling the processing block to execute downsampling message passing every certain number of processing blocks includes:
[0024] In the case where the processing object is the coarse graph within the downsampling interval, the coarse graph is traversed, and every few processing blocks, the processing block is controlled to perform downsampling message passing, and the remaining processing blocks are controlled to skip or output the message of the previously executed processing block.
[0025] Furthermore, the framework of the graph neural network sequentially includes an encoding stage, a processing stage, and a decoding stage. The processing stage includes a training stage and an inference stage. In the training stage, all processing blocks are controlled to pass messages.
[0026] Furthermore, the inference phase also includes an upsampling interval, which follows the downsampling interval;
[0027] The graph neural network acceleration method for fabric physics simulation also includes:
[0028] Within the upsampling interval, the upsampling message is passed layer by layer from the coarse layer of the lowest grid precision to the fine layer.
[0029] When the current execution stage is the decoding stage, the feature nodes and feature edges in the fine layer graph are mapped to the displacement vectors or acceleration vectors of the cloth nodes;
[0030] Based on the displacement vector or the acceleration vector, output the position of the fabric node and the normal between the fabric nodes to obtain the fabric deformation trajectory.
[0031] The beneficial effects of adopting the above technical solution are as follows: by constructing a multi-scale graph structure including fine-layer graphs with high-dimensional features and coarse-layer graphs with multiple layers of low-dimensional features, both global dynamics and local details are taken into account, thereby maintaining high accuracy in cloth simulation. Furthermore, during the downsampling interval in the inference phase, a skip-sampling processing method is used to update the features of the multi-layer coarse-layer graphs, effectively preserving the local detail accuracy of the fine-layer graphs while reducing the number of nodes to be processed and the number of message passes, thereby reducing the system's computational load and improving iteration efficiency. Therefore, the graph neural network acceleration method for cloth physics simulation proposed in this invention can maintain high accuracy and significantly improve processing speed under high-resolution meshes and complex collision scenarios. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the overall process of fabric physical simulation in an embodiment of the present invention;
[0033] Figure 2 This is a flowchart illustrating a graph neural network acceleration method for fabric physics simulation in an embodiment of the present invention.
[0034] Figure 3 This is a flowchart illustrating one inference stage in an embodiment of the present invention. Detailed Implementation
[0035] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0036] It should be noted that the fabric simulation involved in this invention is used for applications such as virtual try-on, animation production, and digital human body, with the aim of accurately predicting fabric deformation under external force, collision, and constraint conditions. Figure 1 This is a schematic diagram illustrating the overall process of fabric physics simulation according to an embodiment of the present invention, demonstrating the overall fabric simulation process using the acceleration method provided by the present invention. To address the problems existing in the prior art, the present invention provides a graph neural network acceleration method for fabric physics simulation. Figure 2 This is a flowchart illustrating a graph neural network acceleration method for fabric physics simulation in an embodiment of the present invention, as shown below. Figure 2 As shown, the above-mentioned graph neural network acceleration method for fabric physics simulation may include the following steps:
[0037] Step 1: Construct the fabric simulation diagram structure.
[0038] For example, the above fabric simulation diagram structure includes a fine layer diagram and multiple coarse layer diagrams, and the mesh precision of each coarse layer diagram is different. Both the fine layer diagram and the coarse layer diagram are composed of feature nodes and feature edges.
[0039] It should be noted that in this invention, the fine-layer graph has a dense mesh of vertices, containing rich details. In the field of cloth simulation, it can reproduce local wrinkles and collision details of cloth; the coarse-layer graph has fewer mesh vertices and a simplified structure. It is used to restore the global deformation situation.
[0040] In this invention, the mesh precision of each coarse layer is different, thereby enabling the global deformation situation of the fabric simulation to be displayed at different precision levels.
[0041] It should be noted that both the fine-layer and coarse-layer graphs are constructed from feature nodes and feature edges between them. A feature node includes the physical characteristics of that node and the local physical properties of the fabric at that node. Feature edges represent the message passing relationships between feature nodes.
[0042] This step constructs a multi-scale graph structure consisting of fine-layer graphs with high-dimensional features and coarse-layer graphs with multiple layers of low-dimensional features, balancing the stability of global deformation with the accurate restoration of local details.
[0043] In some examples, step 1 above may include:
[0044] Step 1.1: Read the initial cloth mesh set and the human body collider. The initial cloth mesh set includes multiple cloth meshes, and the human body collider includes multiple collision nodes.
[0045] It should be noted that,
[0046] For example, the initial cloth mesh set consists of multiple cloth meshes, which can be triangular mesh structures, i.e., one face, three vertices, and three edges.
[0047] In some examples, such as Figure 1 As shown, by inputting the human pose, skeletal parameters, and feature parameters of the fabric mesh structure into the graph neural network, the feature parameters are preprocessed and normalized to facilitate subsequent feature stitching operations.
[0048] Step 1.2: Construct the fine layer graph using the cloth mesh vertices of the plurality of cloth meshes, the adjacent edges of the adjacent cloth meshes, and the collision edges between the plurality of cloth mesh vertices and the plurality of collision nodes.
[0049] It should be noted that the cloth mesh vertices and collision nodes of the cloth mesh are used as the feature nodes mentioned above, and the adjacent edges of adjacent cloth meshes and the collision edges between cloth mesh vertices and collision nodes are used as feature edges to construct the above fine layer graph.
[0050] Step 1.3: Coarsen the fine layer map to obtain the multi-layer coarse layer map. During the coarsening process, the features of the multiple grid edges are preserved.
[0051] For example, the fine-layer graph is coarsened to obtain a multi-layer coarse-layer graph. In this coarsening process, the feature parameters of the feature edges in the fine-layer graph are preserved, that is, the topological connectivity between feature nodes in the fine-layer graph is preserved, and the local information of the fine-layer nodes is aggregated in the coarse layer.
[0052] In some examples, combined Figure 1 As shown, the graph neural network acceleration method for fabric physics simulation provided by this invention uses encoding-processing-decoding as the framework of the graph neural network.
[0053] For example, during the encoding stage, the feature nodes and feature edges in the multi-scale graph structure formed by the constructed fine-layer graph and multiple coarse-layer graphs are mapped to the latent space dimension through MLP (Multilayer Perceptron) to obtain the corresponding latent features.
[0054] The processing stage includes a training stage and an inference stage. The training stage is used to train the model, while the inference stage, in this invention, refers to the stage used for prediction and calculation, which is used to output the predicted values of the fabric simulation.
[0055] For example, during the training phase, all the processing blocks are controlled to pass messages to ensure that the model learns the details and dynamics fully, avoiding training instability or a decrease in accuracy.
[0056] The decoding stage is used to decode feature nodes and feature edges to output the fabric deformation trend.
[0057] The method provided by this invention is mainly applied in the inference stage of the processing phase. By using a step-by-step sampling processing method, the amount of computation is reduced, thereby improving the iteration efficiency. Figure 3 This is a flowchart illustrating one inference stage in an embodiment of the present invention. The following is a summary of the process. Figure 3 The reasoning stage will be introduced.
[0058] Step 2: Identify the structure of the fabric simulation diagram and determine whether the current execution stage is the inference stage.
[0059] For example, the inference phase includes a downsampling interval, which refers to the feature update process from a high-mesh-precision layer to a low-mesh-precision layer.
[0060] For example, such as Figure 1 As shown, the fabric simulation diagram structure constructed in step 1 is identified, which can be understood as an encoding process.
[0061] For example, the inference phase includes a downsampling interval, which in this embodiment refers to the feature update process being completed step by step from the fine layer map to the coarse layer map, and from the high grid precision layer to the low grid precision layer.
[0062] Step 3: If the downsampling interval is in the inference stage and the processing object is the coarse graph, traverse the coarse graph and control the processing block to execute downsampling message passing every few processing blocks.
[0063] For example, the processing block is a computational unit of a graph neural network, and the processing block is used to update the feature nodes and the feature edges.
[0064] The aforementioned processing block can be understood as the smallest operational unit of a graph neural network, or a graph convolution block. It is used to receive the original features of feature nodes and feature edges, and after message passing and aggregation, output the updated features.
[0065] For example, such as Figure 1 As shown, the current execution stage is determined to be the downsampling interval of the inference stage. Since the downsampling interval in this embodiment refers to the transition from the fine-layer graph to the coarse-layer graph, it is further determined whether it is within the coarse-layer graph interval. If it is within the coarse-layer graph interval, the interval step size is controlled to control whether the processing block performs downsampling message passing. However, in the fine-layer graph interval of the downsampling interval, all processing blocks perform message passing.
[0066] It should be noted that the above interval step size can be adjusted at any time as needed.
[0067] It should be noted that in this embodiment, an adjustable step size parameter is introduced to achieve a controllable trade-off between inference speed and physical accuracy: a longer step size skips more computations and reduces inference latency; a smaller step size retains more coarse-level updates and increases accuracy. Therefore, this embodiment can reduce redundant coarse-level computations and lower overall inference latency.
[0068] In some examples, skipped processing blocks can be skipped entirely, or the message output by the previously executed processing block can be used.
[0069] The method provided by this invention constructs a multi-scale graph structure that includes fine-layer graphs with high-dimensional features and coarse-layer graphs with multiple layers of low-dimensional features, balancing global dynamics and local details to maintain high accuracy in cloth simulation. Furthermore, during the downsampling interval in the inference phase, a skip-sampling approach is used to update the features of the multi-layer coarse-layer graphs, effectively preserving the local detail accuracy of the fine-layer graphs while reducing the number of nodes to be processed and the number of message passes, thereby reducing the system's computational load and improving iteration efficiency.
[0070] In some examples, the downsampling message passing described above may include:
[0071] Based on the node features of the source feature node, the node features of the target feature node, and the edge features between the source feature node and the target feature node, calculate the message vector transmitted from each source feature node to the target feature node, where the source feature node is a neighboring node of the target feature node.
[0072] For example, if there are multiple source feature nodes in the neighborhood of the target feature node, the message vector passed from each source feature node to the target feature node is calculated. The calculation method for the message vector passed from each source feature node to the target feature node can be as follows:
[0073] ;
[0074] in, Representing the above source feature nodes, Representing the above target feature nodes, Indicates from feature node Passed to feature nodes The message vector, This represents a multilayer perceptron. Represents feature nodes Features Feature nodes Features Represents feature nodes With feature nodes The features of the edges between them.
[0075] The above multilayer perceptron Will , and Combined, feature nodes are generated. To feature nodes The messages passed between them.
[0076] Aggregate the message vectors corresponding to all the source feature nodes of the target feature node.
[0077] The state of the target feature node is updated based on the aggregation result.
[0078] For example, the message vectors of all source feature nodes in the neighborhood of the target feature node are aggregated, as shown in the following expression:
[0079] ;
[0080] in, This represents feature nodes. Feature nodes in this round of message passing Received comprehensive neighborhood information, Represents feature nodes In the field, This represents an aggregation operator.
[0081] Based on the above comprehensive neighborhood information, feature nodes are then analyzed. Update as follows:
[0082] ;
[0083] in, Represents the updated feature nodes Its characteristics.
[0084] In this embodiment, for each feature node, "its own state + neighborhood information" is used to obtain richer feature messages in the next round. Combined with a multi-scale graph structure, the cloth simulation model can better capture global trends in the coarse-layer graph and more accurately restore local details in the fine-layer graph, thereby improving the ability to express complex cloth deformation.
[0085] In graph neural network techniques, node feature aggregation typically employs a simple summation method. However, in practice, the graph coarsening process can lead to significant differences in node degrees in the coarse-layer graph. Highly connected nodes can exert an excessive influence on feature updates, easily introducing noise or imbalance. Therefore, this invention provides an embodiment to address this technical deficiency.
[0086] In some examples, the message vector corresponding to all the source feature nodes that aggregate the target feature node may include:
[0087] The normalized weights of the edge features between the source feature node and the target feature node are calculated as follows:
[0088] ;
[0089] in, Represents the source feature node. Represents the target feature node. Represents feature nodes and feature nodes Normalized weights of edge features between them. Represents feature nodes The connectivity degree, which represents the feature node's connectivity. How many feature nodes are directly connected? It is a stable term and is not equal to 0. This stable term is used to prevent calculation errors caused by a denominator of 0.
[0090] This step determines the weight of the message transmitted from a source feature node to a target feature node. From the above formula, it can be seen that the message weight of high-connectivity nodes is appropriately reduced, while the message weight of low-connectivity nodes is relatively increased.
[0091] Based on the normalized weights, the message vectors corresponding to all the source feature nodes are weighted and aggregated as follows:
[0092] ;
[0093] in, Represents feature nodes All neighborhood information after aggregation, Indicates from feature node Passed to feature nodes The message vector, Represents feature nodes The field.
[0094] In this embodiment, by appropriately weakening the messages of high-connectivity nodes and relatively strengthening the messages of low-connectivity nodes, some nodes are prevented from dominating the update process during aggregation. This is particularly helpful in maintaining consistency in feature updates while reducing computation, especially in message passing within coarse-layer graph structures in downsampling intervals.
[0095] In the embodiments provided by this invention, during the downsampling interval of the inference phase, skipping steps reduces the number of feature updates in the coarse-layer graph. The introduction of weighted aggregation improves the effectiveness of each update, reduces error accumulation, and ensures that the features in the coarse-layer graph remain reliable even with a limited number of updates, thereby guaranteeing the accuracy and stability of the fine-layer recovery phase. This organic combination and synergistic operation maintains high accuracy in cloth physics simulation while significantly reducing computational power.
[0096] In some examples, such as Figure 3 As shown, the inference phase described above also includes an upsampling interval, which follows the downsampling interval.
[0097] Upon reaching the aforementioned upsampling interval, the upsampling message is passed layer by layer from the coarse layer with the lowest grid precision to the fine layer.
[0098] For example, this step is used to fully restore the feature details of a localized part of the fabric in the detail map.
[0099] It should be noted that in this embodiment, a skip-step strategy is used to execute the downsampling interval, while the complete message passing is maintained in the upsampling interval of fine-layer recovery. This effectively preserves the local detail accuracy of cloth simulation and reduces redundant calculations in coarse layers. Therefore, the graph neural network acceleration method for cloth physics simulation proposed in this invention can maintain high accuracy and significantly improve processing speed under high-resolution meshes and complex collision scenarios.
[0100] After restoring the local details of the fine layer image, we can proceed to the decoding stage described above, mapping the feature nodes and feature edges in the fine layer image to the displacement vectors or acceleration vectors of the cloth nodes.
[0101] Based on the displacement vector or the acceleration vector, output the position of the fabric node and the normal between the fabric nodes to obtain the fabric deformation trajectory.
[0102] For example, such as Figure 1As shown, feature nodes and edges are extracted from the restored high-resolution fine-layer map, and then converted into displacement vectors or acceleration vectors of the cloth nodes. The displacement vector represents the amount and direction of movement of the cloth node, while the acceleration vector represents the direction of acceleration change of the cloth node under force. Both can reflect the changes in the physical properties of the cloth node.
[0103] Based on the displacement vector or acceleration vector mentioned above, the positional change of the fabric node can be calculated. Then, based on the normal of the fabric node after the positional change, a fabric deformation trajectory for an action frame is generated, showcasing the fabric's wrinkling, bending, and other deformation processes. By completely concatenating all the action frames, the complete trajectory of the fabric deformation can be obtained.
[0104] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A graph neural network acceleration method for fabric physics simulation, characterized in that, include: A cloth simulation graph structure is constructed, which includes a fine-layer graph and multiple coarse-layer graphs. The mesh precision of each coarse-layer graph is different. Both the fine-layer graph and the coarse-layer graph include feature nodes and feature edges. Identify the structure of the fabric simulation diagram and determine whether the current execution stage is the inference stage. The inference stage includes a downsampling interval, which refers to the feature update process from a high-mesh-precision layer to a low-mesh-precision layer. If the inference phase is in the downsampling interval and the processing object is the coarse graph, the coarse graph is traversed. Every few processing blocks, the processing block is controlled to execute downsampling message passing. The processing block is a computational unit of the graph neural network and is used to update the feature nodes and feature edges.
2. The graph neural network acceleration method for fabric physics simulation according to claim 1, characterized in that, The constructed fabric simulation diagram structure includes: Read the initial cloth mesh set and the human body collider, wherein the initial cloth mesh set includes multiple cloth meshes and the human body collider includes multiple collision nodes; The fine layer graph is constructed using the vertices of the multiple cloth meshes, the adjacent edges of the adjacent cloth meshes, and the collision edges between the vertices of the multiple cloth meshes and the multiple collision nodes; The fine-layer graph is coarsened to obtain the multi-layer coarse-layer graph. During the coarsening process, the feature parameters of the feature edges in the fine-layer graph are retained.
3. The graph neural network acceleration method for fabric physics simulation according to claim 2, characterized in that, The process of transmitting the downsampling message includes: Based on the node features of the source feature node, the node features of the target feature node, and the edge features between the source feature node and the target feature node, calculate the message vector transmitted by each source feature node to the target feature node, where the source feature node is a neighbor node of the target feature node; Aggregate the message vectors corresponding to all source feature nodes of the target feature node; The state of the target feature node is updated based on the aggregation result.
4. The graph neural network acceleration method for fabric physics simulation according to claim 3, characterized in that, The message vector corresponding to all source feature nodes that aggregate the target feature node includes: The normalized weights of the edge features between the source feature node and the target feature node are calculated as follows: ; in, This represents the source feature node. This refers to the target feature node. This represents the normalized weights of the edge features between the source feature node and the target feature node. This represents the connectivity of the source feature node. It is a stable term and is not equal to 0; Based on the normalized weights, the message vectors corresponding to all the source feature nodes are weighted and aggregated as follows: ; in, This represents the neighborhood information after the target feature nodes are aggregated. This represents the neighborhood of the target feature node. This represents the message vector that the source feature node transmits to the target feature node.
5. The graph neural network acceleration method for fabric physics simulation according to claim 1, characterized in that, In the case where the downsampling interval is during the inference phase and the processing object is the coarse graph, traversing the coarse graph and controlling the processing block to execute downsampling message passing every certain number of processing blocks includes: In the case where the processing object is the coarse graph within the downsampling interval, the coarse graph is traversed, and every few processing blocks, the processing block is controlled to perform downsampling message passing, and the remaining processing blocks are controlled to skip or output the message of the previously executed processing block.
6. The graph neural network acceleration method for fabric physics simulation according to any one of claims 1 to 5, characterized in that, The framework of the graph neural network includes an encoding stage, a processing stage, and a decoding stage. The processing stage includes a training stage and an inference stage. In the training stage, all processing blocks are controlled to pass messages.
7. The graph neural network acceleration method for fabric physics simulation according to claim 6, characterized in that, The inference phase also includes an upsampling interval, which follows the downsampling interval. The graph neural network acceleration method for fabric physics simulation also includes: Within the upsampling interval, the upsampling message is passed layer by layer from the coarse layer of the lowest grid precision to the fine layer. When the current execution stage is the decoding stage, the feature nodes and feature edges in the fine layer graph are mapped to the displacement vectors or acceleration vectors of the cloth nodes; Based on the displacement vector or the acceleration vector, output the position of the fabric node and the normal between the fabric nodes to obtain the fabric deformation trajectory.