TOaCNN: Adaptive Convolutional Neural Network for Multidisciplinary
  Topology Optimization
This paper presents an adaptive convolutional neural network (CNN)
architecture that can automate diverse topology optimization (TO) problems
having different underlying physics. The architecture uses the encoder-decoder
networks with dense layers in the middle which includes an additional adaptive
layer to capture complex geometrical features. The network is trained using the
dataset obtained from the three open-source TO codes involving different
physics. The robustness and success of the presented adaptive CNN are
demonstrated on compliance minimization problems with constant and
design-dependent loads and material bulk modulus optimization. The architecture
takes the user's input of the volume fraction. It instantly generates optimized
designs resembling their counterparts obtained via open-source TO codes with
negligible performance and volume fraction error.
Khaish Singh Chadha, Prabhat Kumar
# TOaCNN: Adaptive Convolutional Neural Network for Multidisciplinary Topology Optimization

###### Abstract

This paper presents an adaptive convolutional neural network (CNN) architecture that can automate diverse topology optimization (TO) problems having different underlying physics. The architecture uses the encoder-decoder networks with dense layers in the middle which includes an additional adaptive layer to capture complex geometrical features. The network is trained using the dataset obtained from the three open-source TO codes involving different physics. The robustness and success of the presented adaptive CNN are demonstrated on compliance minimization problems with constant and design-dependent loads and material bulk modulus optimization. The architecture takes the user's input of the volume fraction. It instantly generates optimized designs resembling their counterparts obtained via open-source TO codes with negligible performance and volume fraction errors.

Keywords:Topology optimization, Machine learning, Convolutional neural network, Standard architecture

## 1 Introduction

Topology optimization (TO) is a computational technique that determines the efficient material distribution within a design domain while optimizing an objective with predetermined constraints and boundary conditions [1]. With the remarkable progress in additive manufacturing processes, TO's utility and demand steadily increase for various design problems [2]. TO process typically involves four stages: (i) parameterizing the given design domain, (ii) conducting finite element analyses for relevant physical aspects, (iii) assessing the objective function, constraints, and their corresponding sensitivities, and (iv) iterating through the optimization procedure. TO becomes notably intricate and computationally demanding, especially when dealing with multi-physics problems [3] and design-dependent loads [4, 5]. These computational requirements present significant challenges and hinder the broader practical implementation of TO methods [3]. This paper introduces an adaptive convolutional neural network-based architecture for multidisciplinary design optimization to complement traditional TO methods. Once trained, this architecture provides optimized designs instantly for the same boundary and force conditions it was trained.
Integration of deep learning into optimization tasks has emerged as a promising avenue [6, 7, 8, 9]. TO codes generate visual representations of optimized designs in the form of images. On the other hand, Convolutional Neural Networks (CNNs) have demonstrated exceptional proficiency in extracting valuable features and discerning intricate patterns and relationships within image data. This is one of the key reasons for their adoption in automating the TO process. Previous attempts at employing CNNs for TO have shown remarkable performance [7, 10, 8]. However, the neural network architecture developed in the mentioned Refs. are tailored for a specific optimization task and lack generalization ability to adapt to new optimization problems. To fill this gap, in this work, we propose an adaptive CNN architecture capable of automating TO problems across various problems. Efficiency of the proposed architecture is demonstrated on three distinct TO problems with different physics: compliance minimization with constant and design-dependent loads and material bulk modulus optimization problems (Fig. 1).

## 2 Methodology

This section presents the problem description, the proposed neural network architecture, and the training data generation methodology.

### Problem description

As mentioned above, we select a set of three problems involving different physics to train the proposed adaptive CNN architecture and obtain the optimized designs. First, the compliance minimization problem for designing a cantilever beam (Fig. 0(a)) is taken. The data pertaining to that is generated using top88 code [11]. Second, the compliance minimization problem for the loadbearing arch structure with the design-dependent load (Fig. 0(b)) is considered. TOPress code [12] is used to generate the data for the arch problem. Design-dependent

Figure 1: Problem descriptions
loads within a TO setting pose several challenges [4, 5, 12] as these loads change their direction, magnitude, and direction with TO evolution. However, once the architecture is trained, those challenges no longer exist. Third, we solve the material bulk modulus optimization problem per [13]. topX code [13] is used to generate the training data.

### Neural Network Architecture

We propose a deep learning model using a convolutional neural network. The network contains an encoder-decoder architecture with dense layers added at the bottleneck region. The encoder and decoder part of the network are purely convolutional, whereas the dense layer is adaptive; one can change the number of neurons \(n\) in the middle layer of the dense layers block (Fig. 2) as per complexity of geometrical feature of the optimized designs.

