OSCR

Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights.

Code ↔ Paper

9 matches between paragraphs of the paper and lines of its authors' code, computed by the harvester (lexical-v1). Click a colored paragraph or line to see its counterpart.

The 9 matches
  1. [1] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/profile_cost.py, lines 1–45 · score 1.00 · ATCNet, CTNet, EEGConformer, EEGITNet, EEGMiner, EEGTCNet
  2. [2] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/statistics.py, lines 1–35 · score 0.99 · Hodges Lehmann median, sided Wilcoxon signed, Benjamini Hochberg, matched pairs rank, cross validation accuracies, confidence interval
  3. [3] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/profile_cost.py, lines 1–45 · score 0.97 · Multiply accumulate operations, matrix multiplications, FLOP counter, registers convolutions, PyTorch, classification experiments
  4. [4] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/benchmark.py, lines 113–170 · score 0.94 · cross entropy loss, AdamW, MNE, cross validation, patience, batch
  5. [5] § 2. Materials and Methods › 2.1. Data Acquisition and Preprocessing ↔ preprocessing/preprocessing.m, lines 24–53 · score 0.74 · mental task onset, 1–50 Hz, 0–10 s, preprocessing, raw, MA
  6. [6] § 3. Results › 3.3. Pairwise Statistical Comparison and Identification of Top-Performing Models ↔ src/statistics.py, lines 1–35 · score 0.73 · rank biserial correlation, matched pairs rank, confidence interval, bootstrap, median, Friedman
  7. [7] § 2. Materials and Methods › 2.1. Data Acquisition and Preprocessing ↔ preprocessing/preprocessing.m, lines 24–53 · score 0.66 · L1, L2, L3, L4, R1, R2
  8. [8] § 2. Materials and Methods › 2.6. Cross-Dataset Evaluation of the Architecture Ranking ↔ src/benchmark.py, lines 1–41 · score 0.61 · fold cross validation, recording days, deep learning, benchmarked, stratified, ear EEG
  9. [9] § 2. Materials and Methods › 2.3. Evaluation and Selection of the Optimal Deep Learning Model ↔ src/benchmark.py, lines 113–170 · score 0.53 · random seeds, cross validation, split, train, fold, accuracies

Paper

