OSCR

Lightweight deep learning model for nonconvulsive status epilepticus diagnosis using EEG time-frequency analysis.

Code ↔ Paper

3 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 3 matches
  1. [1] § Materials and methods › Hilbert-Huang transform ↔ eeg_processor.py, lines 49–192 · score 0.71 · instantaneous phase, instantaneous amplitude, instantaneous frequency, Hilbert, signal
  2. [2] § Materials and methods › Deep learning model ↔ main.py, lines 156–257 · score 0.62 · channel reduction, expansion, devices, activation, convolutional, efficient
  3. [3] § Materials and methods › Hilbert-Huang transform ↔ eeg_processor.py, lines 49–192 · score 0.57 · instantaneous amplitude, Hilbert, IMF, EMD, HHT

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 · 211 lines · 7.9 KB · no license · 2 matches

  1. import mne
  2. from mne.time_frequency import EpochsTFRArray
  3. import numpy as np
  4. import os
  5. from scipy import signal
  6. from PyEMD import EMD
  7. import matplotlib.pyplot as plt
  8. import matplotlib
  9. matplotlib.use('Agg')
  10. class EEGProcessor:
  11. def __init__(self, data_dir, output_dir, config_path="config.yml"):
  12. self.data_dir = data_dir
  13. self.output_dir = output_dir
  14. os.makedirs(output_dir, exist_ok=True)
  15. self.config = self._load_config(config_path)
  16. self.segment_length = self.config['global']['segment_length']
  17. self.overlap = self.config['global']['overlap']
  18. def _load_config(self, config_path):
  19. import yaml
  20. with open(config_path, 'r', encoding='utf-8') as f:
  21. return yaml.safe_load(f)
  22. def _segment_data(self, raw):
  23. epochs = mne.make_fixed_length_epochs(
  24. raw,
  25. duration=self.segment_length,
  26. preload=True,
  27. overlap=self.overlap,
  28. verbose=False
  29. )
  30. return epochs
  31. def process_folder(self):
  32. fif_files = [f for f in os.listdir(self.data_dir) if f.endswith('.fif')]
  33. for idx, fname in enumerate(fif_files, 1):
  34. seq_dir = self.output_dir
  35. self.idx = idx
  36. raw = mne.io.read_raw(os.path.join(self.data_dir, fname), preload=True)
  37. self.epochs = self._segment_data(raw)
  38. for i, epoch in enumerate(self.epochs):
  39. self.generate_spectrograms(i, f"{fname}_seg{i}", seq_dir)
  40. def generate_spectrograms(self, epoch_idx, prefix, seq_dir):
  41. current_epoch = self.epochs[epoch_idx]
  42. fs = self.epochs.info['sfreq']
  43. if self.config.get('multitaper', {}).get('enable', False):
  44. multitaper_dir = os.path.join(seq_dir, 'multitaper')
  45. os.makedirs(multitaper_dir, exist_ok=True)
  46. config = self.config['multitaper']
  47. freqs = np.logspace(*np.log10(config['freqs_range']),
  48. num=config['num_freqs'])
  49. n_cycles = config['n_cycles']
  50. time_bandwidth = config.get('time_bandwidth', 4.0)
  51. single_epoch = mne.EpochsArray(
  52. data=current_epoch.get_data(),
  53. info=self.epochs.info
  54. )
  55. tfr = single_epoch.compute_tfr(
  56. method="multitaper",
  57. freqs=freqs,
  58. n_cycles=n_cycles,
  59. time_bandwidth=time_bandwidth,
  60. return_itc=False,
  61. average=False,
  62. n_jobs=-1
  63. )
  64. avg_data = np.mean(tfr.data[0, :, :, :], axis=0)
  65. plt.figure(figsize=(10, 6))
  66. plt.imshow(avg_data,
  67. aspect='auto',
  68. origin='lower',
  69. extent=[tfr.times[0], tfr.times[-1], freqs[0], freqs[-1]],
  70. cmap='jet')
  71. plt.axis('off')
  72. plt.savefig(os.path.join(multitaper_dir, f"{self.idx}_{epoch_idx}_multitaper.png"),
  73. bbox_inches='tight',
  74. pad_inches=0)
  75. plt.close()
  76. if self.config.get('hht', {}).get('enable', False):
  77. hht_root_dir = os.path.join(seq_dir, 'hht')
  78. os.makedirs(hht_root_dir, exist_ok=True)
  79. data = current_epoch.get_data()
  80. if data.shape[0] == 1:
  81. data = data[0]
  82. all_ch_hht = []
  83. for ch_idx in range(data.shape[0]):
  84. emd = EMD()
  85. imfs = emd(data[ch_idx])
  86. all_freqs = []
  87. all_amps = []
  88. time_points_list = []
  89. for i, imf in enumerate(imfs):
  90. analytic_signal = signal.hilbert(imf)
  91. instantaneous_phase = np.unwrap(np.angle(analytic_signal))
  92. instantaneous_frequency = (np.diff(instantaneous_phase) /
  93. (2.0*np.pi) * fs)
  94. instantaneous_amplitude = np.abs(analytic_signal)[:-1]
  95. current_time_points = np.arange(len(instantaneous_frequency))/fs
  96. time_points_list.append(current_time_points)
  97. all_freqs.append(instantaneous_frequency)
  98. all_amps.append(instantaneous_amplitude)
  99. combined_freqs = np.concatenate(all_freqs)
  100. combined_amps = np.concatenate(all_amps)
  101. time_points = np.concatenate(time_points_list)
  102. n_bins = 200
  103. freq_bins = np.linspace(0, self.config['hht'].get('freq_range', [0, 50])[1], n_bins)
  104. time_bins = np.linspace(0, self.segment_length, n_bins)
  105. valid_mask = (combined_freqs >= 0) & (combined_freqs <= freq_bins[-1])
  106. hist, xedges, yedges = np.histogram2d(
  107. time_points[valid_mask],
  108. combined_freqs[valid_mask],
  109. bins=[time_bins, freq_bins],
  110. weights=combined_amps[valid_mask]
  111. )
  112. all_ch_hht.append(hist)
  113. avg_hht = np.mean(np.array(all_ch_hht), axis=0)
  114. plt.figure(figsize=(10, 6))
  115. plt.pcolormesh(xedges, yedges, avg_hht.T, cmap='jet')
  116. plt.ylim(self.config['hht'].get('freq_range', [0, 50]))
  117. plt.xticks([])
  118. plt.yticks([])
  119. plt.gca().set_xticklabels([])
  120. plt.gca().set_yticklabels([])
  121. plt.gca().axis('off')
  122. plt.savefig(os.path.join(hht_root_dir, f"{self.idx}_{epoch_idx}_hht.png"),
  123. bbox_inches='tight',
  124. pad_inches=0)
  125. plt.close()
  126. if self.config.get('morlet', {}).get('enable', False):
  127. morlet_dir = os.path.join(seq_dir, 'morlet')
  128. os.makedirs(morlet_dir, exist_ok=True)
  129. single_epoch = mne.EpochsArray(
  130. data=current_epoch.get_data(copy=False),
  131. info=self.epochs.info
  132. )
  133. config = self.config['morlet']
  134. freqs = np.logspace(*np.log10(config['freqs_range']),
  135. num=config['num_freqs'])
  136. n_cycles = config['n_cycles']
  137. tfr = single_epoch.compute_tfr(
  138. method="morlet",
  139. freqs=freqs,
  140. n_cycles=n_cycles,
  141. return_itc=False,
  142. average=False,
  143. n_jobs=-1
  144. )
  145. avg_data = np.mean(tfr.data[0, :, :, :], axis=0)
  146. plt.figure(figsize=(10, 6))
  147. plt.imshow(avg_data,
  148. aspect='auto',
  149. origin='lower',
  150. extent=[tfr.times[0], tfr.times[-1], freqs[0], freqs[-1]],
  151. cmap='jet')
  152. plt.axis('off')
  153. plt.savefig(os.path.join(morlet_dir, f"{self.idx}_{epoch_idx}_morlet.png"),
  154. bbox_inches='tight',
  155. pad_inches=0)
  156. plt.close()
  157. if __name__ == "__main__":
  158. import argparse
  159. parser = argparse.ArgumentParser(description='EEG Signal Processing Tool')
  160. parser.add_argument('--d', dest='data_dir', type=str, required=True,
  161. help='Raw data directory path')
  162. parser.add_argument('--config', type=str, default="config.yml",
  163. help='Config file path (default: config.yml)')
  164. args = parser.parse_args()
  165. output_dir = os.path.join(os.path.dirname(args.data_dir), f"{os.path.basename(args.data_dir)}_output")
  166. processor = EEGProcessor(
  167. data_dir=args.data_dir,
  168. output_dir=output_dir,
  169. config_path=args.config
  170. )
  171. processor.process_folder()

