## Abstract

This paper proposes a new parametric level set method for topology optimization based on deep neural network (DNN). In this method, the fully connected DNN is incorporated into the conventional level set methods to construct an effective approach for structural topology optimization. The implicit function of level set is described by fully connected DNNs. A DNN-based level set optimization method is proposed, where the Hamilton–Jacobi partial differential equations (PDEs) are transformed into parametrized ordinary differential equations (ODEs). The zero-level set of implicit function is updated through updating the weights and biases of networks. The parametrized reinitialization is applied periodically to prevent the implicit function from being too steep or too flat in the vicinity of its zero-level set. The proposed method is implemented in the framework of minimum compliance, which is a well-known benchmark for topology optimization. In practice, designers desire to have multiple design options, where they can choose a better conceptual design base on their design experience. One of the major advantages of the DNN-based level set method is capable to generate diverse and competitive designs with different network architectures. Several numerical examples are presented to verify the effectiveness of the proposed DNN-based level set method.

## 1 Introduction

Topology optimization has experienced great attention and development in recent years in that it searches for the optimal material layout in a design domain with gradient-based algorithm. The first homogenization-based topology optimization method proposed by Bendsoe and Sigmund is published in 1988 [1]. The research on topology optimization experienced a boost in the past two decades [2]. A solid isotropic material with penalization (SIMP) method [3] is widely used in engineering because of effectiveness and simplicity. For the SIMP method, the artificial density is applied to describe the material layout distribution, and optimal design is achieved through gradient-based optimization algorithm. However, the intermediate density may exist in optimal design, which blurs the boundaries, and post-processing techniques are needed to remove gray area. In fact, it is hard for the standard density-based method to eliminate intermediate density during optimization [4]. Based on the standard density-based method, several advanced schemes are proposed in recent years to achieve feature control, robust design, and length scale control [5–17], which are able to alleviate such phenomenon using various projection methods. Some other robust formulations [18–21] are also proposed in recent years to ensure manufacturability. In general, the post-processing techniques are needed to obtain a clear-boundary optimal design, while the performance of original optimal design may degenerate compared with the post-processed design.

Compared with the SIMP method, the level set method is a “moving boundary” approach which evolves the boundaries of design in optimization with distinct boundaries [22]. In the beginning, Osher and Sethian [23] proposed the level set method to tackle the fronts of moving fluid. Level set methods represent the design boundaries using the zero-level set of an implicit function, and shape sensitivity analysis is implemented to compute the velocity field, which is incorporated into the Hamilton–Jacobi partial differential equation (PDE) to evolve the level set function. Osher and Santosa [24] proposed a level set method for design optimization problems based on the projected gradient approach. This work is further developed by Allaire et al. [25] and Wang et al. [26]. Allaire et al. [25] proposed a numerical method based on a combination of shape derivative and level set method for front propagation, where the weight and perimeter constrains are considered as objective functions. Wang et al. [26] used a scalar function of a higher dimension to represent the structural boundary with the level set model, where a link between the velocity field and structural sensitivity analysis is identified. Compared with a conventional level set method, several parametrized level set methods are proposed in recent years. Wang and Wang [27] incorporated radial basis functions (RBFs) into the conventional level set method to construct a more efficient approach for topology optimization. An RBF-level set optimization method is proposed to transform the Hamilton–Jacobi PDE to parameterized ordinary differential equations (ODEs), and the level set function is updated through updating the expansion coefficients. Wei and Wang [28] proposed a piecewise constant level set (PCLS) method to resolve the shape and topology optimization problem, where the boundary is described by the PCLS functions. Jiang et al. [29] applied a cardinal basis function to parameterize the level set function with a unity collocation method, where a distance regularization energy functional is introduced to maintain the desired signed distance property in optimization. Recently, Guo et al. [30] and Zhang et al. [31] proposed a new computational framework named moving morphable component (MMC), which embedded the MMCs into level set scheme. This computational scheme incorporates geometry and mechanical information into topology optimization in an explicit way and the structural complexity can be easily controlled in an explicit way. Another method called the moving morphable voids was also proposed by Zhang et al. [32,33], which introduced a set of geometry parameters to describe the boundary of the structure in an explicit way. In recent years, several other advanced parametrized level set methods are proposed as described in Ref. [34]. Luo et al. [35] proposed an efficient non-gradient approach for topology optimization without any sensitivity information. In his method, the material-field series expansion is applied to parametrize the geometry information, which achieves a considerable reduction of design variables, and the kriging-based optimization algorithm is implemented to resolve optimization problem based on the surrogate model.

