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

^{1}

^{2}

^{3}

^{4}

^{5}

^{*}

## Abstract

**:**

## 1. Introduction

#### 1.1. Motivation

#### 1.2. Approach

## 2. State-of-the-Art BCIs Platforms

#### 2.1. Graphical User Interface (GUI)

#### 2.2. EEG Signal Processing

#### 2.2.1. Pre-Processing

#### 2.2.2. Signal Processing

#### 2.2.3. Classification

#### 2.3. Statistical Modeling and Data Visualization

#### 2.4. Programming Languages

#### 2.5. Supported Systems

#### 2.6. Licenses

#### 2.7. Distinctive Features of BioPyC

## 3. Materials and Methods

#### 3.1. Jupyter Notebook and Voilà as a GUI

#### 3.2. BioPyC Modularity

#### 3.3. Reading Data Sets

#### 3.3.1. Raw Data

#### 3.3.2. Preprocessing

#### 3.3.3. Pre-Processed Data

#### 3.4. Applying Spatial Filters and Machine Learning Algorithms

#### 3.4.1. EEG Spatial Filters

#### 3.4.2. Physiological Signal Features

- CVSD is the coefficient of variation of successive differences. This corresponds to the RMSSD divided by meanRR [42].
- cvRR is the RR coefficient of variation. This corresponds to the sdRR divided by the meanRR [42].
- medianRR is the median of the absolute values of the RRIs’ successive differences [44].
- madRR RRIs’ median absolute deviation (MAD) [42].
- mcvRR is the RRIs’ median-based coefficient of variation. This corresponds to the ratio of madRR divided by medianRR [44].
- RR50 or RR20 is the successive RRIs’ number of interval differences greater than 50 ms or 20 ms, respectively [42].
- pRR50 or pRR20 is the proportion derived by dividing RR50 (or RR20) by the number of RRIs [44].
- Shannon_h is the Shannon entropy calculated on the basis of the class probabilities of the RRI density distribution [44].
- VLF is the HRV variance in the very low frequency (0.003 to 0.04 Hz) [42].
- Total_Power is the total power of the full density spectra [44].
- LFn is the normalized LF power. It can be calculated using the equation “LFn = LF/(LF+HF)” [42].
- HFn is the normalized HF power. It can be calculated using the equation “HFn = HF/(LF+HF)” [42].
- LFp is the LF/Total_Power ratio [44].
- HFp is the HF/Total_Power ratio [44].
- DFA is the detrended fluctuation analysis (DFA) [46] of the heart rate raw signals.
- Shannon is the RRIs’ Shannon entropy [44].
- sample_entropy is the RRIs’ sample entropy [47].
- correlation_Dimension represents the RRIs’ correlation dimension [44].
- entropy_Multiscale is the RRIs’ entropy multiscale [47].
- entropy_SVD is the RRIs’ singular value decomposition (SVD) entropy [44].
- entropy_Spectral_VLF represents the RRIs’ spectral entropy over the VLF [44].
- entropy_Spectral_LF is the RRIs’ spectral entropy over the LF [44].
- entropy_Spectral_HF is the RRIs’ spectral entropy over the HF [44].
- Fisher_Info is the RRIs’ Fisher information [48].
- Lyapunov is the RRIs’ Lyapunov exponent [49].
- FD_Petrosian is the RRIs’ Petrosian’s fractal dimension [50].
- FD_Higushi is the Higushi’s fractal dimension of RRIs [51].

- peak_length is the interval of successive peaks in the breathing pattern signal [52].
- trough_length is the interval of successive troughs in the breathing pattern signal [52].
- peak_amplitude is the amplitude calculated for each peak of the trial [52].
- trough_amplitude is the amplitude calculated for each trough of the trial [52].
- resp_rate corresponds to the breathing rate, obtained from the frequency domain analysis of the breathing signals [52].

