{'fraction_non_alphanumeric': 0.023440276868393978, 'fraction_numerical': 0.01438593209241418, 'mean_word_length': 4.733776681325754, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An adaptive artificial neural network-based generative design method for layout designs

Layout designs are encountered in a variety of fields. For problems with many design degrees of freedom, efficiency of design methods becomes a major concern. In recent years, machine learning methods such as artificial neural networks have been used increasingly to speed up the design process. A main issue of many such approaches is the need for a large corpus of training data that are generated using high-dimensional simulations. The high computational cost associated with training data generation largely diminishes the efficiency gained by using machine learning methods. In this work, an adaptive artificial neural network-based generative design approach is proposed and developed. This method uses a generative adversarial network to generate design candidates and thus the number of design variables is greatly reduced. To speed up the evaluation of the objective function, a convolutional neural network is constructed as the surrogate model for function evaluation. The inverse design is carried out using the genetic algorithm in conjunction with two neural networks. A novel adaptive learning and optimization strategy is proposed, which allows the design space to be effectively explored for the search for optimal solutions. As such the number of training data needed is greatly reduced. The performance of the proposed design method is demonstrated on two heat source layout design problems. In both problems, optimal designs have been obtained. Compared with several existing approaches, the proposed approach has the best performance in terms of accuracy and efficiency.


Introduction
Layout design can be broadly defined as the placement of design components/materials in a domain to achieve certain design objectives. This type of problem is frequently encountered in a variety of fields. For example, the V-shaped formation of birds can be regarded as an optimized solution of a layout design problem to improve aerodynamic efficiency [1,2]. In engineering fields, the design of novel composite materials by strategically distributing soft materials inside a hard host material to achieve high stiffness and toughness [3] and the arrangement of heat sources in a system to reduce the maximum temperature [4] are all layout design problems. Often these design problems involve a large number of design degrees of freedom and/or are subjected to various constraints, making the search for the optimal solution extremely challenging and slow.
In recent years, machine learning methods have been increasingly applied in solving design problems. There are mainly two groups of machine learning-based approaches for layout designs. One group uses artificial neural networks as efficient surrogate models to speed up design evaluation in each iteration, and thus shortens the design process. For example, a feature pyramid network was constructed to rapidly predict the temperature field of a design layout directly from its structure [4]. It was then combined with the neighborhood search-based optimization procedure to find an optimized placement of heat sources to minimize the maximum temperature. In [5], a neural network-based surrogate model was developed to predict the drag force of an underwater vehicle fleet and used in the design of a fleet with minimum drag force. One issue in this type of the approach is the high computational cost associated with training data generation, which is often conducted using high-dimensional simulations, for example, the finite element analysis. The amount of training data should be sufficient so that the prediction accuracy of a surrogate model is high enough to yield satisfactory design solutions. A simple approach is to use brute force algorithm to construct a large amount of data covering the entire design space [3,6]. Such an approach is not only inefficient in problems with many design variables, but also not suitable for problems in which good design solutions lie in an extremely small portion of the design space. How to efficiently generate training data to truly achieve time saving in design problems is an ongoing research topic [7]. In a recent work [8], a machine learning framework was developed for topology optimization, in which a deep neural network (DNN) was used to predict the sensitivity information required to update the design. The online training and updating scheme and the two-scale topology optimization formulation facilitate an efficiency approach that shows promising potential to greatly reduce the computational time for large-scale topology designs.
Another group of approaches use various artificial neural networks to directly produce design solutions. For example, convolutional neural networks(CNNs) were used to map structures directly to their responses and the inverse design was carried out using a gradientbased optimization scheme in which the gradients of the responses with respect to each design variable, that is, pixel value, were obtained by performing the backpropagation of the network [9,10]. One challenge in this type of approaches is that for problems with a large number of design variables, the design converges very slowly and the computational cost increases greatly [11,12]. In addition, the obtained optimized structure likely contains unmanufacturable features. With the advent of image generative neural networks such as generative adversarial neural network (GAN) and variational autoencoder (VAE), generative machine learning methods are gaining popularity in design. In [13], a design method based on VAE model was developed. The VAE model served two functions. One was to generate design candidates and the other was to correlate the layout with the response. In a later paper [14], the two functions were separated to improve the performance. A GAN was used to generate design candidates and a CNN was used to map the design to its response/functionality. A design neural network was then constructed by connecting the generator of the GAN with the CNN to produce optimal designs. A similar approach was used to design phononic crystals with a prescribed band gap [15]. In this work, an autoencoder was used to generate crystal structures and a multi-layer perceptron was used to map a phononic structure with its band gap vector. Compared with conventional design methods such as topology optimization, the advantages of the neural network-based generative approaches are that (1) the design variables are latent variables instead of pixel values, which greatly reduce the size of the design problem, and (2) the shapes of designs can be controlled and thus the produced optimized designs are more practical. In a recent work [16], a VAE combined with a regression network was used to map complex microstructures into a lowdimensional, continuous, and organized latent space. This organized latent space facilitates the multiscale metamaterial systems design in which a diverse set of microstructures with specified properties can be rapidly generated and assembled by an efficient graph-based optimization method. However, one main issue in generative machine learning methods is that the design solutions are inherently confined within the design space generated by generative models. To obtain the desired solution, for example, the global optimal design, the generated design space must contain such a design. This is generally difficult to achieve unless a large corpus of training data that covers the entire design space is used to train the generative and the corresponding regression models, which is of course computationally intensive.
In this paper, we present an adaptive learning strategy for both generative and regression models so that a sequence of design spaces are generated. Each of these design spaces occupies a small portion of the entire design space, and hence only a small number of training data is required. Through an iterative learning and optimization process, the sequence approaches to the region that contains optimal designs, allowing the desired solution to be found. To demonstrate the performance of the proposed approach, two types of heat source layout design problems were solved using the proposed method. Such problems are frequently encountered in the thermal management of electronic devices/systems [17][18][19][20] and satellite systems [21,22]. Due to the large design space, efficient design methods are in great demand.
The remaining part of the paper is organized as follows. Section 2 introduces the heat source layout design problem and the existing methods. In Section 3, the proposed adaptive deep neural network-based design method is described. Methods for constructing GAN to produce design candidates satisfying prescribed constraints and CNN for rapid prediction of temperature field are also described. Results are presented in Section 4 including the generation performance of the constructed GAN, the prediction performance of the CNN, and design results of two heat source layout design problems. Performance comparison with conventional methods is also presented. A summary of the work is given in the last section.

Heat source layout design
The size of electronic components continuously shrinks thanks to the advent in microfabrication technology. An adverse effect of this movement is the continuously increased power density due to the densely packed electronic components. Heat concentration and hot spots are more frequently occur in these devices/systems, which undermine the operation consistency and reduce the lifespan. Thermal management has become a pressing issue in the development of this field [17,23]. Various approaches have been proposed. Among them, the method of using smart layout designs to reduce heat concentration and eliminate hot spots is perhaps the most cost-effective and easy approach to implement in practical applications, for example, to optimize the distribution of the high thermal conductivity material in the domain [24][25][26], or to intelligently place heat sources in the system to reduce the heat concentration and/or eliminate hot spots [27,28].
In a typical heat source layout design problem, a number of non-overlapping heat sources, for example, electronic components, are to be placed at certain locations in a domain so that the corresponding temperature field of the system satisfies a set of prescribed conditions, for example, having the lowest maximum temperature. Such a design problem can be casted into an optimization problem with the design objectives being the prescribed conditions on the temperature field and the design variables being the possible locations that each heat source can occupy. Assuming that the temperature of the system is pre-dominated by thermal conduction and/or convection and using a 2D problem as an illustration example, the governing equation for the steady state heat conduction is: where T is the temperature, is the thermal conductivity and ∅( , ) is the intensity distribution of heat sources, which is defined by the locations of heat sources as: where ∅ is the intensity of the -th heat source ( = 1, 2 … ) and is the totally number of heat sources; Г = ⋃ Г =1 denotes the region occupied by heat sources and Г denotes the region occupied by the -th heat sources.
Different boundary conditions can be applied depending on applications. Three common boundary conditions are the adiabatic boundary, the isothermal boundary and the convective boundary, which can be formulated as follows: where 0 represents the temperature of the isothermal boundary; ℎ is the convective heat transfer coefficient and 1 is the fluid temperature of the convective boundary.
Due to the large number of possible locations that heat sources can occupy, efficient design methods must be developed. Over years, several methods have been proposed such as the bionic optimization method [27], the gradient-aware bionic optimization method [29], the simulated annealing method [28] and iterative reweighted L1-norm convex minimization [30]. The bionic optimization method [27] aims at achieving a uniform temperature field in the design domain to eliminate hot spots within the domain. In this method, heat sources are added one by one and always at the location with the minimum temperature. The gradient-aware bionic optimization method [29] is an improved version of the bionic optimization method. It aims at achieving a uniform temperature gradient instead of temperature to eliminate hot spots. When a new heat source is introduced, the gradient-aware bionic optimization method places it at the location with the maximum temperature gradient so that a uniform temperature gradient is achieved in the final design. Both methods are efficient, but they are not general. For example, the temperature constrained heat source layout design problem [4] will be difficult if not impossible to be solved by these two methods. The simulated annealing method reduces the maximum temperature by placing heat sources through random walks based on Metropolis principle [28]. The convergence of this method is very slow, and consequently the corresponding computational cost is very high. In [30], the heat source layout design problem was transferred into a convex optimization problem and the sequential reweighted L1-norm minimization technique was used to solve the problem. An advantage of this method is that only one full-scale temperature simulation is needed, and thus the computational cost is greatly reduced. However, the design results produced were not as good as those obtained from other methods. In addition, a nonzero inter-source spacing must be set to avoid the overlapping of heat sources, which introduces additional errors.
Apart from these conventional approaches, machine learning methods have also been applied to solve heat source layout designs. In [31], a layout design with three heat sources was performed in a 2D ventilated cavity cooled by forced convection. An artificial neural network was constructed to predict the maximum temperature of the cavity. It was then integrated with the genetic algorithm (GA) to optimize the locations of the three heat sources to reduce the maximum temperature in the ventilated cavity. A similar approach was employed in the layout design of five heat sources in a three-dimensional vertical duct [32]. In this case, due to the small size of the design space, an exhaustive search approach was used to generate all possible configurations. In [4], a feature pyramid network was firstly trained to predict the temperature field of heat source layout designs and then combined with the neighborhood search-based optimization to search for the optimal heat source layout with the lowest the maximum temperature. In all the work, an artificial neural network is used to speed up the calculation of the maximum temperature. However, the efficiency gained by using artificial neural network is largely reduced by the large amount of training data used to train the artificial neural network.

Brief overview of the layout design method based on GAN and CNN
The framework of the GAN+CNN-based design method proposed in [14] consists of three parts: a design generator, a design evaluator and a design network as illustrated in Fig. 1. Design candidates are generated by the design generator, which is a generative neural network such as a GAN. There are two advantages of using a generative neural network. First, the layout/structure is described by the latent vector of the generative model, whose dimension is much smaller than the number of design variables. Secondly, geometric constraints of the design can be enforced through the training of the generative model. For example, to design composite materials with only circular inclusions, the GAN can be trained with various microstructures with circular inclusions. Once trained, the generator of the GAN will generate new microstructures with circular inclusions. The design evaluator, which is typically a convolutional neural network, outputs the performance of a given candidate design, for example, the maximum temperature. Then the generator of the GAN and the CNN are connected to form the design network on which the inverse design is conducted. The design variables are the latent variables, Z, of the generative network, and hence the number of design variables is greatly reduced. For a given design target, an optimization scheme is employed to search for a particular Z, which produces a design with the target performance. In [14], a gradient-based optimization scheme was used. The gradient of the loss function with respect to the design variable, that is, Z, was calculated via backpropagation of the design network. Gradient-based optimization schemes are efficient, but the design solution produced highly depends on the initial guess. Hence in [14], several runs of optimization corresponding to different initial Z were conducted and the best design solution was selected among the design solutions obtained from these runs.

The adaptive learning and optimization design method based on GAN, CNN and genetic algorithm
In the original GAN+CNN design method, the two networks, that is, GAN and CNN, are separately trained and conducted off-line. Once trained, these two networks are then combined to form the design network. The training data for both networks must be sufficiently large to ensure that the design space covered by the GAN is large enough to contain the desired design solution. Hence, a large amount of training data is often required. Although the training for GAN is unsupervised, the regression model, CNN, needs to be trained with labels, and often highdimensional simulations are used to produce these labels. Therefore, the computational cost is significant and can largely diminish the efficiency gained by using neural networks.
In this work, an adaptive learning and optimization strategy was proposed and employed to train the GAN and the CNN. The key idea of this strategy is to start with a small design space and then by using iteratively training and optimization gradually move the design space towards to the region that contains the desired design solution. To do so, the training of the GAN and the CNN is conducted online and guided by the optimization results via an iterative procedure. The training data for the GAN changes at each iteration, but the total number is fixed so the design space covered by the GAN remains small. The training data for the CNN is a small subset of the training data for the GAN. To ensure prediction accuracy, the training data for the CNN is continuously expanded by a fixed number at each iteration. The flowchart of the proposed design approach is shown in Fig. 2. We first generate 0 random layouts and randomly selected 0 layouts with 0 ≫ 0 to serve as the training data for the CNN. The Finite Element Method (FEM) or any other method is used to generate labels for these layouts, for an example, to calculate the temperature field of each layout in the heat source layout design problems. The trained CNN is used to screen the original 0 layouts and 1 layouts with best performance are selected. Next, we perform layout perturbation on each selected layout by randomly selecting a heat source and moving it to one of its immediate neighboring pixels, that is, either the left or the right or the top or the bottom pixel of the heat source. This process is conducted p times sequentially, resulting in p new layouts for each selected layout. This process is necessary to move the design space towards the region that contains better solutions. All together they form ( + 1) 1 layouts. The CNN is then used to screen these layouts and 1 layouts with the best performance are selected to serve as the initial training data for the GAN. Among 1 layouts, we randomly select K images and use the FEM to generate their labels. These images together with their labels are added to the original 0 training data to form a new set of training data for the CNN with the total number of 1 = 0 + . After the CNN is re-trained using this new set of data, the generator of the GAN and the CNN are connected to form the design network and the inverse design is performed using this network in conjunction with the genetic algorithm (GA). The design variables are the latent variables of the GAN and the design performance is evaluated using the design network. GA is a gradient-free optimization algorithm and has the potential to produce the global optimal solution [33][34][35]. Another reason for choosing GA instead of a gradient-based optimization scheme in this work is that in layout design problems, the objective function is often non-differentiable with respect to design variables.
Since a small set of training data is used to train the GAN and the CNN, the design solutions obtained from the GA are generally not satisfactory since the design space is confined within the space covered by the GAN. To improve results, more design iterations need to be conducted. For each design in the final generation of GA, layout perturbation is performed to generate new designs. Among these new designs and the designs in the final generation of GA, the best 1 designs are selected using the CNN trained in the last design iteration as the screening tool. These 1 designs are used to re-train the GAN. In the meantime, the training data of the CNN is expanded by adding K new data randomly selected from 1 designs and the CNN is re-trained as well. The re-trained GAN and CNN form a new design network and the inverse design is performed again. This process repeats until the best design obtained converges.
Unlike the previous GAN+CNN-based design method, the proposed method trains networks and conducts the design iteratively. In each iteration, the design solutions obtained from the GAN+CNN+GA method at the previous iteration are collected. They are expanded by layout perturbation and then used to re-train the GAN. Thus, the design space covered by the GAN changes at each iteration and gradually approaches the region containing optimal solutions even though the initial space covered by the GAN does not contain the desired solutions. The training data for the CNN is gradually expanded at each iteration with newly added data being a subset of the training data for the GAN at each iteration. Hence the prediction accuracy of the CNN improves with the number of iterations. This process allows us to effectively use training data and greatly reduce the computational cost. Such a process is most effective in cases with no physical intuition on good designs.

Generative adversarial network for heat source layout generation
GAN is a type of generative neural network [36], which has been widely applied in various applications such as generating porous material structures [14], handwritten digits [37] and anime characters [38]. A GAN consists of a generator and a discriminator. The generator of the GAN produces images while the discriminator determines whether the image is real or fake. Through an adversarial training process, the generator gradually learns the distribution of the training data and can generate images with the same characteristics of the training data.
In this work, GAN is used to generate candidate layouts of heat sources. A major challenge in this task is the precise control of the number of the heat sources. Although GAN has been used to produce different images including structures and metamaterials [39][40][41][42], none of them need to have the precise control on certain image properties. One approach to control the properties of images is to use a conditional GAN [43]. However, we find that it is rather difficult to keep the number of heat sources exactly at the prescribed value in all images generated by the conditional GAN. We then develop a simple method to precisely control the number. Fig. 3 shows the architecture of the GAN used in this work. It contains one fully connect layer, three convolutional layers, followed by a controlling layer and the final layer. Except for the controlling layer, all other layers are common layers in a conventional GAN. The values in the controlling layer are obtained by subtracting a controlling parameter, , from values in the previous layer, that is, −1 = −2 − . Through sigmoid projection and rounding, the values in the final layer, that is, represents rounding, are either 1 or 0 with "1" indicating the existence of a heat source at that element and "0" representing the background material. The value of the controlling parameter, , is chosen according to the required number of heat sources. For example, if five heat sources are required, takes the average value of the fifth and sixth largest elements in the previous layer, so that there will be exactly five positive elements after the subtraction and thus five heat sources in the final image.

ThermalNet
Artificial neural networks have been used increasingly as surrogate models for rapid predictions of physical quantities/fields. Once constructed, artificial neural networks can perform the prediction often in milliseconds as opposed to minutes or hours that high-dimensional physics-based simulations need. A key step in design problems is the repeated evaluations of the objective function. Hence in this work, a convolutional neural network named ThermalNet is constructed to predict the temperature field of the designs. The architecture of the ThermalNet is shown in Fig. 4, which contains a few convolutional and deconvolutional layers and Se-resNet layers [44]. The input of the ThermalNet is an image of the heat source layout, which is represented by a 10 by 10 binary matrix. The output is the corresponding temperature field. To accurately capture the temperature field, the resolution of the output temperature field is set to be 200 by 200, much finer than that of the layout image.

GAN's performance
The function of the GAN in this work is to generate layouts with 20 square-shaped heat sources. To do so, images with 20 non-overlapped heat sources are generated using random sampling and the evolving sampling method proposed in [4]. Evolving sampling allows images with "extreme" distribution of heat sources to be produced, for example, all heat sources located at the top two rows of the image. Fig. 5 shows some of these images where white elements denote heat sources and black elements denote the background material. To test the effect of the controlling layer for the number of heat sources, ten thousand of these images are used to train the GAN with and without the controlling layer. After training, 2000 images are generated by the each GAN. Some generated images are shown in Fig. 6. In all the 2000 generated images, heat sources remain square shaped and are non-overlapped. As expected, the number of heat sources in images generated by the GAN without the controlling layer varies, ranging from 10 to 30 as shown in Fig. 6(a). On the other hand, those generated from the GAN with the controlling layer, which are shown in Fig. 6(b), have the exact 20 heat sources in each image, indicating the effectiveness of the controlling method.  To domonstrate the performance of the ThermalNet for temperature prediction, 10000 images are collected as the training data. Among them, 6000 are generated by sampling and 4000 are generated by evolving sampling. Their temperature fields are calculated using the FEM and serve as the labels. To test the prediction accuracy of the ThermalNet, additional 50 layouts and their corresponding temperature fields are generated using the same approach. The testing performance of the trained ThermalNet is shown in Fig. 7, where the normalized temperature of each pixel/element in each image is plotted with the horizontal axis being the groundtruth and the vertical axis being the predicted values from the ThermalNet. Here the normalization of the temperature field is defined as −298

−298
, so it is within the normal range of neural network's ouput, that is, -1 to 1. The red line with unit slope indicates the case when the prediction perfectly matches with the groundtruth and the two dash lines indicate the ±5% error range. As evident from the figure, all dots are within the two dash lines with most of them located very close to the red line. Fig. 8 shows the temperature fields of two testing samples. Overall the predicted temperature fields shown in the right column agree well with those shown in the middle column, which are calculated from the FEM. The average relative error of the temperature field defined as 1 ∑

| −̃| =1
, where and ̃ are the predicted temperatrue and the goundtruth at the -th pixel respectively, is 1.41%, indicating the high prediction accuracy of the ThermalNet. Regarding the efficiency, the FEM takes 5.4s to compute the temperature field of one image on a computer with 2 x Intel Xeon E5-2670 v3 (2.3GHz), while the ThermalNet uses only 0.0018s to generate the temperature field per image on the same machine. An improvement of three orders of magnitude is achieved. Fig. 7. The prediction accuracy of the trained ThermalNet. Each dot represents the temperature of a pixel in a testing image. A total of 2,000,000 dots are plotted. The red line with unit slope indicates the case when the prediction perfectly matches with the groundtruth and the two dash lines indicate the ±5% error range. The good accuracy shown above is achieved using 10k training data and is also because that the testing samples lie in the space covered by the training data. If layouts are quite different from those images in the training set, the prediction accuracy will deteriorate. In some design problems, optimal layouts have rather extreme distributions that are difficult to generate by the random sampling approach and even the evolving sampling method. The design of heat source layout with minimum maximum temperature is one of such cases. Based on the physical knowledge, designs with small maximum temperature should be those with all heat sources located near the heat sink. One hundred of such layouts are generated manually and their temperature fields are computed using the ThermalNet. Fig. 9 shows the prediction accuracy of each image in the 100 layouts as compared with the groundtruth values. Most data points are outside the ±5% error lines and the average relative error of all data points is 27.3%, much higher than 1.4% achieved when the testing samples are within the space covered by the training data, indicating that even with 10000 samples generated via random and evolving sampling, the space covered by the training data was not large enough to contain these extreme layouts. Fig. 10 shows the temperature fields of two layouts that have low maximum temperature. The temperature fields produced by the FEM (middle column) and by the ThermalNet (right column) are quite different. The relative errors of the maximum tempertaure of the two layouts predicted by the ThermalNet are 120.56% and 115.87% respectively, demonstrating that the ThermalNet trained using 10k data is not adequete for this design problem. A much larger training data set would be required if the same data generation method were used. This would greatly increase the computational cost and diminish the efficiency gained by using the ThermalNet. In the next section, we will show that by using the adaptive learning strategy, a much smaller training set is sufficient to produce good design solutions. Fig. 9. The prediction accuracy of the trained ThermalNet on 100 "extreme" samples. Each dot represents the temperature of a pixel in a testing sample. The red line with unit slope indicates the case when the prediction perfectly matches with the groundtruth and the two dash lines indicate the ±5% error range.

Heat source layout design with minimum maximum temperature
The first design problem solved using the adaptive learning and optimization method is the layout design with minimum maximum temperature. Fig. 11 shows the schematic of the problem domain, which is a square domain with length = 0.1 . Twenty square heat sources with length of = 0.01 are to be distributed within this domain and the design objective is to minimize the maximum temperature of the domain. All four sides of the material domain are adiabatic except the middle region of the bottom boundary where its temperature is kept at a constant temperature 0 = 298 . Hence this region serves as the heat sink for heat flowing out of the domain. The length of the heat sink is = 0.001 . The thermal conductivity of the background material is = 1 /( • ) and the intensity of each heat source is ∅ 0 = 10000 / 2 . The design domain is discretized into a uniform 10 by 10 grid and each heat source occupies one element/pixel as shown in Fig. 12. For the FEM simulation of the temperature field, the design mesh is further refined into a uniform FEM mesh with 200 by 200 elements. This is to ensure the accuracy of the simulated temperature field. Fig. 11. Schematic of the problem domain of the heat source layout design with minimum maximum temperature. Genetic algorithm is employed to solve the inverse design problem. The population size is set to be 250 and a relatively large mutation rate 20% is used considering that this is an extreme design problem. The number of design variables, that is, the latent variables of the GAN, is 10, much smaller than the 100 original design variables if GAN is not used. Adam optimizer [45] is used for the training of neural networks. The corresponding learning rates are 1e-3 and 5e-4 for the ThermalNet and the GAN respectively. The batch size is 10 for the ThermalNet due to the small size of labeled training data. And the batch size for the GAN is 250.
In the first design iteration, 20k ( 0 = 20000) heat source layouts are generated using the random and evolving sampling method. Among them, 250 layouts ( 0 = 250) are randomly selected and their temperature fields are calculated using the FEM. These layouts and their temperature fields serve as the initial training data for the ThermalNet. The trained ThermalNet is then used to screen the 20k layouts and the top 2000 layouts, that is, those with low maximum temperatures, are selected. Layout perturbation is then performed on each selected layout 10 times to produce 20000 new layouts. These new layouts together with the original 2000 layouts go through another screening and the top 2000 ( 1 = 2000) are selected and used to train the GAN. Fig. 13 shows some of layouts in the training set for the GAN. The majority of heat sources locate near the heat sink, which is the result of the pre-screening. Among the 2000 layouts, 62 layouts are randomly selected ( = 62) and are added into the initial 250 layouts ( 1 = 0 + = 312) to form an expanded training set for the CNN. The re-trained CNN and the GAN are then connected to form the design net and the GA is used to obtain design solutions. The GA is terminated when the best design in the final generation does not improve further. Fig. 14 shows some of the design solutions. Compared to the layouts in the training data for the GAN (Fig. 13), heat sources are much closer to the heat sink in the obtained designs and therefore the maximum temperatures of these designs are lower than those of the training layouts.  In the subsequent design iterations, the final design solutions ( = 250) obtained from the previous design iteration are used as the seeds and layout perturbation is performed 20 times on each layout. The newly generated layouts, the design solutions obtained from the previous iteration and the training layouts for the GAN in the previous iteration ( −1 = 2000) are merged into one large data set and the CNN screening is performed on this set to select the top 2000 layouts. These 2000 layouts are used as the training data for the GAN in the current design iteration ( = 2000). For the training of the CNN, again K layouts ( = 62) are randomly selected from the current training data for the GAN ( = 2000) and they are added to the previous training data ( −1 ) for the CNN to form the training set in the current iteration ( = −1 + ). Hence, the training data set for the CNN expands by K data points each iteration. The training data for the GAN changes at each iteration but the total number is kept the same ( = 2000). To keep the training data set for the CNN small to save the computational cost, K is set to be a quarter of the initial training data set, 0 = 250. The trained CNN and GAN are connected to form a new design network and the inverse design is conducted using the GA. Such an iterative process continues until the design solutions obtained from the current iteration agree with those in the previous iterations within a predefined tolerance. Table 1 shows the distribution of the maximum temperature of the training data for the GAN and that of the design solutions at the first two and the final design iterations. Principal component analysis is also performed on these layouts and the first two principal components are plotted and shown in the table. Colors in the PCA plots indicate the value of the maximum temperature of each layout. At each iteration, the maximum temperature distribution of design solutions obtained from the GA is much narrower than that of the training data and is centered at a lower temperature region. Both the average and the lowest maximum temperatures are much smaller than those of the training layouts, demonstrating the effectiveness of the inverse design. As the iteration goes on, the maximum temperature distribution of the training data continuously narrows down and moves towards the lower temperature region, indicating the design space covered by the GAN shifts towards the space containing better and better design solutions. Such a trend can also be observed in the PCA plots, where data are more clustered and have more uniform lower maximum temperature after each iteration. This shift in the design space is the main aim of the proposed adaptive learning and optimization approach, which allows us to find optimal designs without the need of a large training data. As shown in the last column of Table 1, best layout designs in selected iterations are shown and their maximum temperatures calculated from the ThermalNet and the FEM are also listed. The prediction accuracy of the ThermalNet improves with the number of iterations as expected. A total of 7 design iterations are needed in this problem. The best design obtained, which is believed to be one of the optimal solutions, has a maximum temperature of 326.06 K and it is found using a total of 622 training data for the CNN, that is, 622 FEM calculations of the temperature field.

Performance comparison with other design approaches
As mentioned in Section 2, the heat source layout design with minimum maximum temperature has been solved by a number of approaches including both conventional and machine learning based methods. Table 2 summarizes the maximum temperature of the best design obtained from each of these approaches and the number of FEM simulations needed to obtain the best design. As a comparison, the maximum temperature of the best layout design obtained from the proposed adaptive GAN+CNN+GA and the number of FEM calculations are also listed. It is clear from the table that the adaptive GAN+CNN+GA produces the best design among all approaches. In addition, it is also the most efficient as compared with previous approaches except for the convex optimization method [30] in which only one FEM calculation was needed. However, the accuracy of the convex optimization method is less satisfactory. Compared with the artificial neural network-based method [4], the adaptive GAN+CNN+GA not only produces a better design but also uses a much smaller number of training data. Even with only one design iteration, the maximum temperature of the best design obtained from GAN+CNN+GA is 326.94K, which is the lowest among all other approaches. It is achieved with only 312 FEM calculations. With a few more design iterations and a total of 622 FEM calculations, a design that has a maximum temperature of 326.06K can be obtained. Hence, it can be concluded that the proposed method performs the best in terms of both accuracy and efficiency. To demonstrate the effect of the adaptive strategy, design is carried out using the proposed method without any adaptive learning. With the same number of training data for the CNN and the GAN, the best design obtained from the approach without adaptive learning has a maximum temperature of 326.94K, even higher than that of the design obtained by using only one design iteration.  [27]; TGBO: temperature-gradient aware bionic optimization [29]; SA: Simulated annealing [28]; CO: convex optimization [30]; FPN-NSLO: Feature-pyramid-network and neighborhood search-based layout design [4]

Influence of the size of ThermalNet's training data on the performance of the design method
A large portion of the computational cost of the proposed design method is the time spent on generating the training data for the ThermalNet, which is carried out using the FEM. In this method, the size of the ThermalNet training data is determined by two parameters. They are the initial training data 0 and the added training data at each iteration K. In this section, the influence of these two parameters on the performance of the method is investigated. Four cases with initial training data size being 1000, 500 250 and 125 are studied for this purpose. In each case, the added data is set to be a quarter of the initial data size, that is, = 0 4 ⁄ . Table 3 lists the number of ThermalNet training data, the best design and its maximum temperature predicted by the ThermalNet and the FEM in each design iteration for the four cases. Table 3: The influence of ThermalNet training data on the performance of the proposed method in heat source layout design problem: 0 is the initial training data size, = 0 4 is the added training data in each design iteration, = 0 + * is the total number of training data in the -th design iteration; and are the maximum temperatures predicted by the ThermalNet and the FEM respectively.  As illustrated in Table 3, all four cases converge and optimal structures with maximum temperature of 326.06K have been found in all cases. The case with the largest 0 converges fastest but needs the largest total number of training data. For cases with small 0 , although the total number of training data is small, the convergence is very slow, which implies that it needs more GAN and CNN training. In addition, the convergence may not be monotonic due to the small size of the training data. We conduct two runs of the same design problem with the same 0 . Due to random sampling, training samples are different in these two runs. Table 4 and Table  5 list the maximum temperature of the best design in each design iteration obtained from the two runs for cases with 0 = 250 and 0 = 125 respectively. The number of design iterations varies in different run, depending on the training data. In some cases, the maximum temperature of the best design in a later design iteration can be larger than that of the previous iteration. Although it eventually converges, the process is nevertheless much longer. A remedy is to re-train the GAN if the best design identified by the ThemalNet is not better than the best design in the training data of GAN. The rationale for this remedy is that currently there is no standard and consistent criterion to judge the quality of the binary images generate by the GAN other than visual inspection. Re-training the GAN may help the GAN to learn the distribution of the training data better.

Computational cost
The computational cost of the proposed method mainly consists of two parts: time spent on the training of two neural networks and the time spent on generating the training data for the CNN.
As the problem size increases, that is, the number of elements increases, the computational time of the FEM simulations scales linearly with the number of elements. The training time of the networks increases as well, but it does not scale linearly. For an example, the training time for the GAN on 2000 images with 10x10 pixels takes 3.63 minutes. It takes 4.71 minutes on 2000 images with 20x20 pixel. The portion of the FEM simulations increases with the increased problem size, and hence more saving will result. Table 6 lists the time spent on the training of the GAN, the CNN, and generating the training data (FEM simulations) in each design iteration for the case with 0 = 250. The total time is 118.01 min of which 62.54min spent on the training of the networks and 55.47min spent on generating training data. Here the computational time is evaluated on a computer with 2 x Intel Xeon E5-2670 v3 and 2 x Nvidia Tesla K80. The total time depends on the initial training data 0 . For cases with a large 0 and thus a fast convergence rate, the time for network training is less, but the number of training data, thus the FEM simulations, needed is large. Compared with the approach without the CNN, that is, using FEM for temperature evaluation, the total computational time for FEM evaluation alone is 2675min, much larger than 95.47min spent on the training and generating data for the CNN.
As the problem size increases, that is, the number of elements increases, the computational time of the FEM simulations scales linearly with the number of elements. The training time of the networks increases as well, but it does not scale linearly. For an example, the training time for the GAN on 2000 images with 10x10 pixels takes 3.63 minutes. It takes 4.71 minutes on 2000 images with 20x20 pixel. The portion of the FEM simulations increases with the increased problem size, and hence more saving will result. The second design problem solved in this work is the temperature-constrained heat source layout design. In this problem, not only the maximum temperature in the entire design domain is to be minimized, the temperature at a certain point should also be higher than a given value, as formulated in Eq. (4).

minimize ( )
. . Г ∈ , ∀ = 1,2 … ≥ where represents the layout of heat sources, is the maximum value of the temperature field in the design domain, is the temperature of a given point in the layout, is the minimum allowed temperature at that point and Г denotes the layout area covered by the -th heat source, = 20 is the total number of heat sources. This inverse problem can be reformulated using the KKT approach [46] as: where is the objective function; = 0 if − ≤ 0 and is a very large positive value if − > 0. In this work, = 335 , is set to be 10 initially and increases by 10 in each design iteration to reinforce the temperature constraint gradually.
The design domain and the boundary conditions are the same as that of the first design problem presented in Section 4.3. The given point is located at (0.1m, 0.05625m), around the middle of the right side of the square design domain. The origin is set at the left-bottom vertex of the design domain. The parameters of the genetic algorithm used in the optimization process are the same as those listed in Section 4.3.

Design procedure and results
The design procedure is the same as that presented in Section 4.3. In the first design iteration, 20k ( 0 = 20000) heat source layouts are generated using the random and evolving sampling method. Among them, 125 layouts ( 0 = 125) are randomly selected with 75 from random sampling method and 50 from evolving sampling and their temperature fields are calculated using the FEM. These layouts and their temperature fields serves as the initial training data for the ThermalNet. The trained ThermalNet is then used to screen the 20k layouts and the top 2000 layouts, that is, those with the low objective function values, are selected. Layout perturbation is then performed on each selected layout 10 times to produce 20000 new layouts. These new layouts together with the original 2000 layouts go through another screening and the top 2000 ( 1 = 2000) are selected and used to train the GAN. Among the 2000 layouts, 31 layouts are randomly selected ( = 31) and are added into the initial 125 layouts ( 1 = 0 + = 156) to form an expanded training set for the ThermalNet. The re-trained ThermalNet and the GAN are then connected to form the design net and the GA is used to obtain design solutions.
In the subsequent design iterations, the design solutions ( = 250) obtained from the previous design iteration are used as the seeds and layout perturbation is performed 20 times on each layout. The newly generated layouts, the design solutions obtained from the previous iteration and the training layouts for the GAN in the previous iteration ( −1 = 2000) are merged into one large data set and the ThermalNet screening is performed on this set to select the top 2000 layouts. These 2000 layouts are used as the training data for the GAN in the current design iteration ( = 2000). For the training of the ThermalNet, again K layouts ( = 31) are randomly selected from the current training data for the GAN ( = 2000) and added to the previous training data ( −1 ) for the ThermalNet to form the training set in the current iteration ( = −1 + ). The trained ThermalNet and GAN are connected to form a new design network and the inverse design is conducted using GA.
Design results together with the total number of training data for the ThermalNet at each design iteration are listed in Table 7. The design process converges within four iterations and the total number of ThermalNet training data used is only 249. The best design obtained from the adaptive learning and optimization approach has the same and , and both are equal to the given = 335 . This fact indicates that the optimal solution of the design problem has been obtained. Similar to what has been done in the first design problem, the influence of the initial training data size for the ThermalNet on the performance of the method in this design problem is investigated. Four design cases with different numbers of the initial training data, ranging from 500 to 62, are conducted. The observed trends are similar to those in the first design problem. All four cases converge and optimal solutions with = = = 335 are achieved. Cases with a large set of the initial training data converge fast but need a large number of total training data. Those with a small set of initial training data converge slower, but the total number of training data needed is small as well.

Performance comparison with other layout design approaches
The performance of the proposed neural network-based adaptive design approach is compared with the neural network-based method (GAN+CNN+GA) without adaptive learning. For a fair comparison, the total amount of training data used is roughly the same. As shown in Table 8, the maximum temperature obtained from the approach without adaptive learning is 335.17K, which is larger than the temperature at the given point 335.06K. In addition, even though the temperature constraint is satisfied, the design is clearly not optimal, which illustrates the effectiveness of the adaptive learning strategy.
The proposed adaptive design approach also shows advantages as compared with the method listed in Ref. [4] in which a neural network is constructed to predict the temperature field. In their work, 55000 data points are used to train the network, and the best design obtained has a maximum temperature of 335.07K, which is larger than the optimal solution 335K. With the proposed approach, the optimal solution can be obtained using only 249 training data, much less than that used in Ref. [4].

Summary and future work
In this work, an adaptive artificial neural network-based generative design approach has been proposed and developed for layout design. This method combines the state-of-the-art generative adversarial network and the convolutional neural network with the genetic algorithm and uses an adaptive learning and optimization strategy to effectively explore the design space and find desired solutions. As such, the number of high-dimensional calculations for the evaluation of the objective function is greatly reduced. The proposed design approach has been applied to solve two heat source layout design problems in which 20 square-shaped heat sources are to be distributed within the design domain. The design objective of both problems is to minimize the maximum temperature of the entire domain. The second problem has an additional temperature constrain at a given point. In both problems, optimal designs have been obtained. Compared with several existing approaches including both conventional and neural network-based methods, the proposed approach has the best performance in the terms of generality, accuracy and efficiency.
Layout designs are encountered in a variety of different fields as mentioned in the introduction. The proposed design approach should be applicable for a general set of layout designs. Future work will include the applications of the proposed approach to problems with a large number of heat sources of different shapes and the design of composite materials with unique properties.