Machine learning [36] has experienced a huge increase in research interest in the past decade, since it is a powerful tool for constructing the relationship between the input and output sampling data. With the dramatic growth of available data and development of new methods, machine learning has revolutionized our understanding of physical world such as image recognition [37], drug discovery [38], etc. Several successfully applications to physical problems can be found in recent years. Raissi et al. [39] proposed physics-informed neural networks (PINNs) for solving PDEs. In his method, PINNs are trained to solve supervised learning tasks, which are constrained by given laws of physics. Based on this concept, several advanced machine learning-based methods for solving PDEs [40–43] are proposed recently for forward and inverse PDE-based problems. Recent years have also witnessed several studies applying machine learning methods to resolve topology optimization problems. Yu et al. [44] proposed a novel deep learning-based method to predict optimal design with a given boundary conditions without any iterative scheme. Lei et al. [45] proposed a method to achieve real-time structural topology optimization based on a machine learning method. His method combined MMC-based explicit framework with supported vector regression to establish a mapping between design parameters and optimal designs. Oh et al. [46] proposed a framework integrating topology optimization and generative models (generative adversarial networks) in an iterative way to generate new designs. As described in Ref. [47], deep neural networks (DNNs) are applied to represent shape’s boundary with zero-level-set of the learned function, which can represent an entire class of shapes and thus the model size can be reduced by an order of magnitude compared with existing works. In the computational framework of the parametrized level set method, a deep learning-based parameterized level set method is proposed in this paper to achieve topology optimization. The core of the current work is to incorporate DNNs into the present level-set-based topology optimization method. The implicit function is described by deep feedforward neural networks (NNs). Thus, the sufficient smoothness and continuity of implicit function can be guaranteed.

At present, most topology optimization algorithms aim at finding optimal material layout which can minimize or maximize the objective function. In practice, the designers desire to generate multiple solutions that are diverse and competitive enough so that they can make a choice based on their experience from the aesthetic perspective or other functional requirements. Wang et al. [48] achieve diverse and competitive designs by incorporating graphic diversity constraints, which is in the framework of the SIMP method. Based on different penalty methods, Yang et al. [49] present five simple and effective strategies to achieve multiple solutions, where these strategies are demonstrated to provide the designer with structurally efficient and topologically different solutions. Recently, He et al. [50] proposed three stochastic approaches to generate diverse and competitive designs in the framework of bi-directional evolutionary structural optimization, where a series of random designs are produced with distinctly different topologies. Oh et al. [46] proposed an artificial intelligent-based deep generative design framework which is able to generate numerous design options. For the level set method, rare literatures are found in this field. Here, we proposed a DNN-based level set method to effectively generate diverse and competitive designs with high structural performance.

The paper is organized as follows. In Sec. 2, the implicit modeling based on DNN is presented. Section 3 describes the DNN level set topology optimization formulation in detail. In Sec. 4, numerical examples are shown to illustrate the effectiveness of the proposed parameterized level set method, followed by conclusions in Sec. 5.

## 2 Deep Neural Networks Implicit Modeling

**is the parameter of network. The hidden layer is defined as**

*θ*

*h*^{(l)}(

**), and a network with**

*x**L*hidden layers can be expressed as, where

*a*^{(l)}(

**) is a linear operation,**

*x*

*W*^{(l)}is the weight matrix and

*b*^{(l)}is the bias vector for the

*l*th layer. The weight matrix

*W*^{(l)}(

**= 1, 2, …,**

*l***) and bias**

*L*

*b*^{(l)}(

**= 1, 2, …,**

*l***) can be combined into a single parameter**

*L***.**

*θ*

*h*^{(l)}(

**= 1, 2, …,**

*l***) are hidden layer activation functions (kernel functions).**

*L**x*,

*y*) denotes the coordinate of point. The backpropagation learning algorithm [54] is applied here to train the NNs. The activation function is chosen as hyperbolic tangent function. Each layer of network contains eight neurons. The target implicit function is plotted in Fig. 2. The training results of the plate with five circle holes inside using three different architectures are presented in Fig. 3. Note that for network with one hidden layer, the trained shape cannot achieve high fidelity as shown in Fig. 3(a), while the better shape training result can be found in Fig. 3(c) for network with three hidden layers.

## 3 Deep Neural Network Level Set Method for Structural Topology Optimization

