A continuous collision detection method based on deep neural network optimization

Through the optimization method based on deep neural network, combined with the bounding box and BVH tree, the problem of low collision detection efficiency in fabric simulation is solved, and efficient and real-time collision detection is achieved, suitable for large scenarios and high-precision modeling scenarios.

CN114841079BActive Publication Date: 2024-11-19ZHONGBEI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210590138.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2024-11-19
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

In the prior art, collision detection efficiency in fabric simulation is low, especially in finely modeled object interaction scenarios, it is difficult to achieve efficient collision detection.

Method used

Using a continuous collision detection method based on deep neural network optimization, the data set is simulated and the deep neural network is trained through traditional continuous collision detection methods. Combined with Sphere-AABB hybrid bounding box and BVH tree, rough removal and precise detection are performed, and deep neural network optimization is used. The algorithm performs accurate detection.

Benefits of technology

Improve the efficiency of collision detection and ensure the quality and real-time performance of fabric simulation. Especially in large scenarios or high-fine modeling scenarios, the detection time is significantly reduced, and the time-consuming and shortened compared to the algebraic non-penetrating filter optimization algorithm. 12% to 23%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114841079B_ABST
    Figure CN114841079B_ABST
Patent Text Reader

Abstract

The present invention discloses a continuous collision detection method based on deep neural network optimization, which belongs to the field of virtual simulation collision detection technology. In view of the problem of low efficiency of collision detection in the current scene of interaction between cloth and finely modeled objects, the present invention first uses the traditional continuous collision detection algorithm to obtain parameter data, and inputs the obtained data into the deep neural network for training; secondly, the neural network is used to predict the collision pairs that are not eliminated by the bounding box to determine whether they collide; then the collision response is performed on the collision pairs that collide, and the final position of the particles after the response is obtained. Under the premise of ensuring the authenticity and robustness of cloth simulation, compared with the traditional continuous collision detection algorithm and the continuous collision detection algorithm optimized by algebraic non-penetration filter, the detection efficiency of the algorithm has a significant advantage as the degree of refinement of cloth or interactive object modeling increases, and can meet the real-time requirements of cloth simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of virtual simulation collision detection, and specifically relates to a continuous collision detection method based on deep neural network optimization. Background Art

[0002] Cloth simulation is an active research area in computer graphics. Collision detection has a great impact on the efficiency of cloth simulation. Cloth is a typical flexible object, and real-time collision detection requires a lot of performance. How to effectively improve the performance of cloth collision detection is a major focus in the field of cloth simulation research. In order to efficiently perform collision detection on cloth, the detection is generally divided into two stages: rough detection and precise detection.

[0003] Commonly used methods in the rough detection stage are the bounding box method and the space segmentation method. The bounding box method uses a large bounding box with simple geometric features to approximate complex geometric objects, and then approximates the geometric model by building a tree structure, thereby accelerating the collision detection algorithm. Commonly used bounding boxes include Sphere bounding boxes, axial bounding boxes, directed bounding boxes, and discrete direction bounding boxes, which are suitable for smaller scenes. The space segmentation method divides the entire space into cells of the same size, so that the objects in the scene are divided into a smaller group. During detection, only objects in adjacent spaces need to be detected. This method is suitable for use in large scenes with many fixed objects.

[0004] The commonly used method in the precise detection stage is the continuous collision detection method. Currently, there are algorithms based on motion interpolation, continuous collision detection based on algebraic methods, and distance-based collision detection algorithms. Nowadays, with the development of deep learning, more and more studies are being conducted on the combination of cloth simulation and deep learning. Deep learning has the ability to quickly process large amounts of data and has strong nonlinear learning capabilities. It is worth studying how to combine deep learning with collision detection to improve the efficiency of collision detection. Summary of the invention

[0005] In view of the problem of low efficiency of collision detection in the current interaction scenarios between cloth and finely modeled objects, the present invention provides a continuous collision detection method based on deep neural network optimization.