- phasic_peak_amplitude represents the amplitude of phasic peaks [54].
- phasic_peak_longitude is the rise time/duration of the peaks [54].
- phasic_peak_slope represents the slope of the peaks [55].
- ordinate_slope is the ordinate of the slope of the peaks, i.e., the starting point [55].
- peak_peak_interval corresponds to the inter-peaks time [55].

#### 3.4.3. Machine Learning Algorithms

#### 3.5. Calibration Types

#### 3.5.1. Subject-Specific Study

#### 3.5.2. Subject-Independent Study

#### 3.6. Evaluation

#### 3.6.1. Split Ratio

#### 3.6.2. Cross-Validation

#### 3.7. Statistics and Visualization

#### 3.7.1. Performances

#### 3.7.2. Statistics

- Test the data normality with the Shapiro–Wilk test from the Python library Scipy [62].
- Test the data sphericity with Mauchly’s test from Scipy.
- Analyze and compare means of classification performances between machine learning algorithms, using, in the case that data are normalized, the following:
- The t-test: comparing the performance of two algorithms along all the subjects; comparing performances of an algorithm depending on the study type (subject-specific vs. subject-independent) using pingouin.
- One-way ANOVA with repeated measures: comparing performances of multiple algorithms (more than two) or multiple study types using pingouin.
- Two-way ANOVA with repeated measures: comparing performance with both factors (type of algorithms, type of study), using pingouin.

#### 3.7.3. Chance Level

#### 3.7.4. Visualization

#### 3.8. Demonstrating BioPyC Use Cases

#### 3.8.1. Motor Imagery

#### 3.8.2. Workload

#### 3.8.3. Affective States

#### 3.8.4. Attention

## 4. Results

#### 4.1. Motor Imagery

#### 4.2. Workload

#### 4.3. Affective States

#### 4.4. Attention

## 5. Discussion

## 6. Current Status and Future Work