### 3.1 Conventional Level Set-Based Topology Optimization.

The conventional level set method uses a zero contour (2D) or isosurface (3D) to represent the boundaries of geometry, which is introduced by Osher and Sethian [23] to simulate the motion of dynamic interfaces. The interface is described by the zero-level set of implicit function Φ(** x**), which is Lipschitz-continuous in design domain. In this paper, the level set function Φ(

*x*) is defined as

*D*is the design domain, Ω represents all admissible shapes, ∂Ω denotes the boundary of shape, and

*t*is the pseudo time [25] of shape dynamic evolution. The Hamilton–Jacobi PDE can be obtained through differentiating the zero-level set with respect to pseudo time

*t*as follows:

*V*

_{n}is the normal velocity computed through sensitivity analysis. The shape of zero-level set evolves along the gradient direction through solving the above Hamilton–Jacobi equation. This equation can be resolved using upwind schemes, where a reinitialization procedure is needed as an auxiliary step to avoid the implicit function becoming too flat or steep in the vicinity of its zero-level set. In this paper, the objective is chosen as minimizing structural compliance

*J*(Φ), which can be formulated as follows:

**is the displacement and**

*u***(**

*ɛ***) is the strain.**

*u**H*(·) denotes the Heaviside step function.

**is the elastic tensor. Γ**

*C*_{u}and $\Gamma \tau $ denote the displacement and force boundary, respectively. Note that the test function

**should belong to the prescribed displacement on Dirichlet boundary.**

*ν***and**

*τ***denote the traction at boundary and body force in the domain, respectively.**

*b**a*(

**,**

*u***, Φ) is the energy bilinear form and**

*v**l*(

*v*, Φ) is the load linear form.

**is a virtual displacement field. The operator (:) denotes tensor contraction. For Heaviside step function, it equals zero in the void area and one in the solid area. In practice, the step Heaviside function is approximated by a smooth function to ensure the differentiable in the transition area. The smoothed Heaviside function can be formulated as follows:**

*v*The *δ* is a small value, and Δ denotes the half of the transition width. Detailed mathematical properties of the smoothed Heaviside function can be found in Ref. [26].

### 3.2 Deep Neural Network Level Set Optimization Method.

*x*) is updated through solving Hamilton–Jacobi equations to obtain the optimal topology. In this paper, DNN implicit modeling is applied to represent implicit function Φ(

*x*), where the evolution of Φ(

*x*) is equivalent to updating the parameters of networks. As mentioned in Sec. 3.1, the implicit function represented by the time-dependent NNs can be expressed as

*x*,

*y*,

**)/∂**

*θ***is applied to obtain the least-squares solution of the above system. Note that the term ∂ℕ(**

*θ**x*,

*y*,

**)/∂**

*θ***is computed through automatic differential tool CasADi [55].**

*θ*In Eq. (14), the DNN coefficients are time-dependent, where the initial value of DNN can be obtained through back propagation (BP) training. Therefore, a PDE problem is transformed into the ODE problem. It is worth to mention that the derivative information of DNN with respect to its parameter or input is ready to be obtained through graph-based automatic differentiation. To obtain high accuracy and stable solutions, Eq. (14) is solved by a Runge–Kutta–Fehlberg (RKF45) method [56], which is recommended by Ref. [57]. An RKF45 method is able to determine if the proper step size is being used, where two different approximations for the solution are made and compared. If the two approximations do not agree to a specified accuracy, the step size is reduced. More details of this method can be found in Ref. [56]. In general, the time-step size should be sufficiently small to achieve the numerical stability due to the Courant–Friedrichs–Lewy condition for stability [58].

*V*

_{n}along the free moving boundary form minimum compliance can be expressed as follows:

*λ*is the Lagrange multiplier to enforce the constraint of volume fraction. The augmented Lagrangian updating scheme [59] is applied to update

*λ*in this paper.

### 3.3 Parametrized Reinitialization Scheme.

_{initial}is the level set function to be initialized, and sign(·) denotes the sign function. Substituting Eq. (11) into reinitialization in Eq. (17), the following equation can be obtained:

