# Sketch-Guided Topology Optimization with Enhanced Diversity for Innovative Structural Design
## 3 Method
### Parallel Computing for Multi-Solution TO Framework  
In the proposed TO process, perturbing the load force magnitudes, the initial weights of the neural network, as well as the Fourier sampling frequencies are all useful ways to generate multiple diverse designs. To account for the low interpretability of the neural network, this study perturbs the Fourier sampling frequencies \(\mathbf{f}\) and the load force magnitudes \(\mathbf{F}\) across multiple TO processes. As will be proved by the experiments in Section 4, this can provide sufficient design diversity. A larger parallel scale increases the likelihood of discovering more innovative and high-performance designs, but it also increases the computing cost and produces more redundant solutions that are identical or highly similar to each other. To balance this conflict and remove redundant solutions, an adaptive parallel scale is employed. Multiple synchronized parallel TO processes are run, and a similarity measure for each pair of solutions within the current solution is set after a fixed number of iterations are conducted. A randomly selected solution is removed from pairs with high similarity to reduce the parallel scale before continuing the optimization iterations. Similarity indexes include differences in compliance values and the image-based Structural Similarity Index Measure (SSIM) and pixel-wise mean absolute error (MAE), as computed by Equations (14) and (15). The SSIM index is better at capturing the structural characteristics that align with human visual perception, while the MAE index better reflects the data-level difference. \[SSIM(x,y)=\frac{\left(2\mu_{x}\mu_{y}+C_{1}\right)\cdot\left(2\sigma_{xy}+C_{2 }\right)}{\left(\mu_{x}^{2}+\mu_{y}^{2}+C_{1}\right)\cdot\left(\sigma_{x}^{2}+ \sigma_{y}^{2}+C_{2}\right)}\;. \tag{14}\]  
\[MAE(x,y)=\frac{1}{N}\sum_{i=1}^{N}\lvert x_{i}-y_{i}\rvert \tag{15}\]  
where \(x\) and \(y\) represent the density distribution maps of two solutions, \(\mu_{x}\) and \(\mu_{y}\) are the average density values, \(\sigma_{x}^{2}\) and \(\sigma_{y}^{2}\) are density variances, \(\sigma_{xy}\) is the covariance of density distribution maps, \(C_{1}\) and \(C_{2}\) are small constants to avoid division by zero, and \(N\) is the number of pixels. In early iterations of the TO process, the number of gray cells with intermediate density values is large, which makes the structural boundaries blurry. As the iterations progress and the SIMP penalty factor increases, the densities tend to binarize and structural boundaries become more clear and stable. As design diversity is mostly cultivated in the early iterations, a parallel scale is adapted only after the early iterations. A conflict between human preferences expressed through sketches and the compliance minimization objective is very likely to occur. Guided by sketch-based constraints, some generated structural features may be detrimental to compliance minimization, thus are unreasonable for multi-objective optimization. Recognizing such structural features, i.e., the region of conflict, is important to ensure the quality of solutions. To achieve this, we propose a sensitivity-based method to automatically recognize the region of conflict in structures. Given the TO framework's total loss minimization, the elements with positive sensitivity values for the sum of compliance loss and sketch-based penalty loss, denoted as \(L_{t}\), should have their density values decreased under the virtual condition where sketch-based constraints are not applied. Therefore, among the solid elements in the generated structures, the ones with positive sensitivity values can be recognized as the region of conflict. The computation is expressed in Equation (16). The sensitivity can be conveniently computed via gradient back-propagation of neural networks, and the autograd function of PyTorch 1.5 is implemented in the experiment. During iterations of adaptive-scale parallel solving, solutions with large conflict regions are also removed.