# A Generic Block-Level Error Confinement Technique for Memory Based on Principal Component Analysis
## 3 PCA-Based Error Confinement Technique
### Calculation of Error Confinement Vectors (ECVs)  
The establishment of error confinement vector by averaging each dimensional value separately is inspired by the operation of mean pooling in convolutional neural networks. The mean pooling layers merges feature points in a small spatial neighborhood at one layer into new features in the next layer [27; 28]. Its function is to progressively reduce the spatial size of the representation to reduce the number of parameters and computation in the network, and hence to also control over-fitting.  
In this paper, we consider sub-blocks to be an adjacent local area and have similar features, and use the idea of mean-pooling to consider the features of the same latitude of the projection data \(Y_{i}\) and the eigenvectors \(V_{Ki}\) as a neighborhood and then average the different features within the neighborhood. When there is an error in projection data \(Y_{i}\) or the eigenvectors \(V_{Ki}\), the error data can be replaced by the value of the corresponding dimension of the average vector respectively.  
From the process of data dimension reduction and reconstruction, we know that the projection data \(Y_{i}\) and the eigenvectors \(V_{Ki}\) contain the information of the principal components, and these main components are presented in the form of k-dimensional vectors corresponding to descending order of eigenvalues. In this paper, we use the idea of mean-pooling to consider the features of the same latitude of the projection data \(Y_{i}\) and the eigenvectors \(V_{Ki}\) as neighborhood and then average the different features within the those. By averaging each dimensional eigenvalue separately, an k-dimensional average vector is obtained, which is used to represent the average eigenvector of the projection data \(Y_{i}\) and the eigenvectors \(V_{Ki}\).  
Specifically, for the eigenvectors matrix \(V_{Ki}\), as shown in Figure 4a, the first column of eigenvectors of \(V_{Ki}\) corresponds to the largest eigenvalue, and the k-th column of \(V_{Ki}\) corresponds to the smallest eigenvalue. Referring to the idea of mean-pooling, we obtain the average vector \(\overline{V}_{i}\) of sub-block by averaging each dimensional features of the eigenvectors, to represent the average eigenvector of the different eigenvectors. The method of calculating the column average vector \(\overline{V}_{i}\) is as follows:  
\[\overline{V}_{i}=\left[\overline{v}_{1},\overline{v}_{2},\,\cdots\,\overline {v}_{n}\right]^{T} \tag{13}\]  
Figure 3: Extraction of principal components and reduction of dimensions to memory data with PCA.  
And the i-th element \(\
u_{i}\) (i from 1 to n) can be expressed as:  
\[\overline{\
u_{i}}=\frac{\sum_{j=1}^{k}\
u_{ij}}{k} \tag{14}\]  
Similarly, for the projection data \(Y_{i}\), as shown in Figure 4b, column vectors represent the \(m\) samples in k major dimensions. Referring to the idea of mean-pooling, we obtain the average vector \(\overline{Y_{i}}\) by averaging each dimensional features of the column vectors, which can be used to approximate any columns of the projection data \(Y_{i}\). The method of calculating the column average vector \(\overline{Y_{i}}\) is as follows:  
\[\overline{Y_{i}}=[\overline{y}_{1},\overline{y}_{2},\ \ \cdots\overline{y}_{k}]^{T} \tag{15}\]  
And the i-th element \(y_{i}\) (i from 1 to k) can be expressed as:  
\[\overline{y}_{i}=\frac{\sum_{j=1}^{m}y_{ij}}{m} \tag{16}\]