The reinitialization procedure used in Eq. (18) usually slightly moves the zero-level set contour, which may cause inconsistencies during the optimization process. In general, the reinitialization procedure needs to be implemented periodically to maintain the signed distance function [13,61]. Hartmann et al. [62] proposed a constrained reinitialization scheme, where the least-squares solution is obtained to keep the location of zero-level contour. Jiang and Chen [34] proposed a new level set scheme using a double-well potential function to achieve distance regularization inside the topology optimization loop. In this paper, the regular reinitialization scheme is applied periodically to avoid the implicit function becoming too flat or too steep. More details of implementation can be found in Ref. [25]. Equation (18) can be solved using the Runge–Kutta–Fehlberg (RKF45) method [58]. The proposed DNN-based level set algorithm is described as follows:

Initialization of the parametrized level set function Φ(

), corresponding to an initial guess Φ*θ*_{0}. The initial weights and biases are determined through backpropagation algorithm (Eq. (3)).Iteration until convergence, for

*k*≥ 0.Based on an implicit function Φ

_{k}, the material distribution in the design domain can be computed through Heaviside function (Eq. (10)). Solve the equilibrium equation (Eq. (7)) using finite element method technique to obtain displacement field.Compute objective

*J*(Φ) and the normal velocity*V*_{n}. Updating the weights and biases by solving the parametrized Hamilton–Jacobi equation (Eq. (13)) using RBF45 scheme.For stability reasons, the reinitialization of the level set function Φ by solving Eq. (18) in every iteration.

The flowchart of algorithm can be found in Fig. 4.

## 4 Numerical Examples

In this section, several two-dimensional numerical examples are demonstrated to verify the effectiveness of the proposed DNN level set method. Unless stated otherwise, the following parameters are chosen as the elastic modulus *E* = 1 for solid materials and modulus *E* = 1 × 10^{−6} for void materials. The Poisson’s ratio is chosen as *v* = 0.3. The volume fraction constraint is set to be 0.4. The DNNs are initialized using backpropagation training algorithm. The activation function is chosen as hyperbolic tangent function [63]. The detailed initialization description is presented in Sec. 2. For all numerical examples, the design domain is discretized by rectilinear mesh with grid size equals 1. The finite element analysis is based on an ‘ersatz material’ approach, which is a well-known method for level set topology optimization [25].

### 4.1 Messerschmitt–Bölkow–Blohm Beam.

The Messerschmitt–Bölkow–Blohm (MBB) beam is investigated in the present example for minimum compliance problem. The boundary condition is plotted in Fig. 5, where a concentrated force *P* = 1 is applied at the mid of the top edge. The architecture of network is presented in Fig. 6. Note that a fixed support is located at bottom-left corner, while a roller is at the bottom-right corner. The design domain is meshed with 200 × 100 elements with a grid size equals to 1. The fixed Lagrange multiplier is chosen as *l* = 5, and the time-step is chosen as *τ* = 3 × 10^{−3}. For the first case, the implicit function is represented by the NN with one hidden layer, where every hidden layer contains eight neurons (Fig. 6). The total number of design variables is 33. To generate a symmetry design, only half of the design domain is used for optimization, where symmetric boundary condition is implemented. The final optimal design is shown in Fig. 8(a). The initial design (training result) is plotted in Fig. 7(a). Note that the NN with one hidden layer is a shallow network, and the hole in training result is not a perfect circle due to limited fitting ability. A stable topology optimized solution can be achieved through solving the ODEs in Eq. (14) after 150 iterations (Fig. 10(a)).

To make a comparison, NNs with two hidden layers and three hidden layers are chosen to represent the implicit function of level set. The optimization parameter setting is the same as the previous example. The architecture of network is shown in Figs. 1(b) and 1(c). The inputs are the point coordinates (*x*, *y*) in the design domain, and the output is the value of the implicit function at the present point. The initial training results are presented in Figs. 7(b) and 7(c), and the optimal designs are displayed in Figs. 8(b) and 8(c). The total number of design variables are 105 (two hidden layers) and 177 (three hidden layers). The implicit function of optimal design is shown in Fig. 9. The compliance values of two optimal designs are 32.57 and 39.42, respectively. Because the optimization results only converge to local minima, there is no guarantee that more variables will result in better solutions. Convergence history is presented in Fig. 10. Since the level set function is updated via updating the parameters of NNs, new holes can be generated freely from the mathematical point of view. This salient point is verified in Fig. 8, where new small holes are generated during the optimization process. A benchmark design generated by the SIMP method using top88 code as provided in Ref. [64] is presented in Fig. 11. Note that the radius of the filter for the standard SIMP method is chosen as *r* = 2. The compliance of optimal design produced by the SIMP method is 33.48. Compared with solutions from the DNN-based level set method, the structural compliance values of optimized designs (networks with one and two layers) are quite close with the benchmark solution.

