Lightweight deep learning model for nonconvulsive status epilepticus diagnosis using EEG time-frequency analysis.
2 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 3 matches
- [1] § Materials and methods › Hilbert-Huang transform ↔ eeg_processor.py, lines 49 to 192 · score 0.71 · instantaneous phase, instantaneous amplitude, instantaneous frequency, Hilbert, signal · block
oscr:b:FFKKDFA3E7Z1J-D· Report a mismatch - [2] § Materials and methods › Deep learning model ↔ main.py, lines 156 to 257 · score 0.62 · channel reduction, expansion, devices, activation, convolutional, efficient · block
oscr:b:2C0YBSFX6TM0B-U· Report a mismatch - [3] § Materials and methods › Hilbert-Huang transform ↔ eeg_processor.py, lines 49 to 192 · score 0.57 · instantaneous amplitude, Hilbert, IMF, EMD, HHT · block
oscr:b:FFKKDFA3E7Z1J-D· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: 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.3389/fneur.2026.1726258 [code]
- Deep learning-based real-time seizure detection and multi-seizure classification on pediatric EEG.Journal: Frontiers in neurologyIn common: MNE-Python, PyTorch, SciPy, 2 other tools, epilepsy, EEG, clinical / translational, 1 reference
- [2] doi:10.1590/0004-282x-anp-2022-s113
- Status epilepticus: review on diagnosis, monitoring and treatment.Journal: Arquivos de neuro-psiquiatriaIn common: epilepsy, EEG, clinical / translational, 3 references
- [3] doi:10.1371/journal.pdig.0000890 [code]
- Short-horizon neonatal seizure prediction using EEG-based deep learning.Journal: PLOS digital healthIn common: MNE-Python, PyTorch, SciPy, 2 other tools, epilepsy, EEG, 1 reference
- [4] doi:10.1088/1741-2552/aeb331 [code]
- GROND: automated characterization of periodic and rhythmic EEG patterns.Journal: Journal of neural engineeringIn common: MNE-Python, PyTorch, SciPy, 2 other tools, EEG, 1 reference
- [5] 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
- [6] doi:10.1038/s41598-025-18479-9 [code]
- Epileptic seizure detection from electroencephalogram signals based on 1D CNN-LSTM deep learning model using discrete wavelet transform.Journal: Scientific reportsIn common: MNE-Python, SciPy, Matplotlib, 1 other tool, epilepsy, EEG, 1 reference
- [7] doi:10.1371/journal.pcbi.1011395 [code]
- Switching state-space modeling of neural signal dynamics.Journal: PLoS computational biologyIn common: MNE-Python, PyTorch, SciPy, 2 other tools, 1 reference
- [8] doi:10.3389/fnins.2023.1176551 [code]
- A two-branch trade-off neural network for balanced scoring sleep stages on multiple cohorts.Journal: Frontiers in neuroscienceIn common: MNE-Python, PyTorch, SciPy, 2 other tools, 1 reference
- [9] 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
- [10] 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
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:9df5120f6a136552…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41598-026-54785-6)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41598-026-54785-6.svg
:target: https://openscicode.org/badge/doi/10.1038/s41598-026-54785-6
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41598-026-54785-6"><img src="https://openscicode.org/badge/doi/10.1038/s41598-026-54785-6.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge 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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
