Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights.
5 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 9 matches
- [1] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/profile_cost.py, lines 1 to 45 · score 1.00 · ATCNet, CTNet, EEGConformer, EEGITNet, EEGMiner, EEGTCNet · block
oscr:b:CBY04H9KGQ1YV-T· Report a mismatch - [2] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/statistics.py, lines 1 to 35 · score 0.99 · Hodges Lehmann median, sided Wilcoxon signed, Benjamini Hochberg, matched pairs rank, cross validation accuracies, confidence interval · block
oscr:b:G78ZAHHHECMWT-6· Report a mismatch - [3] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/profile_cost.py, lines 1 to 45 · score 0.97 · Multiply accumulate operations, matrix multiplications, FLOP counter, registers convolutions, PyTorch, classification experiments · block
oscr:b:CBY04H9KGQ1YV-T· Report a mismatch - [4] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/benchmark.py, lines 113 to 170 · score 0.94 · cross entropy loss, AdamW, MNE, cross validation, patience, batch · block
oscr:b:R8FKPSPMGCPQ1-4· Report a mismatch - [5] § 2. Materials and Methods › 2.1. Data Acquisition and Preprocessing ↔ preprocessing/preprocessing.m, lines 24 to 53 · score 0.74 · mental task onset, 1–50 Hz, 0–10 s, preprocessing, raw, MA · block
oscr:b:8Z7F3MCS153G4-O· Report a mismatch - [6] § 3. Results › 3.3. Pairwise Statistical Comparison and Identification of Top-Performing Models ↔ src/statistics.py, lines 1 to 35 · score 0.73 · rank biserial correlation, matched pairs rank, confidence interval, bootstrap, median, Friedman · block
oscr:b:G78ZAHHHECMWT-6· Report a mismatch - [7] § 2. Materials and Methods › 2.1. Data Acquisition and Preprocessing ↔ preprocessing/preprocessing.m, lines 24 to 53 · score 0.66 · L1, L2, L3, L4, R1, R2 · block
oscr:b:8Z7F3MCS153G4-O· Report a mismatch - [8] § 2. Materials and Methods › 2.6. Cross-Dataset Evaluation of the Architecture Ranking ↔ src/benchmark.py, lines 1 to 41 · score 0.61 · fold cross validation, recording days, deep learning, benchmarked, stratified, ear EEG · block
oscr:b:HD6KT733YNKNC-G· Report a mismatch - [9] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/benchmark.py, lines 113 to 170 · score 0.53 · random seeds, cross validation, split, train, fold, accuracies · block
oscr:b:R8FKPSPMGCPQ1-4· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 209 lines · 7.3 KB · MIT · 3 matches
- # -*- coding: utf-8 -*-
- """
- Benchmark of 23 deep-learning architectures on ear-EEG.
- Subject-specific stratified k-fold cross-validation, applied independently
- within each participant, recording day and task pair. One row is written per
- (seed, condition, subject, fold); every number reported in the manuscript is
- derived from that file.
- python src/benchmark.py --config configs/main.json
- """
- import os
- import re
- import json
- import glob
- import argparse
- import warnings
- import numpy as np
- import pandas as pd
- from scipy import io
- import torch
- from torch.utils.data import Subset
- from sklearn.model_selection import StratifiedKFold, train_test_split
- import mne
- from braindecode.preprocessing import exponential_moving_standardize
- from braindecode.datasets import create_from_X_y
- from braindecode.models import * # noqa: F401,F403
- from braindecode.util import set_random_seeds
- from braindecode import EEGClassifier
- from skorch.callbacks import EarlyStopping
- from skorch.helper import predefined_split
- warnings.filterwarnings("ignore")
- torch.backends.cudnn.deterministic = True
- torch.backends.cudnn.benchmark = False
- DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
- # ---------------------------------------------------------------------
- # Architectures
- # ---------------------------------------------------------------------
- def build_model(name, n_chans, n_outputs, n_times, sfreq, overrides=None):
- """Instantiate a Braindecode model at its default configuration.
- `overrides` applies architecture-specific keyword arguments. The only one
- used in the manuscript is FBLightConvNet with n_bands = 18.
- """
- cls = globals()[name]
- kwargs = dict(n_chans=n_chans, n_outputs=n_outputs,
- n_times=n_times, sfreq=sfreq)
- if overrides:
- kwargs.update(overrides.get(name, {}))
- return cls(**kwargs)
- class EarlyStoppingWithMinEpochs(EarlyStopping):
- """EarlyStopping that stays inactive until `min_epochs` have elapsed."""
- def __init__(self, min_epochs, **kwargs):
- super().__init__(**kwargs)
- self.min_epochs = min_epochs
- def on_epoch_end(self, net, **kwargs):
- if len(net.history) < self.min_epochs:
- return
- super().on_epoch_end(net, **kwargs)
- # ---------------------------------------------------------------------
- # Data
- # ---------------------------------------------------------------------
- def subject_ids(folder):
- ids = []
- for path in glob.glob(os.path.join(folder, "Sub_*.mat")):
- name = os.path.basename(path)
- if name.endswith("_y_label.mat"):
- continue
- m = re.fullmatch(r"Sub_(\d+)\.mat", name)
- if m and os.path.exists(
- os.path.join(folder, f"Sub_{m.group(1)}_y_label.mat")):
- ids.append(int(m.group(1)))
- return sorted(ids)
- def load_subject(folder, subject, n_times, standardize):
- """Return (trials, channels, samples) and the label vector."""
- data = io.loadmat(os.path.join(folder, f"Sub_{subject}.mat"))
- label = io.loadmat(os.path.join(folder, f"Sub_{subject}_y_label.mat"))
- x = data.get("DATA", data.get(f"Sub_{subject}"))
- y = np.asarray(label.get("LABEL",
- label.get(f"Sub_{subject}_y_label"))).reshape(-1)
- x = np.asarray(x, dtype=np.float64)[:, :, :n_times]
- if standardize:
- for i in range(x.shape[0]):
- x[i] = exponential_moving_standardize(x[i], factor_new=0.001,
- eps=1e-4)
- return x, y
- # ---------------------------------------------------------------------
- # Evaluation
- # ---------------------------------------------------------------------
- def cross_validate(x, y, model_name, cfg, seed):
- """Run one subject through the stratified cross-validation."""
- n_times = x.shape[2]
- skf = StratifiedKFold(n_splits=cfg["n_folds"], shuffle=True,
- random_state=seed["fold"])
- with mne.use_log_level("ERROR"):
- dataset = create_from_X_y(
- [x[i] for i in range(len(y))], y,
- sfreq=cfg["sfreq"], ch_names=cfg["ch_names"],
- drop_last_window=False,
- window_size_samples=None, window_stride_samples=None)
- accuracies = []
- for fold, (train_trials, test_trials) in enumerate(
- skf.split(np.arange(len(y)), y), start=1):
- train_idx, val_idx = train_test_split(
- train_trials, test_size=cfg["val_ratio"],
- stratify=y[train_trials], random_state=seed["split"] + fold)
- set_random_seeds(seed=seed["init"] + fold,
- cuda=torch.cuda.is_available())
- model = build_model(model_name, x.shape[1], len(np.unique(y)),
- n_times, cfg["sfreq"], cfg.get("model_args"))
- if DEVICE == "cuda":
- model = model.cuda()
- clf = EEGClassifier(
- model,
- criterion=torch.nn.CrossEntropyLoss,
- optimizer=torch.optim.AdamW,
- optimizer__lr=cfg["learning_rate"],
- train_split=predefined_split(Subset(dataset, val_idx)),
- batch_size=cfg["batch_size"],
- max_epochs=cfg["max_epochs"],
- device=DEVICE,
- classes=sorted(np.unique(y).tolist()),
- callbacks=[("early_stopping", EarlyStoppingWithMinEpochs(
- min_epochs=cfg["min_epochs"],
- monitor="valid_loss",
- patience=cfg["patience"],
- lower_is_better=True,
- load_best=True))],
- verbose=0,
- )
- clf.fit(Subset(dataset, train_idx), y=None, epochs=cfg["max_epochs"])
- proba = clf.predict_proba(Subset(dataset, test_trials))
- pred = np.array(clf.classes_)[np.argmax(proba, axis=1)]
- accuracies.append(float((pred == y[test_trials]).mean()))
- del clf, model
- if DEVICE == "cuda":
- torch.cuda.empty_cache()
- return accuracies
- def main():
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument("--config", required=True)
- args = parser.parse_args()
- with open(args.config, encoding="utf-8") as f:
- cfg = json.load(f)
- n_times = int(cfg["epoch_seconds"] * cfg["sfreq"])
- rows = []
- for seed in cfg["seeds"]:
- for condition in cfg["conditions"]:
- folder = os.path.join(cfg["data_dir"], condition)
- for subject in subject_ids(folder):
- x, y = load_subject(folder, subject, n_times,
- cfg["standardize"])
- for model_name in cfg["models"]:
- accuracies = cross_validate(x, y, model_name, cfg, seed)
- for fold, acc in enumerate(accuracies, start=1):
- rows.append({"seed": seed["name"],
- "condition": condition,
- "model": model_name,
- "subject": subject,
- "fold": fold,
- "accuracy": acc})
- print(f"{seed['name']} | {condition} | {model_name} | "
- f"S{subject:02d} | {np.mean(accuracies):.4f}",
- flush=True)
- os.makedirs(os.path.dirname(cfg["output"]) or ".", exist_ok=True)
- pd.DataFrame(rows).to_csv(cfg["output"], index=False)
- print(f"\nwrote {len(rows)} rows to {cfg['output']}")
- if __name__ == "__main__":
- main()
benchmark.py at commit b831cfa, under MIT · at the source
Overview
- Department of Computer and Information Science, Korea University, Sejong 30019, Republic of Korea
- Medical Metrology Group, Division of Biomedical Metrology, Korea Research Institute of Standards and Science (KRISS), Daejeon 34113, Republic of Korea
- Department of Electronics and Information Engineering, Korea University, Sejong 30019, Republic of Korea
- Digital Healthcare Center, Sejong Institute for Business and Technology, Korea University, Sejong 30019, Republic of Korea
- Interdisciplinary Graduate Program for Artificial Intelligence Smart Convergence Technology, Korea University, Sejong 30019, Republic of Korea
- Department of Computer Science and Software Engineering, Korea University, Sejong 30019, Republic of Korea
Abstract
Electroencephalography (EEG) measured inside or around ears, called ear-EEG, provides a practical measurement modality for daily brain–computer interface (BCI) applications. However, reliable decoding of mental imagery remains challenging due to the limited number of channels, low signal-to-noise ratio (SNR), and substantial inter- and intra-subject variability inherent to ear-EEG. Addressing these constraints requires advanced decoding strategies specifically optimized for this signal domain. In this study, we retrospectively analyze the ear-EEG dataset of a previous study in which a real-time endogenous BCI was evaluated using conventional machine learning. Specifically, we present an offline benchmark of 23 deep neural network architectures originally developed for scalp-EEG, which were adapted to ear-EEG and evaluated under an identical validation framework. To the best of our knowledge, this is the first systematic comparison of this breadth for ear-EEG-based mental-task classification. Beyond conventional performance comparison, we identify the optimal architecture by jointly considering statistical significance and a performance–cost trade-off, incorporating classification accuracy, parameter count, and measured computational cost. Our results demonstrate that FBLightConvNet achieves the highest classification accuracy among all evaluated models and outperforms common spatial pattern-linear discriminant analysis (CSP-LDA), a widely adopted and robust conventional baseline, on all three recording days, with the difference reaching statistical significance on Days 2 and 3. Notably, many state-of-the-art scalp-EEG models fail to generalize effectively to ear-EEG, highlighting the importance of architecture selection in this domain. These findings identify the best-performing architecture in this setting and indicate which architectural characteristics support effective ear-EEG decoding. Ultimately, this study offers practical design insights and a reproducible benchmarking framework for developing lightweight and high-performance deep learning models, which we hope will support future efforts toward real-world ear-EEG-based BCI systems.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 9 matches between paragraphs and lines of code.
toiro2000/Ear-EEG-DL-Benchmark
b831cfa9c7849d50703b2e6f214c4d9ad0b62598, 31 July 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
7 files
- examples/
make_synthetic_data.py , Python, 55 lines - preprocessing/
preprocessing.m , MATLAB, 109 lines, 2 matches - src/
benchmark.py , Python, 209 lines, 3 matches - src/
profile_cost.py , Python, 187 lines, 2 matches - src/
statistics.py , Python, 176 lines, 2 matches - LICENSE, License, 21 lines
- README.md, Text, 101 lines
Zenodo 21716287
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
7 files
- examples/
make_synthetic_data.py , Python, 55 lines - preprocessing/
preprocessing.m , MATLAB, 109 lines - src/
benchmark.py , Python, 209 lines - src/
profile_cost.py , Python, 187 lines - src/
statistics.py , Python, 176 lines - LICENSE, License, 21 lines
- README.md, Text, 101 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 10 scripts, each with its path and the digest of its content;
- 9 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data Availability Statement
The datasets used in this study are available from the corresponding author upon reasonable request, provided they are utilized for appropriate research purposes. The analysis code and the configuration files required to reproduce the comparison are publicly available at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 5 keywords, 7 MeSH terms, 2 funders, 47 references.
Cite
This paper
Kim, J.-S., Choi, S.-I., Hwang, H.-J., & Han, C.-H. (2026). Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights. Biosensors, 16(8), 437. https://
BibTeX
@article{kim2026deep,
author = {Kim, Ji-Seung and Choi, Soo-In and Hwang, Han-Jeong and Han, Chang-Hee},
title = {{Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights}},
journal = {Biosensors},
year = {2026},
month = aug,
volume = {16},
number = {8},
pages = {437},
publisher = {Multidisciplinary Digital Publishing Institute (MDPI)},
issn = {2079-6374},
doi = {10.3390/
url = {https://
pmid = {42645055},
pmcid = {PMC13510306}
}
RIS
TY - JOUR
AU - Kim, Ji-Seung
AU - Choi, Soo-In
AU - Hwang, Han-Jeong
AU - Han, Chang-Hee
TI - Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights
T2 - Biosensors
J2 - Biosensors (Basel)
PY - 2026
DA - 2026/
VL - 16
IS - 8
SP - 437
SN - 2079-6374
PB - Multidisciplinary Digital Publishing Institute (MDPI)
DO - 10.3390/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3390/
"type": "article-journal",
"title": "Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights",
"container-title": "Biosensors",
"author": [
{
"family": "Kim",
"given": "Ji-Seung"
},
{
"family": "Choi",
"given": "Soo-In"
},
{
"family": "Hwang",
"given": "Han-Jeong"
},
{
"family": "Han",
"given": "Chang-Hee"
}
],
"container-title-short":
"volume": "16",
"issue": "8",
"page": "437",
"DOI": "10.3390/
"PMID": "42645055",
"PMCID": "PMC13510306",
"ISSN": "2079-6374",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
8,
12
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s41598-026-68186-2 [code]
- NeuroStream: spectral-spatio-temporal
deep learning for visual stimulus classification from EEG. Journal: Scientific reportsIn common: Braindecode, PyTorch, scikit-learn, 3 other tools, EEG, 10 references - [2] doi:10.1038/s41598-025-16219-7 [code]
- Temporal convolutional transformer for EEG based motor imagery decoding.Journal: Scientific reportsIn common: Braindecode, MNE-Python, PyTorch, 4 other tools, EEG, 6 references
- [3] doi:10.1038/s41598-025-32207-3 [code]
- Multi-scale EEG feature decoding with Swin Transformers for subject independent motor imagery BCIs.Journal: Scientific reportsIn common: MNE-Python, PyTorch, scikit-learn, 3 other tools, EEG, 7 references
- [4] doi:10.1371/journal.pone.0347671 [code]
- RMETNet: A cross-subject motor imagery EEG signal classification model based on TSLANet and riemannian geometry features.Journal: PloS oneIn common: Braindecode, MNE-Python, PyTorch, 4 other tools, EEG, 5 references
- [5] doi:10.1016/j.patter.2025.101182 [code]
- GREEN: A lightweight architecture using learnable wavelets and Riemannian geometry for biomarker exploration with EEG signals.Journal: Patterns (New York, N.Y.)In common: MNE-Python, PyTorch, scikit-learn, 2 other tools, EEG, 6 references
- [6] doi:10.1038/s42003-025-08464-3 [code]
- How EEG preprocessing shapes decoding performance.Journal: Communications biologyIn common: Braindecode, MNE-Python, statsmodels, 5 other tools, EEG, 2 references
- [7] doi:10.3390/s26051730 [code]
- SFE-GAT: Structure-Feature Evolution Graph Attention Network for Motor Imagery Decoding.Journal: Sensors (Basel, Switzerland)In common: PyTorch, SciPy, NumPy, EEG, 6 references
- [8] doi:10.1371/journal.pone.0309706 [code]
- FDCN-C: A deep learning model based on frequency enhancement, deformable convolution network, and crop module for electroencephalography motor imagery classification.Journal: PloS oneIn common: Braindecode, PyTorch, NumPy, EEG, 5 references
- [9] doi:10.1038/s41597-024-03501-y [code]
- An EEG &
amp; eye-tracking dataset of ALS patients & amp; healthy people during eye-tracking-based spelling system usage. Journal: Scientific dataIn common: Braindecode, MNE-Python, PyTorch, 4 other tools, EEG, 2 references - [10] doi:10.3390/brainsci15050460 [code]
- MCL-SWT: Mirror Contrastive Learning with Sliding Window Transformer for Subject-Independent EEG Recognition.Journal: Brain sciencesIn common: Braindecode, MNE-Python, PyTorch, 3 other tools, EEG, 3 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 10 scripts, and 9 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:200303f0c3aea03a…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.3390/bios16080437)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.3390/bios16080437.svg
:target: https://openscicode.org/badge/doi/10.3390/bios16080437
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.3390/bios16080437"><img src="https://openscicode.org/badge/doi/10.3390/bios16080437.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
