A closed-loop, music-based brain-computer interface for emotion mediation

Stefan K. Ehrlich, Kat Agres, Cuntai Guan, Gordon ChengPLoS 2019

Abstract

Emotions play a critical role in rational and intelligent behavior; a better fundamental knowledge of them is indispensable for understanding higher order brain function. We propose a non-invasive brain-computer interface (BCI) system to feedback a person's affective state such that a closed-loop interaction between the participant's brain responses and the musical stimuli is established. We realized this concept technically in a functional prototype of an algorithm that generates continuous and controllable patterns of synthesized affective music in real-time, which is embedded within a BCI architecture. We evaluated our concept in two separate studies. In the first study, we tested the efficacy of our music algorithm by measuring subjective affective responses from 11 participants. In a second pilot study, the algorithm was embedded in a real-time BCI architecture to investigate affective closed-loop interactions in 5 participants. Preliminary results suggested that participants were able to intentionally modulate the musical feedback by self-inducing emotions (e.g., by recalling memories), suggesting that the system was able not only to capture the listener's current affective state in real-time, but also potentially provide a tool for listeners to mediate their own emotions by interacting with music. The proposed concept offers a tool to study emotions in the loop, promising to cast a complementary light on emotion-related brain research, particularly in terms of clarifying the interactive, spatio-temporal dynamics underlying affective processing in the brain.

Introduction

Traditional emotion research in neuroscience often relies on "open-loop" paradigms where subjects are exposed to static stimuli, such as images or pre-recorded videos. While valuable, these methods fail to capture the dynamic, interactive nature of emotional regulation in real-world scenarios. Music, a powerful emotional stimulus, offers a unique medium for studying these dynamics. However, using existing musical compositions in experiments is challenging because they cannot be precisely manipulated in real-time to reflect a subject's changing neural state. This paper presents a novel closed-loop Brain-Computer Interface (BCI) that translates real-time EEG data into synthesized music, creating an "affective loop" for emotion mediation and study.

Methods

The Affective Music Engine

The music engine uses a rule-based probabilistic algorithm to generate MIDI music in real-time. It maps the two primary dimensions of emotion—valence (pleasure) and arousal (intensity)—to five specific musical parameters:

  • Tempo: Faster for higher arousal.
  • Rhythm: More complex and rough for higher arousal.
  • Loudness: Louder for higher arousal.
  • Pitch Register: Higher for higher valence.
  • Harmonic Mode: Transitions through seven modes (from the bright Lydian to the dark Locrian) to represent valence.

BCI Architecture and Closed-Loop Design

The BCI utilizes a 14-channel Emotiv EPOC EEG to monitor neural activity. Spectral band power (theta, alpha, beta, and gamma) is extracted and processed. A Linear Discriminant Analysis (LDA) classifier, trained during a calibration phase, distinguishes between "happy" and "sad" states. The classifier's output is smoothed into a continuous score (0 to 1), which serves as the real-time input for the music engine, allowing the music to evolve dynamically with the user's emotional state.

Experimental Evaluation and Datasets

The system was evaluated through two distinct studies. To support open science, the authors have made their dataset of affective music and EEG responses available on GitHub.

Study 1: Music Engine Validation

Eleven participants listened to 13 synthesized musical excerpts and provided subjective ratings. The results confirmed that the music engine effectively communicated the intended emotional states, proving particularly successful at communicating arousal ($r = 0.74$) compared to valence ($r = 0.52$).

Study 2: BCI Pilot Study

A pilot study with five participants investigated the real-time closed-loop interaction over two sessions. Participants were tasked with "steering" the music toward target emotional states using emotional imagery (e.g., recalling memories). Three out of five participants successfully modulated the music in at least one task. Notably, performance generally improved from the first session to the second, suggesting a learning effect.

Results and Discussion

Analysis of the neural data revealed several significant findings regarding the "affective loop":

  • Causal Dynamics: Granger causality analysis indicated a significant bi-directional interaction. Specifically, a causal flow was observed from the brain to the music, driven primarily by gamma oscillations in the right fronto-central hemisphere (FC6).
  • Neural Correlates: While frontal beta power decreased during successful modulation, this was likely a side effect of concentration. Gamma band activity appeared to be the primary driver of the emotional feedback loop.
  • Individual Differences: The participant with musical training showed the highest performance, suggesting that musical literacy may enhance a user's ability to navigate the feedback loop effectively.

Conclusion and Future Directions

This research demonstrates the feasibility of a closed-loop, music-based BCI for real-time emotion mediation. While limited by a small sample size and consumer-grade hardware, the results provide a foundation for future work using high-density EEG to better localize emotional processing circuits. Beyond basic research, this technology holds significant clinical potential for neuro-rehabilitation, offering a novel tool for treating conditions like depression and anxiety by helping patients practice shifting their neural states through interactive musical feedback.

Reference: Ehrlich SK, Agres KR, Guan C, Cheng G (2019) A closed-loop, music-based brain-computer interface for emotion mediation. PLoS ONE 14(3): e0213516.

Summary updated

BibTeX
@inproceedings{ehrlich2019closed,
  author = {Stefan K. Ehrlich and Kat Agres and Cuntai Guan and Gordon Cheng},
  title = {{A closed-loop, music-based brain-computer interface for emotion mediation}},
  booktitle = {PLoS},
  year = {2019},
  doi = {10.1371/journal.pone.0213516},
}
Figure