eeg_processor.py at commit 1c43f73, no license · at the source

Overview

Authors: Dong Xu1, Hao Li2, Zhenzhen Pan1, Xiaochuang Yuan1, Fan Yang1, Meifeng Huang1, Haiyan Li3,4
ORCID iDs: Dong Xu
  1. Department of Neuroelectrophysiology, Anyang People’s Hospital, Anyang, Henan China
  2. University of Electronic Science and Technology of China, Chengdu, Sichuan China
  3. Department of Neurology, Anyang People’s Hospital, Anyang, Henan China
  4. Anyang Key Laboratory of Precision Diagnosis and Treatment for Neuromuscular Diseases, Anyang People’s Hospital, Anyang, Henan, China
Journal: Scientific reports, volume 16, issue 1, article 23799
Dates: received 24 August 2025; accepted 15 May 2026; published online 25 May 2026
Type: Research article · Language: English
License: CC BY-NC-ND
Identifiers: DOI 10.1038/s41598-026-54785-6 · PMID 42185493 · PMCID PMC13434304 · OpenAlex W7162293797
Open access: gold, a free copy (OpenAlex)
Status: code verified
Categories: EEG (modality), human (organism), epilepsy (population), clinical / translational (subfield)
Methods: Spectral & time-frequency, Connectivity, Preprocessing, Statistics, Machine learning, Smoothing, state filtering, decompositions
Keywords: Nonconvulsive status epilepticus, Deep learning, EEG, Time–frequency analysis, Computational biology and bioinformatics, Engineering, Mathematics and computing, Neurology, Neuroscience
MeSH: Deep Learning*, Electroencephalography*, Status Epilepticus*, Algorithms, Convolutional Neural Networks, Humans (* major topic)
Topic: EEG and Brain-Computer Interfaces (Cognitive Neuroscience, Neuroscience), according to OpenAlex
Funding: Key Research and Development and promotion projects of Anyang (2023C01SF218); Joint Co-construction Project of Henan Medical Science and Technology Research Plan (LHGJ20240521, LHGJ20230857); National Health Commission Capacity Building and Continuing Education Center Program (2024SNKT11)
Citations: not cited yet (Europe PMC); 45 references in the paper