Figure 2: General Architecture of the Adaptive Convolutional Neural Network (CNN)
"adaptive layer." The architecture combines the strengths of convolutional layers for feature extraction from images and fully connected layers (dense layers) for relatively more abstract, high-level processing. The three main parts of the proposed architecture are discussed below.

**Encoder network** It plays a prominent role in extracting meaningful information from the training data while reducing the dimensionality of the input data. Herein, the input image has a size of \((100\times 100\times 1)\), which is downsampled by the encoder network to a size of \((5\times 5\times 512)\). This is achieved by three successive convolutional and max pooling operations (Fig. 2). All the convolution operations performed are "same" convolutions to ensure that the information at the edges of the input image is fully considered in the output feature map. Max-pooling operations are responsible for the down-sampling of the image. The stride value of each convolution operation is kept as \((1\times 1)\), whereas that for the max-pooling is kept equal to the filter size.
**Dense layers** Output of the encoder network with \((5\times 5\times 512)\) is flattened out to create the first dense layer with 12800 neurons (Fig. 2); the optional adaptive dense layer follows this (indicated by dotted boundary in Fig. 2) and another dense layer having 12800 neurons (Fig. 2). The adaptive layer equips the network with the capability to automate a broad spectrum of optimization tasks. The choice to include the adaptive layer and determine the number of neurons in that layer should be based on the complexity of the optimized designs for the particular TO problem.
**Decoder network** The output of the dense layers is to form a multi-channel image having a size of \((5\times 5\times 512)\), which is then up-scaled to \((100\times 100\times 1)\) via successive transpose convolution operations (Fig. 2). Filter size and number of filters used in each transpose convolution are mentioned in Fig. 2. Each transpose convolution layer has a stride value that equals the filter size. We provide zero padding to both input and output for all the transpose convolution operations.

We use "ReLU" activation function for the convolution and transpose convolution. Mean squared error is the cost function. "adam" optimizer is employed for efficient training of the neural network.

### Generation of training data

