NeuroKit2: A Python toolbox for neurophysiological signal processing

Abstract

NeuroKit2 is an open-source, community-driven, and user-centered Python package for neurophysiological signal processing. It provides a comprehensive suite of processing routines for a variety of bodily signals (e.g., ECG, PPG, EDA, EMG, RSP). These processing routines include high-level functions that enable data processing in a few lines of code using validated pipelines, which we illustrate in two examples covering the most typical scenarios, such as an event-related paradigm and an interval-related analysis. The package also includes tools for specific processing steps such as rate extraction and filtering methods, offering a trade-off between high-level convenience and fine-tuned control. Its goal is to improve transparency and reproducibility in neurophysiological research, as well as foster exploration and innovation. Its design philosophy is centred on user-experience and accessibility to both novice and advanced users.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2

References

  1. Bach, D. R. (2014). A head-to-head comparison of scralyze and ledalab, two model-based methods for skin conductance analysis. Biological Psychology, 103, 63–68.

    Article  Google Scholar 

  2. Bartels, R., & Pecanha, T. (2020). HRV: A pythonic package for heart rate variability analysis. Journal of Open Source Software, 5(51), 1867. https://doi.org/10.21105/joss.01867

    Article  Google Scholar 

  3. Benedek, M., & Kaernbach, C. (2010). A continuous measure of phasic electrodermal activity. Journal of Neuroscience Methods, 190(1), 80–91.

    Article  Google Scholar 

  4. Carreiras, C., Alves, A. P., Lourenço, A., Canento, F., Silva, H., Fred, A., & et al (2015). BioSPPy: Biosignal processing in Python. Retrieved from https://github.com/PIA-Group/BioSPPy/

  5. Clifton, D. A., Gibbons, J., Davies, J., & Tarassenko, L. (2012). Machine learning and software engineering in health informatics. 2012 first international workshop on realizing ai synergies in software engineering (raise) (pp 37–41). IEEE.

  6. Gabrieli, G., Azhari, A., & Esposito, G. (2019). PySiology: A python package for physiological feature extraction. In Neural approaches to dynamics of signal exchanges (pp. 395–402). Springer Singapore. https://doi.org/10.1007/978-981-13-8950-4∖_35

  7. Gomes, P., Margaritoff, P., & Silva, H (2019). pyHRV: Development and evaluation of an open-source python toolbox for heart rate variability (hrv). Proc. Int’l conf On electrical, electronic and computing engineering (icetran), 822–828.

  8. Gramfort, A., Luessi, M., Larson, E., Engemann, D. A., Strohmeier, D., Brodbeck, C., & et al. (2013). MEG and eeg data analysis with mne-python. Frontiers in Neuroscience, 7, 267.

    Article  Google Scholar 

  9. Greco, A., Valenza, G., Lanata, A., Scilingo, E. P., & Citi, L. (2015). CvxEDA: A convex optimization approach to electrodermal activity processing. IEEE Transactions on Biomedical Engineering, 63(4), 797–804.

    PubMed  Google Scholar 

  10. Harris, C. R., Millman, K. J., Van der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., & et al. (2020). Array programming with numpy. Nature, 585(7825), 357–362.

    Article  Google Scholar 

  11. Hunter, J. D. (2007). Matplotlib: a 2D graphics environment. Computing in Science & Engineering, 9(3), 90–95.

    Article  Google Scholar 

  12. Jupyter, B., Forde, F., Granger, H. W, Akici, F., Lippa, D., Niederhut, D., & Pacer, M. (2018). Binder 2.0 - Reproducible, interactive, sharable environments for science at scale. In Proceedings of the 17th Python in Science Conference. https://doi.org/%2010.25080/Majora-4af1f417-011%20 (pp. 113–120).

  13. Khodadad, D., Nordebo, S., Mueller, B., Waldmann, A., Yerworth, R., Becher, T., & et al. (2018). Optimized breath detection algorithm in electrical impedance tomography. Physiological Measurement, 39(9), 094001.

    Article  Google Scholar 

  14. Kiverstein, J., & Miller, M. (2015). The embodied brain: Towards a radical embodied cognitive neuroscience. Frontiers in Human Neuroscience, 9, 237.

    Article  Google Scholar 

  15. Kluyver, T., Ragan-Kelley, B., Pérez, F., Granger, B. E., Bussonnier, M., Frederic, J., & et al. (2016). Jupyter notebooks-a publishing format for reproducible computational workflows. ELPUB, 87–90.

  16. Legrand, N., & Allen, M. (2020). Systole: A python toolbox for preprocessing, analyzing, and synchronizing cardiac data. Retrieved from https://github.com/embodied-computation-group/systole

  17. Maizey, L., & Tzavella, L. (2019). Barriers and solutions for early career researchers in tackling the reproducibility crisis in cognitive neuroscience. Cortex, 113, 357–359.

    Article  Google Scholar 

  18. Makowski, D. (2020). Neurokit: A python toolbox for statistics and neurophysiological signal processing (eeg, eda, ecg, emg...). Retrieved from https://github.com/neuropsychology/NeuroKit.py

  19. Marchewka, A., Żurawski, J.K., & Grabowska, A. (2014). The nencki affective picture system (naps): Introduction to a novel, standardized, wide-range, high-quality, realistic picture database. Behavior Research Methods, 46(2), 596–610.

    Article  Google Scholar 

  20. McKinney, W., et al. (2010). Data structures for statistical computing in python. Proceedings of the 9th python in science conference (vol. 445, pp. 51–56). Austin.

  21. Miłkowski, M., Hensel, W. M., & Hohol, M. (2018). Replicability or reproducibility? on the replication crisis in computational neuroscience and sharing only relevant detail. Journal of Computational Neuroscience, 45(3), 163–172.

    Article  Google Scholar 

  22. Nosek, B. A., Cohoon, J., Kidwell, M., & Spies, J. R. (2015). Estimating the reproducibility of psychological science. Science, 349(6251), aac4716.

    Article  Google Scholar 

  23. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., & Duchesnay, E. (2011). Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12, 2825–2830.

    Google Scholar 

  24. Quintana, D., Alvares, G. A., & Heathers, J. (2016). Guidelines for reporting articles on psychiatry and heart rate variability (graph): Recommendations to advance research communication. Translational Psychiatry, 6(5), e803–e803.

    Article  Google Scholar 

  25. Roy, Y., Banville, H., Albuquerque, I., Gramfort, A., Falk, T. H., & Faubert, J. (2019). Deep learning-based electroencephalography analysis: A systematic review. Journal of Neural Engineering, 16(5), 051001.

    Article  Google Scholar 

  26. Schölzel, C. (2019). Nonlinear measures for dynamical systems. Zenodo. https://doi.org/10.5281/zenodo.3814723

  27. Tarvainen, M. P., Niskanen, J. -P., Lipponen, J. A., Ranta-Aho, P. O., & Karjalainen, P. (2014). A Kubios hrv–heart rate variability analysis software. Computer Methods and Programs in Biomedicine, 113(1), 210–220.

    Article  Google Scholar 

  28. Topalidou, M., Leblois, A., Boraud, T., & Rougier, N. (2015). P A long journey into reproducible computational neuroscience. Frontiers in Computational Neuroscience, 9, 30.

    Article  Google Scholar 

  29. van Gent, P., Farah, H., van Nes, N., & van Arem, B. (2019). HeartPy: A novel heart rate algorithm for the analysis of noisy signals. Transportation Research Part F: Traffic Psychology and Behaviour, 66, 368–378. https://doi.org/10.1016/j.trf.2019.09.015

    Article  Google Scholar 

  30. Van Rossum, G., & Drake, F. L. (2009) Python 3 reference manual. CreateSpace: Scotts Valley.

    Google Scholar 

  31. Virtanen, P., Gommers, R., Oliphant, T. E., Haberland, M., Reddy, T., Cournapeau, D., & Contributors, S. (2020). SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17, 261–272. https://doi.org/10.1038/s41592-019-0686-2

  32. Yuehong, Y., Zeng, Y., Chen, X., & Fan, Y. (2016). The internet of things in healthcare: An overview. Journal of Industrial Information Integration, 1, 3–13.

    Article  Google Scholar 

Download references

Acknowledgments

We would like to thank Prof. C. F. Xavier for inspiration, all the current and future contributors (https://neurokit2.readthedocs.io/en/latest/authors.html), and the users for their support. Additionally, François Lespinasse would like to thank the Courtois Foundation for its support through the Courtois-NeuroMod project (https://cneuromod.ca)

Author information

Affiliations

Authors

Corresponding author

Correspondence to Dominique Makowski.

Ethics declarations

Conflict of interests

The authors declare that the research was conducted in the absence of commercial or financial relationships that could constitute a conflict of interest.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Makowski, D., Pham, T., Lau, Z.J. et al. NeuroKit2: A Python toolbox for neurophysiological signal processing. Behav Res (2021). https://doi.org/10.3758/s13428-020-01516-y

Download citation

Keywords

  • Neurophysiology
  • Biosignals
  • Python
  • ECG
  • EDA
  • EMG