# Hierarchical Tensor Decomposition of Module Partition for the Mechanical Simulation
## 2 Proposed Methodology
### Layer Determination and Tuning Parameters  
A tensor is divided into four layers based on the different intensity variations: the background, the multilayer foreground, the sparse spots layer, and the noise layer. As the number of layers increases, the intensity variation of the extracted foreground cluster regions layer increases. \(\|\hat{\mathbf{B}}_{n}-\hat{\mathbf{S}}\|_{2}\) is decreasing and gradually decreases with the increase of the number of decomposition layers. Therefore, it can be used to derive the number of background and foreground layers. When \(\|\mathbf{B}_{n+1}-\hat{\mathbf{S}}\|_{2}\) and \(\|\mathbf{B}_{n}-\hat{\mathbf{S}}\|_{2}\) are approximately equal, the number of foreground cluster regions layer can be determined to be \(n\). Scree plot [51] of \(\|\hat{\mathbf{B}}_{n}-\hat{\mathbf{S}}\|_{2}\) is introduced. In multivariate statistics, the scree plot is a line plot of the eigenvalues of factors or principal components in an analysis. A scree plot always displays the eigenvalues in a downward curve, ordering the eigenvalues from largest to smallest. It is believed that significant factors or components to the left of the \"elbow\" of the graph are to be retained in the scree test because the eigenvalues appear to level off at this point [52]. Nevertheless, we found that the scree plot can be utilized to determine the number of foreground cluster regions layers. An intuitive scree plot will be presented in the next section of the simulation experiment in order to illustrate the problem of determining the number of layers more intuitively. There are \(N+1\) tuning parameters in the HTD method, i.e., \(\lambda_{n}\) and \(\lambda_{\mathbf{S}}\). As previously mentioned, \(\lambda_{n}\) is used to control the intensity variation of the background, and \(\lambda_{\mathbf{S}}\) is used to control the sparsity of the sparse spots layer. A tuning parameter can be classified into two categories: (i) ground truth is available and (ii) ground truth is not available. Given a training data \(\mathbf{X}\), and the corresponding ground truth \(\mathbf{B}_{n}\) (\(n=\{1,2,\ldots,N\}\)), \(\mathbf{S}\), \(\mathbf{E}\), which is the foreground cluster regions layers, sparse spots layer, and noise layer of \(\mathbf{X}\), the optimal tuning parameters can be determined by minimizing the error [53]:  
\[\lambda_{j}^{*}=\arg\min\mathcal{L}_{j}(\Theta), \tag{5}\]  
where \(\lambda_{j}\) is the tuning parameter, \(\lambda_{j}=\{\lambda_{n},\lambda_{\mathbf{S}}\}\); \(\mathcal{L}_{j}(\Theta)\) represents the difference between the ground truth and the estimated. There are two scenarios that should be interpreted. One scenario is when each element in each layer has a corresponding intensity ground truth, \(\mathcal{L}_{i}(\Theta)=\|\Theta\|_{F}^{2}\), where \(\Theta=\mathbf{X}-\sum_{n=1}^{N}\hat{\mathbf{B}}_{n}-\hat{\mathbf{S}}\); \(\hat{\mathbf{B}}_{n}\) and \(\hat{\mathbf{S}}\) are the estimated of the background and foreground, sparse spots, respectively; another one is that each element is a 0-1 classification problem, e.g., sparse element as a defect object should be detected, \(\mathcal{L}_{j}(\Theta)=\|\Theta\|_{\omega},\Theta=\mathbf{S}-\hat{\mathbf{S}}\). As there is no training sample to analyze, the choice of \(\lambda_{j}\) should be made empirically based on the structural assumption and the feature to be extracted. A larger \(\lambda_{j}\) is used in adjusting the parameters, which suppresses the estimated variable. There are more than three parameters involved in the model, such as \(\lambda_{n}\), and \(\lambda_{\mathbf{S}}\), which should be tuned. Therefore, the control variable method should be utilized when tuning the parameters. Specifically, when tuning \(\lambda_{n}\), it is recommended that \(\lambda_{k}\) (\(k=\{1,\ldots,N\}\cap\{k\
eq n\}\)), and \(\lambda_{\mathbf{S}}\) are fixed until \(\lambda_{n}\) has been determined to be optimal. After that, an optimal \(\lambda_{n}\) is determined.