Giter Site home page Giter Site logo

tvayer / spdsw Goto Github PK

View Code? Open in Web Editor NEW

This project forked from clbonet/spdsw

0.0 0.0 0.0 4.75 MB

Implementation of our ICML2023 paper "Sliced-Wasserstein on Symmetric Positive Definite Matrices for M/EEG Signals"

Python 72.12% Jupyter Notebook 27.88%

spdsw's Introduction

Sliced-Wasserstein on Symmetric Positive Definite Matrices for M/EEG Signals

This repository contains the code to reproduce the experiments of the paper Sliced-Wasserstein on Symmetric Positive Definite Matrices for M/EEG Signals. We propose in this paper a Sliced-Wasserstein distance on the space of symmetric positive definite matrices endowed with the Log-Euclidean metric.

Abstract

When dealing with electro or magnetoencephalography records, many supervised prediction tasks are solved by working with covariance matrices to summarize the signals. Learning with these matrices requires the usage of Riemanian geometry to account for their structure. In this paper, we propose a new method to deal with distributions of covariance matrices, and demonstrate its computational efficiency on M/EEG multivariate time series. More specifically, we define a Sliced-Wasserstein distance between measures of symmetric positive definite matrices that comes with strong theoretical guarantees. Then, we take advantage of its properties and kernel methods to apply this discrepancy to brain-age prediction from MEG data, and compare it to state-of-the-art algorithms based on Riemannian geometry. Finally, we show that it is an efficient surrogate to the Wasserstein distance in domain adaptation for Brain Computer Interface applications.

Citation

@inproceedings{bonet2023sliced,
  title={Sliced-Wasserstein on Symmetric Positive Definite Matrices for M/EEG Signals},
  author={Bonet, Clément and Malézieux, Benoît and Rakotomamonjy, Alain and Drumetz, Lucas and Moreau, Thomas and Kowalski, Matthieu and Courty, Nicolas},
  booktitle={International Conference on Machine Learning},
  pages={2777--2805},
  year={2023},
  organization={PMLR}
}

Installation

pip install -e .

Experiments

The procedures to reproduce the figures and experiments in the paper are described below.

  • Figure 1:

    python experiments/visu/plot_cone_SPD_log.py
    
  • Figure 2:

    python experiments/scripts/runtime.py
    python experiments/figures_scripts/figure_runtime.py
    
  • Table 1: To download the data, put the flag DOWNLOAD to True in da_particles.py or da_transfs.py.

    python experiments/scripts/da_particles.py --task session --ntry 5
    python experiments/scripts/da_transfs.py --task session --ntry 5
    

    Then, the results can be obtained by running the jupyter notebooks experiments/results/parse_results_particles.ipynb and experiments/results/parse_results_transformations.ipynb

  • Figure 4a:

    python experiments/scripts/alignement.py
    python experiments/scripts/figure_alignement.py
    
  • Figure 4b: The script is the same as in Table 1, except that the benchmark is run with "distance": ["spdsw"], and "n_proj": np.logspace(1, 3, 10, dtype=int).

    python experiments/scripts/da_transfs.py --task session --ntry 5
    python experiments/figure_accuracy_projs.py
    
  • BCI in appendix: All other experiments on BCI for cross subject alignement can be obtained by replacing --task session by --task subject.

  • MEG experiments: The code is mainly based on https://github.com/meeg-ml-benchmarks/brain-age-benchmark-paper, on the class SPDSW in spdsw/spdsw.py, and on the class KernelRidgeRegression in scikit-learn.

spdsw's People

Contributors

clbonet avatar ncourty avatar tvayer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.