Topological optimization method for irregular three-dimensional model

By employing a deep learning and physical information-driven approach, and utilizing cross-training of displacement prediction neural networks and density prediction neural networks, the problems of long optimization time and islanding effect in irregular 3D models are solved. This enables the rapid generation of manufacturable optimized structures, suitable for personalized customization and complex component design.

CN121706481APending Publication Date: 2026-03-20NANJING NORMAL UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511905251.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies, topology optimization of irregular 3D models requires professionals to spend a considerable amount of time, and the optimization results suffer from the problem of island effect.

Method used

By employing a deep learning and physical information-driven approach, and through cross-training of displacement prediction neural networks and density prediction neural networks, combined with physical information loss function and graph clustering connectivity analysis, the physical rationality of the topology optimization results and the absence of island effects are achieved, generating optimized structures that can be directly used for 3D printing.

Benefits of technology

It enables rapid generation of manufacturable 3D models, supports rapid iteration and customized production, eliminates the island effect in topology optimization, and is suitable for personalized customization and complex component design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121706481A_ABST
    Figure CN121706481A_ABST
Patent Text Reader

Abstract

The invention discloses an irregular three-dimensional model topological optimization method, which comprises the following steps of: importing an object to be optimized in a three-dimensional model file format, converting the object to be optimized into a mask matrix through a ray scanning method, and acquiring a voxel center coordinate; voxel random sampling coordinates in the model are substituted into a displacement prediction neural network for pre-training, a loss function is set based on a physical information neural network and a minimum potential energy theorem, and a penalty function is introduced and combined with hard displacement constraint to realize displacement fixed constraint; and performing cross training on the density prediction neural network and the displacement prediction neural network to obtain a topological optimization result. According to the method provided by the invention, the problems that a professional needs to apply professional software to carry out topological optimization on the irregular three-dimensional model and takes a long time, and the optimization result has an islanding effect and the like in the related technology are solved. The three-dimensional model improved by the method can be directly printed by utilizing three-dimensional printing equipment, and finally a real object corresponding to a topological optimization result can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the fields of artificial intelligence and topology optimization, and specifically relates to a topology optimization method for irregular three-dimensional models. Background Technology

[0002] Topology optimization is a structural optimization method that has gradually emerged since the late 20th century. Its core idea is to automatically find the optimal material distribution under constraints such as the design domain, material volume fraction, load, and boundary conditions through a mathematical model. With the development of finite element analysis methods and the improvement of computing power, topology optimization has gradually moved from proof-of-concept to engineering application, changing the traditional structural design working mode that relies on empirical iteration, and demonstrating significant structural performance advantages in fields such as aerospace, automotive engineering, and biomedicine.

[0003] Topology optimization methodologies are diverse, including density-based SIMP methods, level set-based shape evolution methods, and evolutionary strategy-based ESO / BESO methods, each with its own characteristics in terms of geometric description, numerical stability, boundary clarity, and optimization efficiency. However, broadly speaking, the standard process mainly consists of three key steps: design domain modeling, defining the geometric range and physical constraints of the structure; numerical solution, iteratively evaluating material distribution schemes using finite element methods or other physical simulation tools; and result reconstruction, transforming the discrete optimization results into a manufacturable structure through steps such as filtering, projection, parametric modeling, or CAD reconstruction.

[0004] In recent years, the rise of deep learning technology has brought new directions to the development of topology optimization. On the one hand, neural network models can be embedded into traditional processes as accelerators to achieve rapid prediction of structural responses, thereby significantly reducing the computational cost of multiple iterations. On the other hand, generative models, graph neural networks, and physically-informed neural networks are used to directly predict optimal material distributions or replace some numerical solution steps, enabling topology optimization to evolve from the traditional "optimization-simulation" cycle to a "learning-generation" model. The introduction of deep learning has not only improved the efficiency of large-scale 3D structural optimization but also provided new technical approaches for dealing with complex geometries, non-standard meshes, and nonlinear material behavior.