Loaded from Europe PMC by your browser, not stored by OSCR: 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

  1. # -*- coding: utf-8 -*-
  2. """
  3. Benchmark of 23 deep-learning architectures on ear-EEG.
  4. Subject-specific stratified k-fold cross-validation, applied independently
  5. within each participant, recording day and task pair. One row is written per
  6. (seed, condition, subject, fold); every number reported in the manuscript is
  7. derived from that file.
  8. python src/benchmark.py --config configs/main.json
  9. """
  10. import os
  11. import re
  12. import json
  13. import glob
  14. import argparse
  15. import warnings
  16. import numpy as np
  17. import pandas as pd
  18. from scipy import io
  19. import torch
  20. from torch.utils.data import Subset
  21. from sklearn.model_selection import StratifiedKFold, train_test_split
  22. import mne
  23. from braindecode.preprocessing import exponential_moving_standardize
  24. from braindecode.datasets import create_from_X_y
  25. from braindecode.models import * # noqa: F401,F403
  26. from braindecode.util import set_random_seeds
  27. from braindecode import EEGClassifier
  28. from skorch.callbacks import EarlyStopping
  29. from skorch.helper import predefined_split
  30. warnings.filterwarnings("ignore")
  31. torch.backends.cudnn.deterministic = True
  32. torch.backends.cudnn.benchmark = False
  33. DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
  34. # ---------------------------------------------------------------------
  35. # Architectures
  36. # ---------------------------------------------------------------------
  37. def build_model(name, n_chans, n_outputs, n_times, sfreq, overrides=None):
  38. """Instantiate a Braindecode model at its default configuration.
  39. `overrides` applies architecture-specific keyword arguments. The only one
  40. used in the manuscript is FBLightConvNet with n_bands = 18.
  41. """
  42. cls = globals()[name]
  43. kwargs = dict(n_chans=n_chans, n_outputs=n_outputs,
  44. n_times=n_times, sfreq=sfreq)
  45. if overrides:
  46. kwargs.update(overrides.get(name, {}))
  47. return cls(**kwargs)
  48. class EarlyStoppingWithMinEpochs(EarlyStopping):
  49. """EarlyStopping that stays inactive until `min_epochs` have elapsed."""
  50. def __init__(self, min_epochs, **kwargs):
  51. super().__init__(**kwargs)
  52. self.min_epochs = min_epochs
  53. def on_epoch_end(self, net, **kwargs):
  54. if len(net.history) < self.min_epochs:
  55. return
  56. super().on_epoch_end(net, **kwargs)
  57. # ---------------------------------------------------------------------
  58. # Data
  59. # ---------------------------------------------------------------------
  60. def subject_ids(folder):
  61. ids = []
  62. for path in glob.glob(os.path.join(folder, "Sub_*.mat")):
  63. name = os.path.basename(path)
  64. if name.endswith("_y_label.mat"):
  65. continue
  66. m = re.fullmatch(r"Sub_(\d+)\.mat", name)
  67. if m and os.path.exists(
  68. os.path.join(folder, f"Sub_{m.group(1)}_y_label.mat")):
  69. ids.append(int(m.group(1)))
  70. return sorted(ids)
  71. def load_subject(folder, subject, n_times, standardize):
  72. """Return (trials, channels, samples) and the label vector."""
  73. data = io.loadmat(os.path.join(folder, f"Sub_{subject}.mat"))
  74. label = io.loadmat(os.path.join(folder, f"Sub_{subject}_y_label.mat"))
  75. x = data.get("DATA", data.get(f"Sub_{subject}"))
  76. y = np.asarray(label.get("LABEL",
  77. label.get(f"Sub_{subject}_y_label"))).reshape(-1)
  78. x = np.asarray(x, dtype=np.float64)[:, :, :n_times]
  79. if standardize:
  80. for i in range(x.shape[0]):
  81. x[i] = exponential_moving_standardize(x[i], factor_new=0.001,
  82. eps=1e-4)
  83. return x, y
  84. # ---------------------------------------------------------------------
  85. # Evaluation
  86. # ---------------------------------------------------------------------
  87. def cross_validate(x, y, model_name, cfg, seed):
  88. """Run one subject through the stratified cross-validation."""
  89. n_times = x.shape[2]
  90. skf = StratifiedKFold(n_splits=cfg["n_folds"], shuffle=True,
  91. random_state=seed["fold"])
  92. with mne.use_log_level("ERROR"):
  93. dataset = create_from_X_y(
  94. [x[i] for i in range(len(y))], y,
  95. sfreq=cfg["sfreq"], ch_names=cfg["ch_names"],
  96. drop_last_window=False,
  97. window_size_samples=None, window_stride_samples=None)
  98. accuracies = []
  99. for fold, (train_trials, test_trials) in enumerate(
  100. skf.split(np.arange(len(y)), y), start=1):
  101. train_idx, val_idx = train_test_split(
  102. train_trials, test_size=cfg["val_ratio"],
  103. stratify=y[train_trials], random_state=seed["split"] + fold)
  104. set_random_seeds(seed=seed["init"] + fold,
  105. cuda=torch.cuda.is_available())
  106. model = build_model(model_name, x.shape[1], len(np.unique(y)),
  107. n_times, cfg["sfreq"], cfg.get("model_args"))
  108. if DEVICE == "cuda":
  109. model = model.cuda()
  110. clf = EEGClassifier(
  111. model,
  112. criterion=torch.nn.CrossEntropyLoss,
  113. optimizer=torch.optim.AdamW,
  114. optimizer__lr=cfg["learning_rate"],
  115. train_split=predefined_split(Subset(dataset, val_idx)),
  116. batch_size=cfg["batch_size"],
  117. max_epochs=cfg["max_epochs"],
  118. device=DEVICE,
  119. classes=sorted(np.unique(y).tolist()),
  120. callbacks=[("early_stopping", EarlyStoppingWithMinEpochs(
  121. min_epochs=cfg["min_epochs"],
  122. monitor="valid_loss",
  123. patience=cfg["patience"],
  124. lower_is_better=True,
  125. load_best=True))],
  126. verbose=0,
  127. )
  128. clf.fit(Subset(dataset, train_idx), y=None, epochs=cfg["max_epochs"])
  129. proba = clf.predict_proba(Subset(dataset, test_trials))
  130. pred = np.array(clf.classes_)[np.argmax(proba, axis=1)]
  131. accuracies.append(float((pred == y[test_trials]).mean()))
  132. del clf, model
  133. if DEVICE == "cuda":
  134. torch.cuda.empty_cache()
  135. return accuracies
  136. def main():
  137. parser = argparse.ArgumentParser(description=__doc__)
  138. parser.add_argument("--config", required=True)
  139. args = parser.parse_args()
  140. with open(args.config, encoding="utf-8") as f:
  141. cfg = json.load(f)
  142. n_times = int(cfg["epoch_seconds"] * cfg["sfreq"])
  143. rows = []
  144. for seed in cfg["seeds"]:
  145. for condition in cfg["conditions"]:
  146. folder = os.path.join(cfg["data_dir"], condition)
  147. for subject in subject_ids(folder):
  148. x, y = load_subject(folder, subject, n_times,
  149. cfg["standardize"])
  150. for model_name in cfg["models"]:
  151. accuracies = cross_validate(x, y, model_name, cfg, seed)
  152. for fold, acc in enumerate(accuracies, start=1):
  153. rows.append({"seed": seed["name"],
  154. "condition": condition,
  155. "model": model_name,
  156. "subject": subject,
  157. "fold": fold,
  158. "accuracy": acc})
  159. print(f"{seed['name']} | {condition} | {model_name} | "
  160. f"S{subject:02d} | {np.mean(accuracies):.4f}",
  161. flush=True)
  162. os.makedirs(os.path.dirname(cfg["output"]) or ".", exist_ok=True)
  163. pd.DataFrame(rows).to_csv(cfg["output"], index=False)
  164. print(f"\nwrote {len(rows)} rows to {cfg['output']}")
  165. if __name__ == "__main__":
  166. main()

