# 表征相似性分析

表征相似性分析（RSA）是一种神经影像分析方法，通过活动模式之间的两两相异性来刻画大脑区域或计算模型如何表征刺激，并通过比较这些相异性结构来检验模型。它生成表征相异性矩阵（RDM），这是一个以实验条件为索引的方阵对称矩阵，其条目量化每对条件下神经反应模式的差异程度。由于RDM概括的是表征的几何结构而非其原始模式，RSA能够在一个框架内将脑活动测量、行为测量和计算建模联系起来，跨越被试、物种和记录方法，而无需测量通道之间逐点对应。<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup>

| 关键事实 | 详情 |
| --- | --- |
| 产出什么 | 一个RDM：活动模式之间两两相异性的方阵对称矩阵，每对条件一个条目<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup> |
| 默认相异性 | 相关距离（1减去跨通道的皮尔逊相关）是经典选择；交叉验证马氏距离在fMRI类数据中常被优先采用，欧氏距离和交叉验证欧氏距离变体也有使用<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup><sup> • </sup><sup>[2](https://rsatoolbox.readthedocs.io/en/stable/distances.html)</sup> |
| 关键原理 | 比较RDM避免了对表征之间空间对应映射的需求<sup>[3](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/neuro.01.035.2009/full)</sup> |
| 提出者 | Nikolaus Kriegeskorte，《系统神经科学前沿》，2008<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup> |
| 推荐的推断方法 | RDM之间的秩相关、随机化或符号秩检验，以及用于评估模型表现的噪声天花板<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup> |
| 设计要求 | 在区分相当多实验条件的条件丰富设计中收益最大<sup>[3](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/neuro.01.035.2009/full)</sup> |
| 主要软件 | MATLAB RSA工具箱、rsatoolbox（Python）、CoSMoMVPA、The Decoding Toolbox、PyMVPA、MNE-RSA<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup><sup> • </sup><sup>[5](https://doi.org/10.21105/joss.09148)</sup> |

## 工作原理

RSA建立在二阶同构之上：即表征可以在其状态之间的关系上对应，即使它们各自的元素并不一一对应。<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC7308652/)</sup> RSA不问哪个体素对应哪个模型单元，而是从活动模式本身抽象出来，计算一个表征所携带信息的RDM。<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup> 这被称为“表征相异性技巧”：RSA并不解决空间对应问题，而是回避了它。<sup>[7](https://deeplearning-jupyterbook.github.io/notebooks/intro-to-rsa.html)</sup>

RDM充当每个表征的签名。两个表征于是可以在没有空间对应映射的情况下进行定量比较，这使得跨物种（人类和猴子）、跨模态（单细胞记录和fMRI）以及大脑与计算网络模型之间的比较成为可能。<sup>[3](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/neuro.01.035.2009/full)</sup> RSA的推断方向是前向的，从模型到脑活动：根据模型解释观测到的相似性结构的能力来检验模型，这与分类分析不同。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC8279005/)</sup> “表征相异性技巧”还使得无需先将模型特征线性映射到反应通道即可检验计算模型。<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup>

## 操作步骤

典型的RSA分析有四个步骤：预处理以估计活动模式、估计相异性、比较RDM、统计推断。<sup>[9](https://kriegeskortelab.zuckermaninstitute.columbia.edu/sites/kriegeskortelab.zuckermaninstitute.columbia.edu/files/content/2025.05.22.655542.full_.pdf)</sup>

1. **模式估计。** 对于fMRI，标准方法用大规模单变量第一层GLM估计活动模式。单试次beta估计可能更准确，但在一个扫描段内彼此相关，因此建议在一个扫描段内平均；活动估计的噪声应在RSA之前进行预白化，因为体素的信噪比不同且存在空间相关。<sup>[9](https://kriegeskortelab.zuckermaninstitute.columbia.edu/sites/kriegeskortelab.zuckermaninstitute.columbia.edu/files/content/2025.05.22.655542.full_.pdf)</sup>
2. **相异性估计。** 常用的度量有相关距离（1减去跨体素或位点计算的皮尔逊相关）、欧氏距离和马氏距离——后者是将空间线性重新编码以白化噪声后的欧氏距离。<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup> 马氏距离使用逆噪声协方差重新缩放通道，\( d_{ij}^2 = (\bar{\mathbf{b}}_i - \bar{\mathbf{b}}_j) \, \Sigma^{-1} (\bar{\mathbf{b}}_i - \bar{\mathbf{b}}_j)^T / P \)，当通道可靠性不同或彼此相关时，它比欧氏距离可靠得多。<sup>[2](https://rsatoolbox.readthedocs.io/en/stable/distances.html)</sup> 交叉验证估计量，如交叉验证平方马氏距离（crossnobis），仅将来自独立扫描段的模式估计相乘，抵消正噪声偏差：如果真实距离为零，平均估计距离也为零。负相异性应保留而非设为零，以保持推断无偏。<sup>[2](https://rsatoolbox.readthedocs.io/en/stable/distances.html)</sup><sup> • </sup><sup>[9](https://kriegeskortelab.zuckermaninstitute.columbia.edu/sites/kriegeskortelab.zuckermaninstitute.columbia.edu/files/content/2025.05.22.655542.full_.pdf)</sup> 对于脉冲计数，可使用泊松计数的对称化KL散度，并有交叉验证版本。<sup>[2](https://rsatoolbox.readthedocs.io/en/stable/distances.html)</sup>
3. **模型比较。** 将测量的RDM与模型预测的RDM进行比较。由于假设模型与脑RDM之间的线性关系值得怀疑，推荐使用秩相关，当模型预测并列秩时使用Kendall's tau-A。<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup> 噪声天花板——在给定数据噪声下未知真实模型所能达到的预期RDM相关——通过上界（平均单被试RDM）和下界（留一被试法）估计，以判断模型失败反映的是模型缺陷还是实验局限。<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup>
4. **推断。** 最初的演示通过随机化条件标签检验RDM相关性，并使用条件集的bootstrap重采样估计模型偏差的变异性。<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup> 默认的组推断是跨被试的单侧符号秩检验；刺激标签随机化检验适用于单被试或任意组大小，但需要至少7个刺激，多重比较通过错误发现率控制。<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup>

## 起源

RSA由Nikolaus Kriegeskorte在《表征相似性分析——连接系统神经科学的分支》（《系统神经科学前沿》，2008）中提出。<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup> 随后的配套应用论文为《匹配人和猴子下颞叶皮层的类别物体表征》（Nikolaus Kriegeskorte等，《神经元》，2008）。<sup>[10](https://doi.org/10.1016/j.neuron.2008.10.043)</sup>

该方法建立在它直接引用的早期工作之上：“内部表征的二阶同构：状态之形状”（《认知心理学》，1970）中的二阶同构理论概念；“表征是相似性的表征”（《行为与脑科学》，1998），一项早期的活动模式相似性分析；以及“内容与聚类分析：评估神经系统中表征相似性”（《[哲学心理学](https://www.edgepedia.org/zh/philosophical-psychology)》，2000），该文通过关联活动模式的相异性结构来比较联结主义网络。<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup><sup> • </sup><sup>[3](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/neuro.01.035.2009/full)</sup> 带有噪声天花板和推断建议的MATLAB RSA工具箱由Hamed Nili等在《PLoS计算生物学》（2014）中展示。<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup> 交叉验证马氏距离（crossnobis）估计量由Alexander Walther等在《NeuroImage》（2015）中展示。<sup>[11](https://doi.org/10.1016/j.neuroimage.2015.12.012)</sup>

## 变体

**探照灯RSA**对以每个体素为中心的球形体素簇执行RSA，生成RDM相关图，并通过阈值控制错误发现率。<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup> 针对EEG和MEG的**时间RSA**在每个时间点计算RDM（并跨传感器和采样点进行探照灯分析）；MNE-RSA包作为MNE-Python的扩展为EEG、MEG和fMRI实现了这一方法，在皮层上使用依据测地线距离而非欧氏距离划定的区块，并使用交叉验证距离度量以获得可靠的脑RDM。<sup>[5](https://doi.org/10.21105/joss.09148)</sup> 对于MEG，交叉验证欧氏距离提供无偏估计和高度可重复的RDM，被推荐为默认相异性度量。<sup>[12](https://doi.org/10.1016/j.neuroimage.2018.02.044)</sup>

**贝叶斯RSA（BRSA）**是一种经验贝叶斯方法，直接对原始fMRI数据建模，对未知活动模式进行边缘化，并保证相似性矩阵半正定；它已被扩展用于建模空间噪声相关和被试间的共享结构。<sup>[13](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1006299)</sup> 认知控制应用发展出了单试次RSA，用分层线性模型在单试次水平拟合RSA模型以检验被试内脑—行为关系，以及表征连接分析和跨任务RSA。<sup>[8](https://pmc.ncbi.nlm.nih.gov/articles/PMC8279005/)</sup>

## 应用

2008年的演示将早期视觉皮层和梭状回面孔区中视觉物体的fMRI表征与计算模型联系起来，使用多维缩放可视化RDM。<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup> 由于RDM不需要共同的测量空间，RSA被用于比较跨物种和测量模态的表征，以及将人工神经网络模型与脑数据联系起来。<sup>[3](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/neuro.01.035.2009/full)</sup><sup> • </sup><sup>[9](https://kriegeskortelab.zuckermaninstitute.columbia.edu/sites/kriegeskortelab.zuckermaninstitute.columbia.edu/files/content/2025.05.22.655542.full_.pdf)</sup> RDM可以从任何类型的数据构建，包括神经影像、行为或计算数据。<sup>[14](https://academic.oup.com/scan/article-pdf/14/11/1243/32789192/nsz099.pdf)</sup>

## 局限性与替代方案

**失效模式。** 传统的扫描段内RSA对任务fMRI模式估计产生严重偏差和虚假相似性结构，这一点通过将相同分析应用于白噪声和静息态fMRI数据得到证明；跨扫描段RSA在理论上分子无偏，但在低信噪比下低估相似性，BRSA在低SNR下表现更好，而跨扫描段RSA在空间白化后在高SNR下优于BRSA。两者都应优先于传统的扫描段内RSA。<sup>[13](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1006299)</sup> 相关距离不能以刺激可解码性来解释，因为测量被噪声主导的弱模式可能具有低测量相关，从而产生误导性的大相关距离；不做方差归一化的均值移除避免了这一陷阱。<sup>[15](https://elifesciences.org/reviewed-preprints/106812v1)</sup> RSA还共享基于相关方法的普遍缺陷，且受离群值影响很大。<sup>[14](https://academic.oup.com/scan/article-pdf/14/11/1243/32789192/nsz099.pdf)</sup>

**度量选择。** 连续相异性度量比分类准确率可靠得多，后者较低的可靠性反映了离散化以及判别函数对扫描段间模式集合变化的敏感性。<sup>[11](https://doi.org/10.1016/j.neuroimage.2015.12.012)</sup> 皮尔逊相关距离对总体反应幅度变化不敏感，而欧氏距离对模式和幅度都敏感。<sup>[6](https://pmc.ncbi.nlm.nih.gov/articles/PMC7308652/)</sup> 交叉验证距离在比率尺度上提供无偏估计，具有可解释的零点，其作者得出结论：在刻画表征几何方面，交叉验证马氏距离优于分类准确率和相关距离。<sup>[11](https://doi.org/10.1016/j.neuroimage.2015.12.012)</sup> 这取代了最初将相关距离作为fMRI类数据默认值的建议<sup>[1](https://doi.org/10.3389/neuro.06.004.2008)</sup>，尽管交叉验证欧氏距离仍是MEG的推荐默认值。<sup>[12](https://doi.org/10.1016/j.neuroimage.2018.02.044)</sup>

**有争议的建议。** 关于基于秩的比较，Nili等推荐秩相关，因为不能假设模型与脑RDM之间的线性匹配，<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup> 而一项已发表的模拟和实证比较发现“基于秩的相关表现远差于其他标准”，基于似然的RSA产生最佳决策。<sup>[16](https://www.biorxiv.org/content/10.1101/071472v3)</sup> 关于多变量噪声归一化——即用第一层GLM残差的扫描段特异性噪声协方差归一化beta权重<sup>[17](https://iris.unitn.it/retrieve/e3835199-7164-72ef-e053-3705fe0ad821/Ritchie_2022_NeuroImage.pdf)</sup>——Walther等报告所有相异性度量的可靠性均有改善，<sup>[11](https://doi.org/10.1016/j.neuroimage.2015.12.012)</sup> 但后来的一项研究发现其影响在可靠性、效应量、感兴趣区域和预处理选择之间变化很大，并建议在增加RSA预处理复杂性之前保持保守。<sup>[17](https://iris.unitn.it/retrieve/e3835199-7164-72ef-e053-3705fe0ad821/Ritchie_2022_NeuroImage.pdf)</sup>

**与替代方案的关系。** 编码分析、模式成分建模（PCM）和RSA都评估活动剖面分布的二阶矩（协方差），它决定了表征几何；这三种方法应被正确理解为单一数据分析工具箱中互补的组成部分。PCM实现似然比检验，如果其假设成立则提供最强大的检验，但其他两种方法在适当实施时也可以表现相似。<sup>[16](https://www.biorxiv.org/content/10.1101/071472v3)</sup> 与MVPA解码和大规模单变量方法相比，RSA自然处理体素间的噪声相关，减少了对训练数据集的需求，且学习曲线低得多；编码模型需要单独的数据集进行模型拟合。<sup>[14](https://academic.oup.com/scan/article-pdf/14/11/1243/32789192/nsz099.pdf)</sup> 剥离表征空间特征的代价是无法以其组成特征的调谐函数来比较群体编码，也无法基于其他被试对某一新刺激的反应来预测某被试对该刺激的反应；然而RSA可以揭示不同脑区的表征存在差异，即使这些区域的多变量模式分类准确率相当。<sup>[18](https://www.annualreviews.org/content/journals/10.1146/annurev-neuro-062012-170325)</sup>

**软件。** 可用的软件包包括MATLAB RSA工具箱，<sup>[4](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)</sup> CoSMoMVPA（Matlab/GNU Octave，由Nikolaas N. Oosterhof、Andrew C. Connolly和[James V. Haxby](https://www.edgepedia.org/zh/james-v-haxby)开发，2016），<sup>[19](https://doi.org/10.3389/fninf.2016.00027)</sup> The Decoding Toolbox，<sup>[20](https://doi.org/10.3389/fninf.2014.00088)</sup> PyMVPA（Python，由Michael Hanke等开发，2009），<sup>[21](https://doi.org/10.1007/s12021-008-9041-y)</sup> MNE-RSA（2025），<sup>[5](https://doi.org/10.21105/joss.09148)</sup> 以及Python rsatoolbox，提供改进的距离度量、模型评估器、白化RDM比较、现一般推荐替代Kendall's tau-a的更快rho-a秩相关，以及归一化Bures相似性。<sup>[9](https://kriegeskortelab.zuckermaninstitute.columbia.edu/sites/kriegeskortelab.zuckermaninstitute.columbia.edu/files/content/2025.05.22.655542.full_.pdf)</sup><sup> • </sup><sup>[22](https://rsatoolbox.readthedocs.io/en/stable/comparing.html)</sup>

## References

1. [Nikolaus Kriegeskorte (2008). Representational similarity analysis – connecting the branches of systems neuroscience. Frontiers in Systems Neuroscience.](https://doi.org/10.3389/neuro.06.004.2008)
2. [Estimating dissimilarities, rsatoolbox 0.3.2 documentation](https://rsatoolbox.readthedocs.io/en/stable/distances.html)
3. [Relating population-code representations between man, monkey, and computational models (Kriegeskorte, Frontiers in Neuroscience 2009)](https://www.frontiersin.org/journals/neuroscience/articles/10.3389/neuro.01.035.2009/full)
4. [A Toolbox for Representational Similarity Analysis (Nili et al., PLOS Computational Biology 2014)](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1003553)
5. [Marijn van van Vliet and colleagues (2025). MNE-RSA: Representational Similarity Analysis on EEG, MEG and fMRI data. The Journal of Open Source Software.](https://doi.org/10.21105/joss.09148)
6. [Tools of the Trade: Multivoxel pattern analysis in fMRI (for social and affective neuroscientists)](https://pmc.ncbi.nlm.nih.gov/articles/PMC7308652/)
7. [7.4. Representational Similarity Analysis, Deep Learning for Experimental Psychologists and Cognitive Neuroscientists (educational tutorial)](https://deeplearning-jupyterbook.github.io/notebooks/intro-to-rsa.html)
8. [Neural coding of cognitive control: The representational similarity analysis approach (Trends in Cognitive Sciences review)](https://pmc.ncbi.nlm.nih.gov/articles/PMC8279005/)
9. [A Python Toolbox for Representational Similarity Analysis (rsatoolbox/RSA3; bioRxiv preprint doi 10.1101/2025.05.22.655542, posted May 27, 2025)](https://kriegeskortelab.zuckermaninstitute.columbia.edu/sites/kriegeskortelab.zuckermaninstitute.columbia.edu/files/content/2025.05.22.655542.full_.pdf)
10. [Nikolaus Kriegeskorte and colleagues (2008). Matching Categorical Object Representations in Inferior Temporal Cortex of Man and Monkey. Neuron.](https://doi.org/10.1016/j.neuron.2008.10.043)
11. [Alexander Walther and colleagues (2015). Reliability of dissimilarity measures for multi-voxel pattern analysis. NeuroImage.](https://doi.org/10.1016/j.neuroimage.2015.12.012)
12. [Matthias Guggenmos, Philipp Sterzer, Radoslaw Martin Cichy (2018). Multivariate pattern analysis for MEG: A comparison of dissimilarity measures. NeuroImage.](https://doi.org/10.1016/j.neuroimage.2018.02.044)
13. [Representational structure or task structure? Bias in neural RSA and a Bayesian method for reducing bias (Cai et al., PLOS Computational Biology)](https://journals.plos.org/ploscompbiol/article?id=10.1371%2Fjournal.pcbi.1006299)
14. [A Guide to Representational Similarity Analysis for Social Neuroscience (Social Cognitive and Affective Neuroscience, 2019)](https://academic.oup.com/scan/article-pdf/14/11/1243/32789192/nsz099.pdf)
15. [When do measured representational distances reflect the neural representational geometry? (eLife reviewed preprint)](https://elifesciences.org/reviewed-preprints/106812v1)
16. [Representational models: A common framework for understanding encoding, pattern-component, and representational-similarity analysis (Diedrichsen & Kriegeskorte; bioRxiv; published PLOS Comput Biol 2017, pcbi.1005508)](https://www.biorxiv.org/content/10.1101/071472v3)
17. [The unreliable influence of multivariate noise normalization on the reliability of neural dissimilarity (Ritchie et al., NeuroImage 2022; institutional repository copy)](https://iris.unitn.it/retrieve/e3835199-7164-72ef-e053-3705fe0ad821/Ritchie_2022_NeuroImage.pdf)
18. [Decoding Neural Representational Spaces Using Multivariate Pattern Analysis (Haxby, Connolly & Guntupalli, Annual Review of Neuroscience 2014, 37:435-456)](https://www.annualreviews.org/content/journals/10.1146/annurev-neuro-062012-170325)
19. [Nikolaas N. Oosterhof, Andrew C. Connolly, James V. Haxby (2016). CoSMoMVPA: Multi-Modal Multivariate Pattern Analysis of Neuroimaging Data in Matlab/GNU Octave. Frontiers in Neuroinformatics.](https://doi.org/10.3389/fninf.2016.00027)
20. [Martin N. Hebart, Kai GÃ¶rgen, John-Dylan Haynes (2015). The Decoding Toolbox (TDT): a versatile software package for multivariate analyses of functional imaging data. Frontiers in Neuroinformatics.](https://doi.org/10.3389/fninf.2014.00088)
21. [Michael Hanke and colleagues (2009). PyMVPA: a Python Toolbox for Multivariate Pattern Analysis of fMRI Data. Neuroinformatics.](https://doi.org/10.1007/s12021-008-9041-y)
22. [Comparing RDMs, rsatoolbox 0.3.2 documentation](https://rsatoolbox.readthedocs.io/en/stable/comparing.html)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 25, 2026*

Topic: 生命与健康 › 人类健康与医学

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/representational-similarity-analysis

English original: https://www.edgepedia.org/representational-similarity-analysis