Abstract

The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.

Repository

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

xD-HAHA/NCSE

License: none: the authors keep all their rights
State: the link answers, verified on 28 September 2026
Evidence: files inventoried
Commit: 1c43f739614647f46204844d2381d6240504d400, 20 June 2026
Languages: Python (2)
Size: 4 files, 2 scripts
Software Heritage: not archived
Found in: “Code availability”
Holds: environment (requirements.txt)
Not found: README, license file, CITATION.cff, tests, continuous integration, documentation
Tools: Matplotlib (1 file), MNE-Python (1 file), NumPy (1 file), PyTorch (1 file), SciPy (1 file)
Availability: 1 check, the latest on 28 September 2026: the link answers
  • 28 September 2026: the link answers
2 files

Code availability statement

The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

Read it in the paper: doi.org/10.1038/s41598-026-54785-6.

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;
  • 2 scripts, each with its path and the digest of its content;
  • 3 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 paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:

  • it says that the data are available on request

Read it in the paper: doi.org/10.1038/s41598-026-54785-6.

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

Recorded: type, language, journal, volume, issue, pages, dates, 7 authors, 9 keywords, 6 MeSH terms, 3 funders, 40 references.

Cite

This paper

Xu, D., Li, H., Pan, Z., Yuan, X., Yang, F., Huang, M., & Li, H. (2026). Lightweight deep learning model for nonconvulsive status epilepticus diagnosis using EEG time-frequency analysis. Scientific reports, 16(1), 23799. https://doi.org/10.1038/s41598-026-54785-6

