BioPyC, an Open-Source Python Toolbox for Offline Electroencephalographic and Physiological Signals Classification

Research on brain–computer interfaces (BCIs) has become more democratic in recent decades, and experiments using electroencephalography (EEG)-based BCIs has dramatically increased. The variety of protocol designs and the growing interest in physiological computing require parallel improvements in processing and classification of both EEG signals and bio signals, such as electrodermal activity (EDA), heart rate (HR) or breathing. If some EEG-based analysis tools are already available for online BCIs with a number of online BCI platforms (e.g., BCI2000 or OpenViBE), it remains crucial to perform offline analyses in order to design, select, tune, validate and test algorithms before using them online. Moreover, studying and comparing those algorithms usually requires expertise in programming, signal processing and machine learning, whereas numerous BCI researchers come from other backgrounds with limited or no training in such skills. Finally, existing BCI toolboxes are focused on EEG and other brain signals but usually do not include processing tools for other bio signals. Therefore, in this paper, we describe BioPyC, a free, open-source and easy-to-use Python platform for offline EEG and biosignal processing and classification. Based on an intuitive and well-guided graphical interface, four main modules allow the user to follow the standard steps of the BCI process without any programming skills: (1) reading different neurophysiological signal data formats, (2) filtering and representing EEG and bio signals, (3) classifying them, and (4) visualizing and performing statistical tests on the results. We illustrate BioPyC use on four studies, namely classifying mental tasks, the cognitive workload, emotions and attention states from EEG signals.

[1]  Andrew Begel,et al.  Using psycho-physiological measures to assess task difficulty in software development , 2014, ICSE.

[2]  Vinay Jayaram,et al.  MOABB: trustworthy algorithm benchmarking for BCIs , 2018, Journal of neural engineering.

[3]  J. Russell A circumplex model of affect. , 1980 .

[4]  Stefan Schmidt,et al.  Electrodermal Activity (Eda) -- State-of-the-Art Measurement and Techniques for Parapsychological Purposes , 1999 .

[5]  F. Yger,et al.  Riemannian Approaches in Brain-Computer Interfaces: A Review , 2017, IEEE Transactions on Neural Systems and Rehabilitation Engineering.

[6]  Scott Makeig,et al.  BCILAB: a platform for brain–computer interface development , 2013, Journal of neural engineering.

[7]  G. vanRossum Python reference manual , 1995 .

[8]  Brian E. Granger,et al.  IPython: A System for Interactive Scientific Computing , 2007, Computing in Science & Engineering.

[9]  Carmen Vidaurre,et al.  BioSig: The Free and Open Source Software Library for Biomedical Signal Processing , 2011, Comput. Intell. Neurosci..

[10]  W. Ray,et al.  EEG alpha activity reflects attentional demands, and beta activity reflects emotional and cognitive processes. , 1985, Science.

[11]  Jonathan R. Wolpaw,et al.  Brain–Computer InterfacesPrinciples and Practice , 2012 .

[12]  Hugo F. Posada-Quintero,et al.  Power Spectral Density Analysis of Electrodermal Activity for Sympathetic Function Assessment , 2016, Annals of Biomedical Engineering.

[13]  Karen J. Reynolds,et al.  Heart rate variability indices for very short-term (30 beat) analysis. Part 1: survey and toolbox , 2013, Journal of Clinical Monitoring and Computing.

[14]  Robert Oostenveld,et al.  FieldTrip: Open Source Software for Advanced Analysis of MEG, EEG, and Invasive Electrophysiological Data , 2010, Comput. Intell. Neurosci..

[15]  Clemens Brunner,et al.  Better than random? A closer look on BCI results , 2008 .

[16]  Mohammad Soleymani,et al.  Single Trial Classification of EEG and Peripheral Physiological Signals for Recognition of Emotions Induced by Music Videos , 2010, Brain Informatics.

[17]  Gordon Cheng,et al.  Gumpy: a Python toolbox suitable for hybrid brain–computer interfaces , 2018, Journal of neural engineering.

[18]  Stephen M. Gordon,et al.  EEGNet: A Compact Convolutional Neural Network for EEG-based Brain-Computer Interfaces , 2021 .

[19]  Alexander L. Francis,et al.  Improved segregation of simultaneous talkers differentially affects perceptual and cognitive capacity demands for recognizing speech in competing speech , 2010, Attention, perception & psychophysics.

