OSCR

Attention-Enhanced U-Net for Sensor-Efficient High-Density EEG Reconstruction in Wearable Brain Monitoring Systems.

Code ↔ Paper

The paper beside its authors' code: matches between them have not been computed for this paper yet.

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 · 153 lines · 5 KB · MIT

  1. # -*- coding: utf-8 -*-
  2. import os
  3. import time
  4. from pathlib import Path
  5. import torch
  6. import numpy as np
  7. import scipy.io as sio
  8. import VEEG_A_U_Net as mm
  9. from dataload import loadData
  10. from modelTrainer import model_train
  11. from modelValidation import modelValidation
  12. def _to_nct(arr: np.ndarray, time_expected: int = 600) -> np.ndarray:
  13. a = np.asarray(arr)
  14. if a.ndim != 3:
  15. raise ValueError(f"Expected 3D array, got {a.shape}")
  16. # (C, T, N)
  17. if a.shape[1] == time_expected and a.shape[0] in (32, 60):
  18. return np.transpose(a, (2, 0, 1))
  19. # (N, C, T)
  20. if a.shape[2] == time_expected and a.shape[1] in (32, 60):
  21. return a
  22. raise ValueError(f"Unrecognized layout (expect T={time_expected}): {a.shape}")
  23. def main():
  24. mse_loss_list = []
  25. device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
  26. start_time = time.time()
  27. # Base dirs (relative to this script file)
  28. CODE_DIR = Path(__file__).resolve().parent
  29. ROOT_DIR = CODE_DIR.parent
  30. folder_path = str(CODE_DIR)
  31. mats = sorted(CODE_DIR.glob("SEED_Sub*.mat"))
  32. if not mats:
  33. raise FileNotFoundError(
  34. "[PATH ERROR] No SEED_Sub*.mat found in the script folder.\n"
  35. f"Script folder: {CODE_DIR}\n\n"
  36. "Fix:\n"
  37. " Put SEED_Sub*.mat into the SAME folder as this .py file,\n"
  38. " or run the script from the folder that contains SEED_Sub*.mat."
  39. )
  40. # Model output path (keep your original structure; relative-safe)
  41. save_path = str((ROOT_DIR / "SEED" / "SREEG" / "VEEG_A_UNet" / "LOSO_LR35" / "iterp").resolve())
  42. os.makedirs(save_path, exist_ok=True)
  43. print(f"[INFO] Device: {device}")
  44. print(f"[INFO] Visible CUDA device count: {torch.cuda.device_count()}")
  45. print(f"[INFO] Input folder: {folder_path}")
  46. print(f"[INFO] Save folder : {save_path}")
  47. print(f"[INFO] Mat files found: {len(mats)}")
  48. # Load mats from script folder
  49. data_dict = loadData(folder_path)
  50. print("\n[CHECK] After loadData() -> normalize to (N, C, T), enforce 60ch:")
  51. for k in sorted(data_dict.keys()):
  52. X_raw = data_dict[k]["X"]
  53. y_raw = data_dict[k]["y"]
  54. print(f" {k} raw : X={np.asarray(X_raw).shape} y={np.asarray(y_raw).shape}")
  55. X_nct = _to_nct(X_raw).astype(np.float32, copy=False)
  56. y_nct = _to_nct(y_raw).astype(np.float32, copy=False)
  57. data_dict[k]["X"] = X_nct
  58. data_dict[k]["y"] = y_nct
  59. print(f" {k} nct : X={X_nct.shape} y={y_nct.shape} dtype={X_nct.dtype}")
  60. if X_nct.shape[1] != 60 or y_nct.shape[1] != 60:
  61. raise RuntimeError(
  62. f"[LOAD ERROR] {k} is not 60ch. Got X={X_nct.shape}, y={y_nct.shape}.\n"
  63. "Please verify your .mat contains 60-channel X and y."
  64. )
  65. print("[CHECK] OK: all subjects are 60ch in (N, C, T).\n")
  66. subjects = sorted(data_dict.keys())
  67. # LOSO training loop (keep logic unchanged)
  68. for i in range(len(subjects)):
  69. X_list, y_list, valid_X_list, valid_y_list = [], [], [], []
  70. sub_now = subjects[i]
  71. for j, sub in enumerate(subjects):
  72. if j == i:
  73. valid_X_list.append(data_dict[sub]["X"])
  74. valid_y_list.append(data_dict[sub]["y"])
  75. else:
  76. X_list.append(data_dict[sub]["X"])
  77. y_list.append(data_dict[sub]["y"])
  78. valid_X = np.concatenate(valid_X_list, axis=0).astype(np.float32, copy=False)
  79. valid_y = np.concatenate(valid_y_list, axis=0).astype(np.float32, copy=False)
  80. X = np.concatenate(X_list, axis=0).astype(np.float32, copy=False)
  81. y = np.concatenate(y_list, axis=0).astype(np.float32, copy=False)
  82. print(f"[LOSO] Valid data shape ({sub_now}): {valid_X.shape}")
  83. print(f"[LOSO] Train data shape: {X.shape}")
  84. if X.shape[1] != 60 or y.shape[1] != 60:
  85. raise RuntimeError(f"[DATA ERROR] Expect 60ch. Got X={X.shape}, y={y.shape}")
  86. ckpt = Path(save_path) / f"{sub_now}_model.pt"
  87. if ckpt.exists():
  88. try:
  89. ckpt.unlink()
  90. except Exception:
  91. pass
  92. model = model_train(
  93. X=X,
  94. y=y,
  95. use_model=mm.Attn_UNet_inter(),
  96. # For this journal, we set batch_size = 64 and epochs = 50, which can be adjusted based on your compute budget.
  97. batch_size=64,
  98. epochs=50,
  99. model_name=sub_now,
  100. savePath=save_path,
  101. device=device,
  102. )
  103. mse_loss = modelValidation(valid_X=valid_X, valid_y=valid_y, model=model, device=device)
  104. mse_loss_list.append(mse_loss)
  105. np.save(f"{save_path}/MSELoss_list.npy", mse_loss_list)
  106. end_time = time.time()
  107. print("[DONE] Total execution time:", round((end_time - start_time) / 3600, 3), "hours")
  108. if __name__ == "__main__":
  109. main()

