Geometrically-driven generation of mechanical designs through deep convolutional GANs

Despite the freedom Additive Manufacturing (AM) offers when manufacturing organic shapes, it still requires some geometrical criteria to avoid a part's collapse during printing. The most synergetic design approach to AM is Topology Optimization (TO), which finds an optimal free-form given mechanical constraints. However, it is hard for TO to integrate these layout geometry-related constraints and it seldom proposes printable shapes. Therefore, this work leverages the Deep Learning (DL) capability to handle spatial correlations within the mechanical design process by integrating the layout and mechanical constraints at the conceptual level. It proposes a DL-layout-driven solution (DL-TO) trained via a triple-discriminator Generative Adversarial Network (GAN) framework. The DL-TO's performance is demonstrated by generating mechanically valid 2D designs conforming with layout constraints in a fraction of a second. DL-TO's creativity is illustrated by its capability to generate designs with unseen input constraints (passive/active elements) and to propose several shapes for the same input mechanical constraints, a task that is hard for a traditional TO to achieve.


Introduction
The growing need for fast, organic, versatile and cost-and material-efficient products in the industrial world drives research to develop design approaches accounting for all these criteria.Topology Optimization (TO) falls in the category of these design approaches.It allows the generation of shapes with curvatures and fine details, given a set of parameters such as loads, boundary conditions and volume fraction.
Complementary to the above comes Additive Manufacturing (AM), which allows the printing of any form.However, this synergy is not as idealistic as it looks.Indeed, AM requires the design's shape to comply with some geometrical criteria that are hard to integrate into TO's formulation (Adam and Zimmer 2014).Thus, designing optimal printable parts requires the intervention of experts to interpret the shapes proposed by TO.Nonetheless, this reinterpretation phase can compromise the initial design's optimality, is time-consuming and depends on the engineer's expertise.
Consequently, with the flourishing role of AM in industry, it is further interesting to find a method that simultaneously considers mechanical constraints (boundary conditions, loads and volume fraction) and geometrical constraints (overhangs, complexity, lengths and thicknesses) at the conceptual level.A recent survey conducted by Subedi, Verma, and Suresh (2020) has shown that half of TO practitioners regret the absence of layout-and manufacturing-related plugins in TO's software.
Thus, research is recently focusing on integrating both these constraints into TO's formulation.Z. Zhang and Zhou (2018), Han et al. (2019) and Bi, Tran, and Xie (2020) adapted TO approaches to account for overhang limitations and to deliver self-supporting designs.Xu et al. (2021) integrated AM support structure and thin feature constraints into bidirectional evolutionary structural optimization to obtain AM-friendly designs.Li et al. (2020), Cunfu Wang and Quian (2020) and Matos, Rocha, and Costa (2021) focused on including the build orientation into TO, especially since the AM part's accuracy and cost are affected mainly by its build orientation.
Nonetheless, TO is an iterative, Finite-Element-based (FE-based) method, hence computationally expensive.While it converges for simple input constraints in a few seconds, its efficiency drops remarkably when the input design space (e.g. the mesh size) increases and input conditions complexify.Moreover, integrating geometric/manufacturing constraints into its formulation, when possible, adds computational costs and often compromises its convergence (Ranjan, Samant, and Anand 2017).
For that reason, other research has turned to machine and Deep Learning (DL) techniques to accelerate the TO process.DL architectures have proven efficient and robust in learning complex spatial correlations and extracting high-level spatial shape-related features from real-world images (Aloysius and Geetha 2017).
The overall DL-based TO approaches found in the literature can be divided into two parts.
On the one hand, the first part partially replaced FE by substituting sensitivity analysis with Neural Networks (NNs) (S.Bi, J. Zhang, and G. Zhang 2020; Chandrasekhar and Suresh 2021) by using super-resolution NNs to enhance the resolution of intermediate FE-TO's outputs (Sosnovik and Oseledets 2019, Kallioras, Kazakis, and Lagaros 2020, Chunpeng Wang et al. 2021) by creating a deep NN-based TO that is trained and penalized using a quality function based on FE (Halle, Campanile, and Hasse 2020), etc.
Nevertheless, none of these DL-based methods included any layout-geometry-related constraints except that of Chandrasekhar and Suresh (2021).On the contrary, they were left to the reinterpretation phase, knowing that significant modifications might be made in the shape during this phase.In other words, the TO phase was accelerated, and not the whole Design for AM (DfAM) process.This work's main contribution is not only accelerating the TO phase but also identifying a way to tailor the design's layout to accelerate the design phase in the DfAM process.Thus, the authors benefit from DL's ability to learn spatial correlations to elaborate a DL approach that simultaneously integrates mechanical and layout conditions at the conceptual level and generates 2D designs validating the input conditions.
The layout is the material arrangement in a design space, which induces a modification in the geometry when changed, in other words, a relaxed geometry condition.The layout condition considered in this work is the total number of components in a 2D design (Nbr bars ).As a matter of fact, the training dataset consists of 2D truss-like structures, each being a collection of three types of beam (Figure 5).The outer shape of a structure is delimited by the clamped and loaded bars, which makes the inner bars a target variable that an engineer can alter, simplify or complexify so as to make the design the design comply with the input constraint.Furthermore, the Nbr bars is an example of layout constraints that are scarcely controllable using FE-TO where the design's geometry is unknown beforehand; hence creating an analytical formula to extract and count beams is hardly feasible.
The DL-layout-driven solution (DL-TO) paves the way to handling and tailoring different shapes during design generation.DL-TO always suggests designs, and even when the proposition is suboptimal, it still offers the engineer a good starting point.This work improves on the work of Almasri et al. (2021), in which the authors trained DL-TO via a dual-discriminator GAN and reported that the generated designs showed poorer mechanical performance (higher compliance values) than their FE based counterparts.Therefore, a third discriminator, a DL-based compliance predictor, is added to the GAN framework penalizing the generator over the compliance during the training.
The use of the GAN training framework has the advantage over other generative approaches in its flexibility.Additional knowledge is incorporated into the generator via new discriminators appended during training; here, the compliance predictor.In the future, thermal distortion and buckling predictors can be added as discriminators to generate designs accounting for these constraints.Additionally, these discriminators can also be used separately (to predict the design's thermal distortion or buckling).This article's significant contributions can be summarized as follows.
(1) The integration of mechanical and non-mechanical layout constraints simultaneously at the conceptual level via a data-driven TO.
(2) The ability to tailor a design's shape easily by a simple change of the input layout condition (Nbr bars in this case), a challenging task to formulate analytically.(3) The creation of a DL compliance predictor.
The rest of the article is organized as follows: Section 2 provides a theoretical overview of TO and GANs, respectively, formulates the problem and outlines the solution.Section 3 details the consolidation of the training and test datasets used to train and evaluate DL-TO.Section 4 depicts the counter-discriminator and compliance-predictor's performance and evaluates the generated designs.Finally, Section 5 summarizes the methodology and its outcomes, and presents future perspectives.

Topology optimization
Structural Optimization (SO) is defined as the process of finding the optimal material distribution within a physical volume domain to support the applied loading conditions and other constraints, e.g.increasing stiffness, reducing stress, reducing displacement, etc.There are three major SO approaches: (i) size; (ii) shape; and (iii) TO.
TO is the most general form of SO.It simultaneously addresses topology, shape and sizing problems, and ensures efficient material use.
The increase in raw material cost, the environmental challenges (like energy consumption), the rise of computational power and the development of advanced programming methods have made TO a prevalent discipline in industrial design (Querin et al. 2017;Sigmund and Maute 2013).The topmost common commercial approach is Solid Isotropic Material with Penalization (SIMP), also called the power-law approach (Bendsøe 1989;Sigmund and Petersson 1998).SIMP is a density-gradient-based iterative method that uses the penalization scheme of the intermediate non-binary values of density material x to converge to an optimal binary design.SIMP represents a design as a distribution of discretized square material elements e (material properties are assumed constant within each e).They are modelled as the relative material density raised to some power times the material properties of the solid material.In this work, the objective function to minimize is the energy of deformation or compliance C(x) in Joules (J): e k e u e (1) subject to : where U and u e are the global and element-wise displacements, F the forces vector, K and k e are the global and element-wise stiffness matrices, N the number of elements e, x min the minimum density x (non-zero to avoid singularity), and p the penalization power (typically 3).V 0 and V(x) are the design domain and material volumes, respectively, and f the volume fraction.
To solve the problem stated above efficiently, Sigmund and Petersson adopted the optimality criterion approach.A mesh-independency filter is applied to the element sensitivities to avoid checkerboard patterns.
In this study, a modified version of the numerical solution of SIMP written by Sigmund (2001) is used to generate a sufficient database of 2D designs.

Problem definition and solution outline
Despite the previously listed advantages of TO, it suffers from one principal drawback.The general shape is usually identified in the very early iterations, making it difficult for TO to modify it to account for other changes imposed by other constraints; hence, the output shape ends up a local minimum (Allaire, Dapogny, and Jouve 2021).Furthermore, for density-based TO, geometry cannot be defined clearly as it depends on the mesh size (Figure 1).Hence, any layout-related constraint controlling the design's geometry cannot be incorporated easily within TO's formulation.Last but not least, TO suffers from a convergence problem despite the penalization scheme; the grey regions in the output designs are hard to interpret physically (Figure 2).
To compensate for these limitations, the authors propose a data-driven approach to explore the DL capability, particularly Convolutional NN (CNN), to integrate a first layout constraint, the Nbr bars , concurrently at the same level as the mechanical constraints.CNNs have demonstrated their potential in learning spatial correlations, and DL outputs converged to crisp black-and-white designs if trained on converged training designs.
Since the problem is to generate designs, a data-driven generative method, in particular GAN, is chosen for its flexible framework in incorporating additional knowledge into the generator.As mentioned previously, this work improves on the work of Almasri et al. 2021 and further explores and interprets the results.

Convolutional conditional GAN (convolutional cGAN)
The approach adopted is based on the convolutional conditional GAN framework detailed in the following subsections.

Generative adversarial networks
GAN is a method that learns to mimic any input data distribution.Its advantage is that it can generate new samples following the same input data distribution.It consists of two neural networks, each working against the other: the generator G(z, θ g ), with θ g its parameters and z a latent random vector following a noise prior distribution p z ; and the discriminator D(x, θ d ), with θ d its parameters and x a real sample.G(z, θ g ) tends to output samples with a distribution p g similar to the real data distribution p data .However, D(x, θ d ) tries to discriminate real samples (i.e. from p data ) from synthesized ones (i.e. from G(z, θ g )).Both networks are trained in a minimax framework to improve the same loss function: the cross-entropy loss L(G, D).This loss, as defined in the original article (Goodfellow et al. 2014) is (3) The solution of this function is p g = p data , i.e. when the generator starts to output data samples following the same distribution as the real ones.

Conditional Generative Adversarial Networks (cGANs)
On the other hand, a cGAN (Mirza and Osindero 2014) is a GAN's extension enabling the generation to be oriented by a specific input condition c.In this framework (Figure 3), the basics of cGAN become the conditional generator as G(z|c, θ g ), the conditional discriminator as D(x|c, θ d ) and the loss function as

Convolutional Neural Networks (CNNs)
CNNs differ from traditional NNs in the way neurons between successive hidden layers are connected.In a hidden layer, a neuron is only connected to a subset of neurons in the previous layer.This sparse connectivity allows CNNs to learn feature maps implicitly and reduce the network's complexity.
CNNs have proven robustness in learning spatial correlations in images (Aloysius and Geetha 2017), making a CNN-based architecture the adequate generator's architecture.
To sum up, a convolutional cGAN is a cGAN with G(z|c, θ g )'s and D(x|c, θ d )'s architectures being based on CNNs.

The methodology
This work aims to create a DL-TO method that simultaneously integrates mechanical and layout constraints.In other words, the training must ensure that DL-TO's network is penalized on both input constraints.The input constraints are formulated as images (Figure 4).Therefore, a conditional convolutional triple-discriminator GAN (Mirza and Osindero 2014) is chosen to train DL-TO.Before the training, the counter and compliance predictors are pre-trained with real data.These discriminators are only used as evaluators during the training of DL-TO.The training procedure is outlined in Figure 3.

Architecture of the generator (DL-TO)
The generator (DL-TO) is a deep Res-U-net network (Z.Zhang, Liu, and Wang 2018).It is an encoder-decoder CNN-based architecture with residual (Res) and skip-connections (U-net).DL-TO's encoder encodes the six input conditions formulated as a six-channel-image (the boundary conditions and loads along the x-and y-axes, the volume fraction and the Nbr bars ) and decodes the 2D design (Figure 4).The architecture is justified and detailed in the online supplemental data, which can be accessed at https://doi.org/10.1080/0305215X.2022.2144847.

Architecture of discriminators
The first one, the traditional discriminator, takes the design, along with all its conditions, and outputs the probability that it comes from the real data distribution to ensure the generator learns it.The second one, the DL-counter, takes the design, and only its mechanical conditions, and outputs its Nbr bars to ensure the generator respects the input layout condition.Finally, the DL-compliance predictor takes the design and predicts its compliance to boost the generated designs' mechanical performance.

Architecture of the traditional discriminator.
The traditional discriminator's network consists of DL-TO's encoder followed by a dropout, then a fully connected layer.It outputs a probability p regarding the design being real (p ≈ 1) or fake (p ≈ 0).It helps DL-TO learn the mapping from constraints to designs (quality) and capture various constraints (diversity).

Architecture of the counter discriminator.
The counter architecture is detailed in the online supplemental data.
In this work, the counter is used at three levels: (1) to augment the training dataset; (2) to train; and (3) to evaluate DL-TO.
It is pre-trained on manually labelled SIMP-designs (4347 samples) before the GAN's full training; the Nbr bars present in each design are counted manually (Figure 5).
This pre-trained counter is used to predict the Nbr bars on unlabelled training designs (to augment the labelled training dataset).This pre-training hack improves DL-TO's convergence.
At each training iteration, this discriminator is used to predict the generated designs' Nbr bars and penalize DL-TO.
At inference time, it is used to predict the Nbr bars on generated designs to evaluate DL-TO's conformity to the layout constraint (Section 4).
The counter's performance is detailed in Section 4.1.

Architecture of the compliance discriminator.
The compliance predictor's architecture is detailed in the supplemental data.It takes an image-like 2D design as input and outputs an estimation of the compliance value.It is pre-trained on real 2D designs (output by SIMP).Its performance is detailed in Section 4.2.It is interesting to highlight that an FE-based compliance evaluator could conduct the training instead of a DL-based one.However, this is disadvantageous in terms of training time.An FE-compliance computation is thousands of times slower than its DL-counterpart (Section 4.2).

Loss function
This triple-discriminator GAN strives to train DL-TO to generate 2D designs of good quality and compliant with the input mechanical and layout conditions.Thus, the original adversarial loss function (L adv ) used to train the generator (Equation 4) is adjusted by adding the reconstruction (L r ), counting (L count ) and compliance (L C ) losses.The modified generator loss function L G adapted in training is the following: where The adversarial loss encourages creativity and diversity in the generated 2D designs.The reconstruction loss boosts their aesthetics and conformity with the volume fraction constraint; the design's volume fraction is the average of the pixel values.The counting loss assures the generator respects the input layout constraint.Finally, the compliance loss compensates for the weak mechanical performance exhibited in the work of Almasri et al. (2021).
It is worth noting that the relative error is used to compare the generated designs' compliance versus the SIMP's in the work of Almasri et al. (2021), which is the L1-norm between the compliances of the DL and SIMP designs divided by the SIMP designs' compliance.Thus, using the L1-norm in the loss function penalizing DL-TO's training is the best choice, especially since the objective is to generate designs with lower compliance.However, the L2-norm was also tested.With L2, the DL designs always showed higher compliance than their SIMP counterparts.Consequently, the L1-norm is chosen for the L C .
The stable-GAN-training challenges and hacks and regularization terms (λ i ; i ∈ [1, 4]) used are justified in the supplemental data.

Data generation
To train the model, 21,538 2D designs were generated following the SIMP method (Section 2.1) via a Python version of the academic open-source TO code written by Sigmund (2001). 1 The layout constraint (Nbr bars ) is added by manual labelling over 4347 samples (which are used to pre-train the counter discriminator), and then the Nbr bars of the remaining samples are predicted using the counter discriminator.
A 2D design of size n x × n y is discretized into a mesh of (n x + 1) × (n y + 1) nodes and is subject to two major constraints: the boundary conditions (BC), i.e. the clamped nodes, and the load configurations (F), i.e. the loaded nodes (Figure 5).Thus, input conditions (BC, F, V and Nbr bars ) are concatenated as a six-channel image i.e. of dimension 6 × n x × n y (Figure 4).
The dataset was separated into a training (80%) and a test (20%).The test set is used to evaluate the generator's performance.
The data generation strategy is further detailed in the supplemental data.

Results and discussion
An optimal design is a trade-off between mechanical performance and layout constraints.Thus, this section conducts a quantitative mechanical evaluation of the generated designs' mechanical performance via the relative error of compliance and volume fraction and a layout one to validate the designs' conformity with the input layout constraint Nbr bars .
Most state-of-the-art GANs evaluations are subjective, based on the creativity and aesthetics of the generated samples.In this study, generated designs are assessed qualitatively and quantitatively.
The relative error e X % = (X g − X o )/X o × 100 is the metric used for the volume fraction V and compliance C, where g and o refer to generated and original, respectively, and {X ∈ {V, C}}, such that V is the mean of density-pixels and C is computed via an FE formula.For the Nbr bars , the metric is the bar-count difference Nbr bars = Nbr bars g − Nbr bars o , such that Nbr bars is predicted via the counter discriminator.

Counter-discriminator's performance
As previously mentioned, the counter discriminator is pre-trained on manually labelled SIMP designs (4347 samples) before the GAN's full training.
The 2D designs in the dataset consist of structures with 3 to 31 components, which is a wide range for the Nbr In conclusion, the counter-discriminator is validated.

Compliance-predictor's performance
The DL compliance predictor's performance is evaluated by two metrics, the computation time (Figure 6(a)) and the prediction error e % , which is the relative error between the true and predicted compliance values on the real designs (Figure 6(b)).Eighty-seven percent of the test predictions fall into a 5% error margin, and 93% of them are made within a 10% error margin.Moreover, it computes the compliance of one design 16 times faster (on the CPU) and 56 times faster (on the GPU) than the FE-based calculator, and 400 (on the CPU) to 5000 (on the GPU) times faster for a batch of designs (Figure 6(a)).Thus, the DL compliance predictor's advantage over its FE counterpart is its prediction speed, especially in batch prediction, allowing faster GAN training within an acceptable level of precision.

DL-TO's performance
This section summarizes the overall performance of DL-TO and compares the results obtained versus those reported in the work of Almasri et al. (2021).The generated designs are thresholded to damp any intermediate density values.Table 1 clearly shows that C is improved by 21.3% with the integration of the compliance predictor as a third discriminator without any loss of generality.Moreover, this improvement increases remarkably, by 45.4%, if the error is restrained to 5% (15.4% versus 60%).
For a better visualization, Figure 7 plots the e V % , e C % and Nbr bars distributions of the test set using DL-TO's previous and improved version.The improvement over C is clear, the median e C %

Aesthetics
Mechanical performance (%) lLayout performance (%) In other words, the addition of the third discriminator enhanced the compliance without deterioration of the initial performance.
Finally, the computational performance of DL-TO and FE-TO (SIMP) are compared.DL-TO generates a design 3500 times faster on the CPU and 47,000 times faster on the GPU (see Table 2 in the supplemental data).Furthermore, DL-TO has the advantage over SIMP in terms of layout control at the conceptual level; it takes into consideration not only mechanical but also layout constraints, for which SIMP needs post-processing.This aspect is demonstrated in Section 4.4.
A sample of the designs generated by the DL-TO trained in this work compared to those generated by Almasri et al. is illustrated in Figures 8(a) and 8(b), respectively; a global threshold is applied over the generated designs.As expected, those generated by the new DL-TO version show lower deformation energy (C).It is essential to underline that applying a threshold is critical to a design's mechanical performance and its layout; the lower the threshold, the higher the V; the higher the threshold, the lower the Nbr bars with possibly the appearance of discontinuities in the design.Hence, the optimal approach is to privilege a local threshold.
To sum up, the overall performance of DL-TO is promising.It generates mechanically valid designs while respecting layout constraints, indistinguishable to the naked eye from those generated by SIMP while being thousands of times faster.
Thus, it offers the designer an alternative way to explore designs faster and easily adjust their layout (here defined by Nbr bars ).Tuning the mechanical and layout conditions is accomplished fast and effortlessly.Furthermore, the choice of GANs is justified.The addition of discriminators is advantageous, and when the right balance between their losses is found, transferring new knowledge to the generator is possible and is demonstrated here.

Tailoring the design's layout via DL-TO
To validate DL-TO's understanding of layout, the mechanical conditions (BC, F and V) were prepended, only Nbr bars is varied (Figure 9(a)).Indeed, the Nbr bars in the design increases with the input variable.
However, the supplementary bars are blurry, and DL-TO struggles to conform with the input Nbr bars , especially for the lower and upper extreme values (7 and 30).
Moreover, V and Nbr bars of a design are correlated.Thus, a better approach would be to vary them together (Figure 9 To identify this minimum value, a set of mechanical constraints are fixed, and Nbr bars is varied between 3 and 30 bars.Then, the designs are generated and evaluated (Figure 10).C and Nbr bars are inversely correlated, and the minimum admissible Nbr bars of the considered example is 15, after which C does not show any remarkable improvement.This information implies that the designer can choose any design with 15 to 30 components and guarantee that its mechanical performance will not deteriorate, knowing that this process takes a fraction of seconds, thanks to DL.

Generating designs with a new unseen constraint
Some spatial constraints can be enforced on the design area's boundaries.These boundaries can be defined by the V matrix.
This section examines DL-TO's potential to propose new designs accounting for this constraint.It should be noted that it was trained using only input V without any design area boundaries.
Since the input V is formulated as a matrix of (n x + 1) × (n y 1) elements, the existence/absence of material in particular locations of the design space is obtained by increasing/decreasing the values in these locations.
This formulation allows many layout constraints to be integrated into the design, like passive elements (e.g. a hole for a pipe) or active elements (e.g. a filled shape for an external pillar).It also allows the addition of boundary and load conditions on these elements by modifying the BC and F matrices.This aspect is not explored in this research.
Figure 11 illustrates a sample of constraints without/with different design area's boundaries and the corresponding generated threshold designs.In all three cases, DL-TO filled/emptied the locations with/from material where extra/no material is forced; it reshaped the internal truss-like shape creatively to maintain the design's integrity while preserving the original design's outer shape.In other words, it respected the input BC and F configurations.As for compliance, it decreased in 4 out of 15 cases, its increase was modest (e C % ≤ 10%) in 5 cases, and its increase was more than 10% in the remaining 6 cases (Figures 11 and 12).
Finally, this experiment was replicated using SIMP (Figure 12).As can be seen clearly, SIMP does not always comply with the constraint.In Figure 12(a), the additional material is on the left side of the domain space; SIMP responded with thicker-bars designs instead of adding extra material only to the left side; in other words, the volume fraction constraint is considered globally and not locally.It is worth mentioning that these designs, while not conforming with the constraint, benefited from lower compliance.In Figure 12(b) where a hole was enforced, SIMP failed to converge to a solution.
To sum up, DL-TO shows an encouraging result in creatively conforming to layout constraints, and its convergence is not easily compromised, especially when trained on converged designs.
To the best of the authors' knowledge, DL-TO is the first strategy that allows for the natural handling of active and passive elements while not explicitly being trained on such samples, demonstrating its generalization capability.

Discussion
Data-driven TO requires three challenging and time-consuming steps: data preparation, model architecture and training.Thus, the acceleration advantage of DL-TO over FE-SIMP can seem moderate in the short term but will definitely pay off in the long run.
This article addresses the problem of handling spatial correlations via a cGAN architecture.cGAN allows the incorporation of a layout constraint, Nbr bars , into the mechanical constraints without the need for explicit formulas for bars.It is essential to highlight that this work does not handle any manufacturing constraint yet, only a simple geometry-related constraint.Further work will try to generalize over more concrete manufacturing constraints.The Nbr bars condition is not a major manufacturing constraint.However, it is used to validate the approach, which is that DL can compensate for the difficulties faced by TO when dealing with mechanical and layout-related constraints concurrently.
Arguably, the level-set approach resolves the principal drawback of density TO mentioned in Section 2.2.Nevertheless, density-TO, SIMP mainly, is the most implemented in industrialcommercial software, which justifies developing a DL approach trained on SIMP designs.Indeed, the asset of DL-TO is that, unlike FE-TO, the initial guess can be easily tailored to account for a layout constraint.Moreover, it increases the domain space of potential designs, which can be leveraged  Moreover, SIMP is chosen to create the dataset in this work.SIMP is the simplest and most easily implemented TO algorithm.Thus, the designs driving the training are created to validate the proposed methodology.Indeed, any new data coming from other TO algorithms can be used to train the proposed model.
Finally, it is essential to highlight that the layout constraint used in this work (Nbr bars ) might not be the most demonstrative example because Nbr bars is more precisely controllable by the primitives/supershapes methods (Smith andNorato 2021, 2019;Norato 2018).However, it is proof that a layout constraint requiring seeing the design as an image, typically an aesthetic constraint (filling the design space) can be integrated via DL.

Conclusion
This article improves the DL-TO model proposed in Almasri et al. (2021).DL-TO generates topologically optimized designs, similar to those generated by SIMP and a thousand times faster.Moreover, it tailors the design's layout by increasing/decreasing the input number of components.A structure can easily be refined towards a simpler or more sophisticated structure, as the first step towards accelerating the design phase in the DfAM process.Furthermore, DL-TO generates creative designs with previously unseen input conditions, in particular the boundary of the design area (passive and active elements).
This work shows that DL architectures can learn the correlation between mechanical and nonmechanical constraints, such as Nbr bars , a layout-related constraint.Its main objective is not to replace robust TO methods but to compensate for their difficulties in accounting for layout-related constraints.With DL-TO, the mechanics and layout-related are managed concurrently at the conceptual level and not sequentially, increasing the potential designs' space and accelerating the DfAM.Moreover, DL-TO's training strategy is flexible.The adaptability and effectiveness of upgrading the training framework from two to three discriminators to incorporate additional knowledge (here, the compliance constraint) to DL-TO without compromising its initial performance are demonstrated.
It is worth noting that the current method does not alleviate the engineering work necessary but does accelerate the search for the optimal print-ready design.
In the future, this strategy paves the way to facilitate the integration of more complex geometrical/manufacturing constraints via new discriminators (geometry-evaluators) appended in the GAN framework (to account for overhangs, maximum/minimum length/thickness, bar curvatures, etc.).Another future perspective is to adapt this approach to 3D designs.Finally, it is interesting to mention that DL-assisted TO algorithms will be good candidates as lighter and faster modules to be implemented in CAD software.

Figure 1 .
Figure 1.An example of the mesh-dependency setback of TO.SIMP outputs two different layouts for two different mesh sizes for the same input mechanical conditions.

Figure 2 .
Figure 2. Diagram of a Conditional GAN.

Figure 3 .
Figure 3. Training Procedure.(From left to right).1)The mechanical constraints (Boundary conditions BC, loads configuration F and volume fraction V) are concatenated with the layout condition (Nbr bars ) and then input into the generator (DL-TO), which outputs the Generated Designs.The latter are concatenated with BC, F, V and Nbr bars and fed to the traditional discriminator, which predicts a score (the adversarial loss).Then they are concatenated with only the mechanical conditions and fed to the counter discriminator, which predicts their Nbr bars .The counting loss is the MSE between the input and predicted Nbr bars .Afterwards, the generated designs' compliance (C) is predicted by the C discriminator.Finally, the generated design's quality is evaluated (the Reconstruction error).All four losses are summed (a weighted sum), and the final score is fed-back to DL-TO to update its weights.2) The Traditional discriminator is trained at two levels: first with the real designs and the second with the generated designs.The adversarial loss is used to update its weights.3) The counter and compliance discriminators are pre-trained ahead with the real designs and used as evaluators during the training.