## 7. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Vidal, J.J. Toward direct brain-computer communication. Annu. Rev. Biophys. Bioeng.
**1973**, 2, 157–180. [Google Scholar] [CrossRef] [PubMed] - Clerc, M.; Bougrain, L.; Lotte, F. Brain-Computer Interfaces 1; Wiley-ISTE: London, UK, 2016. [Google Scholar]
- Millán, J.R.; Rupp, R.; Müller-Putz, G.; Murray-Smith, R.; Giugliemma, C.; Tangermann, M.; Vidaurre, C.; Cincotti, F.; Kübler, A.; Leeb, R.; et al. Combining Brain-Computer Interfaces and Assistive Technologies: State-of-the-Art and Challenges. Front. Neurosci.
**2010**, 4, 161. [Google Scholar] [CrossRef] [PubMed] - Zander, T.; Kothe, C. Towards passive brain-computer interfaces: Applying brain-computer interface technology to human-machine systems in general. J. Neural Eng.
**2011**, 8, 025005. [Google Scholar] [CrossRef] [PubMed] - Pfurtscheller, G. The hybrid BCI. Front. Neurosci.
**2010**, 4, 1–11. [Google Scholar] [CrossRef] [PubMed] - Wolpaw, J.; Wolpaw, E. Brain-Computer Interfaces: Principles and Practice; OSO: Oxford, MS, USA, 2012; pp. 1–424. [Google Scholar] [CrossRef]
- Erp, J.; Lotte, F.; Tangermann, M. Brain-Computer Interfaces: Beyond Medical Applications. Computer
**2012**, 45, 26–34. [Google Scholar] [CrossRef][Green Version] - Jeunet, C.; N’Kaoua, B.; Lotte, F. Advances in user-training for mental-imagery-based BCI control: Psychological and cognitive factors and their neural correlates. Prog. Brain Res.
**2016**, 228, 3–35. [Google Scholar] [CrossRef] - Roc, A.; Pillette, L.; Mladenovic, J.; Benaroch, C.; N’Kaoua, B.; Jeunet, C.; Lotte, F. A review of user training methods in brain computer interfaces based on mental tasks. J. Neural Eng.
**2020**, 18, 011002. [Google Scholar] [CrossRef] [PubMed] - Lotte, F.; Bougrain, L.; Cichocki, A.; Clerc, M.; Congedo, M.; Rakotomamonjy, A.; Yger, F. A Review of Classification Algorithms for EEG-based Brain-Computer Interfaces: A 10-year Update. J. Neural Eng.
**2018**, 15, 031005. [Google Scholar] [CrossRef][Green Version] - Jayaram, V.; Barachant, A. MOABB: Trustworthy algorithm benchmarking for BCIs. J. Neural Eng.
**2018**, 15, 066011. [Google Scholar] [CrossRef] [PubMed] - Rossum, G. Python Reference Manual; Technical Report; Network Theory Ltd.: Amsterdam, The Netherlands, 1995. [Google Scholar]
- Pérez, F.; Granger, B.E. {IP}ython: A System for Interactive Scientific Computing. Comput. Sci. Eng.
**2007**, 9, 21–29. Available online: http://ipython.org (accessed on 10 May 2014). [CrossRef] - Barachant, A.; King, J.R. pyRiemann 0.2.2. 2015. Available online: https://pyriemann.readthedocs.io/en/latest/ (accessed on 25 August 2021).
- Gramfort, A.; Luessi, M.; Larson, E.; Engemann, D.A.; Strohmeier, D.; Brodbeck, C.; Goj, R.; Jas, M.; Brooks, T.; Parkkonen, L.; et al. MEG and EEG data analysis with MNE-Python. Front. Neurosci.
**2013**, 7, 267. [Google Scholar] [CrossRef] [PubMed][Green Version] - Ang, K.; Chin, Z.; Wang, C.; Guan, C.; Zhang, H. Filter bank common spatial pattern algorithm on BCI competition IV datasets 2a and 2b. Front. Neurosci.
**2012**, 6, 1–9. [Google Scholar] [CrossRef][Green Version] - Schölgl, A.; Vidaurre, C.; Sander, T.H. BioSig: The free and open source software library for biomedical signal processing. Comput. Intell. Neurosci.
**2011**, 2011, 935364. [Google Scholar] [CrossRef][Green Version] - Clisson, P.; Bertrand-Lalo, R.; Congedo, M.; Victor-Thomas, G.; Chatel-Goldman, J. Timeflux: An Open-Source Framework for the Acquisition and Near Real-Time Processing of Signal Streams. 2019, pp. 6–11. Available online: https://hal.archives-ouvertes.fr/hal-02315098/document (accessed on 25 August 2021).
- Schalk, G.; Mcfarland, D.J.; Hinterberger, T.; Birbaumer, N.; Wolpaw, J.R. BCI2000: A General-Purpose Brain-Computer Interface (BCI) System. IEEE Trans. Biomed. Eng.
**2004**, 51, 1034–1043. [Google Scholar] [CrossRef] - Renard, Y.; Lotte, F.; Gibert, G.; Congedo, M.; Maby, E.; Delannoy, V.; Bertrand, O.; Lécuyer, A. OpenViBE: An open-source software platform to design, test, and use brain-computer interfaces in real and virtual environments. Presence Teleoper. Virtual Environ.
**2010**, 19, 35–53. [Google Scholar] [CrossRef][Green Version] - Müller-Putz, G.R.; Breitwieser, C.; Cincotti, F.; Leeb, R.; Schreuder, M.; Leotta, F.; Tavella, M.; Bianchi, L.; Kreilinger, A.; Ramsay, A.; et al. Tools for brain-computer interaction: A general concept for a hybrid BCI. Front. Neuroinform.
**2011**, 5, 30. [Google Scholar] [CrossRef][Green Version] - Kothe, C.A.; Makeig, S. BCILAB: A platform for brain-computer interface development. J. Neural Eng.
**2013**, 10, 056014. [Google Scholar] [CrossRef] [PubMed][Green Version] - Perego, P.; Maggi, L.; Parini, S.; Andreoni, G. BCI++: A new framework for brain computer interface application. In 18th International Conference on Software Engineering and Data Engineering 2009, SEDE 2009; International Society for Computers and Their Applications (ISCA): Las Vegas, NV, USA, 2009; pp. 37–41. [Google Scholar]
- Delorme, A.; Makeig, S. Eeglab_Jnm03.Pdf. Available online: https://sccn.ucsd.edu/eeglab/index.php (accessed on 25 August 2021).
- Oostenveld, R.; Fries, P.; Maris, E.; Schoffelen, J.M. FieldTrip: Open source software for advanced analysis of MEG, EEG, and invasive electrophysiological data. Comput. Intell. Neurosci.
**2011**, 2011, 156869. [Google Scholar] [CrossRef] - Tayeb, Z.; Waniek, N.; Fedjaev, J.; Ghaboosi, N.; Rychly, L.; Widderich, C.; Richter, C.; Braun, J.; Saveriano, M.; Cheng, G.; et al. Gumpy: A Python toolbox suitable for hybrid brain-computer interfaces. J. Neural Eng.
**2018**, 15, 065003. [Google Scholar] [CrossRef] [PubMed][Green Version] - Brunner, C.; Andreoni, G.; Bianchi, L.; Blankertz, B.; Breitwieser, C.; Kanoh, S.; Susila, I.P.; Venthur, B. BCI Software Platforms. In Towards Practical Brain-Computer Interfaces; Springer: Berlin/Heidelberg, Germany, 2013; pp. 303–331. [Google Scholar]
- Bao, F.S.; Liu, X.; Zhang, C. PyEEG: An open source python module for EEG/MEG feature extraction. Comput. Intell. Neurosci.
**2011**, 2011, 406391. [Google Scholar] [CrossRef] [PubMed][Green Version] - Venthur, B.; Dähne, S.; Höhne, J.; Heller, H.; Blankertz, B. Wyrm: A Brain-Computer Interface Toolbox in Python. Neuroinformatics
**2015**, 13, 471–486. [Google Scholar] [CrossRef][Green Version] - Blankertz, B.; Tomioka, R.; Lemm, S.; Kawanabe, M.; Müller, K. Optimizing spatial filters for robust EEG single-trial analysis. IEEE Signal Process. Mag.
**2008**, 25, 41–56. [Google Scholar] [CrossRef] - Yger, F.; Berar, M.; Lotte, F. Riemannian approaches in Brain-Computer Interfaces: A review. IEEE TNSRE
**2016**, 25, 1753–1762. [Google Scholar] [CrossRef][Green Version] - MATLAB. Version 7.10.0 (R2010a); The MathWorks Inc.: Natick, MA, USA, 2010. [Google Scholar]
- ISO. ISO/IEC 14882:1998: Programming Languages—C++; American National Standards Institute: New York, NY, USA, 1998; p. 732. [Google Scholar]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res.
**2011**, 12, 2825–2830. [Google Scholar] - Dignam, J.D.; Martin, P.L.; Shastry, B.S.; Roeder, R.G. Eukaryotic gene transcription with purified components. Methods Enzymol.
**1983**, 101, 582–598. [Google Scholar] [CrossRef] - Paszke, A.; Gross, S.; Chintala, S.; Chanan, G.; Yang, E.; DeVito, Z.; Lin, Z.; Desmaison, A.; Antiga, L.; Lerer, A. Automatic Differentiation in PyTorch. In Proceedings of the NIPS Autodiff Workshop, Long Beach, CA, USA, 9 December 2017. [Google Scholar]
- Alois, S. GDF—A General Dataformat for BIOSIGNALS. arXiv
**2006**, arXiv:0608052v10. [Google Scholar] - Congedo, M.; Barachant, A.; Bhatia, R. Riemannian geometry for EEG-based brain-computer interfaces; a primer and a review. Brain-Comput. Interfaces
**2017**, 4, 155–174. [Google Scholar] [CrossRef] - Appriou, A.; Cichocki, A.; Lotte, F. Modern machine learning algorithms to classify cognitive and affective states from electroencephalography signals. IEEE Syst. Man Cybern. Mag.
**2020**, 6, 29–38. [Google Scholar] [CrossRef] - Schirrmeister, R.; Springenberg, J.; Fiederer, L.; Glasstetter, M.; Eggensperger, K.; Tangermann, M.; Hutter, F.; Burgard, W.; Ball, T. Deep learning with convolutional neural networks for EEG decoding and visualization. Hum. Brain Mapp.
**2017**, 38, 5391–5420. [Google Scholar] [CrossRef] [PubMed][Green Version] - Lecun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature
**2015**, 521, 436–444. [Google Scholar] [CrossRef] [PubMed] - Malik, M. Heart rate variability: Standards of measurement, physiological interpretation, and clinical use. Circulation
**1996**, 93, 1043–1065. [Google Scholar] [CrossRef][Green Version] - Smith, A.L.; Owen, H.; Reynolds, K. Heart rate variability indices for very short-term (30 beat) analysis. Part 1: Survey and toolbox. J. Clin. Monit. Comput.
**2013**, 27, 569–576. [Google Scholar] [CrossRef] [PubMed] - Voss, A.; Schroeder, R.; Heitmann, A.; Peters, A.; Perz, S. Short-term heart rate variability—Influence of gender and age in healthy subjects. PLoS ONE
**2015**, 10, e0118308. [Google Scholar] [CrossRef] [PubMed][Green Version] - Shaffer, F.; Ginsberg, J.P. An Overview of Heart Rate Variability Metrics and Norms. Front. Public Health
**2017**, 5, 258. [Google Scholar] [CrossRef] [PubMed][Green Version] - Peng, C.K.; Havlin, S.; Stanley, H.; Goldberger, A. Quantification of scaling exponents and crossover phenomena in nonstationary heartbeat time series. Chaos
**1995**, 5, 82–87. [Google Scholar] [CrossRef] - Tiwari, A.; Albuquerque, I.; Parent, M.; Gagnon, J.F.; Lafond, D.; Tremblay, S.; Falk, T.H. Multi-scale heart beat entropy measures for mental workload assessment of ambulant users. Entropy
**2019**, 21, 783. [Google Scholar] [CrossRef][Green Version] - de Geus, E.J.; Gianaros, P.J.; Brindle, R.C.; Jennings, J.R.; Berntson, G.G. Should heart rate variability be “corrected” for heart rate? Biological, quantitative, and interpretive considerations. Psychophysiology
**2019**, 56, 1–26. [Google Scholar] [CrossRef] [PubMed][Green Version] - Goshvarpour, A.; Goshvarpour, A. Classification of Heart Rate Signals during Meditation using Lyapunov Exponents and Entropy. Int. J. Intell. Syst. Appl.
**2012**, 2, 35–41. [Google Scholar] [CrossRef][Green Version] - Petrosian, A. Kolmogorov complexity of finite sequences and recognition of different preictal EEG patterns. In Proceedings of the IEEE Symposium on Computer-Based Medical Systems, Lubbock, TX, USA, 9–10 June 1995; pp. 212–217. [Google Scholar] [CrossRef]
- Gomes, R.; Vanderlei, L.; Garner, D.; Vanderlei, F.; Valenti, V. Higuchi Fractal Analysis of Heart Rate Variability is Sensitive during Recovery from Exercise in Physically Active Men. Med. Express
**2017**, 4. [Google Scholar] [CrossRef] - Jaiswal, D.; Chowdhury, A.; Banerjee, T.; Chatterjee, D. Effect of Mental Workload on Breathing Pattern and Heart Rate for a Working Memory Task: A Pilot Study. Annu. Int. Conf. IEEE Eng. Med. Biol. Soc.
**2019**, 2019, 2202–2206. [Google Scholar] [CrossRef] [PubMed] - Fritz, T.; Begel, A.; Müller, S.; Yigit-Elliott, S.; Züger, M. Using psycho-physiological measures to assess task difficulty in software development. In Proceedings of the 36th International Conference on Software Engineering; ACM: New York, NY, USA, 2014. [Google Scholar] [CrossRef][Green Version]
- Schmidt, S.; Walach, H. Electrodermal Activity (EDA)—State-of-the-art measurement and techniques for parapsychological purposes. J. Parapsychol.
**2000**, 64, 139–163. [Google Scholar] - Parent, M. Diagnosticité des Mesures Physiologiques PériphéRiques de la Charge Mentale. Ph.D. Thesis, Université du Québec à Montréal, Montréal, QC, Canada, 2019; pp. 82–87. [Google Scholar] [CrossRef]
- Braithwaite, J.J.; Derrick, D.; Watson, G.; Jones, R.; Rowe, M.; Watson, D.; Robert, J. A Guide for Analysing Electrodermal Activity (EDA) & Skin Conductance Responses (SCRs) for Psychological Experiments. 2013, pp. 1–42. Available online: https://www.lancaster.ac.uk/media/lancaster-university/content-assets/documents/psychology/ABriefGuideforAnalysingElectrodermalActivityv4.pdf (accessed on 25 August 2020).
- Shimomura, Y.; Yoda, T.; Sugiura, K.; Horiguchi, A.; Iwanaga, K.; Katsuura, T. Use of Frequency Domain Analysis of Skin Conductance for Evaluation of Mental Workload. J. Physiol. Anthropol.
**2008**, 27, 173–177. [Google Scholar] [CrossRef] [PubMed][Green Version] - Posada-Quintero, H.; Florian, J.; Orjuela-Cañón, A.; Corrales, T.; Charleston-Villalobos, S.; Chon, K. Power Spectral Density Analysis of Electrodermal Activity for Sympathetic Function Assessment. Ann. Biomed. Eng.
**2016**, 44, 3124–3135. [Google Scholar] [CrossRef] [PubMed] - Cortes, C.; Vapnik, V. Support-vector networks. Mach. Learn.
**1995**, 20, 273–297. [Google Scholar] [CrossRef] - McKinney, W. Data Structures for Statistical Computing in Python. In Proceedings of the 9th Python in Science Conference, Austin, TX, USA, 28 June–3 July 2010. [Google Scholar]
- Vallat, R. Pingouin: Statistics in Python. J. Open Source Softw.
**2018**, 3, 1026. [Google Scholar] [CrossRef] - Jones, E.; Oliphant, T.; Peterson, P. A Guide to NumPy, 2001–Today. Available online: https://web.mit.edu/dvp/Public/numpybook.pdf (accessed on 25 August 2020).
- Müller-Putz, G.; Scherer, R.; Brunner, C.; Leeb, R.; Pfurtscheller, G. Better than random? A closer look on BCI results. Int. J. Bioelectromagn.
**2008**, 10, 52–55. [Google Scholar] - Waskom, M. seaborn: Statistical data visualization. J. Open Source Softw.
**2021**, 6, 3021. [Google Scholar] [CrossRef] - Brunner, C.; Leeb, R.; Muller-Putz, G. BCI Competition IV Dataset 2a: 4-Class Motor Imagery; Graz University of Technology: Graz, Austria, 2008. [Google Scholar]
- Mühl, C.; Jeunet, C.; Lotte, F. EEG-based workload estimation across affective contexts. Front. Neurosci.
**2014**, 8, 1–15. [Google Scholar] - Muhl, C.; Allison, B.; Nijholt, A.; Chanel, G. A survey of affective brain computer interfaces: Principles, state-of-the-art, and challenges. Brain-Comput. Interfaces
**2014**, 1, 66–84. [Google Scholar] [CrossRef][Green Version] - Koelstra, S.; Yazdani, A.; Soleymani, M.; Mühl, C.; Lee, J.S.; Nijholt, A.; Pun, T.; Ebrahimi, T.; Patras, I. Single trial classification of EEG and peripheral physiological signals for recognition of emotions induced by music videos. Lect. Notes Comput. Sci.
**2010**, 6334, 89–100. [Google Scholar] - Russell, J.A. A circumplex model of affect. J. Personal. Soc. Psychol.
**1980**, 39, 1161–1178. [Google Scholar] [CrossRef] - Pillette, L.; Appriou, A.; Cichocki, A.; N’Kaoua, B.; Lotte, F. Classification of attention types in EEG signals. In Proceedings of the International BCI Meeting, Pacific Grove, CA, USA, 21–25 May 2018. [Google Scholar]
- Pillette, L. Redefining and Adapting Feedback for Mental-Imagery Based Brain-Computer Interface User Training to the Learners’ Traits and States. Ph.D. Thesis, Université de Bordeaux, Bordeaux, France, 2019. [Google Scholar]
- Zomeren, A.H.; Brouwer, W.H. Clinical Neuropsychology of Attention; Oxford University Press: Oxford, MS, USA, 1994. [Google Scholar]
- Schmidt, R.A. Anticipation and timing in human motor performance. Psychol. Bull.
**1968**, 70, 631. [Google Scholar] [CrossRef][Green Version] - Sturm, W.; Willmes, K. On the functional neuroanatomy of intrinsic and phasic alertness. Neuroimage
**2001**, 14, S76–S84. [Google Scholar] [CrossRef] - Van Leeuwen, C.; Lachmann, T. Negative and positive congruence effects in letters and shapes. Atten. Percept. Psychophys.
**2004**, 66, 908–925. [Google Scholar] [CrossRef] [PubMed] - Francis, A.L. Improved segregation of simultaneous talkers differentially affects perceptual and cognitive capacity demands for recognizing speech in competing speech. Atten. Percept. Psychophys.
**2010**, 72, 501–516. [Google Scholar] [CrossRef] [PubMed][Green Version] - Mulholland, T.B. The concept of attention and the electroencephalographic alpha rhythm. Atten. Neurophysiol.
**1969**, 24, 100–127. [Google Scholar] - Ray, W.J.; Cole, H.W. EEG alpha activity reflects attentional demands, and beta activity reflects emotional and cognitive processes. Science
**1985**, 228, 750–752. [Google Scholar] [CrossRef] - Barachant, A.; Congedo, M.; Jutten, C. Multiclass Brain-Computer Interface Classification by Riemannian Geometry to Cite This Version: Multi-class Brain Computer Interface Classification by Riemannian Geometry. IEEE Trans. Biomed. Eng.
**2012**, 59, 920–928. [Google Scholar] [CrossRef][Green Version] - Samek, W.; Müller, K.R. Towards explainable artificial intelligence. In Explainable AI: Interpreting, Explaining and Visualizing Deep Learning; Springer: Berlin/Heidelberg, Germany, 2019; pp. 5–22. [Google Scholar]
- Appriou, A.; Lotte, F. Tools for affective, cognitive and conative states estimation from both EEG and physiological signals. In Proceedings of the Third International Neuroergonomics Conference, Munich, Germany, 11–16 September 2021. [Google Scholar]
- Rivet, B.; Souloumiac, A.; Attina, V.; Gibert, G. xDAWN Algorithm to Enhance Evoked Potentials: Application to Brain-Computer Interface. IEEE Trans. Biomed. Eng.
**2009**, 56, 2035–2043. [Google Scholar] [CrossRef][Green Version] - Roy, R.; Bonnet, S.; Charbonnier, S.; Campagne, A. Enhancing single-trial mental workload estimation through xDAWN spatial filtering. In Proceedings of the International IEEE/EMBS Conference on Neural Engineering, NER 2015, Montpellier, France, 22–24 April 2015; pp. 360–363. [Google Scholar] [CrossRef][Green Version]
- Noh, E.; De Sa, V. Canonical correlation approach to common spatial patterns. In Proceedings of the International IEEE/EMBS Conference on Neural Engineering, NER 2013, San Diego, CA, USA, 6–8 November 2013; pp. 669–672. [Google Scholar] [CrossRef]
- Roy, R.; Charbonnier, S.; Jallon, P. A Comparison of ERP Spatial Filtering Methods for Optimal Mental Workload Estimation. In Proceedings of the 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Milan, Italy, 25–29 August 2015; pp. 7254–7257. [Google Scholar]
- Vernon, J.L.; Amelia, J.S.; Nicholas, R.W.; Stephen, M.G.; Chou, P.H.; Brent, J.L. EEGNet: A compact convolutional neural network for EEG-based brain–computer interfaces. J. Neural Eng.
**2018**, 15, 056013. [Google Scholar] [CrossRef][Green Version]

