Giter Site home page Giter Site logo

asfa's Introduction

Code for ASFA

Prerequisites

  • python == 3.8.5
  • torch == 1.8.1
  • numpy == 1.20.1
  • scipy == 1.6.1
  • mne == 0.22.0
  • scikit-learn == 0.23.2
  • pyriemann == 0.2.6

Dataset

  • Please manually download the datasets BNCI2014001, BNCI2014002, BNCI2014004 by MOABB.

Framework

  • bci: common approaches in BCIs:
  • bsfda: black-box source model for source-free domain adaptation:
    • Source: source only
    • Source HypOthesis Transfer (SHOT-IM, SHOT)
    • ASFA, ASFA-aug: our proposed approach, ASFA-aug add data augmentation when performing knowledge distillation
  • libs: public function used in this project:
    • augment: augment functions
    • cdan, dan, dann, grl, jan, kernel: files for existing unsupervised domain adaptation approaches, code from https://github.com/thuml/Transfer-Learning-Library
    • dataLoad: load and compute tangent space features for EEG data
    • DataIterator: data iterator when training deep networks
    • network, eegnet, deepconvent, DomainDiscriminator: model definition
    • loss: loss functions
    • utils: common used functions
  • sfda: approaches for source-free domain adaptation:
    • Source: source only
    • BAIT
    • Source HypOthesis Transfer (SHOT-IM, SHOT)
    • ASFA: our proposed approach
  • uda: approaches for unsupervised domain adaptation:
    • Conditional domain adversarial network (CDAN/CDAN-E)
    • Domain adaptation network (DAN)
    • Domain-adversarial neural network (DANN)
    • Joint adaptation netowrk (JAN)
    • Minimum class confusion (MCC)

Run

When you have prepared the datasets, you can directly run the corresponding .py file.

For example,

cd ASFA
python sfda/ASFA.py --gpu_id '0' --device 'cuda' --fileroot your_data_file_path --output ASFA

Citation

If you find this code useful for your research, please cite our papers

@article{XiaASFA2022,
    title={Privacy-preserving domain adaptation for motor imagery-based brain-computer interfaces},
    author={Kun Xia and Lingfei Deng and Wlodzislaw Duch and Dongrui Wu},
    journal={IEEE Trans. on Biomedical Engineering},
    year={2022},
    vol={69},
    no={11},
    pages={3365-3376}
}

Contact

[email protected]

asfa's People

Contributors

xkazm avatar

Stargazers

Haoyu Li avatar Carl avatar Autumnii avatar  avatar Jiawei Huang avatar  avatar Qianqian Zhan avatar  avatar  avatar  avatar Łukasz Furman avatar

Watchers

 avatar

asfa's Issues

Accuracy

Dear Author,

I recently read your paper and tried to reproduce your results using the MI 2 dataset's left/right hand 2-classification and left/right hand, foot, and tongue 4-classification train data for training and testing. However, I found that when using the 2-classification train data, the ASFA algorithm's accuracy results were only 72.99%-73.84%, which is about 2% lower than the 74.18%-75.06% reported in your paper. The same situation also occurred with the 4-classification train data, where my accuracy results were 54.01%-55.25%, while your reported accuracy results in the paper were 56.92%-57.78%.

I wanted to ask if this difference is within your expectations or if there could be any issues with your code or parameter settings. If possible, could you provide some assistance to help me better understand these results and try to address this issue?

Thank you for writing this paper and providing the source code on Github. I look forward to hearing back from you.

Thank you!

Code issue

Hello!
I am very sorry to disturb you! You mentioned in the README.md file that the datasets are downloaded via MOABB: "Please manually download the datasets BNCI2014001, BNCI2014002, BNCI2014004 by MOABB.".
However, in your ASFA.py, line 257 reads "datasets = ['BNCI2014012', 'BNCI2014014', 'BNCI201402', 'BNCI201501-2', 'BNCI2014014-A', 'BNCI2014014-B']".
The names of these two data sets do not correspond to each other, can you tell me how to solve this problem?**

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.