Figure 4 .
Figure 4. Input of the DL-TO.The boundary conditions along the xand y-axes (BC x , BC y ), load configurations (F x , F y ), volume fraction V and layout constraint Nbr bars are formulated as a six-channel image.

Figure 5 .
Figure 5. Types of bars in a design.The design shown here is clamped from the upper-left edge and loaded with two punctual external forces located in the bottom corners and tilted by 7 and 38 degrees.Indeed, It has 5 clamped (red) bars, 2 externally loaded (green) bars outgoing from two nodes corresponding to the forces locations and 6 internal-transmission (blue) bars, thus, a total of 13 bars.
xi being the true and predicted 2D design, y i the input Nbr bars , ŷi the predicted Nbr bars of the generated design, C i the compliance of the real design, Ĉi the compliance predicted over the generated one and n the batch size.The accuracy of the counter discriminator Acc count = 1 N N i=1 ( ti == y i ) with y i , ti the true and predicted Nbr bars in the real designs and N the total number of training samples.
bars variable.An admissible prediction falls within an interval | Nbr bars | ≤ 2. The counter's performance on the training (3885 designs) and test (462 designs) sets: (1) on the training set: 99.8% of the predictions fall within | Nbr bars | ≤ 1 bar; (2) on the test set: 85.4% of the predictions fall within | Nbr bars | ≤ 1 bar while 94.9% of them within | Nbr bars | ≤ 2 bars.