[0005] A search revealed Chinese invention patent CN115344986A, which discloses a device and method for improving the strength of a three-dimensional structure. The method includes: reading a three-dimensional model and data on the stress configuration of the stress-bearing region; discretizing the three-dimensional model into multiple voxels with high precision based on the read data, and assigning a density variable to each voxel; calculating the worst-case load and displacement field of the three-dimensional model using a multigrid method and a power method; determining whether the strain energy of the three-dimensional model converges to the worst-case load; if converged, generating the result data of the three-dimensional model based on the density variable; otherwise, updating the density variable of each voxel based on the distribution of the worst-case load and the displacement field, and returning to the calculation step to recalculate. The disclosed method is significantly faster than traditional methods for large-scale worst-case topology optimization, greatly reducing time overhead, and is suitable for modeling and design in manufacturing and construction industries.

[0006] This application differs from the aforementioned prior art documents in the following ways:

[0007] 1. Patent CN115344986A focuses on strength optimization of three-dimensional structures under uncertain loads. It efficiently solves the worst load distribution through multi-grid methods and improved power methods, and iteratively updates the material density distribution by combining sensitivity analysis and filtering strategies. Its core objective is to improve the load-bearing capacity and material utilization efficiency of structures under variable loads, and it is suitable for structural design and optimization scenarios in the manufacturing and construction industries. In contrast, this patent focuses on topology optimization of irregular three-dimensional models, aiming to achieve structural lightweighting and performance optimization through deep learning and physical information-driven methods. Its core objective is to generate optimized structures that can be directly used for 3D printing, and it is suitable for personalized customization, complex component design, and additive manufacturing. The optimization objects and application scenarios of the two are significantly different.

[0008] 2. The core mechanism of patent CN115344986A is worst-case load solution + density field iterative update. It first accelerates the solution of eigenvalue problems through multigrid method to obtain worst-case load distribution and displacement field, and then gradually updates voxel density variables based on sensitivity analysis and filtering strategy. Finally, it achieves gradual optimization of material distribution under volume constraints, which belongs to the traditional structural optimization path based on numerical calculation and iterative optimization. In contrast, the core mechanism of this patent is dual neural network cross-training + connectivity optimization. Through the collaborative training of displacement prediction network and density prediction network, combined with physical information loss function and graph clustering connectivity analysis, it achieves physical rationality and no island effect in topology optimization results. It belongs to the intelligent optimization path based on the integration of artificial intelligence and physical laws. The optimization methods and implementation mechanisms of the two are fundamentally different.

[0009] 3. In the algorithm function of patent CN115344986A, the multigrid method and the power method are mainly used to efficiently solve the inverse and eigenvalue problems of large-scale stiffness matrices, focusing on improving computational efficiency and engineering feasibility, without involving learning and adaptive capabilities; while the displacement prediction network and density prediction network of this patent contain physical information neural network and graph neural network technology, respectively, which can learn physical laws and realize intelligent generation and connectivity guarantee of structural topology, and have stronger generalization ability and adaptability to complex structures. The technical level and intelligence level of the two are significantly different.

[0010] 4. The optimization process of patent CN115344986A is an iterative numerical optimization, whose convergence speed depends on the mesh size and load complexity, and the results are limited by the initial parameters and iteration strategy. In contrast, this patent adopts an end-to-end neural network training and output mechanism, and the optimization results can be directly converted into manufacturable 3D model files, supporting rapid generation and real-time adjustment. It has advantages in response speed and result availability, and is especially suitable for application scenarios that require rapid iteration and customized production. Summary of the Invention

[0011] This application provides a topology optimization method for irregular 3D models, addressing the problems in related technologies where topology optimization of irregular 3D models requires specialized software and time-consuming processes, and the optimization results suffer from islanding effects. The improved 3D model obtained using this method can be directly printed using 3D printing equipment, ultimately yielding a physical object corresponding to the topology optimization result.

[0012] To achieve the above objectives, the present invention adopts the following technical solution:

[0013] A topology optimization method for irregular 3D models includes: importing the object to be optimized in a 3D file format; converting it into a mask matrix that marks whether each voxel in a stacked cubic voxel block is inside the model using a ray-scanning method and obtaining key information such as the voxel center coordinates; pre-training a displacement prediction neural network by randomly sampling the coordinates of the voxels inside the model; establishing a loss function based on a physical information neural network and the minimum potential energy theorem; introducing a penalty function and combining it with hard displacement constraints to achieve displacement fixation constraints; cross-training a density prediction neural network and a displacement prediction neural network; the loss function of the density prediction neural network follows the principle of compliance minimization; and simultaneously performing connectivity analysis on the density prediction results to reduce or even eliminate the islanding effect, thereby obtaining the topology optimization result; converting the topology optimization result in the form of a voxel stack into a mesh format and storing it as an STL file for 3D printing to obtain a physical object.