The proposed architecture takes input data as images. top88 [11], TOPress[12] and topX[13] MATLAB codes are used to generate target (optimized designs, cf. Figs. 3) images having size \(100\times 100\) (i.e., \(100\times 100\) finite elements are used to parameterize the design domains) for the problems by varying the volume fraction from \(0.01\) to \(0.95\) with an increment of \(0.01\). We use \(\{\texttt{p}\texttt{p}\texttt{e}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}{a}\texttt{a} \texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}\texttt{a}{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a} \texttt{a}{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a} \texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}{a}\texttt{a} \texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}\texttt{a}{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a} \texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a}\texttt{a
## 3 Results and discussion

This section demonstrates efficacy of the proposed architecture on problems involving three different physics (Fig. 3) used for training the architecture.

\begin{table}
\begin{tabular}{|c|c|c|c|c|c|c|} \hline \(V_{f}\) & **Input** & \multicolumn{5}{c|}{**CNN results**} & **Target** \\ \hline \multirow{4}{*}{0.03} & \multicolumn{5}{c|}{**\# neurons in adaptive layer (\(n\))**} \\ \cline{2-7}  & **1000** & **2000** & **4000** & **8000** & **12000** & **16000** \\ \cline{2-7}  & & & & \(\{V_{\rm err}\), \(Obj_{\rm err}\) (\%) & & \\ \cline{2-7}  & & \{3.3, 2.76\} & \{17, 7.9\} & \{10.3, 15.02\} & \{1, 2.48\} & \{1, 2.76\} & \{0.33, 0.89\} \\ \hline \multirow{4}{*}{0.25} & \multicolumn{5}{c|}{\(\{V_{\rm err}\), \(Obj_{\rm err}\}\) (\%)} \\ \cline{2-7}  & \multicolumn{5}{c|}{\(\{0.6, 0.71\}\)} & \{0.12, 0.45\} & \{0.12, 0.31\} & \{0.44, 0.41\} & \{0.024, 0.34\} & \{0.6, 0.56\} \\ \hline \multirow{4}{*}{0.50} & \multicolumn{5}{c|}{\(\{V_{\rm err}\), \(Obj_{\rm err}\}\) (\%)} \\ \cline{2-7}  & \multicolumn{5}{c|}{\(\{0.22, 0.056\}\)} & \{0.04, 0.28\} & \{0.72, 0.28\} & \{0.28, 0.037\} & \{0.08, 0.09\} & \{0.16, 0.14\} \\ \hline \multirow{4}{*}{0.75} & \multicolumn{5}{c|}{\(\{V_{\rm err}\), \(Obj_{\rm err}\}\) (\%)} \\ \cline{2-7}  & \multicolumn{5}{c|}{\(\{0.08, 0.13\}\)} & \{0.41, 0.47\} & \{0.6, 0.68\} & \{0.0, 0.01\} & \{0.34, 0.34\} & \{0.36, 0.41\} \\ \hline \end{tabular}
\end{table}
Table 1: Optimized cantilever beam with different number of neurons \(n\) in the adaptive layer (Fig. 2). \(V_{\rm err}\) and \(Obj_{\rm err}\) indicate the volume and objective error between the results obtained by the proposed CNN and the target output (generated by the MATLAB code used).

Figure 3: Training data set: Input and target images. (a) Input image. Target images: (b) Cantilever beam (Fig. 0(a)), (c) Loadbearing arch (Fig. 0(b)) and (d) Material bulk modulus (Fig. 0(c))
### Cantilever beam problem

The cantilever beam design domain (Fig. 0(a)) is solved herein. First, the proposed CNN architecture without the adaptive layer is trained for 2000 epochs with the data generated per Sec. 2.3. However, this network's optimized designs (output) do not meet the desired quality. After a thorough analysis of the training process, it is noted that despite prolonging the network's training for a substantial number of epochs, the loss function remains persistently elevated and shows no substantial improvement with further training. These designs feature intricate patterns, and this architecture lacked sufficient trainable parameters to capture the underlying patterns embedded within the training data effectively. To circumvent this abnormal behavior and enhance the model learning capabilities, we introduce an adaptive layer containing \(n\) neurons within the dense layers (Fig. 2). Users can change \(n\) as per the complexity of the optimized geometrical features.

Table 1 depicts the optimized results with different \(n\). Errors in volume and performance are denoted via \(\{V_{\text{err}},\,obj_{\text{err}}\}\) in the table. \(\{V_{\text{err}},\,obj_{\text{err}}\}\) with \(n=8000\) are low, which shows the optimized designs obtained by the proposed CNN are in perfect agreement with those generated via the MATLAB code. However, using \(n=8000\) in the adaptive layer may not always give low errors for the different optimization problems. To demonstrate the diversity and capability of the proposed network, next, we present design-dependent loadbearing arch structure [12] and material bulk modulus optimization problems [13].

### Pressure loadbearing arch structure

The design domain is depicted in Fig. 0(b) for pressure loadbearing arch structure. Though the physics involved is complex [4, 12], the obtained optimized arch geometrical feature is simple. Therefore, \(n=0\) is used, i.e., the adaptive layer is not used in this case while training the proposed network.

Figure 4 shows the optimized loadbearing arch designs obtained for different volume fractions (\(V_{f}\)) using the proposed neural network. The output results resemble those obtained via the TOPress code [12] with less than 1% \(V_{\text{err}}\), i.e., negligible \(V_{\text{err}}\). Developing such a network for 3D design-dependent problems [14] can be one of the research directions.

### Material bulk modulus optimization problem

Next, the material bulk modulus optimization problem is solved (Fig. 0(c)). This is considered one of the involved problems in TO [13].

Noting the complexity in the optimized designs, the adaptive layer with \(n=4000\) is employed while training the network. The output of the network with different volume fractions are depicted in Fig. 5. The volume fraction error is negligible.
## 4 Conclusion

This paper proposes an adaptive deep Convolutional Neural Network approach to tackle the TO problem. The architect employs an encoder-decoder network with dense layers wherein an adaptive layer with \(n\) neurons is introduced to help capture the complex geometrical features for the optimized designs. Users can vary \(n\) as per the desired level of accuracy. Three publicly available MATLAB codes are used to generate the data for training purposes. The efficacy and success of the developed CNN architecture are tested by generating optimized designs for compliance minimization problems with constant and design-dependent loads and material bulk modulus optimization. Once the network is trained with a certain number of epochs, it gives the sought-optimized designs instantaneously with negligible error in volume w.r.t. to the target designs.

The proposed model has a fixed domain of \(100\times 100\), and output (optimized designs) can be generated explicitly for the boundary and force conditions for which the training data has been provided. Tapping the power of the deep neural network, generalizing the proposed network for design domain size, and obtaining

Figure 4: Optimized loadbearing arch structures at different volume fractions. (a) \(V_{f}=0.25\) (b) \(V_{f}=0.50\). \(V_{\text{err}}\) indicates the volume fraction errors with respect to the target results.

Figure 5: Results for material bulk modulus optimization for different volume fractions. (a)\(V_{f}=0.25\) (b) \(V_{f}=0.50\).
the output results for the boundary and force conditions that are not used for the training data open up exciting avenues for further research.
