## 3 Double Low-Rank and Sparse Decomposition Model
### Problem Formulation  
Let \(\{R_{1},\ R_{2},\ \cdots,\ R_{K}\}\) be a set of \(K\) non-overlapping sub-regions of a surface defect image \(I\), all the feature vectors of sub-regions can construct the feature matrix \(D\). The proposed DLRSD model is to design an effective model to decompose the feature matrix \(D\) into a feature matrix \(S\) that represents a defect foreground image \(F\) and a feature matrix \(L\) that represents a background image \(B\):  
\[D=S+L \tag{1}\]  
In order to separate defect regions and background regions accurately, some constrains are needed for characterizing two feature matrices \(S\) and \(L\). According to the surface defect image \(I\) that is pre-processed by superpixel segmentation, both defect foreground and background contain multiple homogeneous and highly similar sub-regions, for each defective sub-region, the corresponding locations in saliency map has high probability in larger brightness, indicating that it has higher saliency value. Besides, different defective sub-regions are highly correlated and the corresponding feature vectors lie in a low-dimensional subspace. Therefore, the feature matrix \(S\) is expected to be low-rank. Meanwhile, most of background sub-regions tend to have lower saliency value. They are strongly correlated and lie in a low-dimensional feature subspace that is independent of the defect foreground subspace. The strong correlations among the background sub-regions suggest that feature matrix \(L\) may have the low-rank property. What is more, in order to reduce the influence of noises and enhance the robustness to uneven illumination, we assume that the background lies in a sparse feature subspace and can be characterized by a sparse matrix.  
Based on above analysis, the structured matrix decomposition model can be constructed as follows:  
\[\begin{array}{l}\min_{L,S}(\text{rank}(L)+\alpha\text{rank}(S)+\beta\Theta( S,L)+\gamma||L||_{0})\\ \text{s.t.}D=S+L\end{array} \tag{2}\]  
where \(\text{rank}(\cdot)\) denotes the rank of matrix; \(||\cdot||_{0}\) denotes \(l_{0}\) norm of matrix, which equals the number of non-zero element of matrix; \(\Theta(S,L)\) denotes the regularization to enlarge the margin and reduce the coherence between the feature subspaces induced by \(S\) and \(L\); \(D\in\mathbb{R}^{d\times K}\) represents the feature matrix; \(\alpha>0\), \(\beta>0\) and \(\gamma>0\) are regularization parameters.  
To separate the defect object from the background easily, spatially adjacent sub-regions with smaller spatial distance and more similar feature vector should be assigned to similar and higher weight values, the local invariance assumption [26] based Laplacian regularization \(\Theta(S,L)\)[24] can be defined as follows:  
\[\Theta(S,L)=\frac{1}{2}\sum_{i,j=1}^{K}||\mathbf{s}_{i}-\mathbf{s}_{j}||_{2}^{2}w_{ij }=\text{tr}\Big{(}SMS^{T}\Big{)} \tag{3}\]  
where \(\text{tr}(\cdot)\) denotes the trace of a matrix; \(\mathbf{s}_{i}\) denotes the \(i\)-th column of matrix \(S\); the element \(w_{ij}\) of affinity matrix \(W\in\mathbb{R}^{K\times K}\) denotes the weight that represents the feature similarity between sub-regions \(R_{i}\) and \(R_{j}\); \(M\in\mathbb{R}^{K\times K}\) is a Laplacian matrix.  
According to the undirected graph model from a surface defect image, each sub-region is represented by a node, the affinity matrix \(W\) is  
\[w_{ij}=\left\{\begin{array}{ll}\exp\left(\frac{-||\mathbf{p}_{i}-\mathbf{p}_{j}||_{2 }^{2}}{2\sigma_{p}^{2}}\right)\exp\left(\frac{-||\mathbf{\tilde{f}}_{i}-\mathbf{ \tilde{f}}_{j}||_{2}^{2}}{2\sigma_{f}^{2}}\right)&R_{i}\text{ and }R_{j}\text{ are spatially adjacent}\\ 0&\text{otherwise}\end{array}\right. \tag{4}\]  
where \(\mathbf{p}_{i}\in\mathbb{R}^{2}\) and \(\mathbf{p}_{j}\in\mathbb{R}^{2}\) denote the central coordinate of \(R_{i}\) and \(R_{j}\); \(\mathbf{\tilde{f}}_{i}\in\mathbb{R}^{d}\) and \(\mathbf{