RT Journal Article SR Electronic T1 A framework for closed-loop neurofeedback for real-time EEG decoding JF bioRxiv FD Cold Spring Harbor Laboratory SP 834713 DO 10.1101/834713 A1 Greta Tuckute A1 Sofie Therese Hansen A1 Troels Wesenberg Kjaer A1 Lars Kai Hansen YR 2019 UL http://biorxiv.org/content/early/2019/11/11/834713.abstract AB Neurofeedback based on real-time brain imaging allows for targeted training of brain activity with demonstrated clinical applications. A rapid technical development of electroen-cephalography (EEG)-based systems and an increasing interest in cognitive training has lead to a call for accessible and adaptable software frameworks. Here, we present and outline the core components of a novel open-source neurofeedback framework based on scalp EEG signals for real-time neuroimaging, state classification and closed-loop feedback.The software framework includes real-time signal preprocessing, adaptive artifact rejection, and cognitive state classification from scalp EEG. The framework is implemented using exclusively Python source code to allow for diverse functionality, high modularity, and easy extendibility of software development depending on the experimenter’s needs.As a proof of concept, we demonstrate the functionality of our new software framework by implementing an attention training paradigm using a consumer-grade, dry-electrode EEG system. Twenty-two participants were trained on a single neurofeedback session with behavioral pre- and post-training sessions within three consecutive days. We demonstrate a mean decoding error rate of 34.3% (chance=50%) of subjective attentional states. Hence, cognitive states were decoded in real-time by continuously updating classification models on recently recorded EEG data without the need for any EEG recordings prior to the neurofeedback session.The proposed software framework allows a wide range of users to actively engage in the development of novel neurofeedback tools to accelerate improvements in neurofeedback as a translational and therapeutic tool.