[0014] Furthermore, when importing the object to be optimized, the ray-mapping method is used to calculate the number of triangular faces traversed in parallel to determine whether the voxel center is inside the 3D model. A mask matrix is ​​constructed to mark whether voxels are inside the model, with the number of axes equal to or greater than the number of voxels. At the same time, the coordinates of the center points of each voxel are calculated using the model's longest axis as a scaling factor. Specific methods include:

[0015] The mesh data storing the irregular 3D model was read from the 3D file. The cube coordinates that just encompass the 3D model were obtained from the upper and lower limits of the three-axis coordinates. The cube was divided into a 3D voxel mesh composed of cubes according to the Z-axis finite element number and length-width-height ratio specified by the hyperparameter.

[0016] The ray-scanning method is applied in parallel to penetrate the model along the x, y, and z axes. The number of triangular facets traversed by the ray is calculated, and a mask matrix equal to or larger than the three-dimensional voxel mesh is obtained to determine whether each voxel is inside the model. The voxel is confirmed to be inside the model if at least two of the three axes indicate that it is inside the model.

[0017] Based on the mask matrix and the number of voxels along the three axes, we assume that the longest axis of the original model is a unit of 1, and then calculate a series of parameters for subsequent use. For example, we calculate the actual volume of the model by combining the number of voxels with a Boolean value of True in the mask matrix, calculate the actual size of each cube voxel based on the number of voxels along the longest axis, and derive the center coordinates of each voxel in the model from the actual size.

[0018] Furthermore, during the pre-training of the displacement prediction neural network, the loss function includes the potential energy obtained by subtracting the work done by the external force from the model's strain energy, and the strain energy amplified by the stiffness coefficient of the displacement-fixed constraint region, which serves as the penalty function. Both are jointly optimized by introducing a neural tangent kernel to achieve multi-scale loss function optimization. In addition, in the early stage of pre-training, to ensure that the penalty function does not become too large, some hard displacement constraints are retained and the displacement prediction results of voxels in the displacement-fixed region are directly reduced. The specific method includes: based on the previously obtained voxel center coordinates in the model, randomly sampling the batch size, adding perturbations within the range of positive and negative half voxel widths in the three axes, and substituting them into the displacement prediction neural network model. The displacement prediction neural network contains a Fourier feature expansion layer with fixed parameters and a fully connected layer to be trained.

[0019] The displacement prediction neural network obtains the triaxial displacement of each sampling point, calculates the partial derivative of the displacement with respect to each axis coordinate, constructs the strain matrix, and calculates the strain energy of the model by combining Poisson's ratio and stiffness coefficient. In the pre-training, the voxel density of all input points is set to 0.5 for density penalty, which is the voxel energy multiplied by the cube of the density. The strain energy is subtracted from the external force work obtained by multiplying the magnitude of the force at the force point by the displacement to obtain the model potential energy. Based on the minimum potential energy theorem, the model potential energy is used as the loss function of the physical information neural network.

[0020] For voxels in the fixed displacement constraint region, the prediction results are first forced to zero through hard displacement constraints at the beginning of training. Then, the prediction results are gradually retained as the number of iterations increases. At the same time, the method of introducing a penalty function is used to approximate the strain energy generated by the voxels in the fixed displacement region. The influence is amplified by the stiffness coefficient and substituted into the loss function that includes potential energy to participate in the iteration to reduce the displacement in the fixed region. By introducing a neural tangent kernel as a scaling factor, the multi-scale loss function is optimized together.

