PyCTRSA: A Python package for cross-temporal representational similarity analysis-based E/MEG decoding

Zitong LuZenodo 2020 · DOI

Abstract

<strong>PyCTRSA is a Python toolbox for cross-temporal representation similarity analysis (RSA)-based decoding on EEG/MEG data.</strong> <strong>Summary</strong> Multivariate pattern analysis (MVPA) has become popular in the cognitive neuroscience domain. Using MVPA can obtain deeper information from neural activities than traditional univariate analysis. Representational Similarity Analysis (RSA) is one of the widely used MVPA methods by comparing the similarity of neural representations. In RSA, we should first calculate the representational dissimilarity matrix (RDM), which reflects the similarity among different task conditions. Then we gain the representational similarity computing the similarity between different RDMs. In traditional RSA, we can only use a hypothesis-based coding model RDM to fit the RDMs from neural activity time by time. In this way, encoding information in our brains in a time course can be successfully decoded. However, we still lack knowing whether representations of certain information from two different times have the same form. So, can we conduct cross-temporal decoding based on RSA? <strong>PyCTRSA</strong> is a Python Toolkit for novel cross-temporal representational similarity analysis (CTRSA). PyCTRSA is free open-source, easy-to-use, and comprehensive, which allows psychologists and neuroscientists to perform CTRSA-based decoding for electroencephalography (EEG) and magnetoencephalography (MEG). CTRSA-based decoding is a new algorithm for cross-temporal E/MEG decoding by RSA. We use the neural data from two different time-points to establish a cross-temporal RDM (CTRDM) corresponding to time <em>i</em> and time <em>j</em>. By this train of thought, we can obtain <em>Number_of_Times</em> by <em>Number_of_Times</em> CTRDMs. Then we can establish a Coding Model RDM by the experimental hypothesis. Finally, we can calculate the similarity between this Coding Model RDM and the <em>Number_of_Times</em> by <em>Number_of_Times</em> Cross-Temporal RDMs and obtain the cross-temporal decoding results. In PyCTRSA, you can not only calculate the cross-temporal similarities based on this novel method to realize decoding, but also calculate the cross-temporal similarities based on neural data under two different conditions to see similar patterns between two conditions and calculate cross-temporal similarities based on traditional RDMs to see similar representational patterns between different time-points. <strong>Statement of need</strong> PyCTRSA is a Python toolkit aiming at providing comprehensive functionality to realize a novel cross-temporal neural decoding method based on CTRSA by using very little codes. It requires several basic Python packages to function, including NumPy, SciPy, Matplotlib, and NeuroRA. There are four main features in PyCTRSA: - Calculate the cross-temporal representational dissimilarity matrix (CTRDM): a) calculate CTRDMs for a single channel; b) calculate CTRDMs for one subject; c) calculate CTRDMs for multi-channels/subjects. - Calculate the similarity between two CTRDMs: calculate the similarity by Pearson Correlation/Spearman Correlation/Kendall tau Correlation/Cosine Similarity/Euclidean Distance. - Calculate the cross-temporal similarity (CTS): a) calculate CTSs between neural data under two conditions; b) calculate CTSs based on traditional RDMs; c) calculate CTSs between CTRDMs and a Coding Model RDM. - Plot CTRSA Results: a) plot the CTRDM; b) plot the CTS. Users can find the tutorial on PyCTRSA website: https://github.com/ZitongLu1996/PyCTRSA. Additionally, we offer an introduction between classification-based decoding and CTRSA-based decoding. <strong>Acknowledgements</strong> Members of Memory and Emotion lab at Sun Yet-sen University provided invaluable feedback through the development of PyCTRSA.
BibTeX
@inproceedings{lu2020pyctrsa,
  author = {Zitong Lu},
  title = {{PyCTRSA: A Python package for cross-temporal representational similarity analysis-based E/MEG decoding}},
  booktitle = {Zenodo},
  year = {2020},
  doi = {10.5281/zenodo.4273674},
}

Loading related content...

Figure