Gemborn Nilsson Martin, Tufvesson Pex, Heskebeck Frida, Johansson Mikael
Department of Automatic Control, Lund University, Lund, Sweden.
Ericsson Research, Lund, Sweden.
Front Hum Neurosci. 2023 Jun 27;17:1129362. doi: 10.3389/fnhum.2023.1129362. eCollection 2023.
Brain-computer interfaces (BCIs) translate brain activity into digital commands for interaction with the physical world. The technology has great potential in several applied areas, ranging from medical applications to entertainment industry, and creates new conditions for basic research in cognitive neuroscience. The BCIs of today, however, offer only crude online classification of the user's current state of mind, and more sophisticated decoding of mental states depends on time-consuming offline data analysis. The present paper addresses this limitation directly by leveraging a set of improvements to the analytical pipeline to pave the way for the next generation of online BCIs. Specifically, we introduce an open-source research framework that features a modular and customizable hardware-independent design. This framework facilitates human-in-the-loop (HIL) model training and retraining, real-time stimulus control, and enables transfer learning and cloud computing for the online classification of electroencephalography (EEG) data. Stimuli for the subject and diagnostics for the researcher are shown on separate displays using web browser technologies. Messages are sent using the Lab Streaming Layer standard and websockets. Real-time signal processing and classification, as well as training of machine learning models, is facilitated by the open-source Python package Timeflux. The framework runs on Linux, MacOS, and Windows. While online analysis is the main target of the BCI-HIL framework, offline analysis of the EEG data can be performed with Python, MATLAB, and Julia through packages like MNE, EEGLAB, or FieldTrip. The paper describes and discusses desirable properties of a human-in-the-loop BCI research platform. The BCI-HIL framework is released under MIT license with examples at: bci.lu.se/bci-hil (or at: github.com/bci-hil/bci-hil).
脑机接口(BCIs)将大脑活动转化为数字指令,以便与物理世界进行交互。该技术在从医疗应用到娱乐产业等多个应用领域具有巨大潜力,并为认知神经科学的基础研究创造了新条件。然而,当今的脑机接口仅能对用户当前的心理状态进行粗略的在线分类,而对心理状态进行更复杂的解码则依赖于耗时的离线数据分析。本文通过对分析流程进行一系列改进,直接解决了这一局限性,为下一代在线脑机接口铺平了道路。具体而言,我们引入了一个开源研究框架,其特点是模块化且与硬件无关的可定制设计。该框架便于进行人在回路(HIL)模型训练和再训练、实时刺激控制,并能实现用于脑电图(EEG)数据在线分类的迁移学习和云计算。使用网络浏览器技术在单独的显示器上向受试者显示刺激,并向研究人员显示诊断信息。消息通过实验室流层标准和网络套接字发送。开源的Python包Timeflux便于进行实时信号处理和分类以及机器学习模型的训练。该框架可在Linux、MacOS和Windows上运行。虽然在线分析是BCI-HIL框架的主要目标,但EEG数据的离线分析可以通过MNE、EEGLAB或FieldTrip等包,使用Python、MATLAB和Julia来执行。本文描述并讨论了人在回路脑机接口研究平台的理想特性。BCI-HIL框架根据麻省理工学院许可发布,示例位于:bci.lu.se/bci-hil(或:github.com/bci-hil/bci-hil)。