<figure><img src="image_1.png" /></figure>

HAL
open science

# Pseudo Online Framework

Igor Carrara, Théodore Papadopoulos

► To cite this version:

Igor Carrara, Théodore Papadopoulos. Pseudo Online Framework. BCI Society Meeting 2023, Jun 2023, Bruxelles (BE), Belgium. hal-04128689

HAL Id: hal-04128689

https://hal.science/hal-04128689

Submitted on 19 Jun 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# PSEUDO ONLINE FRAMEWORK

I. Carrara¹,²*, T. Papadopoulos¹,²

¹ Université Côte d'Azur (UCA), Nice, France, ² Centre Inria d'Université Côte d'Azur, Sophia Antipolis, France

**BCI** can be defined as a technology that measures brain activity and translates that signal into instructions for a digital system.
We focus on **non-invasive (EEG)-based BCI (BCI-EEG)**.

A BCI technology can operate in 3 different modalities: **online mode** which requires to constantly analyze the new EEG real-time input data, **offline** which post-processes the signal acquired in a first stage and, lastly **pseudo-online** which uses the same two-stage approach as in the offline mode but post-processes the data incrementally as if they were received by the online mode.

Most studies concerning BCI are tested in offline mode, thus generating unrealistic performance compared to real-life scenario [1].

Can a Pseudo-Online framework allow a more realistic algorithm performance comparison?

## METHODS

**Idea:** extend the current MOABB [2] framework developed for offline analysis with a pseudo-online mode.

**Working on 4 level:**

**Dataset conversion:**

BCI datasets used in MOABB were recorded to perform an offline analysis. The first step is to transform them to **introduce a nothing even** [3].

**Evaluation:**

Change **Within-Session evaluation** of MOABB to remove the use of Cross Validation in order to **keep causal relation on the data**. Use the common split of the dataset into a training dataset (80%) and a test dataset (20%).

Unchange Cross-Session and Cross-Subject evaluation.

**Asynchronous Mode:**

use an overlapping sliding windows approach (dealing with mixed events) to have a performance evaluation much closer to a real BCI application.

**Metrics:**

Such constructed datasets are **strongly unbalanced** with respect to the nothing event.

**Accuracy** is not very meaningful in such cases.

**Use Matthew Correlation Coefficient and Information Transfer Rate** instead [4, 5].

$$nMCC = \frac{1}{2} \left( \frac{TP \times TN - FP \times FN}{\sqrt{(TP + FP)(TP + FN)(TN + FP)(TN + FN)}} + 1 \right)$$

$$ITR = MI(X, Y) \frac{60}{T}$$

<figure><img src="image_3.png" /></figure>

## RESULTS

We considered four **Motor Imagery BCI datasets** consisting of several subjects for each dataset and several sessions. We tested different methods on **different tasks** and **different evaluation procedures**.

<table><thead><tr><th>Dataset</th><th>Subjects</th><th>Channels</th><th>Sampling Rate</th><th>Sessions</th><th>Tasks</th></tr></thead><tbody><tr><td>BNCI2014001</td><td>9</td><td>22</td><td>250 Hz</td><td>2</td><td>4</td></tr><tr><td>BNCI2015001</td><td>12</td><td>13</td><td>512 Hz</td><td>1</td><td>2</td></tr><tr><td>BNCI2014002</td><td>14</td><td>15</td><td>512 Hz</td><td>5</td><td>2</td></tr><tr><td>BNCI2014004</td><td>9</td><td>3</td><td>250 Hz</td><td>1</td><td>2</td></tr></tbody></table>

Example of a 3 tasks problem (RH/LH/nothing or RH/F/nothing) for the datasets in the bold red box.

<figure><img src="image_4.png" /><figcaption>Pseudo-Online Statistical Analysis</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Offline Statistical Analysis</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Pseudo-Online Statistical Analysis</figcaption></figure>

<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /></figure>

UNIVERSITÉ
CÔTE D'AZUR

<figure><img src="image_9.png" /></figure>

NEURO
MOD

Preprocessing
parameters

Online
Paradigm

<figure><img src="image_10.png" /></figure>

<figure><img src="image_11.png" /></figure>

Online
Evaluation

<figure><img src="image_12.png" /></figure>

<figure><img src="image_13.png" /></figure>

Online
score

<figure><img src="image_14.png" /></figure>

Statistical
analysis

<figure><img src="image_15.png" /></figure>

Figure adapted from [2].

## TAKE HOME MESSAGE

The possibility of analyzing the performance of different algorithms first offline, followed by subsequent validation of performance in pseudo-online mode, will be able to speedup advancement of performance of classification algorithms of the BCI community in real time application. The code will be soon integrated in MOABB.

**Acknowledgements:** This work has been partially financed by a EUR DS4H/Neuromod fellowship. We would like to thank S.Chevallier for supporting the idea of integrate this approach in MOABB.

**References:**

[1] Lehtonen, Janne, et al. "Online classification of single EEG trials during finger movements." IEEE Transactions on Biomedical Engineering 55.2 (2008): 713-720.

[2] Jayaram, Vinay, and Alexandre Barachant. "MOABB: trustworthy algorithm benchmarking for BCIs." Journal of neural engineering 15.6 (2018): 066011.

[3] EB Sadeghian et al. "Continuous detection of motor imagery in a four-class asynchronous BCI." 2007 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE, 2007.

[4] Nykopp, Tommi. "Statistical modelling issues for the adaptive brain interface." Helsinki: Helsinki University of Technology (2001).

[5] Delgado, Rosario, and Xavier-Andoni Tibau. "Why Cohen's Kappa should be avoided as performance measure in classification." PloS one

<figure><img src="image_16.png" /></figure>

SCAN ME