# 共空间模式

共空间模式（common spatial pattern, CSP）方法是一种有监督的信号处理技术，它计算空间滤波器，使两类多通道信号之间的方差比最大化，最突出的应用是脑机接口（BCI）中的运动想象脑电。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> 由于带通滤波后脑电信号的方差对应于频带功率，CSP 学到的滤波器使一类的频带功率最大化、同时使另一类的频带功率最小化，因此对于基于频带功率特征的判别是最优的。<sup>[2](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)</sup> 它至今仍是运动想象脑机接口研究中使用最广泛的空间滤波算法，<sup>[3](https://eurasip.org/Proceedings/Eusipco/Eusipco2015/papers/1570102435.pdf)</sup> 其滤波器组版本在 BCI 竞赛 IV 中夺冠。<sup>[4](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2012.00039/full)</sup>

| 关键事实 | 内容 |
|---|---|
| 输出 | 一个矩阵 \( W \in \mathbb{R}^{C \times C} \)，将 \( C \) 通道信号投影到一个替代传感器空间，\( x_{\mathrm{CSP}}(t) = W^{\top} \cdot x(t) \)<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> |
| 原理 | 通过广义特征值问题对两个类别的协方差矩阵进行同时对角化<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> |
| 典型设置 | 7–30 Hz 带通，分析窗口从提示后 1000 ms 开始，特征值谱两端各取 2–3 个滤波器（通常总计 \( J = 6 \)）<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> |
| 特征与分类器 | 滤波信号方差的对数，用 Fisher 线性判别分析（LDA）分类<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> |
| 基准结果 | 滤波器组 CSP 在 BCI 竞赛 IV 中夺冠，平均 kappa 为 0.569（数据集 2a）和 0.600（数据集 2b）<sup>[4](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2012.00039/full)</sup> |
| 正则化增益 | 最佳正则化 CSP 变体将平均准确率提高约 3–4%，中位准确率提高近 10%（相比普通 CSP）<sup>[2](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)</sup> |
| 主要失效模式 | 训练集较小时严重过拟合且对噪声敏感<sup>[2](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)</sup> |

## 工作原理

CSP 将每个空间滤波器 \( w \) 取为瑞利商

\[ J(w) = \frac{w^{\top} \cdot \hat{R}_{1} \cdot w}{w^{\top} \cdot \hat{R}_{2} \cdot w}, \qquad \|w\|_{2} = 1, \]

的驻点，其中 \( \hat{R}_{k} = X_{k} \cdot X_{k}^{\top} / L \) 是条件 \( k \) 的估计空间协方差矩阵。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC4441303/)</sup> 当 \( \hat{R}_{2} \) 正定（或通过限制空间或正则化使其正定）时，瑞利商的所有驻点都可以闭式地表示为广义特征值问题 \( \hat{R}_{1} \cdot w = \lambda \cdot \hat{R}_{2} \cdot w \) 的特征向量，特征值 \( \lambda = J(w) \) 度量两个滤波信号的可分性；若 \( \hat{R}_{2} \) 奇异，商在零空间方向上可能无定义，需要适当处理。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC4441303/)</sup> 在 CSP 的记号中，这写作类别协方差矩阵的同时对角化，

\[ W^{\top} \cdot \Sigma_{(+)} \cdot W = \Lambda_{(+)}, \qquad W^{\top} \cdot \Sigma_{(-)} \cdot W = \Lambda_{(-)}, \]

