# 2DPCA

2DPCA 是针对图像特征提取提出的数据降维方法。相比 PCA，2DPCA 用于处理矩阵而不是向量。

## 算法¶

$\mathbf{Y} = \mathbf{AX}.$

$J(\mathbf{X}) = \operatorname{tr}(\mathbf{S}_x),$

\begin{aligned} \mathbf{S}_x &=E(\mathbf{Y}-E \mathbf{Y})(\mathbf{Y}-E \mathbf{Y})^T \\ &=E[\mathbf{A X}-E(\mathbf{A X})][\mathbf{A} \mathbf{X}-E(\mathbf{A X})]^T \\ & =E[(\mathbf{A}-E \mathbf{A}) \mathbf{X}][(\mathbf{A}-E \mathbf{A}) \mathbf{X}]^T, \end{aligned}

$\operatorname{tr}\left(\mathbf{S}_x\right)=\mathbf{X}^T\left[E(\mathbf{A}-E \mathbf{A})^T(\mathbf{A}-E \mathbf{A})\right] \mathbf{X}.$

$\mathbf{G}_t = E[(\mathbf A - E\mathbf A)^T (\mathbf A - E \mathbf A)],$

$\mathbf{G}_t=\frac{1}{M} \sum_{j=1}^M\left(\mathbf{A}_j-\overline{\mathbf{A}}\right)^T\left(\mathbf{A}_j-\overline{\mathbf{A}}\right)$

$J(\mathbf{X}) = \mathbf{X}^T \mathbf{G}_t \mathbf{X},$

$\begin{gathered} \arg \max_{\{\mathbf{X}_1, \ldots, \mathbf{X}_n\}} J(\mathbf(X)) \\ \text{s. t. } \mathbf{X}_i^T \mathbf{X}_j = 0, i\neq j, i, j = 1, \ldots, d \end{gathered}$

## 特征提取¶

$\mathbf{Y}_k = \mathbf{AX}_k, \quad k = 1, 2, \ldots, d.$

$\mathbf{B}_i = [\mathbf{Y}_1^{(i)}, \mathbf{Y}_2^{(i)}, \ldots, \mathbf{Y}_d^{(i)}],$

## 分类¶

$d\left(\mathbf{B}_i, \mathbf{B}_j\right)=\sum_{k=1}^d\left\|\mathbf{Y}_k^{(i)}-\mathbf{Y}_k^{(j)}\right\|_2$

## 图像重建¶

$\mathbf{V} = \mathbf{AU}$

$\tilde{\mathbf{A}}=\mathbf{V} \mathbf{U}^T=\sum_{k=1}^d \mathbf{Y}_k \mathbf{X}_k^T$

$$\tilde{\mathbf{A}} = \mathbf{Y}_k \mathbf{X}_k^T \in \mathbb{R}^{m\times n}(k = 1, 2, \ldots, d)$$，表示$$\mathbf{A}$$ 的一张子图像。$$\mathbf{A}$$ 可视为前 $$d$$ 张子图像的和。当 $$d = n$$，有 $$\tilde{\mathbf{A}} = \mathbf{A}$$。否则，当 $$d<n$$$$\tilde{\mathbf{A}}$$$$\mathbf{A}$$ 的近似。

## Reference¶

Jian Yang, D. Zhang, A. F. Frangi and Jing-yu Yang, "Two-dimensional PCA: a new approach to appearance-based face representation and recognition," in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 26, no. 1, pp. 131-137, Jan. 2004, doi: 10.1109/TPAMI.2004.1261097. https://ieeexplore.ieee.org/document/1261097

@article{1261097,
author  = {Jian Yang and Zhang, D. and Frangi, A.F. and Jing-yu Yang},
journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
title   = {Two-dimensional PCA: a new approach to appearance-based face representation and recognition},
year    = {2004},
volume  = {26},
number  = {1},
pages   = {131-137},
doi     = {10.1109/TPAMI.2004.1261097}
}