## 2 The ProbPlot via IR-AVPCA Technique for Bearing Fault Detection and Diagnosis (BFDD)
### AVPCA-Base Image Recognition
#### 2.2.1 PCA to image recognition  
PCA algorithm is a method that aims to best present the data by projection (in a least square sense) for reducing the dimension and compressing the data. In image analysis, the PCA takes the 2-D image and represents it as a 1-D image vector by liaising each row/column into a long vector. Thus, the image vectors \(x_{i}\) are defined as [39]:  
\[x_{i}=[\sigma_{1},\cdots,\sigma_{N}]^{T};i=1\cdots M \tag{3}\]  
in which \(M\) is the number of vectors that represent the sampled image, which are of size \(N\), and \(\sigma_{j}\)'s represents the pixel. Subtracting the mean image \(mi\) from each image vector, the mean centered \(c_{i}\) of the image is computed as:  
\[c_{i}=x_{i}-mi \tag{4}\]  
Figure 2: ProbPlot-based features generation flowchart procedure in Matlab.  
in which  
\[mi=\frac{1}{M}\sum_{i=1}^{M}x_{i} \tag{5}\]  
Maximizing the quantity in which  
\[\lambda_{i}=\frac{1}{M}\sum_{n=1}^{M}\left(v_{i}^{T}C_{n}\right)^{2} \tag{6}\]  
with the orthonormality constraint \(v_{i}^{T}v_{k}=\delta_{ik}\) allows the finding of a set of \(M\) orthogonal vectors \(v_{i}\)'s, which have the largest possible projection onto each of the \(c_{i}\)'s. \(v_{i}\)'s and \(\lambda_{i}\)'s are the eigenvectors and eigenvalues, respectively, of the covariance matrix \(W_{nxn}\) that is defined as  
\[W=CC^{T} \tag{7}\]  
in which \(C\) is a matrix in which its columns are the vectors \(c_{i}\) placed side by side.  
In practice, it is not a suitable solution to find the \(v_{i}\) and \(\lambda_{i}\) of the covariance matrix \(W\). Thus, in linear algebra, the calculation of the eigenvectors \(v_{i}\) and eigenvalues \(\lambda_{i}\) is obtained by finding those of the \(C^{T}C\) matrix of size \(M\times M\), i.e., finding \(e_{i}\) and \(\mu_{i}\), the eigenvectors and eigenvalues of \(C^{T}C\), respectively, in which  
\[CC^{T}e_{i}=\mu_{i}e_{i} \tag{8}\]  
If both sides of Equation 8 are multiplied by C: \(CC^{T}(Ce_{i})=\mu_{i}(Ce_{i})\), then, the first \(M-1\) eigenvectors \(v_{i}\) and eigenvalues \(\lambda_{i}\) of matrix \(CC^{T}\) correspond to \(Ce_{i}\) and \(\mu_{i}\), respectively. However, first, the rank of the covariance matrix should not exceed \(M-1\), and the eigenvectors \(Ce_{i}\) have to be normalized to be equal to \(v_{i}\). Therefore, the computed eigenvectors will generate an orthonormal basis of the subspace that allows the representation of the image and most of its data with a minimum error. Usually, these computed eigenvectors range from the largest to the smallest following their corresponding eigenvalues, in which the largest eigenvector (corresponding to the biggest eigenvalue) reflects the greatest variance in the image and vice versa. It is found that the first 5% to 10% of the dimensions usually contain 90% of the total variance. The facial image \(\Psi\) can be projected onto \(M\)' (\(<<\)\(M\)) dimensions by calculating  
\[\Psi=[p_{1}p_{2}\cdots p_{M}]^{T};p_{i}=e_{i}^{T}c_{i} \tag{9}\]  
in which \(p_{i}\) is the \(i\)th coordinate of the facial image \(\Psi\) in the new space, which comes to be the principal component. The vectors \(e_{i}\) represent and are known as the eigenfaces. Fault presence recognition is achieved by minimizing the error distance.