# Human Activity Recognition Based on Non-Contact Radar Data and Improved PCA Method
## 3 Methodology
### Improved PCA  
Traditional principal component analysis (PCA) is a linear dimension reduction method which uses orthogonal transformation as the mapping matrix. PCA uses the orthogonal matrix \(\mathbf{A}\in\mathbf{R}^{k\ast n}\) to map samples to lower dimensional spaces \(Am\in\mathbf{R}^{k}\) for data samples in high-dimensional spaces. \(k\ll n\) plays a role in dimensionality reduction, which can solve the problem of too many parameters due to poor data and also speeds up the rate of convergence.  
Equation (3) shows a \(m\times n\) matrix created from \(m\) samples of \(n\) dimensions.  
\[\mathbf{X}=\begin{bmatrix}x_{11}&\cdots&x_{1n}\\ \vdots&\ddots&\vdots\\ x_{m1}&\cdots&x_{mn}\end{bmatrix} \tag{3}\]  
\(\mathbf{X}_{\text{pre}}\) is given by zero-mean normalization and standardization, as shown in Equation (4).  
\[\mathbf{X}_{\text{pre}}=\begin{bmatrix}\frac{X_{11}-\overline{X}_{1}}{S_{1}}& \ldots&\frac{X_{1n}-\overline{X}_{n}}{S_{n}}\\ \vdots&\ddots&\vdots\\ \frac{X_{m1}-\overline{X}_{1}}{S_{1}}&\ldots&\frac{X_{m}-\overline{X}_{n}}{S_ {n}}\end{bmatrix} \tag{4}\]  
\[\overline{X_{n}}=\frac{1}{n}\sum_{i=1}^{m}x_{mn} \tag{5}\]  
In Equation (5), \(\overline{X_{n}}\) denotes the mean value of each dimension and  
\(S_{n}\) denotes the standard deviation of each dimension.  
\[S_{n}=\frac{1}{m}\sqrt{\sum_{i=1}^{m}(x_{mn}-\overline{X_{n}})} \tag{6}\]  
The covariance matrix \(\mathbf{X}_{\text{cov}}\) is given by Equation (7).  
\[\mathbf{X}_{\text{cov}}=\frac{1}{n-1}\overline{X_{pre}X^{T}} \tag{7}\]  
The value \(\mathbf{\lambda}=[\mathbf{\lambda}_{1},\ldots\mathbf{\lambda}_{\mathbf{\pi}}]\) of the covariance matrix and the orthonormal vector \(\mathbf{V}=[\mathbf{v}_{1},\ldots,\mathbf{v}_{n}]\) are obtained by diagonalizing \(\mathbf{X}_{\text{cov}}\).  
Traditional PCA extracts orthonormal vectors and sorts the values to obtain the top principal components with the highest contribution. When the principal component matrix is given, it is compressed from \(n\) dimension to \(k\) dimension by multiplying with \(\mathbf{X}_{\text{pre}}\). However, when the data dimension is greatly compressed for small-scale datasets, it can lead to a decrease in accuracy and over-fitting. This effect also pays the price, that is, at the expense of freedom. The loss of information caused by data compression can be offset by increasing the number of principal components retained for final analysis with an associated cost of a loss of degrees of freedom. The impact is more significant in smaller datasets than in larger datasets.  
Therefore, our work used an improved PCA to arrange the contribution of principal components and enhance values. Firstly, we selected \(k\) eigenvectors from the \(n\) dimensions, which accounted for most (>70%) of the valuable information of the spectrograms and then enhanced these \(k\) values by making them normally distributed. The abnormal values that are not on the interval of \((\overline{x}-2\sigma,\overline{x}+2\sigma)\) were replaced by the mean of the \(n-k\) dimensions. The substituted values were then added with a deviation to prevent over-fitting, while the values of the \(n-k\) eigenvectors left did not change. Finally, the \(k\) eigenvectors were combined into a new principal component matrix \(\mathbf{V}\) after enhancement, with \(\mathbf{V}\) given by Equation (8).  
\[\mathbf{V}=\left[\begin{array}{c}v_{1}^{\prime}\\ v_{2}^{\prime}\\ v_{p}^{\prime}\\ \ldots\\ v_{k}\end{array}\right] \tag{8}\]  
\(v_{1}^{\prime},v_{2}^{\prime}\ldots v_{k}^{\prime}\) are eigenvectors whose values are processed by the algorithm and \(\mathbf{V}\) is an enhanced matrix that combines these values with the rest of the unchanged values. Finally, the compressed matrix of \(k\) dimensions is given by \(\mathbf{V}\times\mathbf{X}_{\text{pre}}\). The data preprocessing process based on PCA is shown in Figure 2.