# A new Neural Network-based methodology for multi-level topology optimisation in structural problems

Antolín Martínez-Martínez, José Manuel Navarro-Jiménez, Juan José

Ródenas, Olivier Allix, Enrique Nadal Soriano

► To cite this version:

Antolín Martínez-Martínez, José Manuel Navarro-Jiménez, Juan José Ródenas, Olivier Allix, Enrique Nadal Soriano. A new Neural Network-based methodology for multi-level topology optimisation in structural problems. 2025. hal-04968068

HAL Id: hal-04968068

https://hal.science/hal-04968068v1

Preprint submitted on 28 Feb 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# A new Neural Network-based methodology for multi-level topology optimisation in structural problems

A. Martínez-Martínez<fnref n="1" />, J. M. Navarro-Jiménez<fnref n="1" />, J. J. Ródenas<fnref n="1" />, O. Allix<fnref n="2" />, and E. Nadal<fnref n="1" />

## Abstract

The optimisation of high-resolution trabecular structures is crucial for various industrial applications due to their resilience to unexpected loads. Current topology optimisation (TO) approaches face challenges like high computational costs and limited topology versatility. Addressing this, a 2-Level Topology Optimization approach was proposed [1], where material is first distributed over the domain (discretised into cells) at the coarse level and then finely redistributed at the fine level into each cell, using TO in both levels. This density-based multi-level approach ensures the topology versatility of optimised cells while reducing computational costs.

Recently, Machine learning (ML) techniques have been considered to enhance the efficiency of TO processes, but current models lack generality in arbitrary domains and boundary conditions. This paper introduces a data-driven surrogate model in the cell-level stage of the 2-Level TO process, leveraging the repetitive shape of cells in coarse discretisation. This ensures methodology versatility across different domains and boundary conditions, mitigating generalisation issues while enhancing the efficiency of the multi-level TO.

The methodology details include the TO scheme, U-Net architecture of the surrogate model, creation of the training dataset, and case study evaluations. Numerical analyses compare the proposed approach with traditional Finite Element Method (FEM)-based TO procedures, demonstrating its efficacy in achieving accurate results, optimised topologies, and generalisation capability. The proposed data-driven surrogate model might yield suboptimal structures in some cases. However, this is addressed through a tuning strategy involving a few extra iterations of FEM-based cell TO, without dramatically penalising the achieved speed-up.

**Keywords:** Machine Learning, Multi-level Topology Optimisation, Finite Element Analysis, U-Net architecture

## 1 Introduction

Topology optimisation (TO) techniques aim to find the optimal topology in a given design space or problem domain. These techniques are particularly useful in structural problems where resource optimisation is a crucial design aspect, such as aeronautics, automotive industry or architecture.

Most structural TO methodologies can be grouped into density-based methods [2], such as the Solid Isotropic Material with Penalization (SIMP) method [3]. These methods define a design domain discretised using a finite element (FE) mesh. The objective function to optimise is usually the compliance, while the constraint is the amount of material in the domain. Thus, density-based methods search for the optimal material distribution by identifying the amount of material contained in each mesh element. Trabecular structures, naturally occurring in elements like bones or specific bird beaks [4, 5], exhibit enhanced buckling stability [6] and effective properties in dissipating heat energy and vibrations [7]. These characteristics make them interesting for advanced structural design [8]. Moreover, they demonstrate robust structural responsiveness to unexpected loads [9]. For example, this feature is particularly advantageous for optimizing implant designs [10, 11, 12], where exploring optimal topologies at various scales becomes crucial to minimize alterations in load transmission routes, thereby reducing the risk of stress shielding-induced bone damage [13, 14].

Recent advancements in additive manufacturing techniques allow the creation of complex and high-resolution structures applicable in various fields, including general structural engineering [15], aeronautics [16], and medical applications [17, 18, 19]. However, the design process faces a critical challenge: optimising the structure's mechanical properties while effectively managing the computational costs of designing trabecular architectures. Achieving this balance is crucial for ensuring the effectiveness and affordability of these advanced structures in demanding industrial contexts.

High-resolution or multi-level optimisation algorithms are employed to capture material distribution heterogeneities within the main structural component, providing an optimised trabecular structure. In manufacturing

<footnote n="1">¹Instituto de Investigación en Ingeniería Mecánica y Biomecánica - Universitat Politècnica de València, Valencia, Spain</footnote>

<footnote n="2">²Université Paris-Saclay, ENS Paris-Saclay, CentraleSupélec, CNRS, LMPS. Gif-sur-Yvette, France</footnote>
terms, it involves defining an optimised and heterogeneous infill distribution for components produced through
additive manufacturing. Two primary categories of multi-resolution optimisation techniques are lattice-based
strategies and density-based approaches.

Lattice-based approaches limit the material arrangement in the fine scale to a reduced number of parameters [20, 21]. Some pursue an anisotropic constitutive model, seeking an equivalent microstructure to fulfil the homogenised constitutive model [22]. However, these techniques have limitations, such as the restricted range of possible topologies resulting from the reduced number of parameters that define the topology at the finest discretisation level.

Alternatively, density-based methods can be employed to achieve trabecular structures. These methods provide a locally optimised infill that is heterogeneous within the component and richer than lattice structures, potentially providing superior structural properties. For instance, a one-level strategy with extreme fine discretisation using the SIMP method has been proposed [5, 18]. However, this approach becomes impractical for most industrial applications due to its high hardware and computational cost requirements.

The methodology proposed in [1] incorporates a two-level optimisation strategy based on the SIMP approach, where the global domain is discretised into repetitive cells. The first step involves solving the coarse-level optimisation of the global problem using a FEM-based TO methodology, providing the optimal density for each cell with an affordable computational cost. Then, the equilibrated traction field of each optimised cell can be computed and then repeat the TO at the cell level (fine discretisation).