[0006] The purpose of the present invention is to optimize the continuous collision detection algorithm and improve the collision detection efficiency.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions:

[0008] A continuous collision detection method based on deep neural network optimization includes the following steps:

[0009] Step 1: Use the traditional continuous collision detection method to simulate cloth interaction to obtain a data set, and then input the data set into a deep neural network for training;

[0010] Step 2: construct a fixed Sphere-AABB hybrid bounding box for the cloth, and use the bounding box to roughly eliminate the cases where no collision occurs; use the AABB bounding box to build a BVH tree for the cloth that has collided. If there is an uneliminated collision pair, that is, a collision occurs, execute step 3; otherwise, re-execute step 2 to continue detection;

[0011] Step 3: Use a deep neural network to optimize the continuous collision detection algorithm, perform accurate detection, and calculate the specific collision pairs and the time when the collision occurs;

[0012] Step 4: Make a collision response to the collision pair detected to have collided.

[0013] Furthermore, the specific method of using the traditional continuous collision detection method to simulate cloth interaction and obtain a data set in step 1 is: within a time interval (t, t+Δt), the position of the cloth point is X0, the speed of the cloth point is v0, the vertices of the triangular faces not eliminated by the bounding box are (X1, X2, X3), and their speeds are (v1, v2, v3).

[0014] Furthermore, in step 2, a fixed Sphere bounding box is used to roughly eliminate the cases where no collision occurs, the center of the circle O is set at the center of the cloth, and the radius r of the Sphere is half of the cloth's ultimate stretching length; if there is an interactive particle X satisfying |OX|≤r, an AABB bounding box detection is performed. AABB bounding box detection is simple and efficient. It only requires knowing the positions of the projections of the AABB bounding boxes of the two objects on the X, Y and Z axes. If there is an overlap of projections on two or more axes, it is determined that a collision has occurred, otherwise no collision has occurred. The Sphere bounding box is often used for collision detection of rigid bodies because of its advantages of simple and fast detection. If used on a deformable body, it is necessary to detect the deformation of the object in real time to update the position and size of the Sphere, which is not worth the loss. This patent uses a fixed Spere bounding box algorithm for cloth, only to meet the purpose of rough elimination. There is no need to update the size of the Sphere bounding box, thus avoiding the consumption of program performance.

[0015] Furthermore, in step 3, the specific method of using a deep neural network to optimize the continuous collision detection algorithm for accurate detection is:

[0016] Step 5.1, when "edge-edge" and "point-plane" collisions occur, the four colliding points are on the same plane, and the scalar triple product is derived, expressed as:

[0017] D(t)=(x 10+tv 10 )×(x 20 +tv 20 )·(x 30 +tv 30 )=0 (1)

[0018] Among them, x 10 represents the position difference between X0 and X1, v 01 Indicates the speed difference between v0 and v1;

[0019] According to formula (1), it can be solved into a standard cubic equation:

[0020] D(t)=a+bt+ct 2 +dt 3 (2)

[0021] The constants a, b, c, d in the scalar triple product (2) and whether D(t) has a solution are used as the data set, where D(t) is defined as 1 if it has a solution, and 0 if it does not. The obtained data set is divided into a training set and a test set, where the training set accounts for 80% and the test set accounts for 20%.

[0022] Step 5.2, normalize the parameters in the data set, and the range of f(x) after normalization is (-1, 1);

[0023]

[0024] Among them, f(x) represents the normalized data, X min and X max are the minimum and maximum values ​​in the data set, respectively;

[0025] Step 5.3, input the normalized parameters into the deep neural network, use the logistic activation function for training, and the output value is z:

[0026]

[0027]

[0028] where x1, x2, …, x i ,…,x n is the information input to the network, w1,w2,…,w i ,…,w n is the weight, b is the bias, act() is the activation function;

[0029] Step 5.4, train the network using the standardized squared error as the loss function, expressed as:

[0030]

[0031] Among them, NSE represents the value of the loss function, out represents the output value of the deep neural network, tar represents the actual value in the data set, and A represents the normalization coefficient;