[0021] Furthermore, during cross-training of the displacement prediction neural network and the density prediction neural network, the density used for density penalty in the displacement prediction neural network is updated accordingly. The calculated strain energy is converted into compliance and used as part of the loss function of the density prediction neural network during training. During iteration, the density prediction neural network performs connectivity analysis, constructs a voxel adjacency graph based on voxel coordinates and dimensions, and finds the maximum connected component based on the graph neural network correlation function. The voxel densities of connected components and disconnected voxels are processed and incorporated into the loss function to promote density binarization while suppressing or even eliminating islanding effects. Specifically, following the same random sampling point generation method, each iteration of the density prediction neural network is accompanied by 20 iterations of the displacement prediction neural network. The overall process of the displacement prediction neural network remains unchanged, but the density used for density penalty when calculating strain energy using sampling points is derived from the update of the density prediction neural network. The density prediction neural network is structurally similar to the density prediction neural network, except that a sigmoid activation function is added at the end to obtain the normalized voxel density. Its loss function is based on minimizing compliance and the difference between the current volume fraction and the target volume fraction, while the compliance is derived from twice the strain energy calculated by the displacement prediction neural network.

[0022] By introducing connectivity analysis, the current coordinates of some high-density voxels are recorded. Connected edges are constructed according to voxel size to detect adjacent voxels. Graph clustering and graph neural network correlation functions are used to detect the largest connected component, and the largest connected object among the currently retained high-density voxels is determined. The difference between the mean density of connected voxels and unit 1 is calculated, and then the mean density of the remaining voxels is calculated. Adding the above two to the loss function of the density prediction neural network can effectively reduce the islanding effect and promote density binarization. Since the proportion of high-density voxels participating in the detection gradually approaches the target volume fraction, this method can also promote the volume fraction to reach the target value. In addition, the proportion of connected voxels added outside the training conditions of the density prediction neural network must reach 98% or more to ensure that islands are effectively removed.

[0023] In the final testing phase, to obtain the topology optimization results, the center coordinates of all voxels within the model were substituted into the density prediction neural network. During connectivity detection, voxels outside the largest connected component were directly pruned, and the density of all connected voxels was set to 1 to ensure the accuracy of density prediction. Then, the density prediction results and voxel center coordinates were substituted into the displacement prediction neural network to calculate displacement and strain energy. For regions with fixed displacement constraints, hard displacement constraints were directly applied to prune minute displacements to ensure the accuracy of displacement prediction, thereby ensuring the accuracy of the compliance calculation of the optimization results.

[0024] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages:

[0025] 1. More widely applicable

[0026] This application utilizes deep learning to perform topology optimization on irregular 3D models, supporting 3D models in any 3D file format.

[0027] 2. Voxel-preserved gradients in fixed displacement regions participate in neural networks.

[0028] Common approaches use hard displacement constraints to directly truncate voxel displacements within a region, which may result in the removal of voxels from all regions. This approach, however, designs a method that combines a penalty function with hard displacement constraints. The penalty function suppresses the prediction of fixed displacement regions, but gradient calculations can be performed to ensure the backpropagation of voxel energy gradients. Whether voxels in fixed regions are retained no longer depends on randomness.

[0029] 3. Eliminate the island effect

[0030] Islanding effects frequently occur in topology optimization, where voxels occupy a volume fraction but have no impact on physical properties. This solution proposes to detect the connectivity between voxels based on graph neural networks and graph clustering correlation functions. During training, voxels acting as islands are suppressed as much as possible in the form of a loss function. During testing, a small number of island voxels are directly pruned to ensure that islanding effects no longer exist in the topology optimization solution. Attached Figure Description

[0031] Figure 1 This is a flowchart outlining the overall methodology of the solution.

[0032] Figure 2 Import flowcharts for irregular 3D models;

[0033] Figure 3 Flowchart for pre-training a displacement prediction neural network;

[0034] Figure 4 The flowchart shows the process of obtaining optimized results through cross-training of displacement prediction neural networks and density prediction neural networks. Detailed Implementation

[0035] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. The specific implementation methods of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0036] like Figure 1 As shown, the irregular three-dimensional model topology optimization method provided in this embodiment can be mainly divided into four steps: importing the irregular three-dimensional model, pre-training the displacement prediction neural network, cross-training the displacement prediction neural network and the density prediction neural network to obtain the optimization result, format conversion of the optimization result and model printing.

