# A Generic Block-Level Error Confinement Technique for Memory Based on Principal Component Analysis
## 4 Case Study
### Experimental Results  
#### 4.2.1 Exploration of Modularization  
According to [30; 31], partitioning the image first before applying PCA to partitioned sub-blocks can not only effectively extract the local characteristics of the image, but also speed up the dimensionality reduction and reconstruction of the image. Given this, in this experiment, we cut the images of 512 \(\times\) 512 into several sub-blocks, then extract principal components and reduce dimensions on sub-blocks with PCA. Afterwards, the reconstruction results of the sub-blocks can be combined to get the reconstruction result of the original image. Figure 9 compares the reconstruction time and quality of _image (a)_ in Figure 7 of different size sub-blocks in the case of retaining only 50% numbers of PCs. As can be seen from Figure 9, cutting into 256 \(\times\) 8 sub-blocks ensures less running time and better reconstruction quality. For an input image of size 512 \(\times\) 512, we divide it into 128 sub-blocks, and the size of each sub-block is 256 \(\times\) 8. The results of dimensionality reduction and image reconstruction with PCA are shown in Table 1. The relevant parameters are defined as follows:  
**K**: The number of principal components. **Size**: The size of the projection data Y and eigenvectors \(V_{k}\). Figure 8: Pseudo code: error confinement for memory based on PCA. **Rate**: The ratio between the size of compressed data (Y and \(V_{k}\)) and the size of original image (\(512\times 512\)). As can be seen from Table 1, when the reserved the number of principal components (PCs) is equal to 2, 3, or 4, the quality of the reconstructed image is guaranteed (the PSNR of image is 31.1) and the size of the projection data Y and the eigenvectors \(\mathrm{V}_{K}\) is also significantly reduced. It's obvious that more reserved PCs leads to better quality of reconstructed images, while also increases the physical overheads of execution time and memory usage. Practically, it is wise to strike a balance between quality and overhead by reserving appropriate number of PCs on the premise of satisfying the quality of the image. Beyond the developing trend between PSNR, sub-block dimension, K and execution time for a single image, it is interesting to explore how different images affect optimal choice of sub-block size, giving a demanded PSNR value. As shown in Figure 10, six images in Figure 7 are analysed in terms of PSNR and execution time subjecting to different sub-block sizes. While execution time among images in Figure 10b show very small differences, it is observed in Figure 10a that for all images, the trends of PSNR increase with increased sub-block size. However, the absolute PSNR values and the slope of its increasing vary among images. To explain the achieving difference in PSNR among images, PC concentration level (PCCL) is introduced as the percentage of remaining principle components in order to achieve a specified contribution rate (CR) averaged across all sub-blocks. A smaller PCCL value implies that the targeting image is more effective to be projected onto the space of fewer uncorrelated vectors. Figure 10c,d shows the PCCL levels to reach 99% CR and 99.9% CR for six images, respectively. The statistics infer a strong correlation between PCCL of _original_ images and PSNR of _reconstructed_ images. As the size of sub-block increases, the PCs of subblocks tend to concentrate for all images. Concentrated PCs show that removing high orders of PC results in fewer information loss which gives a higher PSNR of reconstructed image. \begin{table}
\begin{tabular}{l l l l l l l} \hline \hline
**K(256-8)** & **8** & **6** & **4** & **3** & **2** & **1** \\ \hline CR & 100\% & 99.99\% & 99.3\% & 97.7\% & 94.72\% & 87\% \\ PSNR & No loss & 57.32 & 43.22 & 36.74 & 31.1 & 25.26 \\ Size & 270,336 & 202,752 & 135,168 & 101,376 & 67,584 & 33,792 \\ Rate & 103.12\% & 77.34\% & 51.56\% & 38.67\% & 25.78\% & 12.89\% \\ \hline \hline \end{tabular}
\end{table}