This methodology represents a breakthrough in enhancing the computational efficiency of high-resolution TO structures based on density methods. In contrast to prior approaches [23, 24] relying on efficient parametrised cellular structures, the 2-Level TO methodology stands out due to its inherent flexibility in topology. Additionally, compared to [5], it proposes a two-level approach, reducing computational time and ensuring a manageable size of the FE models used to solve the TO problem, significantly reducing the computational resource requirements. However, this process involves solving one TO process for each cell and, therefore, running multiple FE analyses for each of the multiple cells. Therefore, strategies for acceleration should be explored to make it compatible with demanding industrial contexts.

In recent years, machine learning (ML) techniques have been applied to TO [25, 26, 27, 28, 29], leading to new models that describe physical processes or improve existing ones in terms of accuracy or computational cost [30]. Surrogate models have been used to obtain topologically optimised direct designs [31], speed up the optimisation process [32], post-process the results [33] or reduce the dimensionality of the design space [34].

Particularly, several approaches have been proposed aiming to reduce the computational cost of the TO process. In the general context of TO, generative models are employed in complex problems where the objective function is not differentiable, and the computational cost of evaluating this function given a candidate is expensive. These models aim to provide a more extensive variety of topologies, offering candidates that could be optimal solutions [35, 36]. For that purpose, the training dataset is often created using topologies with characteristics of interest. However, when dealing with compliance minimisation in structural problems, the SIMP method provides robust solutions that minimise the objective function while ensuring material continuity. In this scenario, the dataset creation can efficiently be performed using the SIMP method, and the surrogate model is designed to replace its function.

In structural TO, some approaches replace the entire TO process with several ML models to predict the final optimal density distribution [25]. Others focus on predicting the density sequence [27, 29] or selectively replacing specific modules within the TO process to predict compliance at each iteration [25]. The latter approach usually provides more accurate results [25]. Despite having demonstrated its efficacy for accelerating this process, these approaches might present significant limitations in 'real-world' problems [37] because of integrating data-driven surrogate models without dealing with the poor generality of these models. They may depend on the mesh or training dataset and, as a result, they will not be applicable to new structural problem domains or boundary conditions [28, 38, 39]. Additionally, these approaches may lead to locally undefined bars and even disconnected bars, which may have a large influence on the compliance value [40]. As a result, data-driven density-based TO approaches require more in-depth exploration [37].

Moreover, in the realm of high-resolution TO structures, ML techniques have also been employed to accelerate the computation process [21, 26, 41] of cell-structured approaches. Nevertheless, they exhibit a deficiency in topological diversity owing to inherent limitations in parametrised-lattice optimisation.

This paper tackles the generalisation limitation by introducing a novel ML-based methodology to enhance the efficiency of the multi-level TO process, building on the approach presented in [1]. Our strategy replaces the FE analysis at the cell level, a computationally intensive step in the two-level TO workflow, aligning with the philosophy of [25] for single-level problems. The remaining steps follow the standard TO process, involving the computation of compliance sensitivities, application of a filter, and determination of the new density distribution. This innovative approach significantly improves the efficiency of the FE-based two-level TO. Combining this ML-based approach with the 2-level TO methodology [1], we can achieve high-resolution optimised components with structural continuity and reasonable computational cost.

This paper introduces an innovation by incorporating a data-driven surrogate model within the frame-
work of the 2-level TO. Leveraging the repetitive cell-domain structure and the limited but general definition of cell boundary conditions addresses generalisation challenges observed in prior data-driven approaches [25, 27, 29]. Simultaneously, it accelerates the two-level TO process, facilitating the design of trabecular-like structures through density-based methods. Its computations efficiency stands out when compared to previous high-resolution procedures [5] and offers greater topological flexibility in comparison to parametric cell-based approaches [21, 23, 24, 26, 41].

This paper is structured as follows: Section 2 presents the proposed methodology, describing the new cell-level TO scheme and the U-Net architecture of the NN. Additionally, we describe the creation of the training dataset and the different case studies where the training of the network is evaluated. Section 3 shows the numerical analyses used to assess the model training and the performance of this methodology in the cell-level TO process compared with the FEM-based TO procedure. Finally, we present the conclusions of this work in Section 4.

# 2 Methodology

In this section we explain the new methodology for the topology optimisation of multi-level structural problems based on a surrogate model. After explaining the procedure, we show the numerical tools used to develop the subsequent numerical analysis.

## 2.1 Topology optimisation problem - SIMP method

TO methods in structural problems aim to find the optimal material distribution $\rho$ in a given design domain $\Omega$, which minimises the compliance $c$. The SIMP method [3, 42, 43] defines a volume fraction restriction to limit the amount of material used in $\Omega$. This approach considers $\rho$ as a continuous variable with values in the range [0,1]. Additionally, a penalisation parameter $p$ enforces the segregation between material ($\rho = 1$) and void ($\rho = 0$) and penalises intermediate density values. As a result, the SIMP method formulates the TO as follows

