# Hierarchical Tensor Decomposition of Module Partition for the Mechanical Simulation
## 2 Proposed Methodology
### Decomposition Model  
The purpose of this subsection is to introduce the model of decomposition and propose an efficient algorithm to implement it. As shown in Figure 1c, strain contours are employed, with a global smooth background, several local smooth foregrounds, and sparsity spot strains (caused by concentrations of stress). The global smooth background has low intensity variation. The sparsity spot strains have high intensity variation. The local smooth foregrounds have greater intensity variation and are occupied in a greater proportion than sparsity spot strains. Random noise is embedded in the sample. Simulated strain contours (tensors) have a few common characteristics, including a smooth background layer, several smooth foreground layers, sparse spots, and noise layers.  
Assumption a two-way tensor \(\mathbf{X}\), it could be modeled as a linear superposition of background component (\(\mathbf{B}_{1}\)), foreground  
where \(C_{n}^{i}=\frac{n!}{l!(n-l)!}\), \(i=\{0,\cdots,n\}\), \(\mathbf{G}_{v}^{n}\in\mathbb{R}^{(I-n)\times I}\); \(\mathbf{G}_{h}^{m}=(\mathbf{G}_{v}^{m})^{T}\), \(\mathbf{G}_{h}^{m}\in\mathbb{R}^{l\times(I-m)}\), where \(m=\{1,2,\cdots\}\).  
The difference matrices are employed to calculate gradients of discrete variables such as: a first-order difference matrix operator is ordinarily employed to calculate the gradient change between adjacent points of a vector; a second-order difference matrix operator is ordinarily employed to calculate the gradient change between adjacent points; a \(N\)-order difference matrix operator is ordinarily employed to calculate the gradient change between two \(n-1\) adjacent points. As a consequence, components with different characteristics of intensity variation may be derived from the original data by employing various difference matrices. Thus, taking into account the hierarchical characteristics of a two-way tensor, its magnitude can be given as \(\sum_{n=1}^{N}(\lambda_{n}\|\mathbf{G}_{v}^{n}\mathbf{B}_{n}\mathbf{G}_{h}^{n} \|_{F}^{2})\), where \(\lambda_{n}\) is tuning parameter, \(\|\cdot\|_{F}\) is the Frobenius norm [44].  
Least square regression is used to estimate the model components (i.e., \(\mathbf{B}_{n}\) and \(\mathbf{S}\)). To ensure the smoothness of the estimated back-/foreground and the sparsity component, the least square loss function is augmented by \(l1\)[45] and Frobenius norm penalties, which results in the following penalized regression criterion:  
\[\begin{split}\min\|\mathbf{E}\|_{F}^{2}+\sum_{n=1}^{N}\lambda_{n }\|\mathbf{G}_{v}^{n}\mathbf{B}_{n}\mathbf{G}_{h}^{n}\|_{F}^{2}+\lambda_{ \mathbf{S}}\|\mathbf{S}\|_{1},\\ \text{s.t.}\quad\mathbf{X}=\sum_{n=1}^{N}\mathbf{B}_{n}+\mathbf{S }+\mathbf{E},\end{split} \tag{1}\]  
where \(\lambda_{n},\lambda_{\mathbf{S}}\) are tuning parameters, which control the tradeoff among background, foreground, and sparse spots; \(\lambda_{n}\) is determined the gradient magnitude. The intensity variation of the background and foreground can be guaranteed by combining \(\lambda_{n}\), and the corresponding different order difference matrices. The sparse spot layer is controlled by \(\lambda_{\mathbf{S}}\). Finally, sparse spots \(\mathbf{S}\), which should have been calculated by \(l0\)[45], i.e., \(\|\mathbf{S}\|_{0}\); however, the optimization \(\|\mathbf{S}\|_{0}\) is an NP-hard problem [46; 47], through replacing it with a convex surrogate \(\|\mathbf{S}\|_{1}\) to make the above problem tractable.  
According to Equation (1), all components including background and foreground (\(\hat{\mathbf{B}}_{1,\cdots,N}\)) and the sparse spots layer (\(\hat{\mathbf{S}}\)) can be determined. Consequently, the performance of the proposed method is assessed by comparing the estimated components with the ground truth components. In this study, a criterion is introduced, which is the root mean square error (RMSE), for computing the intensity of all elements between the estimated components and ground truth components.