[20]  Michael L. Waskom,et al.  Seaborn: Statistical Data Visualization , 2021, J. Open Source Softw..

[21]  Atefeh Goshvarpour,et al.  Classification of Heart Rate Signals during Meditation using Lyapunov Exponents and Entropy , 2012 .

[22]  Brendan Z. Allison,et al.  The Hybrid BCI , 2010, Frontiers in Neuroscience.

[23]  Raphael Vallat,et al.  Pingouin: statistics in Python , 2018, J. Open Source Softw..

[24]  M Congedo,et al.  A review of classification algorithms for EEG-based brain–computer interfaces: a 10 year update , 2018, Journal of neural engineering.

[25]  Christian Jutten,et al.  Multiclass Brain–Computer Interface Classification by Riemannian Geometry , 2012, IEEE Transactions on Biomedical Engineering.

[26]  Christian Mühl,et al.  EEG-based workload estimation across affective contexts , 2014, Front. Neurosci..

[27]  N. Birbaumer,et al.  BCI2000: a general-purpose brain-computer interface (BCI) system , 2004, IEEE Transactions on Biomedical Engineering.

[28]  Brent Lance,et al.  EEGNet: a compact convolutional neural network for EEG-based brain–computer interfaces , 2016, Journal of neural engineering.

[29]  David M. Garner,et al.  Higuchi Fractal Analysis of Heart Rate Variability is Sensitive during Recovery from Exercise in Physically Active Men , 2017 .

[30]  Christian Kothe,et al.  Towards passive brain–computer interfaces: applying brain–computer interface technology to human–machine systems in general , 2011, Journal of neural engineering.

[31]  Wolfram Burgard,et al.  Deep learning with convolutional neural networks for EEG decoding and visualization , 2017, Human brain mapping.

[32]  Benjamin Blankertz,et al.  Wyrm: A Brain-Computer Interface Toolbox in Python , 2015, Neuroinformatics.

[33]  Pierre Jallon,et al.  A comparison of ERP spatial filtering methods for optimal mental workload estimation , 2015, 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC).

[34]  K.-R. Muller,et al.  Optimizing Spatial filters for Robust EEG Single-Trial Analysis , 2008, IEEE Signal Processing Magazine.

[35]  Thomas Lachmann,et al.  Negative and positive congruence effects in letters and shapes , 2004, Perception & psychophysics.

[36]  J J Vidal,et al.  Toward direct brain-computer communication. , 1973, Annual review of biophysics and bioengineering.

[37]  Léa Pillette,et al.  Redefining and Adapting Feedback for Mental-Imagery based Brain-Computer Interface User Training to the Learners' Traits and States. (Redéfinition et adaptation du feedback donné à l'utilisateur lors de l'entraînement à l'utilisation des interfaces cerveau-ordinateur en fonction du profil de l'appre , 2019 .

[38]  Alexandre Barachant,et al.  Riemannian geometry for EEG-based brain-computer interfaces; a primer and a review , 2017 .

[39]  Debatri Chatterjee,et al.  Effect of Mental Workload on Breathing Pattern and Heart Rate for a Working Memory Task: A Pilot Study , 2019, 2019 41st Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC).

[40]  J. Wolpaw,et al.  Brain-Computer Interfaces: Principles and Practice , 2012 .

[41]  Eunho Noh,et al.  Canonical correlation approach to common spatial patterns , 2013, 2013 6th International IEEE/EMBS Conference on Neural Engineering (NER).

[42]  Xin Liu,et al.  PyEEG: An Open Source Python Module for EEG/MEG Feature Extraction , 2011, Comput. Intell. Neurosci..

[43]  Giuseppe Andreoni,et al.  BCI++: A New Framework for Brain Computer Interface Application , 2009, SEDE.

[44]  H. Stanley,et al.  Quantification of scaling exponents and crossover phenomena in nonstationary heartbeat time series. , 1995, Chaos.

[45]  Andrzej Cichocki,et al.  Modern Machine-Learning Algorithms: For Classifying Cognitive and Affective States From Electroencephalography Signals , 2020, IEEE Systems, Man, and Cybernetics Magazine.

[46]  A. Malliani,et al.  Heart rate variability. Standards of measurement, physiological interpretation, and clinical use , 1996 .

