OSCR

NeuroStream: spectral-spatio-temporal deep learning for visual stimulus classification from EEG.

Code ↔ Paper

10 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 10 matches · 1 of them tie a paragraph to a whole file, not to given lines: a weak match, whose lines are not tinted
  1. [1] § Methods › Dataset ↔ scripts/generate-freqdistribution.py, lines 25–39 · score 0.73 · 14–70 Hz, 55–95 Hz, raw signal, 14 Hz, 55 Hz, EEG
  2. [2] § Results › Baselines and implementation details ↔ models/registery.py, the whole file · a weak match · score 0.68 · ATCNet, EEGNet, EEGConformer, EEGChannelNet, LSTM, model
  3. [3] § Methods › Dataset ↔ utils/lib.py, lines 184–306 · score 0.66 · 14–70 Hz, 55–95 Hz, 14 Hz, filtered, 55 Hz, channel
  4. [4] § Results › Block design confound › Semantic relabeling and generalization ↔ scripts/aggregate-results.py, lines 14–56 · score 0.66 · confidence intervals, random seeds, macro F1, confusion, validation, matrix
  5. [5] § Results › Block design confound › Semantic relabeling and generalization ↔ utils/evaluation-metrics.py, lines 5–31 · score 0.60 · confidence intervals, macro F1, confusion matrix, accuracy
  6. [6] § Results › Bias analysis ↔ scripts/bias-analysis.py, lines 130–221 · score 0.58 · multi class, confusion matrices, subject accuracies, bias, model
  7. [7] § Methods › Evaluation protocols ↔ utils/evaluation-metrics.py, lines 5–31 · score 0.55 · confidence intervals, macro F1, metric, accuracy
  8. [8] § Methods › Evaluation protocols ↔ scripts/aggregate-results.py, lines 14–56 · score 0.53 · confidence intervals, macro F1, metric, accuracy
  9. [9] § Results › Block design confound › Semantic relabeling and generalization ↔ scripts/aggregate-results.py, lines 58–89 · score 0.50 · confidence interval, macro F1, seed, raw, accuracy, model
  10. [10] § Methods › Spectral-spatio-temporal representation ↔ models/VisualTransforms.py, lines 123–187 · score 0.50 · log power, frequency bands, transformed

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 · 100 lines · 3.7 KB · GPL-3.0 · 3 matches

  1. import glob
  2. import os
  3. import json
  4. import pandas as pd
  5. from pathlib import Path
  6. from ..utils import load_checkpoint
  7. import numpy as np
  8. # Import the metric calculation logic
  9. from ..utils.evaluation_metrics import compute_macro_f1_and_ci
  10. PKG_ROOT = Path(__file__).resolve().parents[1]
  11. MODELS_DIR = PKG_ROOT / "semantic_models"
  12. def aggregate_checkpoints():
  13. """
  14. Scans the directory for all checkpoints, groups them by Model and Dataset,
  15. and computes aggregated statistics across the random seeds.
  16. """
  17. model_files = glob.glob(f"{MODELS_DIR}/**/*.pth", recursive=True)
  18. # Dictionary to hold grouping: [Model][Dataset] -> list of run dicts
  19. grouped_results = {}
  20. for file_path in model_files:
  21. # We don't need the model state dict, just the metadata
  22. _, checkpoint = load_checkpoint(file_path, map_location="cpu")
  23. model_name = checkpoint.get("model_name", "Unknown_Model")
  24. dataset_name = checkpoint["dataset_options"]["eeg_dataset"].split("\\")[-1].split(".")[0]
  25. conf_mat = checkpoint.get("confusion_matrx")
  26. if conf_mat is None:
  27. continue # Skip if older checkpoint without matrix
  28. subject_acc = checkpoint["dataset_options"].get("subject_validation_acc", {})
  29. # Calculate true metrics from raw matrix
  30. acc, macro_f1, ci = compute_macro_f1_and_ci(conf_mat)
  31. run_data = {
  32. "seed_hash": checkpoint["model_hash"],
  33. "epoch": checkpoint["epoch"],
  34. "top1_accuracy": acc,
  35. "macro_f1": macro_f1,
  36. "confidence_interval": ci,
  37. "subject_bias": subject_acc
  38. }
  39. if model_name not in grouped_results:
  40. grouped_results[model_name] = {}
  41. if dataset_name not in grouped_results[model_name]:
  42. grouped_results[model_name][dataset_name] = []
  43. grouped_results[model_name][dataset_name].append(run_data)
  44. return generate_summary_report(grouped_results)
  45. def generate_summary_report(grouped_results):
  46. final_report = {}
  47. for model, datasets in grouped_results.items():
  48. final_report[model] = {}
  49. for dataset, runs in datasets.items():
  50. accs = [r["top1_accuracy"] for r in runs]
  51. f1s = [r["macro_f1"] for r in runs]
  52. cis = [r["confidence_interval"] for r in runs]
  53. # Extract average per-subject accuracy across seeds
  54. all_subjects = set(sub for r in runs for sub in r["subject_bias"].keys())
  55. subject_avg = {}
  56. for sub in all_subjects:
  57. sub_scores = [r["subject_bias"][sub] for r in runs if sub in r["subject_bias"]]
  58. subject_avg[f"Subject_{sub}"] = round(sum(sub_scores) / len(sub_scores), 4)
  59. final_report[model][dataset] = {
  60. "total_seeds_run": len(runs),
  61. "metrics": {
  62. "top1_accuracy_mean": round(float(np.mean(accs)), 4),
  63. "top1_accuracy_std": round(float(np.std(accs)), 4),
  64. "macro_f1_mean": round(float(np.mean(f1s)), 4),
  65. "macro_f1_std": round(float(np.std(f1s)), 4),
  66. "confidence_interval_mean": round(float(np.mean(cis)), 4)
  67. },
  68. "average_subject_accuracy": subject_avg,
  69. "raw_runs": runs
  70. }
  71. return final_report
  72. # TODO: make it accept the output as as a parameter
  73. if __name__ == "__main__":
  74. print("Aggregating checkpoint data without running inference...")
  75. report = aggregate_checkpoints()
  76. output_file = "bias_analysis_summary.json"
  77. with open(output_file, "w") as f:
  78. json.dump(report, f, indent=4)
  79. print(f"Aggregation complete! Clean data written to {output_file}.")