[0032] Step 5.5, select the optimal network model based on the training and testing results of the deep neural network.

[0033] Compared with the prior art, the present invention has the following advantages:

[0034] The present invention makes collision detection more efficient by using a continuous collision detection algorithm optimized by a deep neural network, ensures the quality of cloth simulation, and ensures the real-time and authenticity of the simulation process. It also performs well in scenarios such as large scenes or high-precision modeling that require processing large amounts of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a schematic diagram of the algorithm flow of the present invention;

[0036] Figure 2 This is a graph showing the effect of the number of hidden layers in a deep neural network on time consumption and accuracy;

[0037] Figure 3 This is a graph showing the effect of the number of neurons in each layer of a deep neural network on time consumption and accuracy;

[0038] Figure 4 This is a graph showing the time taken to detect cloth collisions with different accuracies using different algorithms. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0040] Example 1

[0041] like Figure 1 As shown,

[0042] A continuous collision detection method based on deep neural network optimization includes the following steps:

[0043] Step 1: Use the traditional continuous collision detection method to simulate cloth interaction to obtain a data set, and then input the data set into the deep neural network for training; specifically, within a time interval (t, t+Δt), the position of the cloth point is X0, the speed of the cloth point is v0, the vertices of the triangular face that are not eliminated by the bounding box are (X1, X2, X3), and their speeds are (v1, v2, v3);

[0044] Step 2, build a fixed Sphere-AABB hybrid bounding box for the cloth, use the bounding box to roughly eliminate the situation where no collision occurs; use the AABB bounding box to build a BVH tree for the cloth that has collided. If there is an uneliminated collision pair, that is, a collision occurs, execute step 3; otherwise, re-execute step 2 to continue detection; Step 2 uses a fixed Sphere bounding box to roughly eliminate the situation where no collision occurs, set the center of the circle O to the center of the cloth, and the radius r of the Sphere is half of the cloth's limit stretching length; if there is an interactive particle X that satisfies |OX|≤r, then perform AABB bounding box detection. AABB bounding box detection is simple and efficient. It only needs to know the position of the projection of the AABB bounding box of each of the two objects on the X, Y and Z axes. If there is an overlap of projections on two or more axes, it is determined that a collision has occurred, otherwise no collision has occurred.

[0045] Step 3: Use a deep neural network to optimize the continuous collision detection algorithm, perform accurate detection, and calculate the specific collision pairs and the time when the collision occurs;

[0046] Step 3.1, when "edge-edge" and "point-plane" collisions occur, the four colliding points are on the same plane, and the scalar triple product is derived, expressed as:

[0047] D(t)=(x 10 +tv 10 )×(x 20 +tv 20 )·(x 30 +tv 30 )=0 (1)

[0048] Among them, x 10 represents the position difference between X0 and X1, v 01 Indicates the speed difference between v0 and v1;

[0049] According to formula (1), it can be solved into a standard cubic equation:

[0050] D(t)=a+bt+ct 2 +dt 3 (2)

[0051] The constants a, b, c, d in the scalar triple product (2) and whether D(t) has a solution are used as the data set, where D(t) is defined as 1 if it has a solution, and 0 if it does not. The obtained data set is divided into a training set and a test set, where the training set accounts for 80% and the test set accounts for 20%.

[0052] Step 3.2, normalize the parameters in the data set, and the range of f(x) after normalization is (-1, 1);

[0053]

[0054] Among them, f(x) represents the normalized data, X min and X max are the minimum and maximum values ​​in the data set, respectively;

[0055] Step 3.3, input the normalized parameters into the deep neural network, use the logistic activation function for training, and the output value is z:

[0056]

[0057]

[0058] where x1, x2, …, x i ,…,x n is the information input to the network, w1,w2,…,w i ,…,w n is the weight, b is the bias, act() is the activation function;

[0059] Step 3.4, train the network using the standardized squared error as the loss function, expressed as:

[0060]

