Lightweight deep learning model for nonconvulsive status epilepticus diagnosis using EEG time-frequency analysis.
The 3 matches
- [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] § Materials and methods › Deep learning model ↔ main.py, lines 156–257 · score 0.62 · channel reduction, expansion, devices, activation, convolutional, efficient
- [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
- import mne
- from mne.time_frequency import EpochsTFRArray
- import numpy as np
- import os
- from scipy import signal
- from PyEMD import EMD
- import matplotlib.pyplot as plt
- import matplotlib
- matplotlib.use('Agg')
- class EEGProcessor:
- def __init__(self, data_dir, output_dir, config_path="config.yml"):
- self.data_dir = data_dir
- self.output_dir = output_dir
- os.makedirs(output_dir, exist_ok=True)
- self.config = self._load_config(config_path)
- self.segment_length = self.config['global']['segment_length']
- self.overlap = self.config['global']['overlap']
- def _load_config(self, config_path):
- import yaml
- with open(config_path, 'r', encoding='utf-8') as f:
- return yaml.safe_load(f)
- def _segment_data(self, raw):
- epochs = mne.make_fixed_length_epochs(
- raw,
- duration=self.segment_length,
- preload=True,
- overlap=self.overlap,
- verbose=False
- )
- return epochs
- def process_folder(self):
- fif_files = [f for f in os.listdir(self.data_dir) if f.endswith('.fif')]
- for idx, fname in enumerate(fif_files, 1):
- seq_dir = self.output_dir
- self.idx = idx
- raw = mne.io.read_raw(os.path.join(self.data_dir, fname), preload=True)
- self.epochs = self._segment_data(raw)
- for i, epoch in enumerate(self.epochs):
- self.generate_spectrograms(i, f"{fname}_seg{i}", seq_dir)
- def generate_spectrograms(self, epoch_idx, prefix, seq_dir):
- current_epoch = self.epochs[epoch_idx]
- fs = self.epochs.info['sfreq']
- if self.config.get('multitaper', {}).get('enable', False):
- multitaper_dir = os.path.join(seq_dir, 'multitaper')
- os.makedirs(multitaper_dir, exist_ok=True)
- config = self.config['multitaper']
- freqs = np.logspace(*np.log10(config['freqs_range']),
- num=config['num_freqs'])
- n_cycles = config['n_cycles']
- time_bandwidth = config.get('time_bandwidth', 4.0)
- single_epoch = mne.EpochsArray(
- data=current_epoch.get_data(),
- info=self.epochs.info
- )
- tfr = single_epoch.compute_tfr(
- method="multitaper",
- freqs=freqs,
- n_cycles=n_cycles,
- time_bandwidth=time_bandwidth,
- return_itc=False,
- average=False,
- n_jobs=-1
- )
- avg_data = np.mean(tfr.data[0, :, :, :], axis=0)
- plt.figure(figsize=(10, 6))
- plt.imshow(avg_data,
- aspect='auto',
- origin='lower',
- extent=[tfr.times[0], tfr.times[-1], freqs[0], freqs[-1]],
- cmap='jet')
- plt.axis('off')
- plt.savefig(os.path.join(multitaper_dir, f"{self.idx}_{epoch_idx}_multitaper.png"),
- bbox_inches='tight',
- pad_inches=0)
- plt.close()
- if self.config.get('hht', {}).get('enable', False):
- hht_root_dir = os.path.join(seq_dir, 'hht')
- os.makedirs(hht_root_dir, exist_ok=True)
- data = current_epoch.get_data()
- if data.shape[0] == 1:
- data = data[0]
- all_ch_hht = []
- for ch_idx in range(data.shape[0]):
- emd = EMD()
- imfs = emd(data[ch_idx])
- all_freqs = []
- all_amps = []
- time_points_list = []
- for i, imf in enumerate(imfs):
- analytic_signal = signal.hilbert(imf)
- instantaneous_phase = np.unwrap(np.angle(analytic_signal))
- instantaneous_frequency = (np.diff(instantaneous_phase) /
- (2.0*np.pi) * fs)
- instantaneous_amplitude = np.abs(analytic_signal)[:-1]
- current_time_points = np.arange(len(instantaneous_frequency))/fs
- time_points_list.append(current_time_points)
- all_freqs.append(instantaneous_frequency)
- all_amps.append(instantaneous_amplitude)
- combined_freqs = np.concatenate(all_freqs)
- combined_amps = np.concatenate(all_amps)
- time_points = np.concatenate(time_points_list)
- n_bins = 200
- freq_bins = np.linspace(0, self.config['hht'].get('freq_range', [0, 50])[1], n_bins)
- time_bins = np.linspace(0, self.segment_length, n_bins)
- valid_mask = (combined_freqs >= 0) & (combined_freqs <= freq_bins[-1])
- hist, xedges, yedges = np.histogram2d(
- time_points[valid_mask],
- combined_freqs[valid_mask],
- bins=[time_bins, freq_bins],
- weights=combined_amps[valid_mask]
- )
- all_ch_hht.append(hist)
- avg_hht = np.mean(np.array(all_ch_hht), axis=0)
- plt.figure(figsize=(10, 6))
- plt.pcolormesh(xedges, yedges, avg_hht.T, cmap='jet')
- plt.ylim(self.config['hht'].get('freq_range', [0, 50]))
- plt.xticks([])
- plt.yticks([])
- plt.gca().set_xticklabels([])
- plt.gca().set_yticklabels([])
- plt.gca().axis('off')
- plt.savefig(os.path.join(hht_root_dir, f"{self.idx}_{epoch_idx}_hht.png"),
- bbox_inches='tight',
- pad_inches=0)
- plt.close()
- if self.config.get('morlet', {}).get('enable', False):
- morlet_dir = os.path.join(seq_dir, 'morlet')
- os.makedirs(morlet_dir, exist_ok=True)
- single_epoch = mne.EpochsArray(
- data=current_epoch.get_data(copy=False),
- info=self.epochs.info
- )
- config = self.config['morlet']
- freqs = np.logspace(*np.log10(config['freqs_range']),
- num=config['num_freqs'])
- n_cycles = config['n_cycles']
- tfr = single_epoch.compute_tfr(
- method="morlet",
- freqs=freqs,
- n_cycles=n_cycles,
- return_itc=False,
- average=False,
- n_jobs=-1
- )
- avg_data = np.mean(tfr.data[0, :, :, :], axis=0)
- plt.figure(figsize=(10, 6))
- plt.imshow(avg_data,
- aspect='auto',
- origin='lower',
- extent=[tfr.times[0], tfr.times[-1], freqs[0], freqs[-1]],
- cmap='jet')
- plt.axis('off')
- plt.savefig(os.path.join(morlet_dir, f"{self.idx}_{epoch_idx}_morlet.png"),
- bbox_inches='tight',
- pad_inches=0)
- plt.close()
- if __name__ == "__main__":
- import argparse
- parser = argparse.ArgumentParser(description='EEG Signal Processing Tool')
- parser.add_argument('--d', dest='data_dir', type=str, required=True,
- help='Raw data directory path')
- parser.add_argument('--config', type=str, default="config.yml",
- help='Config file path (default: config.yml)')
- args = parser.parse_args()
- output_dir = os.path.join(os.path.dirname(args.data_dir), f"{os.path.basename(args.data_dir)}_output")
- processor = EEGProcessor(
- data_dir=args.data_dir,
- output_dir=output_dir,
- config_path=args.config
- )
- processor.process_folder()
eeg_processor.py at commit 1c43f73, no license · at the source
Overview
- Department of Neuroelectrophysiology, Anyang People’s Hospital, Anyang, Henan China
- University of Electronic Science and Technology of China, Chengdu, Sichuan China
- Department of Neurology, Anyang People’s Hospital, Anyang, Henan China
- Anyang Key Laboratory of Precision Diagnosis and Treatment for Neuromuscular Diseases, Anyang People’s Hospital, Anyang, Henan, China
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
1c43f739614647f46204844d2381d6240504d400, 20 June 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
2 files
- eeg_processor.py, Python, 211 lines, 2 matches
- main.py, Python, 833 lines, 1 match
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:
- it points to the authors' code: xD-HAHA/
NCSE
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://
BibTeX
@article{xu2026lightweig
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/
url = {https://
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/
VL - 16
IS - 1
SP - 23799
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"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":
"volume": "16",
"issue": "1",
"page": "23799",
"DOI": "10.1038/
"PMID": "42185493",
"PMCID": "PMC13434304",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://
"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 processingIn 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: EBioMedicineIn 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 oneIn 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 researchIn 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: MedCommIn 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 mappingIn 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 medicineIn 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 oneIn 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.
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: 1 repository of the authors' code, each at its verified commit and with its license, 2 scripts, and 3 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:b8f638928b4ce848…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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.