[0037] The import stage for irregular 3D models targets 3D files, such as... Figure 2 As shown, firstly, we read the mesh data storing the irregular 3D model from a 3D file (e.g., an STL file). This data includes the vertex coordinates of the triangular facets and the vertex indices that make up the triangular facets. From the upper and lower limits of the three-axis coordinates, we obtain the cube coordinates that perfectly encompass the 3D model. Based on the Z-axis finite element number and aspect ratio specified by the hyperparameters, this cube is divided into a 3D voxel mesh composed of cubes. Then, we apply a ray-scanning method in parallel computation along the x, y, and z axes, traversing the model and calculating the number of triangular facets the rays pass through. This yields a mask matrix equal to or larger than the 3D voxel mesh, indicating whether each voxel is inside the model. A voxel is confirmed to be inside the model if at least two of the three axes indicate it is. Finally, based on this mask matrix and the number of voxels along the three axes, assuming the longest axis of the original model is a unit of 1, we calculate a series of parameters for subsequent calls. For example, we calculate the actual volume of the model using the number of voxels with a Boolean value of True in the mask matrix, calculate the actual size of each cube voxel based on the number of voxels along the longest axis, and derive the center coordinates of each voxel within the model from the actual size.

[0038] To support this, we need to design specific methods for random coordinate sampling, fixed-displacement voxel localization, and force-induced voxel localization. For random coordinate sampling, based on the center coordinates of all voxels calculated during the previous 3D model-to-voxel model conversion, we add perturbation values ​​of positive and negative half-voxel widths to each of the three axes to obtain randomly distributed coordinates that can be uniformly sampled within each voxel. During training, the batch size is set to a fixed multiple of the number of voxels in the model. This batch consists of two parts: one part consists of repeated force points and displacement constraint points (rounded down multiple times), and the other part consists of randomly selecting the remaining required number of points from the obtained coordinates through multiple executions of the above-mentioned random coordinate sampling (rounded up multiple times). Finally, the fixed-point coordinates and random-point coordinates are concatenated and then shuffled. For fixed-displacement voxel localization, we choose to use a rectangular selection method to delineate the displacement constraint region. Specifically, we designed three hyperparameters. The first hyperparameter inputs the triaxial normalized coordinates and the triaxial voxel count to determine the starting voxel position. The second hyperparameter determines the positive and negative directions of the bounding box along the triaxial axes. The third hyperparameter determines the number of voxels the bounding box spans. We obtain the coordinates of all voxels within the bounding box in a grid format and then fuse them with the previously imported model mask matrix to obtain the indices of all model voxels within the rectangular area to be fixed. For the location of the force-bearing voxels, after multiplying the triaxial normalized coordinates input by the triaxial voxel count to obtain the force-bearing voxel coordinates, we additionally need to check the corresponding Boolean value of the voxel in the imported 3D model mask matrix, i.e., determine whether the voxel is within the irregular model. When the voxel is outside the irregular model, we calculate the Euclidean distance between the voxel and the voxel within the model, and select the voxel with the smallest distance as the force-bearing point.

[0039] like Figure 3 As shown, in the pre-training part of the displacement prediction neural network, we use the previously mentioned random coordinate sampling method to obtain sampling points and substitute them into the displacement prediction neural network model. The displacement prediction neural network contains a Fourier feature expansion layer with fixed parameters and a fully connected layer to be trained. The neural network outputs the three-axis displacement of the sampling points and calculates the partial derivatives of the displacement with respect to each axis coordinate. For example, the partial derivative of the predicted displacement along the x-axis with respect to the x-coordinate. Construct the strain matrix Based on Poisson's ratio and stiffness coefficient Calculate Lamé constant and We can obtain:

[0040] ;

[0041] Then, follow the formula Calculate strain, where the Kronecker product... Then substitute it into the strain energy density calculation formula. The strain energy density is obtained. as follows:

[0042] ;

[0043] Considering the solid isotropic material penalty (SIMP), the calculated strain energy density of each voxel is multiplied by the voxel density. The cube of the above. Considering that the above result is the strain energy density and the batch size is not equal to the actual number of voxels, the mean strain energy density is multiplied by the actual volume. Note that calculating the actual volume for irregular models requires combining the 3D model mask matrix, i.e., the percentage of voxels within the actual model relative to the primes of the outer cube. The external force work is calculated directly using force... Multiply by displacement The potential energy is obtained by subtracting the work done by the external force from the strain energy. Considering the minimum potential energy theorem, this potential energy is used as the loss function. The optimization of the displacement prediction neural network is facilitated by the following formula:

[0044] ;