[47]  Tiago H. Falk,et al.  Multi-Scale Heart Beat Entropy Measures for Mental Workload Assessment of Ambulant Users , 2019, Entropy.

[48]  A. Nijholt,et al.  A survey of affective brain computer interfaces: principles, state-of-the-art, and challenges , 2014 .

[49]  Guillaume Gibert,et al.  OpenViBE: An Open-Source Software Platform to Design, Test, and Use BrainComputer Interfaces in Real and Virtual Environments , 2010, PRESENCE: Teleoperators and Virtual Environments.

[50]  Akinori Horiguchi,et al.  Use of frequency domain analysis of skin conductance for evaluation of mental workload. , 2008, Journal of physiological anthropology.

[51]  Fabien Lotte,et al.  Classification of attention types in EEG signals , 2018 .

[52]  F. Shaffer,et al.  An Overview of Heart Rate Variability Metrics and Norms , 2017, Front. Public Health.

[53]  Luca Antiga,et al.  Automatic differentiation in PyTorch , 2017 .

[54]  Geoffrey E. Hinton,et al.  Deep Learning , 2015, Nature.

[55]  A. Peters,et al.  Short-Term Heart Rate Variability—Influence of Gender and Age in Healthy Subjects , 2015, PloS one.

[56]  Wes McKinney,et al.  Data Structures for Statistical Computing in Python , 2010, SciPy.

[57]  K. Willmes,et al.  On the Functional Neuroanatomy of Intrinsic and Phasic Alertness , 2001, NeuroImage.

[58]  Marco Congedo,et al.  Timeflux: an open-source framework for the acquisition and near real-time processing of signal streams , 2019, GBCIC.

[59]  Clemens Brunner,et al.  BCI Software Platforms , 2012 .

[60]  Peter J. Gianaros,et al.  Should heart rate variability be “corrected” for heart rate? Biological, quantitative, and interpretive considerations , 2018, Psychophysiology.

[61]  Cuntai Guan,et al.  Filter Bank Common Spatial Pattern Algorithm on BCI Competition IV Datasets 2a and 2b , 2012, Front. Neurosci..

[62]  Arthur Petrosian,et al.  Kolmogorov complexity of finite sequences and recognition of different preictal EEG patterns , 1995, Proceedings Eighth IEEE Symposium on Computer-Based Medical Systems.

[63]  Corinna Cortes,et al.  Support-Vector Networks , 1995, Machine Learning.

[64]  Fabien Lotte,et al.  A review of user training methods in brain computer interfaces based on mental tasks , 2020, Journal of neural engineering.

[65]  Guillaume Gibert,et al.  xDAWN Algorithm to Enhance Evoked Potentials: Application to Brain–Computer Interface , 2009, IEEE Transactions on Biomedical Engineering.

[66]  Fabien Lotte,et al.  Brain-Computer Interfaces: Beyond Medical Applications , 2012, Computer.

[67]  F Lotte,et al.  Advances in user-training for mental-imagery-based BCI control: Psychological and cognitive factors and their neural correlates. , 2016, Progress in brain research.

[68]  C. Neuper,et al.  Combining Brain–Computer Interfaces and Assistive Technologies: State-of-the-Art and Challenges , 2010, Front. Neurosci..

[69]  Alois Schlögl GDF - A general dataformat for BIOSIGNALS , 2006, ArXiv.

[70]  Stephane Bonnet,et al.  Enhancing single-trial mental workload estimation through xDAWN spatial filtering , 2015, 2015 7th International IEEE/EMBS Conference on Neural Engineering (NER).

[71]  A. I. Yakimchik Jupyter Notebook: a system for interactive scientific computing , 2019 .

[72]  E. Niedermeyer,et al.  Clinical neuropsychology of attention , 1994 .

[73]  Gaël Varoquaux,et al.  Scikit-learn: Machine Learning in Python , 2011, J. Mach. Learn. Res..

[74]  R. Schmidt Anticipation and timing in human motor performance. , 1968 .

[75]  R. Roeder,et al.  Eukaryotic gene transcription with purified components. , 1983, Methods in enzymology.

[76]  Klaus-Robert Müller,et al.  Towards Explainable Artificial Intelligence , 2019, Explainable AI.