Figure 6 .
Figure 6.This figure shows the relative prediction error of the DL-compliance-predictor and compares its computational efficiency versus the traditional FE-based-compliance-calculator.(a) Computation time in seconds (s) and (b) Relative prediction error, e % .

Figure 7 .
Figure 7.The distributions of the relative errors of volume fraction and compliance (e V% and e C% ) and the difference between the number of design components ( Nbr bars ) computed over the test set for the DL-TO trained with two (Almasri et al. 2021) versus three discriminators.

Figure 8 .
Figure 8.Comparison between the generated designs from two DL-TO models.The designs in Figure 8(a) are generated by a DL-TO trained with an additional DL compliance predictor.The generated designs' mechanical performance (the compliance) is improved after integrating the DL compliance predictor as a third discriminator.(a) Generation by the DL-TO trained with an additional compliance predictor and (b) Generation by the DL-TO of Almasri et al. (2021).
(b)).Modifying V and Nbr bars simultaneously improves DL-TO's conformity with the input layout and V constraints ( Nbr bars and e V % decreased in Figure 9(b)), and most importantly demonstrates DL-TO's creativity in adding/removing internal bars to/from the design.Nevertheless, while C improved for Nbr bars = 20 and 30, it exploded for Nbr bars = 7.This phenomenon implies a minimum Nbr bars for every set of mechanical conditions to guarantee the design's integrity and resilience.

