MMFNet: A multi-branch multi-scale framework with adaptive sparse self-attention and cross-modal fusion for sleep stage assessment.
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 · 51 lines · 1.6 KB · no license
- import os
- import numpy as np
- import re
- from scipy.io import savemat
- directory = 'C:/Users/Smart/Desktop/AttnSleep-main/prepare_datasets/edf_78'
- files = [f for f in os.listdir(directory) if re.match(r'SC4\d{3}([EFG]0)\.npz', f)]
- file_groups = {}
- for file in files:
- match = re.match(r'SC4(\d{3})([EFG]0)\.npz', file)
- if match:
- group_key = int(match.group(1)) // 10
- if group_key not in file_groups:
- file_groups[group_key] = []
- file_groups[group_key].append(file)
- for group_key, group_files in file_groups.items():
- if len(group_files) == 2:
- group_files.sort()
- data1 = np.load(os.path.join(directory, group_files[0]))
- data2 = np.load(os.path.join(directory, group_files[1]))
- tmp1 = data1['x']
- tmp1_label = data1['y']
- tmp2 = data2['x']
- tmp2_label = data2['y']
- data = np.transpose(np.concatenate((tmp1,tmp2),axis=0),axes=(0,2,1))
- data = data[:,1:5,:]
- label = np.concatenate((tmp1_label,tmp2_label),axis=0).reshape(-1, 1)
- print(f"merge {group_files[0]} and {group_files[1]} succedd")
- else:
- data1 = np.load(os.path.join(directory, group_files[0]))
- tmp1 = data1['x']
- tmp1_label = data1['y']
- data = np.transpose(tmp1,axes=(0,2,1))
- data = data[:,1:5,:]
- label = tmp1_label.reshape(-1, 1)
- output_filename = f'C:/Users/Smart/Desktop/AttnSleep-main/prepare_datasets/edf_78_mat/{group_files[0][:-7]}.mat'
- savemat(output_filename, {
- "data": data,
- "label": label
- })
- print("final")
convert_mat.py, no license · at the source
Overview
- School of Physics and Electronic-Electrical Engineering, ABA Teachers College, Aba Tibetan and Qiang Autonomous Prefecture, Sichuan, China
Abstract
Accurate sleep stage classification serves as a crucial foundation for sleep health assessment and disease diagnosis. However, existing approaches still encounter several challenges, including limited feature representation, redundancy in extracted information, and difficulties in effectively integrating cross-modal physiological signals. To address these issues, we propose a novel framework entitled Multi-Branch Multi-Scale Fusion with Adaptive Sparse Self-Attention and Cross-Modal Integration (MFFNet). Specifically, considering the prominent time-frequency characteristics of sleep signals, multiple branches are designed to capture multi-scale information, including a time-granular feature extraction branch and a time-frequency extraction branch. Furthermore, a multi-head adaptive sparse self-attention mechanism is introduced to suppress redundant information while emphasizing discriminative features. In addition, we employ an adaptive cross-modal fusion strategy that dynamically integrates information from EEG and EOG, and further visualize the contribution of each modality to sleep stage classification. Experiments conducted on the Sleep-EDF-39 and Sleep-EDF-153 datasets demonstrate the effectiveness of the proposed approach. Using the Fpz-Cz EEG channel and EOG signals, MFFNet achieves accuracy rates of 84.26% and 81.86%, with F1 scores of 75.91% and 73.38%, respectively, highlighting its competitive performance in sleep stage assessment.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
OSF tmjbk
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
3 files
- Code/
convert_mat.py , Python, 51 lines - Code/
dhedfreader.py , Python, 209 lines - Code/
rename.py , Python, 28 lines
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:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 3 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
Datasets cited
- physionet.org/
content/ , at PhysioNet; found in “Data Availability”sleep-edfx
Data Availability
All data used in this study are from publicly available datasets. The Sleep-EDF-39 and Sleep-EDF-153 datasets are available from the Sleep-EDF Database Expanded on PhysioNet at https://
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, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 7 MeSH terms, 27 references.
Cite
This paper
Li, Y., & Wang, N. (2026). MMFNet: A multi-branch multi-scale framework with adaptive sparse self-attention and cross-modal fusion for sleep stage assessment. PloS one, 21(7), e0353930. https://
BibTeX
@article{li2026mmfnet,
author = {Li, Yuan and Wang, Ningning},
title = {{MMFNet: A multi-branch multi-scale framework with adaptive sparse self-attention and cross-modal fusion for sleep stage assessment}},
journal = {PloS one},
year = {2026},
month = jul,
volume = {21},
number = {7},
pages = {e0353930},
publisher = {PLOS},
issn = {1932-6203},
doi = {10.1371/
url = {https://
pmid = {42467718},
pmcid = {PMC13378990}
}
RIS
TY - JOUR
AU - Li, Yuan
AU - Wang, Ningning
TI - MMFNet: A multi-branch multi-scale framework with adaptive sparse self-attention and cross-modal fusion for sleep stage assessment
T2 - PloS one
J2 - PLoS One
PY - 2026
DA - 2026/
VL - 21
IS - 7
SP - e0353930
SN - 1932-6203
PB - PLOS
DO - 10.1371/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1371/
"type": "article-journal",
"title": "MMFNet: A multi-branch multi-scale framework with adaptive sparse self-attention and cross-modal fusion for sleep stage assessment",
"container-title": "PloS one",
"author": [
{
"family": "Li",
"given": "Yuan"
},
{
"family": "Wang",
"given": "Ningning"
}
],
"container-title-short":
"volume": "21",
"issue": "7",
"page": "e0353930",
"DOI": "10.1371/
"PMID": "42467718",
"PMCID": "PMC13378990",
"ISSN": "1932-6203",
"publisher": "PLOS",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
17
]
]
}
}
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/diagnostics16162609
- Automated Multimodal Sleep Staging Using DWT-Based Wavelet Decomposition and Explainable Machine Learning with Signal Sculpting Topographies.Journal: Diagnostics (Basel, Switzerland)In common: physionet.org/content/sleep-edfx, methods / tools, EEG, 5 references
- [2] doi:10.3390/brainsci16080793
- Disentangling EEG Fingerprinting and Sleep Biomarkers Using Generalized Weighted Ordinal Patterns.Journal: Brain sciencesIn common: physionet.org/content/sleep-edfx, EEG, 2 references
- [3] doi:10.1007/s00422-026-01049-1 [code]
- A three-component dynamical index of consciousness-related neural organisation.Journal: Biological cyberneticsIn common: SciPy, NumPy, physionet.org/content/sleep-edfx, EEG
- [4] doi:10.1038/s41598-026-48881-w
- SleepPACNet: new convolutional neural network considering phase-amplitude coupling for automatic sleep stage classification using single-channel electroencephalogram.Journal: Scientific reportsIn common: EEG, 3 references
- [5] doi:10.3390/s26134091
- Hypnogram-Driven Automatic Sleep Staging and a Quality-Index Assessment Through a Two-Stage LSTM-DNN Ensemble Learning Approach Using Multi-Biosignal Features for Sleep Disorder Detection.Journal: Sensors (Basel, Switzerland)In common: methods / tools, EEG, 2 references
- [6] doi:10.1371/journal.pone.0346294
- Neural network architectures and normalization techniques for automated sleep stage classification using rodent EEG and EMG signals.Journal: PloS oneIn common: methods / tools, EEG, 2 references
- [7] doi:10.1038/s41598-026-68186-2 [code]
- NeuroStream: spectral-spatio-temporal
deep learning for visual stimulus classification from EEG. Journal: Scientific reportsIn common: SciPy, NumPy, methods / tools, EEG, 1 reference - [8] doi:10.1371/journal.pone.0352191 [code]
- Bayesian Uncertainty-aware Deep Learning with noisy labels: Tackling annotation ambiguity in EEG seizure detection.Journal: PloS oneIn common: SciPy, NumPy, methods / tools, EEG, 1 reference
- [9] 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: SciPy, NumPy, EEG, 1 reference
- [10] doi:10.1093/sleepadvances/zpag044 [code]
- REST-a deep learning tool for automated mouse sleep stage classification.Journal: Sleep advances : a journal of the Sleep Research SocietyIn common: SciPy, NumPy, 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.
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, 3 scripts, and 0 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:943ba9aedeb451da…
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
[.
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.