To further verify the effectiveness of the proposed DNN-based level set method for diverse and competitive designs, different network architectures are selected to produce diverse designs as shown in Fig. 12. It is worth mentioning that different networks are capable of generating distinctly different solutions. For the single layer network with five neurons, the optimized result is simple and no intricate geometric details are found as shown in Fig. 12(a). For a network with two layers (15 × 15), the optimized design seems to be more complex with several truss-like support components inside as shown in Fig. 12(f). For a given architecture of NN, the implicit function (segmentation) represented by NN is a subspace of all possible designs. Thus, NN with different architectures describes different subspace of solutions, which give the explanation of diverse solutions.

### 4.2 Short Cantilever Beam.

The minimum compliance design of a short cantilever beam is presented in Fig. 13. The design domain is a square with fixed boundary condition on the left side, and a vertical concentration force *F* = 1 is applied at the midpoint of right side. The design domain is meshed with 100 × 100 elements with grid size equals 1. The optimization formulation is described in Eqs. (6) and (7). A fixed Lagrange multiplier *l* = 3 is applied for volume constraint, and the time-step is chosen as *τ* = 3 × 10^{−3}. For the first case, NN with one hidden layer is chosen to represent the implicit function, where the hidden layer contains eight neurons. Because of the limited fitting ability of shallow NN, the initialized shape has some artifacts near the boundary, and the training result is presented in Fig. 14(a). The final optimal design is displayed in Fig. 15(a). The implicit function of optimal design is shown in Fig. 16(a), and the optimization progress converges after 120 iterations (Fig. 17(a)). To make a comparison with numerical results generated by shallow NNs, the networks with two or three hidden layers are examined here. The architectures of networks are shown in Figs. 1(b) and 1(c), where each layer contains eight neurons. The total number of design variables is 105 (two hidden layers) and 177 (three hidden layers). The other optimization settings are the same as before. The optimal layout and implicit functions are demonstrated in Figs. 15(b), 15(c), 16(b), and 16(c). Obviously, the optimal designs using DNNs (two or three hidden layers) have more intricate geometric features compared to the result obtained by shallow NN. The convergence histories for the two designs are demonstrated in Figs. 17(b) and 17(c), where the stable topology optimized design is achieved after 140 iterations. A benchmark design obtained with the SIMP method is demonstrated in Fig. 18. It is worth to mention that designs produced by the NN with 2 or 3 layers are slightly lower than the value of benchmark design (around 3.5% difference).

To further generate multiple alternatives, nine different NN architectures are examined to obtain the solutions as shown in Fig. 19. Obviously, although these designs have distinctly different topologies, the compliance value of optimized design is close with respect to benchmark (difference less than 5%). Unsymmetrical designs can be easily obtained as plotted in Figs. 19(b)–19(i).

## 5 Conclusion

In this paper, a DNN level set method is proposed for topology optimization. DNNs are popular for function approximation. The implicit function is represented by deep feedforward NNs. The activation function is chosen as a hyperbolic tangent function. Based on DNNs, a high level of smoothness in gradient and curvature of implicit function can be achieved. The Hamilton–Jacobi PDE is transformed into parametrized ODE and implicit function is updated through updating the weights and biases of network.

The major contribution of the proposed method is applying the DNN as a function approximator to describe implicit function of the level set method. Different DNN architectures are capable of generating diverse and competitive designs with high structural performance. DNN-based level set method can provide the designers with multiple conceptual alternatives instead of finding one optimum solution to maximize or minimize the objective. The limitation of the present work is that the mathematical connection between network architecture and structural complexity or performance cannot be quantified explicitly. At present, applying mathematical tool to quantify this relation is extremely difficult and further effort will be devoted to solving this issue in the future. Compared to the diverse competitive design for topology optimization methodology based on diversity constraints proposed by Wang et al. [48], qualifying the relationship between the diversity and NN architectures is future research direction. The proposed DNN-based method provides an alternative way to produce the diversity solution in the framework of the level set method. In addition, using the deep learning method to represent implicit function opens an opportunity toward a marriage of machine learning and topology optimization.

## Conflict of Interest

There are no conflicts of interest.

## Data Availability Statement

The datasets generated and supporting the findings of this article are obtained from the corresponding author upon reasonable request. The authors attest that all data for this study are included in the paper.