DP_LOSO_Train.py at commit 7438484, under MIT · at the source

Overview

Authors: Jyun-Rong Zhuang1, Pin-Cheng Guo1
ORCID iDs: Jyun-Rong Zhuang
  1. Department of Mechanical Engineering, National Chung Hsing University, 145 Xingda Rd., South Dist, Taichung City, Taiwan 402202 R.O.C
Institutions: National Chung Hsing University (Taiwan)
Journal: Journal of medical systems, volume 50, issue 1, article 46
Dates: received 11 July 2025; accepted 28 March 2026; published online 6 April 2026; in print 2026
Type: Research article · Language: English
License: CC BY
Identifiers: DOI 10.1007/s10916-026-02374-5 · PMID 41936725 · PMCID PMC13050758 · OpenAlex W7151005540
Open access: hybrid, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), other (modality), human (organism), methods / tools (subfield)
Methods: Spectral & time-frequency, Connectivity, Machine learning, Preprocessing
Keywords: Electroencephalography (EEG), Virtual Channel Generation, Sensor Efficiency, U-Net, High-channel-density (HCD), Low-channel-density (LCD)
MeSH: Brain*, Deep Learning*, Electroencephalography*, Signal Processing, Computer-Assisted*, Wearable Electronic Devices*, Algorithms, Attention, Humans, Signal-To-Noise Ratio (* major topic)
Topic: EEG and Brain-Computer Interfaces (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: National Chung Hsing University
Citations: not cited yet (Europe PMC); 35 references in the paper

Abstract

High-channel-density (HCD) electroencephalography (EEG) enables fine-grained neural sensing but is constrained by high hardware costs, spatial complexity, and limited portability. This study developed a deep learning-based method to reconstruct high-density EEG signals from low-channel-density (LCD) inputs, enabling more practical and affordable brain-monitoring systems. This study introduces VEEG-A-U-Net, a lightweight U-Net architecture enhanced with attention gates and residual learning. The model combined spherical spline interpolation with a learnable correction signal to adaptively model spatial-temporal features. The framework was trained and evaluated on the SEED dataset, using normalized mean square error (NMSE), signal-to-noise ratio (SNR), and Pearson correlation coefficient (PCC) to assess reconstruction performance. Validation was conducted through leave-one-subject-out cross-validation (LOSO-CV) and cross-dataset experiments to examine generalizability. Under the same reconstruction setting (scale factor = 2), VEEG-A-U-Net achieved competitive reconstruction performance compared with state-of-the-art methods, while requiring substantially fewer parameters and computational operations. Cross-dataset evaluations confirmed stable performance across different EEG paradigms. Inference-time analysis showed low computational latency, indicating practical feasibility for deployment in resource-constrained and edge computing environments. A preliminary clinical EEG evaluation was also conducted to explore feasibility in clinical settings.The proposed framework offers an effective and lightweight solution for reconstructing high-density EEG from sparse measurements. These findings may support the development of sensor-efficient and portable EEG systems for practical neuroengineering and brain–computer interface applications.

Supplementary Information: The online version contains supplementary material available at 10.1007/s10916-026-02374-5.

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

Repositories

Its files are read in the Code ↔ Paper reader above.

IASlab526/VEEG-A-U-Net

License: MIT
State: the link answers, verified on 29 September 2026
Evidence: files inventoried
Commit: 7438484714f50cb649458b213e1b9daa36146dff, 25 January 2026
Languages: Python (6)
Size: 31 files, 6 scripts
Software Heritage: not archived
Found in: the text, “VEEG-A-U-Net Framework”
Holds: README, license file
Not found: CITATION.cff, environment file, tests, continuous integration, documentation
Tools: PyTorch (5 files), SciPy (5 files), NumPy (4 files), MNE-Python (1 file), pandas (1 file), scikit-learn (1 file)
Availability: 1 check, the latest on 29 September 2026: the link answers
  • 29 September 2026: the link answers
8 files

IASlab526/VEEG-A-U-NetAdditional

License: none: the authors keep all their rights
State: the link is dead, verified on 29 September 2026
Evidence: found in the paper
Software Heritage: not archived
Found in: “Data Availability”
Not found: README, license file, CITATION.cff, environment file, tests, continuous integration, documentation
Availability: 1 check, the latest on 29 September 2026: the link is dead
  • 29 September 2026: the link is dead

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;
  • 6 scripts, each with its path and the digest of its content;
  • no match between paragraphs and code yet;
  • 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

The source code and model configurations of VEEG-A-U-Net are publicly available at https://github.com/IASlab526/VEEG-A-U-NetAdditional details are provided in the Supplementary Material (Supplementary.pdf).

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, 29 September 2026: the first record

Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 6 keywords, 9 MeSH terms, 1 funder, 31 references.

Cite

This paper

Zhuang, J.-R., & Guo, P.-C. (2026). Attention-Enhanced U-Net for Sensor-Efficient High-Density EEG Reconstruction in Wearable Brain Monitoring Systems. Journal of medical systems, 50(1), 46. https://doi.org/10.1007/s10916-026-02374-5

BibTeX

@article{zhuang2026attention,
author = {Zhuang, Jyun-Rong and Guo, Pin-Cheng},
title = {{Attention-Enhanced U-Net for Sensor-Efficient High-Density EEG Reconstruction in Wearable Brain Monitoring Systems}},
journal = {Journal of medical systems},
year = {2026},
month = apr,
volume = {50},
number = {1},
pages = {46},
publisher = {Springer Science+Business Media},
issn = {0148-5598},
doi = {10.1007/s10916-026-02374-5},
url = {https://doi.org/10.1007/s10916-026-02374-5},
pmid = {41936725},
pmcid = {PMC13050758}
}

RIS

TY - JOUR
AU - Zhuang, Jyun-Rong
AU - Guo, Pin-Cheng
TI - Attention-Enhanced U-Net for Sensor-Efficient High-Density EEG Reconstruction in Wearable Brain Monitoring Systems
T2 - Journal of medical systems
J2 - J Med Syst
PY - 2026
DA - 2026/04/06
VL - 50
IS - 1
SP - 46
SN - 0148-5598
PB - Springer Science+Business Media
DO - 10.1007/s10916-026-02374-5
UR - https://doi.org/10.1007/s10916-026-02374-5
LA - en
ER -

CSL-JSON

{
"id": "10.1007/s10916-026-02374-5",
"type": "article-journal",
"title": "Attention-Enhanced U-Net for Sensor-Efficient High-Density EEG Reconstruction in Wearable Brain Monitoring Systems",
"container-title": "Journal of medical systems",
"author": [
{
"family": "Zhuang",
"given": "Jyun-Rong"
},
{
"family": "Guo",
"given": "Pin-Cheng"
}
],
"container-title-short": "J Med Syst",
"volume": "50",
"issue": "1",
"page": "46",
"DOI": "10.1007/s10916-026-02374-5",
"PMID": "41936725",
"PMCID": "PMC13050758",
"ISSN": "0148-5598",
"publisher": "Springer Science+Business Media",
"URL": "https://doi.org/10.1007/s10916-026-02374-5",
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
6
]
]
}
}

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.1093/bioinformatics/btag169 [code]
Bidirectional Mamba-2 boosts EEG super-resolution via regression and diffusion.
Journal: Bioinformatics (Oxford, England)
In common: MNE-Python, PyTorch, scikit-learn, 3 other tools, methods / tools, EEG, 5 references
[2] doi:10.3390/s26082431
Missing Data Gap Imputation Methods in Electroencephalogram (EEG) Signals: A Systematic Scoping Review.
Journal: Sensors (Basel, Switzerland)
In common: methods / tools, EEG, 5 references
[3] 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: MNE-Python, PyTorch, scikit-learn, 3 other tools, methods / 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, 2 references
[5] doi:10.1371/journal.pone.0351872 [code]
Decoding visual object recognition from EEG signals.
Journal: PloS one
In common: MNE-Python, PyTorch, scikit-learn, 3 other tools, EEG, 1 reference
[6] doi:10.1038/s41597-026-07120-7 [code]
PhysioMotion Artifact: A task-driven EEG dataset with point-wise motion artifact annotations.
Journal: Scientific data
In common: MNE-Python, PyTorch, scikit-learn, 2 other tools, methods / tools, EEG, 1 reference
[7] doi:10.1038/s41598-026-56070-y [code]
SSDLabeler: realistic semi-synthetic data generation for multi-label artifact classification in EEG.
Journal: Scientific reports
In common: PyTorch, scikit-learn, pandas, 1 other tool, EEG, 3 references
[8] doi:10.1038/s41467-026-75435-5 [code]
Sensory-guided human-machine joint learning accelerates the acquisition of motor imagery brain computer interface control.
Journal: Nature communications
In common: MNE-Python, PyTorch, scikit-learn, 2 other tools, EEG, 2 references
[9] doi:10.3390/bioengineering13070820 [code]
Benchmarking Multimodal Workload Classification: Effects of Modality, Validation Protocol, and Segmentation Contrast on an Open Graded-Arithmetic Dataset.
Journal: Bioengineering (Basel, Switzerland)
In common: MNE-Python, PyTorch, scikit-learn, 3 other tools, other, methods / tools, EEG
[10] doi:10.3390/bios16080437 [code]
Deep Learning for Ear-EEG-Based Brain-Computer Interface: A Systematic Comparison and Design Insights.
Journal: Biosensors
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.