其中 \( W \) 的缩放选择为使 \( \Lambda_{(+)} + \Lambda_{(-)} = I \)；每个 \( \lambda_{(c)\,j} \geq 0 \) 就是条件 \( c \) 在替代通道 \( j \) 中的方差。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> 等价地，对于正定的 \( C_{2} \)，可以求解标准特征值问题 \( C_{2}^{-1/2} \cdot C_{1} \cdot C_{2}^{-1/2} \cdot u = \lambda \cdot u \)，并恢复滤波器为 \( w = C_{2}^{-1/2} \cdot u \)；滤波器即最大和最小特征值对应的特征向量。<sup>[2](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)</sup> 同一分解也可以视为总协方差 \( C = C_{1} + C_{2} \) 与一个类别协方差的联合对角化。<sup>[6](https://marco-congedo.github.io/Diagonalizations.jl/dev/csp/)</sup>

## 操作步骤

标准流程如下。首先，对脑电试次进行带通滤波；常见的一般设置是 7–30 Hz 频带和从提示后 1000 ms 开始的时间区间，不过针对被试的个性化设置可以改善在线性能。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> 其次，估计各类别的协方差矩阵，通过特征值分解得到滤波器矩阵；在 MATLAB 中即命令 `[V, D] = eig(S1, S1 + S2)`，其特征向量为 `V` 的列，由 `D` 的对角元素选取。<sup>[4](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2012.00039/full)</sup> 第三，只保留少量 \( 2m \) 个投影，即 \( \hat{W} \) 中对应 \( m \) 个最大和 \( m \) 个最小特征值的列。<sup>[7](https://doc.ml.tu-berlin.de/bbci/publications/LemBlaCurMue05.pdf)</sup> 实践中 \( J = 6 \)，即两端各取三个特征向量，通常已足够；交叉验证是选择 \( J \) 的另一种方式，滤波器过多会过拟合。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> 第四，特征计算为滤波信号方差的对数：对于含 \( L \) 个样本的中心化试次数据，\( f_{i} = \log\left(\mathrm{diag}\left\{W^{\top} \cdot X^{(i)} \cdot X^{(i)\top} \cdot W\right\}\right) / (L - 1) \)。<sup>[8](https://ar5iv.labs.arxiv.org/html/2504.17111)</sup> 最后，特征权重由 Fisher LDA 确定。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> 由于 CSP 使用了标签信息，滤波器只能从每个交叉验证折内的训练数据计算；否则泛化误差会被严重低估。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup>

## 起源

在脑电领域，该方法的现代脑机接口形式基于 H. Ramoser、J. Muller-Gerking 和 G. Pfurtscheller 于 2000 年发表在《IEEE 康复工程汇刊》上的论文《想象手部运动期间单试次脑电的最优空间滤波》，该文为运动想象脑机接口确立了想象手部运动期间单试次脑电的最优空间滤波。<sup>[9](https://doi.org/10.1109/86.895946)</sup> 后来关于非平稳性的工作，即平稳 CSP 变体，由 Wojciech Samek 及其同事于 2012 年发表在《神经工程学杂志》上。<sup>[10](https://doi.org/10.1088/1741-2560/9/2/026013)</sup>

## 变体

**正则化 CSP。** 由于普通 CSP 对噪声高度敏感且在小训练集上过拟合，可以在协方差层面施加正则化，例如将估计向单位矩阵收缩或向由其他被试构建的通用协方差收缩，也可以在目标函数层面通过受 Tikhonov 正则化启发的加权 \( \ell_{2} \) 范数惩罚来实现。<sup>[2](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)</sup><sup> • </sup><sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC4441303/)</sup> 在一项比较 11 种正则化 CSP 算法的研究中，使用来自 BCI 竞赛数据集的 17 名被试的脑电，表现最佳的是 Tikhonov 正则化 CSP（TRCSP）和加权 Tikhonov 正则化（WTRCSP），增益集中在初始表现较差的被试上。<sup>[2](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)</sup>

**滤波器组 CSP（FBCSP）。** 该变体通过一组九个 Chebyshev II 型带通滤波器处理信号，覆盖 4–8、8–12 直至 36–40 Hz，在每个频带应用 CSP，选择特征并分类；对四类数据使用 \( m = 2 \) 对滤波器，对二类数据使用 \( m = 1 \)，并有一对多、成对和分治等多类扩展。<sup>[4](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2012.00039/full)</sup>

**非平稳性与鲁棒性变体。** 平稳 CSP 将滤波器向平稳子空间正则化，帮助那些几乎无法控制脑机接口的被试。<sup>[10](https://doi.org/10.1088/1741-2560/9/2/026013)</sup> 不变 CSP 最小化由协方差矩阵预先表征的调制（如枕区 alpha 活动）的影响，在普通 CSP 随加入的 alpha 增加而退化时保持稳定性能。<sup>[11](https://proceedings.neurips.cc/paper_files/paper/2007/file/6aab1270668d8cac7cef2566a1c5f569-Paper.pdf)</sup> 一个基于散度的框架将 CSP 重新表述为散度最大化，并统一了正则化、其他被试信息和不变性扩展。<sup>[12](https://iphome.hhi.de/samek/pdf/SamRBME14.pdf)</sup> 将 CSP 重新表述为通过交替 SVD 和最小二乘求解的约束最小化，绕过了广义特征值问题的内在非凸性，并实现了稀疏、迁移和多被试 CSP。<sup>[13](https://ieeexplore.ieee.org/document/9076261)</sup>

## 应用

CSP 几乎只应用于脑机接口的运动想象脑电。在 BCI 竞赛 IV 数据集 2a 上，该数据集包含 9 名被试的 4 类 22 通道脑电，FBCSP 取得了竞赛最佳平均 kappa 0.569，使用朴素贝叶斯 Parzen 窗分类器。<sup>[4](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2012.00039/full)</sup> L1 正则化 CSP 使电极数量减少到 10–20 个而性能无显著下降。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup> 近期工作将 CSP 与[黎曼几何](https://www.edgepedia.org/zh/riemannian-geometry)和深度学习结合：RW-FBCSP 在 BCI 竞赛 IV 数据集 2a 上验证，用黎曼 Fréchet 均值替代算术协方差均值，通过一对多分解将 CSP 扩展到多类，并按试次到类别质心的黎曼距离对试次加权，使离群试次对滤波器提取的影响减小。<sup>[14](https://link.springer.com/article/10.1186/s40708-026-00295-0)</sup> CSP-Net（2024）将 CSP 层置于网络骨干中，发现在 22 通道四类数据集上 \( f = 8 \) 个滤波器是性能与计算成本的良好平衡。<sup>[15](https://arxiv.org/html/2411.11879)</sup>

## 局限与替代方案

**过拟合与协方差估计。** CSP 对噪声高度敏感，在小训练集上严重过拟合。<sup>[2](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)</sup> 它以朴素的数据驱动方式计算滤波器，因此估计不佳的类别协方差矩阵——尤其是在电极多、数据少时——会直接降低空间滤波器的质量；在数据稀缺时，没有先验信息或正则化几乎不可能可靠地估计高维协方差矩阵。<sup>[12](https://iphome.hhi.de/samek/pdf/SamRBME14.pdf)</sup> 当眨眼或肌肉活动等伪迹在类别间分布不均时，单个试次可能主导一个滤波器，尽管这类滤波器通常获得接近零的分类权重。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup>

**非平稳性。** 在 10–30 分钟校准记录上优化的滤波器无法抑制在线操作期间出现的非任务相关调制，如警觉性变化、吞咽、眨眼或打哈欠；由电极伪迹、肌肉活动或任务投入变化引起的非平稳性常常降低分类性能。<sup>[11](https://proceedings.neurips.cc/paper_files/paper/2007/file/6aab1270668d8cac7cef2566a1c5f569-Paper.pdf)</sup> 对分类器偏置的简单自适应可以出人意料地很好地补偿非平稳性，而重新训练 LDA 或重新计算 CSP 贡献甚微。<sup>[1](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)</sup>

**替代方案。** 黎曼几何流程将协方差矩阵视为流形上的点：在 22 通道数据上，黎曼平均（均值、中位数、对数欧几里得）达到平均准确率 78.78–79.24%，而欧几里得平均为 76.31%，但在 60 或 118 通道时，欧几里得方法优于其黎曼对应方法，为 79.27% 对 74.03%，显示出对称正定假设随维度增长的局限。<sup>[3](https://eurasip.org/Proceedings/Eusipco/Eusipco2015/papers/1570102435.pdf)</sup> 黎曼最小距离均值（MDM）和切空间映射（TSM）基线在 pyRiemann 工具箱中作为标准几何替代方案实现。<sup>[16](https://arxiv.org/pdf/2202.02472v3.pdf)</sup> 已发表的 CSP 与 xDAWN 或 LCMV 波束形成器滤波器的定量比较尚属空白，因此这些比较在此无法定论。

## References

1. [Optimizing Spatial Filters for Robust EEG Single-Trial Analysis (Blankertz, Tomioka, Lemm, Kawanabe, Müller, IEEE Signal Processing Magazine 2008)](https://doc.ml.tu-berlin.de/bbci/publications/BlaTomLemKawMue08.pdf)
2. [Regularizing Common Spatial Patterns to Improve BCI Performance (Lotte & Guan, IEEE TBME 2011; same paper also mirrored at https://inria.hal.science/inria-00476820/file/tbme10.pdf)](https://personal.ntu.edu.sg/ctguan/Publications/2011_Fabien_IEEE_TBME.pdf)
3. [Averaging covariance matrices for EEG signal classification based on the CSP: an empirical study (EUSIPCO 2015)](https://eurasip.org/Proceedings/Eusipco/Eusipco2015/papers/1570102435.pdf)
4. [Filter bank common spatial pattern algorithm on BCI Competition IV Datasets 2a and 2b (Ang et al., Frontiers in Neuroscience 2012)](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/fnins.2012.00039/full)
5. [Probabilistic Common Spatial Patterns for Multichannel EEG Analysis](https://pmc.ncbi.nlm.nih.gov/articles/PMC4441303/)
6. [CSP · Diagonalizations.jl documentation](https://marco-congedo.github.io/Diagonalizations.jl/dev/csp/)
7. [Spatio-Spectral Filters for Improving the Classification of Single Trial EEG (Lemm, Blankertz, Curio, Müller, IEEE TBME 2005)](https://doc.ml.tu-berlin.de/bbci/publications/LemBlaCurMue05.pdf)
8. [Transferring Spatial Filters via Tangent Space Alignment in Motor Imagery BCIs (arXiv 2504.17111, 2025)](https://ar5iv.labs.arxiv.org/html/2504.17111)
9. [H. Ramoser, J. Muller-Gerking, G. Pfurtscheller (2000). Optimal spatial filtering of single trial EEG during imagined hand movement. IEEE Transactions on Rehabilitation Engineering.](https://doi.org/10.1109/86.895946)
10. [Wojciech Samek and colleagues (2012). Stationary common spatial patterns for brain–computer interfacing. Journal of Neural Engineering.](https://doi.org/10.1088/1741-2560/9/2/026013)
11. [Invariant Common Spatial Patterns: Alleviating Nonstationarities in Brain-Computer Interfacing (NeurIPS 2007)](https://proceedings.neurips.cc/paper_files/paper/2007/file/6aab1270668d8cac7cef2566a1c5f569-Paper.pdf)
12. [Divergence-based Framework for Common Spatial Patterns (Samek et al., IEEE TBME 2014)](https://iphome.hhi.de/samek/pdf/SamRBME14.pdf)
13. [Common Spatial Pattern Reformulated for Regularizations in Brain–Computer Interfaces (Wang et al., IEEE Trans. Cybernetics 2021)](https://ieeexplore.ieee.org/document/9076261)
14. [Filter bank CSP with Riemannian weighting for disability-centric motor imagery BCI (Brain Informatics, 2026)](https://link.springer.com/article/10.1186/s40708-026-00295-0)
15. [CSP-Net: Common Spatial Pattern Empowered Neural Networks for EEG-Based Motor Imagery Classification (arXiv, Nov 2024)](https://arxiv.org/html/2411.11879)
16. [Tensor-CSPNet: A Novel Geometric Deep Learning framework (arXiv 2202.02472v3)](https://arxiv.org/pdf/2202.02472v3.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Machine learning methods › Supervised, unsupervised, and semi-supervised learning › Feature selection and feature engineering

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/common-spatial-pattern

English original: https://www.edgepedia.org/common-spatial-pattern