[0045] Based on this, for voxels in a fixed displacement constraint region, we designed a method that combines a penalty function with hard displacement constraints to control the displacement of points in the fixed displacement region, further improving the loss function of the above displacement prediction neural network.

[0046] First, we still need to determine which voxels in the sampled batch belong to the fixed region. This part of the function requires combining the displacement fixed region voxel localization method mentioned earlier, and obtaining the upper and lower limits of the fixed region's coordinates based on three hyperparameters. The sampled coordinates are subtracted from the upper and lower limits and compared with 0, so that the coordinates within the region return a value of 0, and the coordinates outside the region return a negative value, and then substituted into the formula. Scaling can further convert it into a mask matrix corresponding to the Boolean value distribution of the sampling points, or it can be directly used as a scaling factor for hard displacement constraints.

[0047] Then, regarding the displacement of voxels within the region We use the formula To approximate the strain energy density and further reduce the resulting displacement, the stiffness coefficient is substituted here. The stiffness coefficient E is set to be 100 times the value of the object to be optimized. Note that SIMP must also be followed here, with energy multiplied by the corresponding voxel density. The cube of . Next, in order to make its order of magnitude independent of the current batch size and to map its dimensions to the previous strain energy, we calculate the mean of the strain energy density in the fixed region. Multiply by the proportion of voxels in a fixed region to the total number of primes in the object to be optimized. Then multiply by the actual volume V of the original model.

[0048] To address the issue of multi-scale interactions between different terms in the PINN loss function and the resulting instability in gradient descent, we introduce a ratio between the neural tangent kernels. As a penalty term coefficient. Specifically, we use the predicted displacement... Regarding coordinates The derivative is used to construct the Jacobian matrix J. NTK is defined as the Jacobian matrix multiplied by its transpose. The trace of NTK is used as the scaling factor, and the ratio between the trace of NTK at non-fixed region points and the trace of NTK at fixed region points is the scaling factor. We use the subscript f to mark points in fixed regions and the subscript uf to mark points in non-fixed regions. Representing three-axis coordinates, the formula is:

[0049] ;

[0050] However, calculating the complete Jacobian matrix requires a lot of time and memory. Therefore, we introduced the Hutchinson approximation to approximate a subset of random sampling points. To make the random sampling effect more stable, we introduced the exponential moving average (EMA), which uses 90% of the previous trace and combines it with 10% of the current trace.

[0051] To address the issues of randomness in displacement prediction within a fixed region during the initial training phase, and the excessively large stiffness coefficient leading to the penalty term dominating the loss function, we choose to retain some hard displacement constraints in the initial training phase. This means scaling the predicted displacements within the fixed region during the early training stages. We set the normalization ratio for the training process as follows: The previously obtained hard displacement constraint scaling factor is ds, and the function that takes the larger value is max. Then, the scaling formula is used for the predicted displacement u:

[0052] ;

[0053] In summary, we obtain the loss function in the complete displacement prediction neural network as follows:

[0054] :

[0055] The optimization result obtained through cross-training of the displacement prediction neural network and the density prediction neural network also follows the aforementioned random sampling point generation method. Each iteration of the density prediction neural network is accompanied by 20 iterations of the displacement prediction neural network. The overall training process of the displacement prediction neural network is similar to that of the pre-training process; however, the density used for density penalty in calculating strain energy is derived from the updates of the density prediction neural network. The density prediction neural network is structurally similar to the density prediction neural network, except that a sigmoid activation function is added at the end to obtain the normalized voxel density. Its loss function is based on minimizing compliance and the difference between the current volume fraction and the target volume fraction, with compliance derived from twice the strain energy calculated by the displacement prediction neural network.

[0056] Based on this, we designed a connectivity analysis method based on graph neural networks and graph clustering correlation functions to reduce or even eliminate the islanding effect. Similarly, it is necessary to improve the loss function of the density prediction neural network.