[0061] Among them, NSE represents the value of the loss function, out represents the output value of the deep neural network, tar represents the actual value in the data set, and A represents the normalization coefficient;

[0062] Step 3.5, select the optimal network model based on the training and testing results of the deep neural network. Figure 2 , Figure 3 The results show that the optimal number of hidden layers in the network is 4, the optimal number of neurons in each layer is 6, the input layer has four neurons a, b, c and d, and the output layer has one neuron Z.

[0063] Step 4: Make a collision response to the collision pair detected to have collided.

[0064] In summary, the continuous collision detection algorithm optimized by deep neural network is compared with the traditional continuous collision detection algorithm and the continuous collision detection algorithm optimized by algebraic non-penetration filter. The simulation experiment is carried out by selecting cloths of different resolutions to interact with the same object. The experimental results are as follows: Figure 4 As shown in the figure, it can be seen that as the fabric accuracy increases, the time consumed by collision detection will also increase. The time consumption of the continuous collision detection algorithm optimized by deep neural network is shorter than that of the other two algorithms, and it is 12% to 23% shorter than the continuous collision detection algorithm optimized by algebraic non-penetration filter.

[0065] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technicians in the field of this technology, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A continuous collision detection method based on deep neural network optimization, characterized in that: The following steps are involved: Step 1: Use the traditional continuous collision detection method to simulate cloth interaction to obtain a data set, and then input the data set into a deep neural network for training; Step 2: construct a fixed Sphere-AABB hybrid bounding box for the cloth, and use the bounding box to roughly eliminate the cases where no collision occurs; use the AABB bounding box to build a BVH tree for the cloth that has collided. If there is an uneliminated collision pair, that is, a collision occurs, execute step 3; otherwise, re-execute step 2 to continue detection; Step 3: Use a deep neural network to optimize the continuous collision detection algorithm, perform accurate detection, and calculate the specific collision pairs and the time when the collision occurs; Step 4, making a collision response to the collision pair detected to have collided; In step 2, a fixed Sphere bounding box is used to roughly eliminate the cases where no collision occurs. The center of the circle O is set at the center of the cloth, and the radius r of the Sphere is half of the maximum stretch length of the cloth. If there is an interactive particle X that satisfies , then perform AABB bounding box detection.

2. The continuous collision detection method based on deep neural network optimization according to claim 1, characterized in that: The specific method of obtaining a data set by simulating cloth interaction using the traditional continuous collision detection method in step 1 is: , the location of the cloth point is , the speed of the cloth point is , the vertices of the triangular faces that are not culled by the bounding box are , whose speed is .

3. The continuous collision detection method based on deep neural network optimization according to claim 1, characterized in that: The specific method of using the deep neural network to optimize the continuous collision detection algorithm for accurate detection in step 3 is: Step 3.1, when "edge-edge" and "point-plane" collisions occur, the four colliding points are on the same plane, and the scalar triple product is derived, expressed as: (1) in, x 10 express X 0 and X The position difference of 1, v 01 express v 0 and v 1 speed difference; According to formula (1), it can be solved into a standard cubic equation: (2) The scalar triple product (2) contains constants a, b, c, d and Is there a solution as a data set where Define a solution as 1, otherwise 0; divide the obtained data set into a training set and a test set, where the training set accounts for 80% and the test set accounts for 20%; Step 3.2: Normalize the parameters in the data set. The range is (-1, 1); (3) in, represents the normalized data, and are the minimum and maximum values ​​in the data set, respectively; Step 3.3, input the normalized parameters into the deep neural network, use the logistic activation function for training, and the output value is z: (4) (5) where x1, x2, …, x i ,…,x n is the information input to the network, w1,w2,…,w i ,…,w n is the weight, b is the bias, act() is the activation function; Step 3.4, train the network using the standardized squared error as the loss function, expressed as: (6) in, NSE Represents the value of the loss function, out represents the output value of the deep neural network, tar represents the actual value in the data set, and A represents the normalization coefficient; Step 3.5, select the optimal network model based on the training and testing results of the deep neural network.