BibTeX

@article{xu2026lightweight,
author = {Xu, Dong and Li, Hao and Pan, Zhenzhen and Yuan, Xiaochuang and Yang, Fan and Huang, Meifeng and Li, Haiyan},
title = {{Lightweight deep learning model for nonconvulsive status epilepticus diagnosis using EEG time-frequency analysis}},
journal = {Scientific reports},
year = {2026},
month = may,
volume = {16},
number = {1},
pages = {23799},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/s41598-026-54785-6},
url = {https://doi.org/10.1038/s41598-026-54785-6},
pmid = {42185493},
pmcid = {PMC13434304}
}

RIS

TY - JOUR
AU - Xu, Dong
AU - Li, Hao
AU - Pan, Zhenzhen
AU - Yuan, Xiaochuang
AU - Yang, Fan
AU - Huang, Meifeng
AU - Li, Haiyan
TI - Lightweight deep learning model for nonconvulsive status epilepticus diagnosis using EEG time-frequency analysis
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/05/25
VL - 16
IS - 1
SP - 23799
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/s41598-026-54785-6
UR - https://doi.org/10.1038/s41598-026-54785-6
LA - en
ER -

CSL-JSON

{
"id": "10.1038/s41598-026-54785-6",
"type": "article-journal",
"title": "Lightweight deep learning model for nonconvulsive status epilepticus diagnosis using EEG time-frequency analysis",
"container-title": "Scientific reports",
"author": [
{
"family": "Xu",
"given": "Dong"
},
{
"family": "Li",
"given": "Hao"
},
{
"family": "Pan",
"given": "Zhenzhen"
},
{
"family": "Yuan",
"given": "Xiaochuang"
},
{
"family": "Yang",
"given": "Fan"
},
{
"family": "Huang",
"given": "Meifeng"
},
{
"family": "Li",
"given": "Haiyan"
}
],
"container-title-short": "Sci Rep",
"volume": "16",
"issue": "1",
"page": "23799",
"DOI": "10.1038/s41598-026-54785-6",
"PMID": "42185493",
"PMCID": "PMC13434304",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://doi.org/10.1038/s41598-026-54785-6",
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
25
]
]
}
}

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.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, SciPy, 2 other tools, EEG, 1 reference
[2] doi:10.1016/j.ebiom.2026.106375 [code]
Brainwaves under medication: revealing class-specific neural signatures of psychotropic medication from 24,000 EEGs.
Journal: EBioMedicine
In common: MNE-Python, SciPy, Matplotlib, 1 other tool, EEG, clinical / translational, 1 reference
[3] doi:10.1371/journal.pone.0343722 [code]
Comprehensive methodology for sample enrichment in EEG biomarker studies for Alzheimer's risk classification.
Journal: PloS one
In common: MNE-Python, SciPy, Matplotlib, 1 other tool, EEG, clinical / translational, 1 reference
[4] doi:10.2196/80286 [code]
At-Home Sleep Electroencephalography Assessment in Young and Older Adults Using a Novel Wireless Soft Electronics Sleep Monitoring System: Experimental Study.
Journal: JMIR formative research
In common: MNE-Python, SciPy, Matplotlib, 1 other tool, EEG, 1 reference
[5] doi:10.1002/mco2.70980 [code]
An Intraoperative EEG Biomarker for Postoperative Delirium Predicting Based on Interpretable Deep Learning Framework.
Journal: MedComm
In common: MNE-Python, PyTorch, SciPy, 2 other tools, EEG, clinical / translational
[6] 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, PyTorch, SciPy, 2 other tools, EEG, clinical / translational
[7] 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, SciPy, 2 other tools, EEG, clinical / translational
[8] doi:10.1162/imag.a.1190 [code]
Canonical Hidden Markov Model Networks for studying M/EEG.
Journal: Imaging neuroscience (Cambridge, Mass.)
In common: MNE-Python, SciPy, Matplotlib, 1 other tool, EEG, 1 reference
[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, SciPy, 2 other tools, EEG
[10] doi:10.1371/journal.pone.0351872 [code]
Decoding visual object recognition from EEG signals.
Journal: PloS one
In common: MNE-Python, PyTorch, SciPy, 2 other tools, EEG

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.