[0057] Specifically, such as Figure 4 As shown, firstly, we substitute the voxel center points into the density prediction neural network to obtain the current density distribution, and then select some high-density voxels to record their coordinates. Next, using the maximum width of the voxel's three axes as the radius, we use the `torch_cluster.radius_graph` function to generate connected edges between voxels, comparing the differences in the three-axis coordinates and the voxel's three-axis width to retain effective connected edges. Then, we substitute the coordinates and connected edges into `torch_geometric.data.Data` to construct the graph structure, and use `torch_geometric.transforms.LargestConnectedComponents` to obtain the largest connected component, thus obtaining the main body of the model composed of the high-density points to be retained in the voxels. Finally, for voxels outside the main structure, we calculate their mean density and add this part to the loss function to reduce the density of isolated voxels; for the main structure, we calculate the mean density minus 1, and adding this part to the loss function also effectively helps in the binarization of the predicted density.

[0058] Since the voxel density predicted in the initial stage is relatively random, the change in the loss function brought about by connectivity analysis may cause oscillations in the early stage of model training. Therefore, we set the connectivity analysis to be performed only after the density prediction neural network has iterated for 5% of the time.

[0059] To address the need to retain more high-density voxels in the early stages to increase optimization possibilities, we adjusted the proportion of high-density voxels extracted based on the following formula:

[0060] ;

[0061] in The proportion of high-density points extracted. For the target volume fraction, The maximum value is set to a larger proportion of the number of iterations in the density prediction neural network. Thirdly, a margin is set for the voxel spacing threshold. When the connected spacing threshold is exactly equal to the voxel's three-axis width, errors in judgment are inevitable due to rounding of decimal precision. Therefore, the threshold is uniformly set to 1.02 times the voxel's three-axis width.

[0062] Therefore, after incorporating connectivity analysis to eliminate the islanding effect, the loss function for training the density prediction neural network is as follows:

[0063] ;

[0064] Where c is the compliance corresponding to the density prediction result. Based on the minimum potential energy theorem, the compliance is approximately twice the strain energy calculated after substituting it into the displacement prediction neural network. This refers to the compliance after the initial density prediction, and its purpose here is to adjust the dimensions of compliance for different optimization targets. v is the volume fraction after the current density prediction, derived from the mean of the predicted voxel densities. This refers to the target volume fraction, which varies depending on the model, and the scaling factor. The importance of volume fraction accuracy increases with the number of iterations; hyperparameters , To predict the current iteration number of the density-based neural network, the min value is set to a smaller value. and These refer to the voxel density in the largest connected component and the voxel density in the non-connected component, respectively, with mean being the average value.

[0065] In addition, considering that different optimization objects have different convergence speeds in neural networks, we used a while loop in the training process. Only when the proportion of connected voxels exceeds 98% in the hyperparameter interval during the training iterations will we exit the training loop and enter the testing phase.

[0066] In the final testing phase, to obtain the topology optimization results, we substituted the center coordinates of all voxels within the model into the density prediction neural network. During connectivity detection, we directly pruned voxels outside the largest connected component and set the density of all connected voxels to 1 to ensure the accuracy of density prediction. Then, we substituted the density prediction results and voxel center coordinates into the displacement prediction neural network to calculate displacement and strain energy. For regions with fixed displacement constraints, we directly applied hard displacement constraints to prune minute displacements to ensure the accuracy of displacement prediction, thereby ensuring the accuracy of the compliance calculation of the optimization results.

[0067] For the format conversion and model printing of the optimization results, based on the topology optimization results in the form of voxel stacking provided above, we used library functions in skimage.measure and pyvista to convert the voxel distribution into a mesh and visualize it. To obtain a more accurate mesh, we iterated the level parameter of the skimage.measure.marching_cubes function using a bisection method until the error between the volume fraction after conversion and the target volume fraction was less than 10%. Finally, the mesh data stored in pyvista.PolyData can be directly converted into an STL file using the save function, which can then be used in slicing software to generate a Gcode file for 3D printing to obtain a physical model.

[0068] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.

Claims

1. A method for topology optimization of irregular three-dimensional models, characterized in that, include: S1. Import the object to be optimized in a 3D model file format, convert it into a mask matrix using the ray scanning method, and obtain the coordinates of the voxel centers within the model. S2. Pre-train the displacement prediction neural network by substituting randomly sampled coordinates of voxels inside the model into the displacement prediction neural network. Establish a loss function based on the physical information neural network and the minimum potential energy theorem, introduce a penalty function and combine it with hard displacement constraints to realize displacement fixed constraints. S3. Density prediction neural network and displacement prediction neural network are cross-trained. The loss function of density prediction neural network follows the minimum potential energy theorem. At the same time, connectivity analysis is performed on density prediction results to reduce or even eliminate the island effect and obtain optimized results.