**Figure 1.**BioPyC data flow: the 4 main modules allow users to follow the standard BCI process for offline EEG and biosignal processing and classification.

**Figure 2.**Comparison of main features of existing toolboxes having modules for EEG signals processing and classification. BioPyC values for each feature are written in black; values of features that are similar to those of BioPyC are written in green; and finally, values of features that differ from those of BioPyC are written in grey. “opt” stands for “optional” in the figure.

**Figure 3.**Screenshot of BioPyC’s widgets, i.e., “select multiples” and buttons at the step of selecting the type of data/signals to work on. In BioPyC, a blue button stands for the action to make, when the disabled orange ones stand for future actions to make: orange buttons turn blue when the previous action is done.

**Figure 5.**Classification accuracy of each algorithm, for each subject, on the “BCI competition IV data set 2a”, in both subject-specific and subject-independent calibrations.

**Figure 6.**Classification accuracy of each algorithm on the “BCI competition IV data set 2a”, in both subject-specific and subject-independent calibrations.

**Figure 7.**Average confusion matrices over all subjects for classification of attention in theta (4–8 Hz) and alpha (8–12 Hz) frequency bands of 5 attentional states, i.e., alertness (tonic), alertness (phasic), sustained, selective, and divided.

**Figure 8.**Classification accuracy of each algorithm on the workload data, in both subject-specific and subject-independent calibrations.

**Figure 9.**Classification accuracy of each algorithm on the valence data, in both subject-specific and subject-independent calibrations.

**Figure 10.**Classification accuracy of each algorithm on the arousal data, in both subject-specific and subject-independent calibrations.

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Appriou, A.; Pillette, L.; Trocellier, D.; Dutartre, D.; Cichocki, A.; Lotte, F. BioPyC, an Open-Source Python Toolbox for Offline Electroencephalographic and Physiological Signals Classification. *Sensors* **2021**, *21*, 5740.
https://doi.org/10.3390/s21175740

**AMA Style**

Appriou A, Pillette L, Trocellier D, Dutartre D, Cichocki A, Lotte F. BioPyC, an Open-Source Python Toolbox for Offline Electroencephalographic and Physiological Signals Classification. *Sensors*. 2021; 21(17):5740.
https://doi.org/10.3390/s21175740

**Chicago/Turabian Style**

Appriou, Aurélien, Léa Pillette, David Trocellier, Dan Dutartre, Andrzej Cichocki, and Fabien Lotte. 2021. "BioPyC, an Open-Source Python Toolbox for Offline Electroencephalographic and Physiological Signals Classification" *Sensors* 21, no. 17: 5740.
https://doi.org/10.3390/s21175740