$$ (\text{TO}(v_f)) = \left\{ \begin{array}{ll} \min_{\rho, \mathbf{u}}: & c(\rho; \mathbf{u}) = \frac{1}{2} \int_{\Omega} \varepsilon(\mathbf{u})\mathbf{D}(\rho)\varepsilon(\mathbf{u})d\Omega \quad (1a) \\ & \text{with } \mathbf{D}(\rho) = \rho^p \mathbf{D}_0 \quad (1b) \\ \text{subject to:} & V(\rho) = \int_{\Omega} \rho d\Omega = \bar{V}_e \sum \rho_e = v_f V_0 \quad (1c) \\ & a(\mathbf{u}, \boldsymbol{\nu}; \rho) = l(\boldsymbol{\nu}) \text{ where,} \quad (1d) \\ & a(\mathbf{u}, \boldsymbol{\nu}; \rho) = \int_{\Omega} \varepsilon(\mathbf{u})\mathbf{D}(\rho)\varepsilon(\mathbf{u})d\Omega \quad (1e) \\ & l(\boldsymbol{\nu}) = \int_{\Omega} \mathbf{b}^T \boldsymbol{\nu} d\Omega + \int_{\Gamma_N} \mathbf{t}^T \boldsymbol{\nu} d\Gamma_N \quad (1f) \\ & 0 \le \rho_{\min} \le \rho \le 1, \quad (1g) \end{array} \right. $$

where $\varepsilon$ and $\mathbf{u}$ represent the strain and displacement fields, respectively, and $v$ is the virtual displacement field. $\mathbf{D}$ is Hook's law matrix which relates the strains and stresses. Moreover, $v_f$ is the predefined volume fraction, and $V_0$ is the total volume of $\Omega$.

To avoid numerical instabilities in the densities distribution, such as a checker-board pattern, a low-pass filter is applied to the compliance sensitivities. Additionally, we use the optimality criteria (OC) algorithm to update the density distribution according to the filtered compliance sensitivities. However, other optimisation algorithms could be used. More details of the implementation are explained in [44].

## 2.2 Individual cell-level optimisation in a two-level topology optimisation approach

In this work, we only consider TO procedures that minimise $c$ (see Equation (1a)), the objective function, with a volume fraction constraint. This is equivalent to maximising the stiffness of the structural component for a given amount of material. In this work, we use the workflow proposed in [1], which makes it possible to define a 2-level TO procedure where the cells of the global problem are solved individually. There are two main stages in
this multi-level process: the optimisation of the coarse discretisation of the global problem and the optimisation of the cells (see Figure 1).

A notable difference between these stages lies in using the penalisation factor, introducing distinct behaviours based on their magnitude. When the penalisation factor approaches one, it facilitates a continuous distribution defined by intermediate density values, resulting in a structure without sharp boundaries. Conversely, an increase in the penalisation factor accentuates the differentiation between regions identified as material (solid) and void (empty space), providing a well-defined structure of bars.

In the context of one-level TO approaches, the continuous distribution (low penalisation) is considered undesirable as intermediate values are impractical for manufacturing processes. However, in the 2-Level TO employed in our study, both penalisation scenarios find application to generate the final trabecular structure: penalisation $p = 1$ will be used in the global problem optimisation to obtain a low-definition / coarse material distribution, then $p = 3$ will be used at the cell level to create the final high-resolution material distribution.

Additionally, the final trabecular structure is mainly determined by the discretization size used in the cell-level stage, independently from the rest of the cells. Consequently, trabecular feature size can be controlled if necessary with the fine mesh size.

<figure><img src="image_2.png" /><figcaption>Figure 1: Two-level TO methodology proposed in [1] consisting on the global problem and cell level optimisation. Particularly, the TO of the fine discretization (cell-level TO) is the basis of the numerical analyses presented in this work. We propose to replace the FE analysis (FEA) by an Artificial Neural Network (ANN) to solve the elasticity problem.</figcaption></figure>

Regarding the substeps followed at each stage, firstly, the coarse-level topology optimisation procedure is similar to the conventional implementations as follows:

1. Initialize the problem variables, such as boundary conditions, volume fraction and material properties.

2. Compute FEM analysis to solve the elasticity problem and obtain $c$.

3. Update new densities. This step can be done with different strategies. In this work, we use the SIMP scheme with a low penalty value ($p = 1$).

4. Check if convergence is reached. In that case, the result is the final optimised topology. Conversely, the loop is repeated from point 2 using the new densities field.

This step is computationally affordable because the number of FE analyses is small. Once the coarse-level problem is finished, the cell-level topology optimisation starts. Given the low penalty value imposed in the coarse-level TO, the optimal density distribution is defined by void and full cells with extreme density values alongside multiple with intermediate-density values. While such solution may not be desirable in a single-level optimisation, within the framework of the 2-Level TO, it is addressed in the second stage of the
multi-level discretisation strategy. Thus, only the intermediate-density cells from the coarse-level problem become individual TO problems, while cells with extreme values maintain their definitive status. The number of intermediate-density cells can be controlled using a density threshold, as demonstrated in [1]. After the coarse stage, cells with high and low-density values are directly assigned as full or void cells, respectively. Subsequently, the equilibrated traction fields of each intermediate-density cell are computed from the solution of the coarse problem, effectively representing the boundary conditions of each new TO cell problem. Moreover, each cell domain is discretised using a uniform Cartesian grid, and the intermediate-density value from the coarse TO solution defines the volume fraction constraint of each cell TO. Once this intermediate preprocess is finished, the cell-level TO procedure follows these steps:

1. Initialize the problem variables. The equilibrated traction field of each cell has previously been computed. Additionally, the predefined volume fraction is determined by the relative density of the cell obtained at the end of the coarse optimisation process.

2. Solve the elasticity problem. A FE analysis could be done, like in step 2 of the coarse-level problem. Nonetheless, numerous FE analyses would be required for each iteration and cell. Instead of that, we propose the use a NN to obtain the required magnitudes to finally compute $c$, which is more efficient.

3. Update new densities. This step can be done with different strategies. In this work, we use the SIMP scheme with a high penalty value ($p = 3$) to obtain solid or void density values and a well-defined optimised cell's geometry.

4. Check if convergence is reached. In that case, the result is the final optimised topology. Conversely, the loop is repeated from point 2 using the new density field.

As a result, since the NN replaces the FE analysis of the cells, the inputs of the NN are the boundary conditions, in this case the traction fields ($t_x$ and $t_y$), and the density distribution ($\rho$). The output is the stress field ($\sigma_x$, $\sigma_y$ and $\tau_{xy}$) which describes the elastic behaviour. The stress distribution in the design subdomain exhibits more pronounced and diverse characteristics than the displacement or strain field. Consequently, fewer resources will be required for the NN to accurately infer the output.

## 2.3 Neural network's architecture

In this work, we use an NN architecture based on U-Net, consisting of an encoder-decoder scheme with information transfer from the encoder's blocks to the decoder's blocks with the same dimensionality level [45]. Encoder-decoder schemes require less GPU memory than conventional CNN due to applying some convolutions at lower dimensional spaces, which is especially interesting when using large images [46]. On the other hand, in front of simple encoder-decoder architectures, U-Net scheme avoids losing feature information when compressing transferring the output of encoder blocks to decoder's by concatenating [46].

<figure><img src="image_3.png" /><figcaption>Figure 2: U-Net architecture.</figcaption></figure>
In Section 2.2, we introduced the surrogate model as a replacement for FE analysis. As a result, the channels of the input layer correspond to the discretised domain’s boundary conditions and density distribution in the cell, while the output layer represents the solution to the elastic problem, specifically the stress field. Notably, the U-Net processes this information as images, requiring a conversion of discretization mesh data into an image format. In this study, we propose the use of a uniform Cartesian mesh to facilitate and standardize this transformation.

In this study, the U-Net configuration has 4 compression steps in the encoder’s segment and 4 decompression steps in the decoder segment (see Figure 2). Each of those dimensional levels is formed of 3 convolutional layers. For each encoder-decoder level descent, the number of filters increases according to $2^{level} * n_{if}$, where $n_{if}$ is the number of filters in the convolutional layers at level 0 (initial level), that is a hyperparameter which controls the NN size. The input layer receives images of size ($n_{px}$, $n_{px}$). At the end of each encoder block, the information is compressed, reducing the size of the information provided by the previous layer by half along each spatial dimension. In the decoder segment, the original dimensions are recovered by up-sampling in the reverse manner of the encoder’s blocks. Consequently, the dimensionality in the encoder and decoder block is the same at the corresponding level, enabling the characteristic concatenation of U-Net models.

Concerning NN parameter configuration, there exists a dependency on problem characteristics, including dataset properties, problem linearity, and dimensions in input and output spaces. Due to this characteristic, in Section 3.1, sensitivity and exploratory analyses are conducted to evaluate the model’s accuracy dependence on various configurations. Specifically, we discuss the comparison of converged neural network models based on the final loss function, providing insights into our application’s most suitable parameter configuration.

Additionally, other relevant aspects of U-Net implementation for TO are:

### Loss function

In this work, the surrogate model is purely data-based. Therefore, NN is only trained using the dataset information. Consequently, the definition of the loss function ($\mathcal{L}$) becomes a critical aspect for ensuring proper convergence of the training process and accuracy of the model. In this paper, we have employed the symmetric mean absolute percentage error (SMAPE), which is computed on all the images ($\Omega_{Nodal image}$) as

$$ \mathcal{L} = \frac{1}{N} \sum_{i=1}^{N} \frac{2 * |\sigma_i - \tilde{\sigma}_i|}{|\sigma_i| + |\tilde{\sigma}_i| + \varepsilon} \quad (2) $$

where $i$ is each of the $N$ pixels of the image, $\sigma$ is the actual stress component of the tensor provided by the dataset, and $\tilde{\sigma}$ is the predicted component by the NN. Additionally, $\varepsilon$ is a stabilisation term to prevent a zero denominator with a small value [47].

The choice of SMAPE and the inclusion of a small term in the denominator are motivated by several considerations specific to our problem’s nature and the output’s characteristics. It is imperative to measure the prediction error in the stress field, which cannot be fully standardised even when boundary conditions are. Consequently, the most essential characteristics of the proposed loss function, which align with this problem, include:

* Bounded range: SMAPE incorporates a denominator term that normalises the difference between the prediction and the ground truth, providing both a lower (0) and an upper bound (1). This characteristic is crucial in topology optimisation, where the tensional states of the output can vary among samples. The bounded range allows for a meaningful comparison of different tensional states, ensuring that the loss function is sensitive to variations across diverse samples. This is a crucial aspect compared to alternative metrics like Mean Squared Error (MSE) or Mean Absolute Error (MAE).

* Avoidance of division by small stress values: We introduced a small term ($\varepsilon$) to the denominator of SMAPE to prevent instability when the stress values are very low. This addition helps avoid division by small values, which is particularly relevant in pixels with no relative density and, consequently, no stress. By doing so, we enhance the numerical stability of the training process and mitigate potential issues associated with near-zero denominators, which do not appear in other metrics such as MSE or MAE.

### Activation functions

All convolutional layers within the encoder and decoder blocks utilise rectified linear unit (ReLU) activation functions. It introduces non-linearity by allowing positive values to pass unchanged while setting negative values to zero. In the context of topology optimisation, ReLU has shown effectiveness in capturing intricate patterns and promoting faster convergence during training.

Additionally, the last convolutional layer of the output layer employs a linear activation function. A linear activation function in the output layer is suitable for topology optimisation problems, where the goal is often to predict continuous variables (such as stress fields).

### Optimiser
The chosen optimiser is ADAM, one of the most common optimiser used in ML studies because of its fast converge performance, configured with a learning rate of 0.001, $\beta_1=0.09$, $\beta_2=0.999$, and $\epsilon=1 \times 10^{-7}$.

## Training configuration

The update process of the neural network's optimisable parameters involves a batch size of 30 samples, and each analysis undergoes 30,000 passes through the neural network. Too-small batch size values may provide noise during training, while a too-big batch size may lead to exceeding memory capability and overfitting of the model.

## 2.4 Creation of dataset

The dataset is formed by multiple $j$ samples of cell images. Each $j$ sample is formed of a group of three input ($t_x$, $t_y$ and $\rho$) and three output nodal images ($\sigma_{xj}$, $\sigma_{yj}$, $\tau_{xyj}$). This dataset must reproduce the conditions of a multi-level problem: given any cell subdomain $\Omega_C$ from a global-problem domain $\Omega_{global}$, the static equilibrium must be fulfilled. As a result, the imposed load cases that will form the dataset must ensure the equilibrium of forces ($F$) and momentum ($M$) as

$$ \sum F = 0, \qquad (3) $$

$$ \sum M = 0. \qquad (4) $$

To achieve this, and as a first approach, we will create different load cases imposing linear distribution of tractions at each $i$ side of the contour of the cell as

$$ t_{x_i} = a_i s_i + b_i \qquad (5) $$

$$ t_{y_i} = c_i s_i + d_i \qquad (6) $$

where $a_i$, $b_i$, $c_i$ and $d_i$ are the linear coefficients which describe the traction fields ($t_{x_i}$ and $t_{y_i}$) for each $j$ sample. Additionally, $s_i$ is the local coordinate of each $i$ side.

<figure><img src="image_4.png" /><figcaption>Figure 3: Definition of the dataset dimensionality according to the linear distribution approximation.</figcaption></figure>

As a result, the traction fields are determined by 16 parameters (4 linear coefficients for each side of the cell). However, considering the imposed equilibrium condition (see Equations (3) and (4)), the resulting dataset is defined by only 13 degrees of freedom. This high-dimensional space is randomly sampled, and the values of the 13 imposed parameters are in the range [-1,1] (see Figure 3).

A standard TO process is performed using a FE analysis for each equilibrated load case in the dataset to obtain multiple valid topologies efficiently. The cell domain is discretized with a uniform Cartesian mesh, facilitating the transfer of element values to the image format required by the U-Net NN.

The dataset is created by defining multiple load cases, performing the standard TO process and storing a sample $j$ at each process step. The 13 parameters which define each equilibrated load case are randomly sampled within the range of [-1, 1] to span the high-dimensional space efficiently. This approach ensures diverse and
regularized training and test dataset sampling. Finally, the dataset consists of 20,000 unique samples obtained from each iteration of the TO process of 550 cells with different load cases. Consequently, the dataset samples are tailored to the TO process, limiting the space of topologies to consider. Moreover, the dataset is independent of the global problem, and all the computational costs associated with exploration are concentrated in the offline stage.

<figure><img src="image_5.png" /><figcaption>Figure 4: Example of *j* sample of the dataset formed of 6 images of element values.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Figure 5: Examples of different $\rho$ images in the dataset. They are obtained with a standard TO process using MEF and SIMP with different load cases and at different TO loop iterations.</figcaption></figure>

# 3 Results

In this work, the main novelty is introducing a surrogate model which substitutes the FEM solver in the cell-level stage of a multi-level TO application, as presented in Section 2.2. Consequently, the initial numerical analyses focus on the training stage of the model. In Section 3.1, we explore the impact of the training dataset size (see Section 2.4) on the performance of the surrogate model. Once the training dataset size is appropriately defined, we assess, in Section 3.2, the accuracy of the surrogate model in predicting a specific stress field from the input variables. Finally, in Section 3.3, the subsequent numerical analysis evaluates the performance of the surrogate model in the cell-level TO process, comparing the results with the FEM-based methodology.

## 3.1 Comparative analysis of NN sizes and training strategies

In the first numerical analysis, a comparative study is conducted on different sizes of NN and training strategies. Each model is defined by two parameters: the number of trainable parameters and the percentage of available dataset used during training. The objective is to define the proper size of the NN and the size of the dataset for this purpose.
First, the NN size is determined by the number of trainable parameters of the network. This characteristic is controlled by the hyperparameter $n_{if}$, as it is explained in Section 2.3. Then, the proportion of dataset used is defined by the percentage of training dataset available. All models utilize 10% of the dataset for the validation phase, while for the training phase, they can only use 20%, 45%, or 90% of the available dataset (see Figure 6).

<figure><img src="image_7.png" /><figcaption>Figure 6: Dataset distribution for the three models of numerical analysis conducted to evaluate the influence of dataset size.</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Figure 7: Comparison of the test loss results after 30,000 training passes. Each numerical analysis is defined by the number of trainable parameters (NN size) and the percentage of available training dataset used in the training phase.</figcaption></figure>

Figure 7 illustrates the evaluation of the loss function using the test dataset at the final training iteration (30,000 passes through the network). The results demonstrate that the model configuration with the highest accuracy is the network with 15 $n_{if}$ and 90% of the dataset used for training. Additionally, the minimal variation in results between the models with 10 and 15 $n_{if}$ indicates that, given the information available in the dataset, using a larger network would not contribute significantly to improving the accuracy of the model. In any case, the increment of the dataset is welcome, but with the current size, the results of the TO process are sufficiently accurate.

## 3.2 Surrogate model performance: Stress field prediction

Figures 8 and 9 illustrate the results of stress field prediction using the best model obtained in the study presented in Section 3.1. To provide a more representative overview, the samples shown are taken from different stages of the TO process and load cases.

Figure 8 shows a sample from an early iteration, where the density distribution is nearly homogeneous. As a result, the stress distribution is non-zero throughout the domain. It can be observed that the macro features are accurately described by the surrogate model, although small regions with noise appear.
<figure><img src="image_9.png" /><figcaption>Figure 8: Comparison between the ground truth stress field ($\sigma_x, \sigma_y, \tau_{xy}$) and the predicted values ($\tilde{\sigma}_x, \tilde{\sigma}_y, \tilde{\tau}_{xy}$) using the best NN model. In this case, the sample comes from the first iteration of a cell's TO process. Therefore, the density distribution is homogeneous in the domain.</figcaption></figure>

In Figure 9, the sample represents a more advanced iteration of the TO process, where well-defined bars already exist. This leads to stress fields approaching zero in regions where the density is nearly zero. In this case, the prediction noise is reduced.
<figure><img src="image_10.png" /><figcaption>Figure 9: Comparison between the ground truth stress field ($\sigma_x, \sigma_y, \tau_{xy}$) and the predicted values ($\tilde{\sigma}_x, \tilde{\sigma}_y, \tilde{\tau}_{xy}$) using the best NN model. In this case, the sample comes from an late iteration of a cell's TO process. Therefore, the density distribution is heterogeneous in the domain.</figcaption></figure>

As observed in Section 2.4, the training dataset has greater amount of geometries with bars than the others, explaining the behaviour of the ANN.

Additionally, Figure 10 presents the mean absolute error for each stress field across the whole test dataset. The results demonstrate consistency between the training and test datasets, with Mean Absolute Error (MAE) values of approximately 0.04 and 0.05, respectively, for all the stress components. These findings validate the accuracy and reliability of the predictions obtained.

<figure><img src="image_11.png" /><figcaption>Figure 10: Mean absolute error (MAE) of the best NN model for the three components of the stress tensor with training and test datasets.</figcaption></figure>

## 3.3 NN-based topology optimisation process

In this section, the model is employed to obtain the stress field of the TO process for two examples of cell-level problems, as Figure 1 illustrates. Each example is defined by a different equilibrated traction field which has not been considered in the training stage of the surrogate model.

Three different numerical analyses are performed for each load case following different approaches. First, the FEM-based TO process is performed to set a reference result regarding optimal topology and compliance. Then,
we assess the performance of the NN-based methodology. For both analyses, the same convergence criterion is defined, which is fulfilled if the number of iterations falls within the range of 2 to 100 and the maximum change in nodal density does not exceed 5% at any pixel between iterations. Finally, a tuning strategy is proposed, where the NN-based TO approach is used until convergence is reached, followed by extra iterations using the FEM-based approach until convergence is achieved again. This supplementary strategy aims to alleviate the limitations of the NN-based approach.

<figure><img src="image_12.png" /><figcaption>Figure 11: Relative compliance evolution over the TO process for various TO strategies, demonstrating no significant differences among them.</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>Figure 12: Relevant snapshots of the TO process with different TO strategies. Convergence is reached after 69, 23 and 43 iterations for FEM-based, NN-based and tuning approaches, respectively.</figcaption></figure>

The first case is shown in Figures 11 and 12. The evolution of the objective function *c* (compliance), which is minimized during the TO process, is compared for the different approaches, as shown in Figure 11. It is important to note that compliance is always calculated using an FEM solver to generate this graph, regardless of the approach employed during the TO process. This allows for a comprehensive comparison and an accurate assessment of the differences between the performance of the surrogate model and the FEM solver. In this example, the results demonstrate that the NN-based method performs well, achieving appropriate optimisation of the structure and approaching the optimum obtained by the FEM-based approach.
<figure><img src="image_14.png" /><figcaption>Figure 13: Relative compliance evolution over the TO process for various TO strategies, demonstrating deviations in terms of compliance in proposed topology by the pure NN-based approach.</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Figure 14: Relevant snapshots of the TO process with different TO strategies. Convergence is reached after 59, 49 and 69 iterations for FEM-based, NN-based and tuning approaches, respectively.</figcaption></figure>

Despite the overall effectiveness of the U-Net model, there are instances where its predictions are inaccurate, particularly when disconnected bars appear during the TO process, as illustrated in Figures 13 and 14. While the final optimal topology proposed by NN-based approach may appear qualitatively valid (see Figure 14), the evolution of the actual compliance reveals differences (see Figure 13). In the NN-based approach, small bars may be partially disconnected, and although they should be removed, the surrogate model fails to sufficiently reduce the stress values in that area, hindering the elimination of these structures.

The main reason for the inaccurate performance of the surrogate model in such situations is the reliance of purely data-driven models on the training dataset. Since the surrogate model has never encountered topologies with disconnected bars, it is unable to accurately predict the corresponding stress field. Including topologies with disconnected bars in the dataset is not feasible due to the prohibitively large size of the topology space.

Fortunately, these situations can be effectively identified with a single FE analysis after the convergence of the NN-based strategy. In such cases, if a significant discrepancy is detected, performing a few iterations of the FEM-based TO process helps refine and rectify the results, as demonstrated in the load case shown in Figure 13. The rate of these situations in our test dataset is approximately 20%.

## Speed-up results

In the presented methodology, the surrogate model replaces the FEA conducted at the cell-level of the 2-Level TO, representing the most computationally demanding task, consuming nearly 90% of the computational time during each iteration. To evaluate the acceleration performance, the computational time required for executing a traditional FEM calculation is compared with the execution time of the trained NN.

The results indicate that the FEM calculation takes approximately 0.950 ms in a desktop computer with
i7-4770 3.40GHz CPU and 32 GB of RAM, while the NN execution only requires 0.105 ms. This difference demonstrates a potential acceleration of computational costs by nearly 10 times when employing the surrogate model.

Despite these considerations, the implementation of surrogate models is crucial for accelerating the process. Surrogate models do not scale in terms of computational resources or times like the FEM-based approach, especially when dealing with more complex FE problems or larger degrees of freedom. Consequently, this methodology represents a relevant initial acceleration strategy based on machine learning, which is anticipated to become even more critical in addressing three-dimensional problems.

# 4 Conclusions

In this study, we investigated the application of a NN-based methodology for the multi-level TO process, explicitly replacing the FE analysis at the cell-level TO problem while maintaining the traditional density update procedure. We have assessed its performance with two numerical analyses at the cell level: the prediction of the stress field and the capability to obtain optimal topologies when it replaces FE analyses in the TO process. In both analyses, the accuracy and optimisation achieved by the NN-based approach were comparable to those of the FEM-based approach. This finding highlights the potential of using NN as an alternative method for multi-level TO, offering efficient and accurate solutions.

One significant limitation of data-driven TO approaches was the lack of generalizability, restricting its implementation in real-world problems [37]. However, integrating surrogate models into the workflow of 2-Level TO mitigates this problem. The repetitive cell structure and the limited range of boundary condition definitions make it more feasible to obtain a general surrogate approach in the bounded context of cell optimisation while ensuring the capability to optimise global problems.

Nevertheless, certain limitations of surrogate models in TO emerged again. While the U-Net model, used as the NN architecture, demonstrated its ability to capture complex stress distributions, there were instances where its predictions were not sufficiently accurate, particularly in scenarios involving disconnected bars [40]. However, introducing a tuning strategy based on computing a few iterations of FEM-based TO mitigates this limitation without dramatically penalising the achieved speed-up.

In conclusion, our findings suggest that the NN-based methodology has the potential to enhance the 2-Level TO process, offering faster results compared to traditional FEM-based approaches. To further improve its performance, future research directions could focus on refining the NN architecture, exploring surrogate model alternatives, incorporating explicit physics information into the surrogate model, exploring alternative convergence criteria, and developing strategies to enhance the accuracy of predictions for cases involving disconnected bars. Additionally, the recent development of the 2-Level TO methodology requires further research regarding the feasibility of optimal designs for manufacturing and the implementation of this method in a three-dimensional context. Despite these challenges, this study marks an initial step in implementing a surrogate model to accelerate the methodology, representing a first exploration that can serve as a basis for more extensive research in the future.

# Acknowledgements

The authors gratefully acknowledge the financial support of Ministerio de Educación y Formación Profesional (FPU 19/02103), Ministerio de Ciencia e Innovación, Agencia Estatal de Investigación (MCIN/AEI/10.13039/501100011033) and Fondo Europeo de Desarrollo Regional -FEDER- (Proyect PID2022-141512NB-I00), Generalitat Valenciana (Prometeo/2021/046 and CIAICO/2021/226) and Vicerrectorado de Investigación de la Universitat Politècnica de València (PAID-11-12).

O. Allix would like to thank the French National University Council, ENS Paris-Saclay and National Center for Scientific Research (CNRS) for supporting his sabbatical at UPV, which made it possible to closely interact with the colleagues from I2MB/UPV.

# Availability of data

Data available on request from the authors. The data that supports the findings of this study are available from the corresponding authors upon reasonable request.
References

[1] R. Merli, A. Martínez-Martínez, J. J. Ródenas, M. Bosch-Galera, and E. Nadal, "Two-Level High-Resolution Structural Topology Optimization with Equilibrated Cells," *CAD Computer Aided Design*, vol. 179, no. May 2024, p. 103811, 2025.

[2] J. D. Deaton and R. V. Grandhi, "A survey of structural and multidisciplinary continuum topology optimization: Post 2000," *1* 2014.

[3] M. P. Bendsoe, "Structural optimization optimal shape design as a material distribution problem," 1989.

[4] A. Dara, M. R. Bahubalendruni, and A. J. Mertens, "Does topology optimization exist in nature?," *National Academy Science Letters*, vol. 45, no. 1, pp. 69–73, 2022.

[5] N. Aage, E. Andreassen, B. S. Lazarov, and O. Sigmund, "Giga-voxel computational morphogenesis for structural design," *Nature*, vol. 550, no. 7674, pp. 84–86, 2017.

[6] A. Clausen, N. Aage, and O. Sigmund, "Exploiting additive manufacturing infill in topology optimization for improved buckling load," *Engineering*, vol. 2, no. 2, pp. 250–257, 2016.

[7] L. Cheng, X. Liang, E. Belski, X. Wang, J. M. Sietins, S. Ludwick, and A. To, "Natural frequency optimization of variable-density additive manufactured lattice structure: theory and experimental validation," *Journal of Manufacturing Science and Engineering*, vol. 140, no. 10, p. 105002, 2018.

[8] A. Garaigordobil, R. Ansola, O. M. Querin, and A. Olabarrieta, "Infill topology optimization of porous structures with discrete variables by the sequential element rejection and admission method," *Engineering Optimization*, vol. 55, no. 3, pp. 457–475, 2023.

[9] J. Wu, O. Sigmund, and J. P. Groen, "Topology optimization of multi-scale structures: a review," *Structural and Multidisciplinary Optimization*, vol. 63, pp. 1455–1480, 2021.

[10] M. Al Deeb, A. A. Aldosari, and S. Anil, "Osseointegration of tantalum trabecular metal in titanium dental implants: histological and micro-ct study," *Journal of Functional Biomaterials*, vol. 14, no. 7, p. 355, 2023.

[11] Y. Zhang, B. Sun, L. Zhao, and G. Yang, "Design and manufacturing of a novel trabecular tibial implant," *Materials*, vol. 16, no. 13, p. 4720, 2023.

[12] J. Wu, N. Aage, R. Westermann, and O. Sigmund, "Infill optimization for additive manufacturing—approaching bone-like porous structures," *IEEE transactions on visualization and computer graphics*, vol. 24, no. 2, pp. 1127–1140, 2017.

[13] E. Garner, J. Wu, and A. A. Zadpoor, "Multi-objective design optimization of 3d micro-architected implants," *Computer Methods in Applied Mechanics and Engineering*, vol. 396, p. 115102, 2022.

[14] C. Cheng, N. Dai, J. Huang, Y. Zhuang, T. Tang, and M. Yang, "Topological optimization design for a multiscale femoral prosthesis model based on homogenization method," *Scientific Programming*, vol. 2022, 2022.

[15] J. Wu, N. Aage, R. Westermann, and O. Sigmund, "Infill optimization for additive manufacturing—approaching bone-like porous structures," *IEEE Transactions on Visualization and Computer Graphics*, vol. 24, no. 2, pp. 1127–1140, 2018.

[16] H. Klippstein, H. Hassanin, A. Diaz De Cerio Sanchez, Y. Zweiri, and L. Seneviratne, "Additive manufacturing of porous structures for unmanned aerial vehicles applications," *Advanced Engineering Materials*, vol. 20, no. 9, p. 1800290, 2018.

[17] B. Liu, J. Feng, J. Chen, Y. He, and J. Fu, "A topology optimisation-based design method for 3d voronoi porous structures and its application for medical pillows," *Virtual and Physical Prototyping*, vol. 18, no. 1, p. e2285392, 2023.

[18] T. Smit, S. Koppen, S. J. Ferguson, and B. Helgason, "Conceptual design of compliant bone scaffolds by full-scale topology optimization," *journal of the mechanical behavior of biomedical materials*, vol. 143, p. 105886, 2023.

[19] Z. Wang, D. Millet, and Y. Zhang, "Using 2d ct images to directly design and print 3d parametric porous medical models," *CIRP Annals*, 2023.
[20] Z. Wu, L. Xia, S. Wang, and T. Shi, "Topology optimization of hierarchical lattice structures with sub-structuring," *Computer Methods in Applied Mechanics and Engineering*, vol. 345, pp. 602-617, 2019.

[21] A. Chandrasekhar, S. Sridhara, and K. Suresh, "Graded multiscale topology optimization using neural networks," *Advances in Engineering Software*, vol. 175, p. 103359, 2023.

[22] D. A. White, W. J. Arrighi, J. Kudo, and S. E. Watts, "Multiscale topology optimization using neural network surrogate models," *Computer Methods in Applied Mechanics and Engineering*, vol. 346, pp. 1118-1135, 4 2019.

[23] C. Wang, J. H. Zhu, W. H. Zhang, S. Y. Li, and J. Kong, "Concurrent topology optimization design of structures and non-uniform parameterized lattice microstructures," *Structural and Multidisciplinary Optimization*, vol. 58, pp. 35-50, 2018.

[24] C. Zhang, T. Wu, S. Xu, and J. Liu, "Multiscale topology optimization for solid-lattice-void hybrid structures through an ordered multi-phase interpolation," *Computer-Aided Design*, vol. 154, p. 103424, 2023.

[25] J. Rade, A. Balu, E. Herron, J. Pathak, R. Ranade, S. Sarkar, and A. Krishnamurthy, "Algorithmically-consistent deep learning frameworks for structural topology optimization," *Engineering Applications of Artificial Intelligence*, vol. 106, 11 2021.

[26] S. Rastegarzadeh, J. Wang, and J. Huang, "Multi-scale topology optimization with neural network-assisted optimizer," vol. 2, American Society of Mechanical Engineers (ASME), 2022.

[27] Y. Zhang, B. Peng, X. Zhou, C. Xiang, and D. Wang, "A deep convolutional neural network for topology optimization with strong generalization ability," *arXiv preprint arXiv:1901.07761*, 2019.

[28] A. Chandrasekhar and K. Suresh, "Tounn: Topology optimization using neural networks," *Structural and Multidisciplinary Optimization*, vol. 63, pp. 1135-1149, 2021.

[29] C. Qiu, S. Du, and J. Yang, "A deep learning approach for efficient topology optimization based on the element removal strategy," *Materials and Design*, vol. 212, 12 2021.

[30] R. V. W. Id, N. A. Id, J. A. B. Id, and O. S. Id, "On the use of artificial neural networks in topology optimisation," 8 2022.

[31] D. W. Abueidda, S. Koric, and N. A. Sobh, "Topology optimization of 2d structures with nonlinearities using deep learning," *Computers & Structures*, vol. 237, p. 106283, 2020.

[32] J. Yan, Q. Zhang, Q. Xu, Z. Fan, H. Li, W. Sun, and G. Wang, "Deep learning driven real time topology optimisation based on initial stress learning," *Advanced Engineering Informatics*, vol. 51, p. 101472, 2022.

[33] A. Yildiz, N. Öztürk, N. Kaya, and F. Öztürk, "Integrated optimal topology design and shape optimization using neural networks," *Structural and Multidisciplinary Optimization*, vol. 25, pp. 251-260, 2003.

[34] D. Muñoz, E. Nadal, J. Albelda, F. Chinesta, and J. Ródenas, "Allying topology and shape optimization through machine learning algorithms," *Finite Elements in Analysis and Design*, vol. 204, p. 103719, 2022.

[35] Y. Mao, Q. He, and X. Zhao, "Designing complex architecture materials with generative adversarial networks," *Science advances*, vol. 6, no. 17, p. eaaz4169, 2020.

[36] S. Yamasaki, K. Yaji, and K. Fujita, "Data-driven topology design using a deep generative model," *Structural and Multidisciplinary Optimization*, vol. 64, pp. 1401-1420, 9 2021.

[37] H. Jeong, J. Bai, C. P. Batuwatta-Gamage, C. Rathnayaka, Y. Zhou, and Y. T. Gu, "A physics-informed neural network-based topology optimization (pinnto) framework for structural optimization," *Engineering Structures*, vol. 278, 3 2023.

[38] Z. Zhang, Y. Li, W. Zhou, X. Chen, W. Yao, and Y. Zhao, "Tonr: An exploration for a novel way combining neural network with topology optimization," *Computer Methods in Applied Mechanics and Engineering*, vol. 386, p. 114083, 2021.

[39] L. Chen and M.-H. H. Shen, "A new topology optimization approach by physics-informed deep learning process," *Advances in Science, Technology and Engineering Systems Journal*, vol. 6, no. 4, pp. 233-240, 2021.
[40] G. C. Ates and R. M. Gorguluarslan, "Two-stage convolutional encoder-decoder network to improve the performance and reliability of deep learning models for topology optimization," *Structural and Multidisciplinary Optimization*, vol. 63, no. 4, pp. 1927-1950, 2021.

[41] M. Abu-Mualla and J. Huang, "Inverse design of 3d cellular materials with physics-guided machine learning," *Materials & Design*, vol. 232, p. 112103, 2023.

[42] H. Mlejnek, "Some aspects of the genesis of structures," *Structural optimization*, vol. 5, pp. 64-69, 1992.

[43] D. Muñoz, J. Albelda, J. J. Ródenas, and E. Nadal, "Improvement in 3d topology optimization with h-adaptive refinement using the cartesian grid finite element method," *International Journal for Numerical Methods in Engineering*, vol. 123, no. 13, pp. 3045-3072, 2022.

[44] O. Sigmund, "A 99 line topology optimization code written in matlab," *Structural and multidisciplinary optimization*, vol. 21, pp. 120-127, 2001.

[45] O. Ronneberger, P. Fischer, and T. Brox, "U-net: Convolutional networks for biomedical image segmentation," in *Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015: 18th International Conference, Munich, Germany, October 5-9, 2015, Proceedings, Part III 18*, pp. 234–241, Springer, 2015.

[46] W. Weng and X. Zhu, "U-net: Convolutional networks for biomedical image segmentation," *IEEE Access*, vol. 9, pp. 16591–16603, 5 2015.

[47] O. Ovadia, A. Kahana, P. Stinis, E. Turkel, and G. E. Karniadakis, "Vito: Vision transformer-operator," *3 2023*.