2. The method for topology optimization of an irregular three-dimensional model according to claim 1, characterized in that, The step S1, which converts the 3D model file into a mask matrix using the ray scanning method, specifically includes the following methods: S11. Read the mesh data of the irregular three-dimensional model stored in the three-dimensional model file, obtain the cube coordinates from the upper and lower limits of the three-axis coordinates, and divide the cube into a three-dimensional voxel mesh composed of cubes according to the Z-axis finite element number and length-width-height ratio specified by the hyperparameter. S12. Using the ray scanning method, the model is traversed along the x, y, and z axes in parallel computing. The number of triangular facets traversed by the ray is calculated, and the shape of each voxel is obtained as a mask matrix of the three-dimensional voxel mesh to determine whether it is inside the model. If at least two of the three axes determine that the voxel belongs to the model, it is determined that the voxel is inside the model. 3.S13. Based on the mask matrix and the three-axis prime number, calculate the parameters that are convenient for subsequent calls.

4. The method for topology optimization of an irregular three-dimensional model according to claim 2, characterized in that, Step S2 specifically includes: S21. Based on the voxel center coordinates obtained in step S1, randomly sample the batch size, add perturbations within the range of positive and negative half voxel widths in the three axes, and substitute them into the displacement prediction neural network model. The displacement prediction neural network contains a Fourier feature expansion layer with fixed parameters and a fully connected layer to be trained. S22. The displacement prediction neural network obtains the triaxial displacement of each sampling point, calculates the partial derivative of the displacement with respect to each axis coordinate, constructs the strain matrix, and calculates the strain energy of the model by combining Poisson's ratio and stiffness coefficient. In the pre-training, the voxel density of all input points is set to 0.5 for density penalty, that is, the voxel energy is multiplied by the cube of the density. The strain energy is subtracted from the external force work obtained by multiplying the magnitude of the force at the force point by the displacement to obtain the model potential energy. Based on the minimum potential energy theorem, the model potential energy is used as the loss function of the physical information neural network. S23. For voxels in the fixed displacement constraint region, the prediction results are first forced to zero through hard displacement constraints at the beginning of training. Then, the prediction results are gradually retained as the number of iterations increases. At the same time, the method of penalty function is introduced to approximate the strain energy generated by voxels in the fixed displacement region separately. The influence is amplified by stiffness coefficient and substituted into the loss function containing potential energy to participate in the iteration to reduce the displacement of the fixed region. The neural tangent kernel is introduced as a scaling factor to optimize the multi-scale loss function together.

5. The method for topology optimization of an irregular three-dimensional model according to claim 3, characterized in that, Step S3 specifically includes: S31. Following the random sampling point generation method in step S21, each iteration of the density prediction neural network is accompanied by 20 iterations of the displacement prediction neural network. The overall process of the displacement prediction neural network remains unchanged, but the density used for density penalty when calculating strain energy using the sampling points comes from the update of the density prediction neural network; of The loss function is based on compliance minimization and the difference between the current volume fraction and the target volume fraction. The compliance is derived from twice the strain energy calculated by the displacement prediction neural network. S32. Introduce connectivity analysis, record the current coordinates of some high-density voxels, construct connected edges according to voxel size to detect adjacent voxels, use graph clustering and graph neural network correlation functions to detect the maximum connected component, determine the largest connected object among the currently retained high-density voxels, calculate the difference between the density mean of connected voxels and unit 1, and then calculate the density mean of the remaining voxels. Add the above two to the loss function of the density prediction neural network to weaken the island effect and promote density binarization. S33. Substitute the center coordinates of all voxels in the model into the density prediction neural network. In the connectivity detection, directly prune the voxels outside the largest connected component and set the density of all connected voxels to 1. Then, substitute the density prediction results and voxel center coordinates into the displacement prediction neural network to calculate the displacement and strain energy. For the displacement fixed constraint region, directly use hard displacement constraints to prune the micro-displacement to ensure the accuracy of displacement prediction, thereby ensuring the accuracy of the compliance calculation of the optimization result.

Citation Information

Patent Citations

  • Device and method for improving strength of three-dimensional structure

    CN115344986A