Figure 9 .
Figure 9. Tailoring the layout of a design: (a) the mechanical constraints (BC, F and V) are fixed and the Nbr bars condition is variable; (b) BC and F are fixed while Nbr bars and V are variable.(a) Varying Nbr bars and (b) Varying Nbr bars and V proportionally.

Figure 10 .
Figure 10.Compliance versus Nbr bars variation for a set of fixed mechanical constraints.The maximum admissible compliance is 450 J (the dashed line).The minimum admissible Nbr bars here is 15 bars, and the lowest compliance is achieved at Nbr bars = 30.

Figure 11 .
Figure 11.Sample of DL-TO designs generated without versus with constraints on the design area's boundary as input (V input ).All designs are threshold: (a) additional material is added on the right edge; (b) a hole (passive element) of radius r = 30 is enforced at the bottom left of the design space; (c) an active element of radius r = 15 is enforced at the centre of the design space.The BC (dashes in red) and F (arrows in green) conditions are only shown on the first row.The computed compliance C in Joules (J) is shown under the design.

Figure 12 .
Figure 12.Sample of SIMP designs generated without versus with constraints on the design area's boundary as input (V input ).All designs are threshold: (a) additional material is added on the right edge; (b) a hole (passive element) of radius r = 30 is enforced at the bottom left of the design space; and (c) an active element of radius r = 15 is enforced at the centre of the design space.The BC (dashes in red) and F (arrows in green) conditions are only shown on the first row.The computed compliance C in Joules (J) is shown under the design.
3% from the work of Almasri et al.The distributions of e V % and Nbr bars remain similar.