benchmark.py at commit b831cfa, under MIT · at the source

Overview

Authors: Ji-Seung Kim1, Soo-In Choi2, Han-Jeong Hwang3,4,5, Chang-Hee Han4,6
  1. Department of Computer and Information Science, Korea University, Sejong 30019, Republic of Korea
  2. Medical Metrology Group, Division of Biomedical Metrology, Korea Research Institute of Standards and Science (KRISS), Daejeon 34113, Republic of Korea
  3. Department of Electronics and Information Engineering, Korea University, Sejong 30019, Republic of Korea
  4. Digital Healthcare Center, Sejong Institute for Business and Technology, Korea University, Sejong 30019, Republic of Korea
  5. Interdisciplinary Graduate Program for Artificial Intelligence Smart Convergence Technology, Korea University, Sejong 30019, Republic of Korea
  6. Department of Computer Science and Software Engineering, Korea University, Sejong 30019, Republic of Korea
Institutions: Korea University (South Korea); Korea Research Institute of Standards and Science (South Korea); Sejong Institute (South Korea)
Journal: Biosensors, volume 16, issue 8, article 437
Dates: received 2 July 2026; accepted 8 August 2026; published online 12 August 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.3390/bios16080437 · PMID 42645055 · PMCID PMC13510306 · OpenAlex W7202288422
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), human (organism)
Methods: Spectral & time-frequency, Statistics, Machine learning, Preprocessing, Connectivity
Keywords: Ear-EEG, brain–computer interface, mental imagery, deep learning architecture, lightweight convolutional neural network
MeSH: Brain-Computer Interfaces*, Deep Learning*, Ear*, Electroencephalography*, Humans, Neural Networks, Computer, Signal-To-Noise Ratio (* major topic)
Topic: EEG and Brain-Computer Interfaces (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Research Foundation of Korea (RS-2025-25419004, RS-2024-00397674, RS-2026-25518845); Ministry of Science and ICT, South Korea (IITP-2026-RS-2023-00258971)
Citations: not cited yet (Europe PMC); 49 references in the paper

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

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Commit: b831cfa9c7849d50703b2e6f214c4d9ad0b62598, 31 July 2026
Languages: Python (4), MATLAB (1)
Size: 13 files, 5 scripts
Software Heritage: not archived
Found in: “Data Availability Statement”
Holds: README, license file, environment (requirements.txt)
Not found: CITATION.cff, tests, continuous integration, documentation
Tools: NumPy (4 files), SciPy (4 files), pandas (3 files), Braindecode (2 files), PyTorch (2 files), Signal Processing Toolbox (1 file), MNE-Python (1 file), scikit-learn (1 file), statsmodels (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers
  • 27 September 2026: the link answers
7 files

Zenodo 21716287

License: MIT
State: the link answers, verified on 27 September 2026
Evidence: files inventoried
Size: 1 file
Software Heritage: not checked
Found in: “Data Availability Statement”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: NumPy (4 files), SciPy (4 files), pandas (3 files), Braindecode (2 files), PyTorch (2 files), Signal Processing Toolbox (1 file), MNE-Python (1 file), scikit-learn (1 file), statsmodels (1 file)
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
  • 27 September 2026: the link answers (HTTP 200)
7 files

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://github.com/toiro2000/Ear-EEG-DL-Benchmark (accessed on 31 July 2026) and archived at https://doi.org/10.5281/zenodo.21716287.

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://doi.org/10.3390/bios16080437

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/bios16080437},
url = {https://doi.org/10.3390/bios16080437},
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/08/12
VL - 16
IS - 8
SP - 437
SN - 2079-6374
PB - Multidisciplinary Digital Publishing Institute (MDPI)
DO - 10.3390/bios16080437
UR - https://doi.org/10.3390/bios16080437
LA - en
ER -

CSL-JSON

{
"id": "10.3390/bios16080437",
"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": "Biosensors (Basel)",
"volume": "16",
"issue": "8",
"page": "437",
"DOI": "10.3390/bios16080437",
"PMID": "42645055",
"PMCID": "PMC13510306",
"ISSN": "2079-6374",
"publisher": "Multidisciplinary Digital Publishing Institute (MDPI)",
"URL": "https://doi.org/10.3390/bios16080437",
"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 reports
In common: Braindecode, PyTorch, scikit-learn, 3 other tools, EEG, 10 references
[2] 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 one
In common: Braindecode, MNE-Python, PyTorch, 4 other tools, EEG, 5 references
[3] doi:10.3389/fpsyg.2026.1774068 [code]
Analysis of cognitive mechanisms in phoneme perception and pronunciation errors among Korean language learners.
Journal: Frontiers in psychology
In common: Braindecode, MNE-Python, PyTorch, 4 other tools, EEG, 1 reference
[4] doi:10.1186/s13634-026-01330-2 [code]
Leednet: a lightweight network for event detection in EEG signals.
Journal: Journal on advances in signal processing
In common: MNE-Python, PyTorch, scikit-learn, 3 other tools, EEG, 3 references
[5] doi:10.3390/biomimetics11060377
PG-MCTFormer: A Prior-Guided Multi-Scale Convolutional Transformer for Interpretable Motor Imagery EEG Classification.
Journal: Biomimetics (Basel, Switzerland)
In common: EEG, 6 references
[6] doi:10.1038/s41746-026-02778-0 [code]
Trust-gated synthetic EEG augmentation reduces performance drops when generalizing to new patients.
Journal: NPJ digital medicine
In common: MNE-Python, PyTorch, scikit-learn, 3 other tools, EEG, 2 references
[7] doi:10.3389/fnins.2026.1874302 [code]
Architecture-data matching for EEG-EMG decoding: compact deep models match classical spectral decoders on the WAY-EEG-GAL grasp-and-lift dataset.
Journal: Frontiers in neuroscience
In common: PyTorch, scikit-learn, pandas, 2 other tools, EEG, 3 references
[8] doi:10.1002/hbm.70628 [code]
EEG Biomarkers for Affective Disorders Diagnosis: An Evaluation and Validation Study.
Journal: Human brain mapping
In common: MNE-Python, statsmodels, PyTorch, 4 other tools, EEG
[9] doi:10.1371/journal.pcbi.1014302 [code]
Trial-level sequence modeling reveals hidden dynamics of dual-task interference.
Journal: PLoS computational biology
In common: MNE-Python, statsmodels, PyTorch, 4 other tools, EEG
[10] doi:10.1007/s10916-026-02374-5 [code]
Attention-Enhanced U-Net for Sensor-Efficient High-Density EEG Reconstruction in Wearable Brain Monitoring Systems.
Journal: Journal of medical systems
In common: MNE-Python, PyTorch, scikit-learn, 3 other tools, EEG, 1 reference

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.

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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.

Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.

Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.