aggregate-results.py at commit fa800f4, under GPL-3.0 · at the source

Overview

  1. Electrical Engineering Department, Faculty of Engineering at Shoubra, Benha University, Cairo, Egypt
  2. Computer Science Faculty, Benha National University, Cairo, Egypt
  3. Electronics and Communication Engineering Department, Kuwait College of Science and Technology, Doha District, Kuwait
  4. Present Address: Egypt–Japan University of Science and Technology (E-JUST), Alexandria, Egypt
Journal: Scientific reports, volume 16, issue 1, article 28489
Dates: received 6 March 2026; accepted 20 August 2026; published online 11 September 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1038/s41598-026-68186-2 · PMID 42728336 · PMCID PMC13569483 · OpenAlex W7212258884
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), human (organism), methods / tools (subfield)
Methods: Statistics, Spectral & time-frequency, Machine learning
Keywords: EEG-classification, Brain-visual-representations, Multimodal-learning, Deep-learning, Computational biology and bioinformatics, Engineering, Neuroscience
MeSH: Deep Learning*, Electroencephalography*, Photic Stimulation*, Algorithms, Humans, Signal Processing, Computer-Assisted, Wavelet Analysis (* major topic)
Topic: EEG and Brain-Computer Interfaces (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Citations: not cited yet (Europe PMC); 65 references in the paper

Abstract

Electroencephalography (EEG)-based visual classification is a challenging task due to low spatial resolution, complex temporal dynamics, and potential experimental confounds, yet with the recent advances in EEG classification, it offers a cost-effective, portable alternative with millisecond-level temporal resolution to Functional Magnetic Resonance Imaging (fMRI) for large scale studies and real-time applications. We propose a novel Spectral-Spatio-Temporal (SST) representation that transforms raw EEG signals into a structured, video-like format. Specifically, we compute wavelet transforms for all channels, aggregate log power into frequency bands, and map these features to electrode positions over time, thereby synthesizing the signal’s multi-dimensional dynamics into a unified, high-fidelity sequence. Building on this representation, we introduce the NeuroStream-SST framework, featuring a lightweight deep learning architecture optimized for spatiotemporal feature extraction. Experiments on the EEGCVPR40 dataset show that our approach reaches accuracy in the high-gamma band using standard dataset splits, outperforming existing methods evaluated under an identical protocol and demonstrating its ability to capture complex neural characteristics effectively. Furthermore, we implement a set of evaluation protocols designed to expose and quantify the contribution of temporal correlations to reported accuracy. decoding performance declines steadily as the association between class labels and recording sessions is weakened, and falls to the majority-class baseline once the sessions of the evaluated classes are withheld entirely. These findings highlight our framework as a promising direction for EEG-based visual decoding, with implications for brain-computer interfaces and cognitive neuroscience.

Reproduced under the paper's license (CC BY), from the paper cited above.

Repository

Its files are read in the Code ↔ Paper reader above, with 10 matches between paragraphs and lines of code.

aim97/Visual-brain-study

License: GPL-3.0
State: the link answers, verified on 26 September 2026
Evidence: files inventoried
Commit: fa800f425e9cadc8a7ef4c5e89c2ee59ec7be48b, 14 July 2026
Languages: Python (57), Shell (1)
Size: 84 files, 58 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: license file
Not found: README, CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (46 files), NumPy (20 files), pandas (11 files), Matplotlib (7 files), Braindecode (3 files), SciPy (3 files), PyWavelets (1 file), scikit-learn (1 file), seaborn (1 file)
Availability: 1 check, the latest on 26 September 2026: the link answers
  • 26 September 2026: the link answers
59 files

Code availability

The code used to preprocess the data and implement the Spectral–Spatio–Temporal (SST) model is available in our project repository:https://github.com/aim97/Visual-brain-study.

Reproduced under the paper's license (CC BY), from the paper cited above.

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:

  • 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
  • 58 scripts, each with its path and the digest of its content;
  • 10 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 EEGCVPR40 dataset used in this study is publicly available from the original authors at:https://github.com/perceivelab/eeg_visual_classification. This study does not redistribute the original EEG recordings. The train/validation/test split indices generated for our experiments are publicly available at:https://github.com/aim97/Visual-brain-study/tree/master/resources

The code used to preprocess the data and implement the Spectral–Spatio–Temporal (SST) model is available in our project repository:https://github.com/aim97/Visual-brain-study.

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 3, 28 September 2026

  • Funding: added Science and Technology Development Fund; Benha University

Version 1, 27 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 7 keywords, 7 MeSH terms, 51 references.

Cite

This paper

Abdelmagid, M., Yusuf, M., ElHalawany, B. M., & Fares, A. (2026). NeuroStream: spectral-spatio-temporal deep learning for visual stimulus classification from EEG. Scientific reports, 16(1), 28489. https://doi.org/10.1038/s41598-026-68186-2

BibTeX

@article{abdelmagid2026neurostream,
author = {Abdelmagid, Mohamed and Yusuf, Marwa and ElHalawany, Basem M and Fares, Ahmed},
title = {{NeuroStream: spectral-spatio-temporal deep learning for visual stimulus classification from EEG}},
journal = {Scientific reports},
year = {2026},
month = sep,
volume = {16},
number = {1},
pages = {28489},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-68186-2},
url = {https://doi.org/10.1038/s41598-026-68186-2},
pmid = {42728336},
pmcid = {PMC13569483}
}

RIS

TY - JOUR
AU - Abdelmagid, Mohamed
AU - Yusuf, Marwa
AU - ElHalawany, Basem M
AU - Fares, Ahmed
TI - NeuroStream: spectral-spatio-temporal deep learning for visual stimulus classification from EEG
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/09/11
VL - 16
IS - 1
SP - 28489
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-68186-2
UR - https://doi.org/10.1038/s41598-026-68186-2
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-68186-2",
"type": "article-journal",
"title": "NeuroStream: spectral-spatio-temporal deep learning for visual stimulus classification from EEG",
"container-title": "Scientific reports",
"author": [
{
"family": "Abdelmagid",
"given": "Mohamed"
},
{
"family": "Yusuf",
"given": "Marwa"
},
{
"family": "ElHalawany",
"given": "Basem M"
},
{
"family": "Fares",
"given": "Ahmed"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "28489",
"DOI": "10.1038/s41598-026-68186-2",
"PMID": "42728336",
"PMCID": "PMC13569483",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-68186-2",
"language": "en",
"issued": {
"date-parts": [
[
2026,
9,
11
]
]
}
}

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.3390/bios16080437 [code]
Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights.
Journal: Biosensors
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, PyTorch, seaborn, 5 other tools, methods / tools, EEG, 4 references
[3] 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: PyWavelets, PyTorch, seaborn, 5 other tools, EEG, 2 references
[4] 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, PyTorch, seaborn, 5 other tools, EEG, 1 reference
[5] doi:10.1371/journal.pone.0351872 [code]
Decoding visual object recognition from EEG signals.
Journal: PloS one
In common: PyTorch, scikit-learn, pandas, 3 other tools, EEG, 3 references
[6] doi:10.1162/imag.a.1299 [code]
A modular semantic-structural pipeline for visual decoding from primate spiking data via selective temporal integration.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: PyTorch, seaborn, scikit-learn, 4 other tools, methods / tools, 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, 3 other tools, methods / tools, EEG, 3 references
[8] doi:10.1038/s41597-026-07077-7 [code]
Everyday Activity Science and Engineering Table Setting Dataset.
Journal: Scientific data
In common: PyTorch, seaborn, scikit-learn, 4 other tools, methods / tools, EEG, 2 references
[9] doi:10.1038/s41467-026-72057-9 [code]
Sex-specific behavioral feedback modulates sensorimotor processing and drives flexible social behavior.
Journal: Nature communications
In common: PyWavelets, PyTorch, seaborn, 5 other tools, 1 reference
[10] doi:10.1038/s41598-026-55584-9 [code]
Reproducible benchmark of wavelet-enhanced intrabody communication biometric identification.
Journal: Scientific reports
In common: PyWavelets, PyTorch, seaborn, 5 other tools, methods / tools

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.