An OSA Sleep Staging Enhancement Method and System Based on Multi-Scale Width Learning

CN122556904APending Publication Date: 2026-08-14FOURTH MILITARY MEDICAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0011]本发明的目的在于克服现有技术不足,提供一种基于多尺度宽度学习的OSA睡眠分期增强系统及方法,通过PSG与SpO2多模态双向交互、标签平衡宽度学习(LBBLS)、长短程双分支上下文融合、动态上下文收紧机制,解决了现有技术中OSA患者睡眠分期准确率低、样本不平衡、模型不可解释、部署成本高的问题,实现睡眠分期与OSA检测的相互增强

Benefits of technology

本发明通过获取待测对象的多导睡眠图信号和血氧饱和度信号。该步骤通过同时采集多导睡眠图和血氧饱和度信号,为后续融合分析提供了多模态生理数据基础,使得模型能够利用血氧信息捕捉OSA事件导致的睡眠结构变化,从而从根本上解决了单一信号源对OSA患者分期信息不足的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122556904A_ABST
    Figure CN122556904A_ABST
Patent Text Reader

Abstract

This invention discloses an OSA sleep staging enhancement method and system based on multi-scale width learning, aiming to solve problems such as low accuracy of sleep staging in OSA patients, sample imbalance, single modality, poor interpretability of deep learning models, and difficulty in clinical deployment in existing technologies. This invention acquires polysomnography and blood oxygen saturation signals, and after filtering for artifact removal, downsampling, and temporal slicing preprocessing, extracts matching sleep staging features and OSA detection features, which are then input into a pre-trained OSABLSleep model to achieve bidirectional enhancement inference. This model adopts a multimodal bidirectional interactive architecture, using long- and short-range bi-branch fusion, label-balanced width learning, and dynamic context tightening to enhance sleep staging in OSA patients. This invention can significantly improve the accuracy of sleep staging in severe OSA patients, alleviate the class imbalance problem, has strong interpretability, requires only a CPU for deployment, and has high clinical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of sleep stage segmentation technology in artificial intelligence, and in particular to an enhanced method and system for OSA (Obstructive Sleep Apnea) sleep staging based on multi-scale width learning. Background Technology

[0002] Sleep is a fundamental physiological activity, occupying one-third of a human lifespan. Sleep quality is closely related to physical and mental health. Sleep not only eliminates fatigue from daytime activities but also allows the brain and various organs of the body to relax and repair. However, with the increasingly fast pace of modern life and rising stress levels, sleep duration and quality are gradually declining. Reduced sleep quality not only affects brain function but also leads to physiological dysfunction, resulting in a sub-healthy state and even triggering a series of sleep-related diseases such as hypertension, heart disease, and depression. Among various sleep disorders, SAS (Sleep Apnea Syndrome) is the most common and has the highest incidence rate. The 2024 China Sleep Research Report indicates that over 53% of respondents were at high risk of sleep apnea. Even more serious is the situation among those born in the 1990s and 2000s, with 33% of respondents in this age group facing a high risk of sleep apnea.

[0003] In sleep research, sleep is divided into two physiological stages based on different physiological characteristics: REM (Rapid Eye Movement) sleep and NREM (Non-Rapid Eye Movement) sleep. NREM is further divided into three stages: NREM-I, NREM-II, and NREM-III. Sleep quality is assessed by determining the proportion of different sleep stages an individual experiences throughout the night relative to their total sleep time. Sleep staging is based on overnight polysomnography (PSG), which records signals generated during sleep, including EEG (electroencephalogram), a pair of EOGs (horizontal electrooculogram), EMG (chin electromyogram), and other physical signals. The most commonly used staging standard is the American Academy of Sleep Medicine (AAM) manual. According to its staging rules, PSG is divided into 30-second epochs, defining four sleep stages: REM sleep and NREM 1, NREM 2, and NREM 3. Sleep stages are defined by specific features extracted from PSG signals. Typically, N3 is defined as the presence of more than 6 slow waves in a 30s EEG, N2 is defined as the presence of the spindle and K complex in the EEG, and similarly, REM is defined as conjugate REM and low-amplitude EMG in the EEG. REM and NREM stages form 4-5 cycles throughout the night, each cycle lasting approximately 1.5 hours. This periodicity is an important component of the human circadian rhythm.

[0004] However, traditional sleep staging is a tedious and time-consuming task. Typically, sleep experts need 2-3 hours to complete a full night's sleep gestation (PSG) segmentation, which includes 8-10 hours of signal. Furthermore, the low score consistency (~83%) and low intra-score consistency (~90%) among experts on the same sleep record, influenced by expert subjectivity, also limit the widespread adoption of sleep staging. Therefore, promoting AI-based automatic sleep stage segmentation is essential for its widespread adoption.

[0005] Furthermore, the inaccurate staging results caused by sleep structure changes due to various diseases, especially OSA interference, remain one of the pain points and core challenges of automatic sleep stage segmentation methods, causing difficulties for doctors. The severity of OSA patients is determined by their gold standard apnea-hypopnea index (AHI), ranging from mild OSA (Mild OSD) to moderate OSA (Moderate OSA) and severe OSA (Severe OSA). While existing OSA-related studies have investigated the sleep staging status of OSA patients, demonstrating the significant impact of OSA on staging results, they have not further explored how to improve the staging accuracy of OSA patients, nor have they proposed solutions to the problems existing in clinical practice.

[0006] Traditional automatic sleep stage segmentation is performed by human experts following the AASM manual, visually observing PSG signals (including 3-channel EEG, 2-channel EEG, and 1-channel mandibular muscle EEG) characteristics, dividing the signals into 30-second epochs, and identifying the stage of each epoch. The discrimination criteria in the AASM manual determine a sleep stage based on the state of different signals, and have a sound theoretical basis. Therefore, sleep stages segmented by human experts are considered the gold standard for automatic sleep stage segmentation. However, there is currently no program specifically designed to enhance sleep staging for OSA patients.

[0007] Currently, offline automatic sleep slow-wave detection algorithms on the market can be categorized into two types. For example, Chinese patent CN114668373A uses a sleep stage classification method based on dynamic mode decomposition. It uses single-channel EEG and EEG signals, performs dynamic mode decomposition on them, then shares and encapsulates them into several feature elements and generates a feature power spectrum. Finally, it constructs a random forest model for sleep stage segmentation. Because EEG and EEG signals are nonlinear random signals, and the random forest model lacks the ability to extract contextual features from linear signals, its performance is significantly inferior to similar deep learning models. It does not focus on the sleep staging of OSA patients.

[0008] Meanwhile, for example, Chinese patent CN112869711A preprocesses EEG and EOG signal segments and inputs them as one-dimensional signals into two CNNs of the model. After multi-layer feature extraction and activation, features are extracted from the EEG and EOG signals respectively. Then, a bidirectional LSTM network is used to extract contextual features, and finally, an FC layer and a softmax layer are used to obtain the classification result. Although this method has high accuracy, its acceptance in clinical practice is low because the deep features extracted based on CNNs lack reliable clinical interpretation. Furthermore, since deep learning relies on GPU computation, it is difficult to implement in hospital and other application scenarios. It also does not focus on the sleep staging of OSA patients.

[0009] In summary, existing automatic installment payment methods have the following insurmountable drawbacks: 1. The staging accuracy of OSA patients is significantly low: OSA causes fragmentation of sleep structure, and the staging accuracy decreases significantly with the increase of AHI, with the error being particularly prominent in patients with severe OSA; 2. The problem of imbalanced samples remains unresolved: samples for classes such as Wake, N1, and N3 are sparse, and traditional models have poor ability to identify minority classes; 3. Lack of multimodal interaction enhancement mechanism: Blood oxygen saturation (SpO2) and PSG signal are not fused bidirectionally, making it impossible to use OSA event information to correct staging results; 4. Poor clinical adaptability of deep learning models: They rely on GPU computing power and their features are not interpretable, making them difficult to deploy at low cost in hospital settings; 5. No dedicated staged enhancement scheme for OSA: Existing algorithms are all designed for healthy individuals and have not been specifically optimized for sleep disorders caused by OSA.

[0010] Therefore, developing a high-precision, interpretable, lightweight method for enhancing sleep staging in OSA patients has become an urgent need in the fields of sleep medicine and intelligent diagnosis. Summary of the Invention

[0011] The purpose of this invention is to overcome the shortcomings of existing technologies and provide an OSA sleep staging enhancement system and method based on multi-scale width learning. Through PSG and SpO2 multimodal bidirectional interaction, label balanced width learning (LBBLS), long and short-range bi-branch context fusion, and dynamic context tightening mechanism, this invention solves the problems of low accuracy of sleep staging in OSA patients, sample imbalance, uninterpretable models, and high deployment costs in existing technologies, and achieves mutual enhancement of sleep staging and OSA detection.

[0012] In a first aspect, the present invention provides an OSA sleep staging enhancement method based on multi-scale width learning, comprising: Acquire polysomnography and blood oxygen saturation signals of the subject under test; The polysomnography signal and the blood oxygen saturation signal are preprocessed to obtain time-aligned preprocessed polysomnography signal and preprocessed blood oxygen saturation signal. Feature extraction was performed on the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal to obtain sleep stage features and OSA detection features; A pre-trained OSABLSleep model is used to process the sleep stage features and OSA detection features to obtain sleep stage classification results and OSA event detection results. The OSABLSleep model includes a sleep stage unit and an OSA detection unit. The sleep stage unit is used to fuse the sleep stage features to obtain sleep stage classification results. The OSA detection unit is used to sequentially process the OSA detection features to obtain OSA event detection results.

[0013] Secondly, the present invention provides an OSA sleep staging enhancement system based on multi-scale width learning, comprising: The signal acquisition module is used to acquire the polysomnography signal and blood oxygen saturation signal of the subject under test; The preprocessing module is used to preprocess the polysomnography signal and the blood oxygen saturation signal to obtain time-aligned preprocessed polysomnography signal and preprocessed blood oxygen saturation signal. The feature extraction module is used to extract features from the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal to obtain sleep stage features and OSA detection features. The OSABLSleep model is used to process the sleep stage features and OSA detection features using a pre-trained OSABLSleep model, obtaining sleep stage classification results and OSA event detection results; wherein... The OSABLSleep model is used to process the sleep stage features and OSA detection features using a pre-trained OSABLSleep model, obtaining sleep stage classification results and OSA event detection results. The OSABLSleep model includes a sleep stage unit and an OSA detection unit. The sleep stage unit performs a two-branch fusion process of long-range and short-range context on the sleep stage features to obtain sleep stage classification results. The OSA detection unit performs sequential processing on the OSA detection features to obtain OSA event detection results.

[0014] One or more technical solutions provided in this invention have at least the following technical effects or advantages: This invention acquires polysomnography (PSG) signals and blood oxygen saturation signals from the subjects under test. This step, by simultaneously acquiring PSG and blood oxygen saturation signals, provides a multimodal physiological data foundation for subsequent fusion analysis, enabling the model to use blood oxygen information to capture sleep structure changes caused by OSA events. This fundamentally solves the problem of insufficient information on OSA patient staging from a single signal source.

[0015] Polysomnography (PSG) and blood oxygen saturation (OOS) signals were preprocessed to obtain preprocessed signals. A pre-trained OSABLSleep model was then used to process the features, yielding sleep stage classification results and OSA event detection results, thus enhancing the accuracy of sleep stage segmentation in OSA patients. Specifically, the sleep staging unit employs a dual-branch fusion structure of long-range and short-range context, simultaneously capturing global temporal dependencies and local details. This is further enhanced by interacting with the event results output by the OSA detection unit, effectively overcoming sleep fragmentation interference caused by OSA and significantly improving the accuracy of sleep staging in patients with severe OSA. The OSA detection unit further improves the detection rate of respiratory events by sequentially processing and fusing sleep staging feedback. The entire model is based on a wide-range learning system, offering advantages such as strong interpretability, support for incremental learning, and the ability to be trained and deployed using only a CPU, meeting the practical needs of low cost and high robustness in clinical practice. Attached Figure Description

[0016] Figure 1 A flowchart illustrating the steps of the OSA sleep staging enhancement method based on multi-scale width learning provided in this embodiment of the invention; Figure 2 This is a module architecture diagram of an automatic sleep stage division system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of OSABLSleep provided in an embodiment of the present invention; Figure 4 A schematic diagram of the structure of LBBLS provided in an embodiment of the present invention; Figure 5 A comparison diagram of OSABLSleep and a model using only MSBLS provided for embodiments of the present invention; Figure 6 A comparison chart of the results of OSABLSleep provided in this embodiment of the invention and a model that does not perform context compression on samples related to sleep breathing events; Figure 7 This is a comparison chart of the weighted features of different modules in each stage of OSABLSleep provided in this embodiment of the invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0018] In a first aspect, this invention provides an OSA sleep staging enhancement method based on multi-scale width learning, see [link to relevant documentation]. Figure 1 and Figure 2 This includes the following steps S101 to S104.

[0019] S101, acquire the polysomnography signal and blood oxygen saturation signal of the subject under test; For example, S102, preprocess the polysomnography signal and blood oxygen saturation signal to obtain the preprocessed time-aligned polysomnography signal and the preprocessed blood oxygen saturation signal; Specifically, in step S102, the polysomnography signal and the blood oxygen saturation signal are preprocessed to obtain the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal, including the following steps S1021 to S1026.

[0020] S1021, extracts the electroencephalogram (EEG) channels of the frontal, central and occipital regions, the horizontal electrooculogram (EOG) channel, and the mandibular electromyography (EMG) channel from the polysomnography signal, and performs differential processing on the mandibular EMG channel to obtain a composite EMG signal. S1022, Remove invalid channels whose outlier ratio exceeds a preset threshold; S1023 performs power frequency notch filtering and bandpass filtering on EEG and EEG signals, high-pass filtering on EMG signals, and low-frequency bandpass filtering on blood oxygen saturation signals. S1024, independent component analysis was used to separate and remove electrooculogram artifacts from EEG signals; S1025 downsamples all channel signals to the same sampling rate; S1026 divides the downsampled signal into multiple time-domain segments according to a preset duration, and performs synchronous slicing on the blood oxygen saturation signal to align the two signals in the time domain.

[0021] For example, firstly, the preprocessing module extracts the required signals and performs artifact removal, filtering, and signal slicing preprocessing; secondly, the feature extraction module extracts features from different signals, divides them into training, validation, and test sets, and normalizes them; then, OSA events are detected using SpO2 signal features, and the results are sent to the stage segmentation model for processing. Similarly, the stage segmentation results are input into the OSA detection model, and the features of the two models are fused together to obtain the final sleep staging and OSA detection results.

[0022] Typically, the PSG data used for automatic sleep stage segmentation is in .edf files. First, three-channel electroencephalogram (EEG) signals (C4, F4, O2), two-channel electroophthalmogram (EOG) signals (EOG1 (left eye) and EOG2 (right eye)), and two-channel electromyogram (EMG) signals (CHINZ and CHIN1) are extracted from the .edf file. The CHIN signal is obtained by subtracting CHINZ from CHIN1, and the corresponding sampling rate is extracted from its header file. Second, the signals are examined, and any outliers (more than 3 times the signal mean ± standard deviation) exceeding one-third of the total night's data length are checked. The signals were deemed invalid and removed from the data space. Butterworth filters were then applied to each channel. First, EEG and EOS signals were subjected to a 50Hz notch filter, followed by a 0.3-35Hz bandpass filter. Mandibular EMG signals were subjected to a 10-100Hz bandpass filter. If the EMG signal sampling rate was less than 200Hz, it was considered a non-standard PSG signal and was sampled at 10-fs / 2 (fs being the EMG signal sampling rate). Independent component analysis (ICA) was used to remove EMG artifacts. Each channel was then resampled and uniformly downsampled to 128Hz. Finally, starting from the time the lights were turned off, all signals were divided into 30-second epochs, and signals shorter than 30 seconds at the end of the PSG were discarded. Similarly, SpO2 signals were processed accordingly, with the filtering range adjusted to 0.1-0.4Hz and the sampling rate set to 1Hz, and then sliced ​​accordingly.

[0023] S103, feature extraction is performed on the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal to obtain sleep stage features and OSA detection features; Specifically, in step S103, feature extraction is performed on the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal to obtain sleep stage features and OSA detection features, including the following steps S1031 to S1033.

[0024] S1031. For the EEG, EOS and EMG signals in the preprocessed polysomnography signal, extract the time-domain statistical features, nonlinear features, wavelet packet decomposition coefficients and reconstructed signal features, as well as the correlation and KL divergence features between multiple channels, and splice and normalize them to obtain the signal feature matrix. S1032, Extract demographic information of the subject to be tested, and combine the signal feature matrix with the demographic information to form sleep stage features; S1033 extracts the maximum, minimum, mean, standard deviation, power spectral density, and nonlinear dynamic characteristics from the preprocessed blood oxygen saturation signal and combines them into OSA detection features.

[0025] For example, the features extracted from the signals fall into three categories: first, general features extracted from all channels; second, wavelet features extracted from EEG signals; and third, relationship features between signals. Specifically, general features are extracted from EEG, EOS, and EMG signals. These general features include temporal features and nonlinear features. Temporal features include signal mean, standard deviation, median, kurtosis, and divergence. Nonlinear features include information entropy, sample entropy, permutation entropy, fractal dimension, zero-crossing rate, and Hjorth parameters (Hjorth activity, Hjorth mobility, and Hjorth complexity). When extracting general features, the signal from each epoch is divided into 5-second segments, and the above features are extracted separately for each segment. General features are also extracted from each 30-second epoch, and all general features are then concatenated.

[0026] Since EEG signals are non-stationary random processes, and the sleep stage is defined by the characteristic waveforms of different frequency bands of the EEG signal, wavelet packet transform is used to extract the band features of the EEG signal. The db5 wavelet basis is used to perform a 7-level wavelet packet decomposition of the EEG signal, decomposing it into six inherent EEG frequency bands: slow oscillation (0.3-2Hz, SO), delta (0.3-4Hz), theta (4-7Hz), alpha (0.8-13Hz), beta (14-30Hz), and gamma (31-45Hz). The corresponding wavelet coefficients are extracted as features. Simultaneously, the EEG signal is reconstructed according to these six inherent frequency bands. General features and the power ratios between different frequency bands are extracted from the six reconstructed signals as features. The wavelet coefficient features and the reconstructed signal features are concatenated to obtain the wavelet features.

[0027] Furthermore, correlation coefficients and Kl divergences between EEG, EOS, and EMG signals at the same time point were extracted as relational features. Intraclass correlation coefficients and Kl divergences between EEG and EOS signals at the same time point were also extracted as relational features. Subsequently, different signal features from the same time period were concatenated into a single sample and normalized to form a signal feature matrix.

[0028] Table 1 Summary of detailed input features for EEG+EOG+EMG

[0029] For segments of the SpO2 signal, time-domain features are extracted, including maximum, minimum, mean, median, standard deviation, kurtosis, skewness, zero-crossing rate, and the proportion of signals below a certain threshold. First-order derivative features are also extracted, including the maximum, mean, and standard deviation of the first-order derivative. Furthermore, frequency-domain features are extracted, including the total power spectral density of the SpO2 signal, the power spectral density of the SpO2 signal in the 0.014–0.033 Hz band, and the peak value of the power spectrum of the SpO2 signal in the 0.014–0.033 Hz band. Nonlinear features are also extracted, including approximate entropy, sample entropy, permutation entropy, Lyapunov exponent, trend fluctuation analysis, and concentration measurement trend.

[0030] Next, location information and demographic information (including age, gender, height, weight, BMI, etc.) were extracted from different samples, and the newly added information was normalized separately.

[0031] Finally, the EEG+EOG+EMG signal features and demographic features are combined to form a stage-based feature space. The SpO2 feature matrix is ​​used as the feature space for OSA detection. The feature space is divided into a training set, a validation set, and a test set (with leave-one-out cross-validation), which correspond one-to-one with the dataset labels.

[0032] S104 utilizes a pre-trained OSABLSleep model to process sleep stage features and OSA detection features, obtaining sleep stage classification results and OSA event detection results. The OSABLSleep model includes a sleep stage unit and an OSA detection unit. The sleep stage unit performs dual-branch fusion processing of long-range and short-range context on the sleep stage features to obtain sleep stage classification results. The OSA detection unit performs sequential processing on the OSA detection features to obtain OSA event detection results.

[0033] For example, this invention uses LBBLS as its core and leverages the incremental learning characteristics of BLS and sleep stage contextual information to construct an enhanced sleep staging model for OSA patients called OSABLSleep. This model can simultaneously perform sleep stage segmentation and OSA event detection, such as... Figure 3 As shown, the model consists of a sleep staging model and an OSA detection model. The sleep staging model employs a two-branch structure, with the two branches analyzing the long-term and short-term context dimensions respectively, and then merging them to improve model performance. The OSA detection model has a sequential structure and interacts with the automatic segmentation model during the staging process to improve sleep staging performance. Simultaneously, the results from the sleep staging branch are also used to enhance the OSA detection results.

[0034] The sleep staging model has two branches, each based on a baseline model. The classification probability features generated by the two baseline models are used to transmit contextual information at different scales to the other branch. The final result is then obtained through the fusion training of the different contextual information from both branches. During training, the features and labels of the OSA model interact with the two contextual branches of the staging branch to intervene in the staging of specific samples, thereby improving the staging results for OSA patients. The structure of each branch will be described in detail below.

[0035] Sleep stage unit.

[0036] Specifically, in step S104, the sleep staging unit performs a two-branch fusion process of long-range and short-range context on the sleep staging features to obtain the sleep stage classification results, including: (1) Input the sleep stage features into the long-term context branch, extract the global temporal dependency, and obtain the long-term prediction probability matrix; Here, the long-range context branch includes: the first LBBLS unit, the first FMLBBLS unit, the first ENBLS unit, the second ENBLS unit, and the second FMLBBLS unit, which are connected in series. (1.1) The first LBBLS unit is used to receive sleep stage features and output the first intermediate matrix; Here, the LBBLS unit includes: a global feature mapping layer, used to perform feature mapping on sleep stage features using multiple sliding windows of different widths to obtain global features; a local feature mapping layer, used to perform feature mapping on subsets of sleep stage features to obtain local features; an enhancement node layer, used to perform nonlinear transformation on the combination of global and local mapped features to obtain enhancement node features; and an output computation layer, used to concatenate the global, local, and enhancement node features into a hidden layer matrix, and use ridge regression to calculate the pseudo-inverse and output weights, and calculate the first intermediate matrix based on the hidden layer matrix and output weights.

[0037] (1.2) The first FMLBBLS unit is used to receive the first intermediate matrix and the short-range prediction probability matrix, update the first intermediate matrix step by step, and output the second intermediate matrix.

[0038] (1.3) The first ENBLS unit is used to receive the second intermediate matrix and the short-range prediction probability matrix, and output the third intermediate matrix; (1.4) The second ENBLS unit is used to receive the third intermediate matrix and the short-range prediction probability matrix, and output the fourth intermediate matrix; (1.5) The second FMLBBLS unit is used to receive the fourth intermediate matrix and the short-range prediction probability matrix, and output the long-range prediction probability matrix.

[0039] (2) After time-domain expansion, the sleep stage features are input into the short-range context branch to extract local time-series details and obtain the short-range prediction probability matrix. Here, the short-range context branch includes: the third ENBLS unit, the fourth ENBLS unit, the fifth ENBLS unit, the sixth ENBLS unit, and the seventh ENBLS unit connected in series. (2.1) The third ENBLS unit is used to receive the results of sleep stage features after time-domain expansion and output the short-range prediction probability matrix; (2.2) The fourth ENBLS unit is used to output the first updated short-range matrix based on the short-range prediction probability matrix and the long-range prediction probability matrix; (2.3) The fifth ENBLS unit is used to obtain the second updated short-range matrix based on the first updated short-range matrix and the long-range prediction probability matrix; (2.4) The sixth ENBLS unit is used to output the third updated short-range matrix based on the second updated short-range matrix and the short-range prediction probability matrix; (2.5) The seventh ENBLS unit is used to receive the third updated short-range matrix and the long-range prediction probability matrix, and output the fourth updated short-range matrix as the sleep stage classification result.

[0040] (3) The long-range prediction probability matrix is ​​fused with the time-domain expanded sleep stage features in the short-range context branch to obtain the first short-range fusion matrix; (4) The first short-range fusion matrix is ​​fused with the sleep stage features in the long-range context branch to obtain the first long-range fusion matrix; (5) The OSA event detection results output by the OSA detection unit are fused with the first short-range fusion matrix and the first long-range fusion matrix respectively to obtain the second long-range fusion matrix and the second short-range fusion matrix; (6) Output the second short-range fusion matrix as the sleep stage classification result.

[0041] For example, in this invention, rebalanced training labels are used as carriers, and Label Balanced BLS (LBBLS) units are proposed based on MSBLS, such as... Figure 4 As shown.

[0042] The data space of an LBBLS cell is: ,in, For the sample size, The sample length is denoted as . ,in, For tag categories, i.e. Tags that are one-hot encoded.

[0043] First, extract feature nodes. ,for Overall, use Feature mapping is performed on windows of different widths to obtain global mapped features: (1) in, and These are the initial weights and biases for randomization. As the activation function, The group mapping features are concatenated to obtain the global features. .

[0044] (2) Since using only global features would lead to the neglect of detailed information, a local feature node that maps local features was proposed. Local features can be Any subset, i.e. They all use Extract given local features using a window of length 1. Mapping features: (3) in, This is the activation function.

[0045] Will A local mapping feature is obtained by concatenating the local mapping features. Mapping features For all mapping features In other words, local features Represented as: (4) in, The types of local features extracted.

[0046] After that, ask Group global features Enhanced nodes Using a non-linear activation function to The enhanced nodes are obtained by activating the linear transformation, specifically represented as follows: (5) in, and For random weights and biases, This is a non-linear activation function. By concatenating the group of augmented nodes, a global augmented node is obtained: (6) In addition, similar methods are used to obtain the feature set. The enhanced node, specifically represented as: (7) (8) Therefore, the final output hidden layer matrix is: (9) Then, use ridge regression to find The pseudo-inverse is used to obtain its weight.

[0047] (10) in, It is the identity matrix. The regularization coefficient is . pseudo-inverse In classic BLS, after obtaining the weights, the output can be calculated, i.e., the first intermediate matrix is ​​represented as: (11) During training, since the classic BLS does not perform well in classifying imbalanced samples, the model is optimized by iteratively applying the training labels. The proposed weight calculation method is the same as formula (11), where... Replace with This represents the labels after iterative optimization, in the first round of training. .

[0048] The prediction results are used to iteratively optimize the training labels, with the loss function being: (12) in, For the predicted results, This is the prediction probability matrix.

[0049] After iteration, when the loss no longer decreases, or after reaching the specified number of training rounds, the final weights are obtained, and the BLS output can be obtained by formula (11).

[0050] It is important to note that the system input... These are one-hot encoded tags processed by the rebalancing module; that is, each LBBLS needs to be paired with a rebalancing module, and its rebalancing strategy is as follows: In this context, there are k minority classes, defined as samples whose proportion of the total sample is less than a given threshold. For minority sample labels... Rebalance it using formula (13): (13) in, s This is the balance coefficient.

[0051] The core advantage of BLS lies in its incremental learning method, which includes adding new feature nodes and new input samples. For new feature nodes... Calculate its enhanced nodes : (14) The hidden layer output of incremental learning BLS is then... =[ If ], then its corresponding weight is: (15) in, The product of the pseudoinverse of the reference matrix and the new input: (16) use Build : (17) (18) In this way, the training process of incremental BLS is completed. It can be seen intuitively that this method uses the original training parameters during training and only trains on newly added samples or features, thereby improving model performance. This brings great convenience to model training.

[0052] This branch, as the core of the system, exchanges data with both the short-range context branch and the SPO2 branch. The first LBBLS unit, the first FMLBBLS unit, the first ENBLS unit, the second ENBLS unit, and the second FMLBBLS unit are connected in series.

[0053] The fusion operation of the first FMLBBLS unit and the second FMLBBLS unit is implemented in the following manner, and the fusion information formula is as follows: (19) in, This is the long-range prediction probability matrix output by FMLBBLS; This is the second intermediate matrix; This is the result of time-domain expansion of the short-range prediction probability matrix and coupling it with OSA labels. for The coupling with the SpO2 tag is explained in detail below. This refers to the SpO2 feature after fusion with the SpO2 tag.

[0054] Between the two FMLBBLS are n-3 ENBLS, namely the first FMLBBLS unit and the first ENBLS unit, which are used to interact with the short-range LBBLS. Each BLS unit in the long-range branch uses a prediction probability matrix. The output is sent to the short-range context branch, where it interacts with the corresponding BLS unit. The long-range branch completes its work once the last FMLBBLS unit inputs the fusion information to the short-range branch. Here, the LBBLS unit, FMLBBLS unit, and ENBLS unit are all BLS units.

[0055] In the long-range context branch, the first FMLBBLS uses the first LBBLS unit as the baseline model and uses some of its parameters. However, the input size of the subsequent ENBLS decreases, so it is not possible to reuse parameters from the baseline model.

[0056] OSA detection unit.

[0057] The OSA detection unit is used to sequentially process OSA detection features to obtain OSA event detection results, including: (1) The second LBBLS unit, the eighth ENBLS unit, and the ninth ENBLS unit are connected in series in sequence; Here, the second LBBLS unit, the eighth ENBLS unit, and the ninth ENBLS unit are connected in series and share network parameters; the eighth and ninth ENBLS units are also used to receive the binary matrix of the sleep stage classification results output by the sleep stage unit after binarization, and to perform time-domain expansion on the binary matrix to obtain a weighted matrix; the OSA event detection result output by the ninth ENBLS unit is the predicted probability of respiratory events after time-domain expansion.

[0058] (2) The second LBBLS unit is used to receive OSA detection features, perform feature mapping and enhanced node transformation on OSA detection features, and output the first OSA intermediate detection result. (3) The eighth ENBLS unit is used to receive the first OSA intermediate detection result and the weighted matrix obtained by binarization and temporal expansion of the sleep stage classification result, and then output the second OSA intermediate detection result. (4) The ninth ENBLS unit is used to fuse the second OSA intermediate detection result with the weighting matrix and output the OSA event detection result.

[0059] For example, the SpO2 branch adopts the SpO2 characteristic. With tags As input, This is a binary matrix normalized to 30s. This branch contains three BLS units: the second LBBLS unit, the eighth ENBLS unit, and the ninth ENBLS unit. The second LBBLS unit is the SpO2 baseline model, while the eighth and ninth ENBLS units share parameters with it. The eighth and ninth ENBLS units will interact with the PSG model, and their output is a time-domain extended one-hot format of respiratory event prediction probabilities normalized to 30s, with a time-domain window of [missing information]. .

[0060] To enhance the sleep staging performance of OSA patients, OSA information was integrated into the sleep staging model based on the relationship between OSA events and sleep fragmentation, and calculated according to formula (23): (twenty three) in, It is the interval of blood oxygen saturation events calculated from SpO2. It is a scaling matrix that provides different contextual perspectives for different samples. Therefore, This can indicate whether the current 30 seconds are affected by sleep fragmentation. For problematic samples, through... Tighten the view window of long-range context branches to suppress the interference of long-range historical information on the current moment, thereby avoiding misjudgments caused by sleep structure disorder due to OSA.

[0061] In addition, the same As input, sleep stage segmentation information is incorporated into the respiratory event detection process. The sleep event labels output by the last BLS unit are used as the output of the SpO2 branch.

[0062] (twenty four) Among them, the last ENBLS or the first FMLBBLS (if Prediction results As an output of the SpO2 branch.

[0063] Here, the width learning units in the OSABLSleep model employ a label balancing mechanism; The label balancing mechanism includes: defining the categories whose proportion of the total number of samples in the training labels is less than a given threshold as minority categories, weighting the labels of minority categories, and iteratively updating the weighting coefficients based on the prediction probabilities of the previous round; The OSABLSleep model employs an incremental learning mechanism. The incremental learning mechanism includes: when a new feature node or a new input sample is added, the mapping features and enhancement nodes of the new node are calculated based on the original model parameters, and the network weights are updated by ridge regression to obtain the pseudo-inverse, without retraining the entire model.

[0064] For example, in the training of the long-range context branch, there is a preceding sample rebalancing module before each BLS unit, which generates a label with additional weights. The calculation method of the initial rebalancing label is explained in formula (13). There is also a transitive relationship between the rebalancing modules. Training labels for each BLS unit The calculation is based on the previous round of labels and the short-range branch probability matrix for the minority category labels: (20) in, This is a magnification factor for a small number of samples. The confidence coefficient is derived from... Calculate, where s is a constant scaling factor.

[0065] The features in the long-range branch matrix are divided by a radius of... After temporal expansion of the window, a new feature matrix is ​​obtained. The inputs to the short-range branch include reconstructed signal features from each frequency band of the EEG data, as well as temporal global features. The probability matrix of the long-range branch also serves as input; therefore, the final input is represented as: (twenty one) This branch has the same number of BLS units as the long-range branch. All units use ENBLS. The first BLS unit is trained using ENBLS to obtain the baseline model, and it shares training parameters with all subsequent ENBLS units. (Equation (22)...) This represents the output of each corresponding module in the long-range branch. The contextual information from the output of each module in the short-range branch is fused into the long-range branch. Because the short-range branch contains more detailed information, the classification probabilities of ENBLS are extended in the time domain using EXUNIT to represent the contextual information and broaden the contextual reference range. For a window with a width of 2w, its extended matrix is ​​represented as follows: (twenty two) in, This is the predicted probability for the current 30 seconds. The label is for respiratory-related samples, which integrates OSA discrimination information and sleep stage information. The specific algorithm is explained in the OSA branch.

[0066] Meanwhile, the classification probability matrices output by the first and penultimate BLS units in the short-range branch are normalized to binarized matrices for WAKE and non-WAKE operations. The input is fed into the OSA discriminant model for feature fusion.

[0067] Typically, the result of the last BLS module of the short-range branch is used as the system output.

[0068] Secondly, the present invention provides an OSA sleep staging enhancement system based on multi-scale width learning, comprising: The signal acquisition module is used to acquire the polysomnography signal and blood oxygen saturation signal of the subject under test; The preprocessing module is used to preprocess the polysomnography signal and the blood oxygen saturation signal to obtain the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal. The feature extraction module is used to extract features from the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal to obtain sleep stage features and OSA detection features. The OSABLSleep model utilizes a pre-trained OSABLSleep model to process sleep stage features and OSA detection features, obtaining sleep stage classification results and OSA event detection results. The OSABLSleep model includes a sleep stage unit and an OSA detection unit. The sleep stage unit performs a two-branch fusion process of long-range and short-range context on the sleep stage features to obtain sleep stage classification results. The OSA detection unit performs sequential processing on the OSA detection features to obtain OSA event detection results.

[0069] For example, in a specific instance, the signal acquisition module reads the PSG signals (including C4, F4, and O2 EEG, left and right Ophthalmic EEG, and mandibular EMG) and SpO2 signals from a sleep monitoring device throughout the night from a patient with severe OSA (AHI=35). The preprocessing module performs bandpass filtering (0.3–35Hz) and notch filtering (50Hz) on the EEG / Ophthalmic EEG, filtering (10–100Hz) on the EMG, and filtering (0.1–0.4Hz) on the SpO2, then uniformly downsamples to 128Hz and cuts it into 30-second segments. The feature extraction module extracts features such as time domain, nonlinearity, wavelet packet coefficients, and inter-channel correlation from each segment, combines them into a sleep stage feature vector (dimension 285), and extracts the mean, standard deviation, and power spectral density from the SpO2 segment to form OSA detection features (dimension 32). In the OSABLSleep model, the long-range branch (LBBLS→FMLBBLS→two ENBLS→FMLBBLS) of the sleep staging unit extracts global dependencies, while the short-range branch (five ENBLS) extracts local details. Simultaneously, the OSA detection unit (LBBLS→ENBLS→ENBLS) outputs the probability of respiratory events per second. After the two branches are fused, the final output is the sleep stage (W / N1 / N2 / N3 / REM) and whether an OSA event occurred for each 30-second segment. The entire system can be trained in 3 hours on an Intel Xeon CPU, and its classification accuracy for patients with severe OSA is significantly improved compared to the unenhanced model.

[0070] The invention was tested using the following hyperparameters to verify its beneficialness. Global feature nodes of LBBLS were selected. For [1,2,8,16], the local feature nodes of LBBLS For 2, LBBLS enhanced nodes The context radius of the long-range branch is [1,4]. The OSA discriminative context extension radius is 5. The value is 3.

[0071] This invention used four different publicly available datasets for experiments: ISURC1, UCDDB, SOF, and CFS. Due to the differences between the datasets, different channels and parameters were used for each dataset. These datasets are all mixed datasets of OSA samples and healthy human samples, and all include complete PSG and SpO2 signals. 10-fold cross-validation was performed on all datasets.

[0072] 1. Overall results.

[0073] 1.1. Improvement of sleep staging results in OSA patients by OSABLS.

[0074] To verify the effectiveness of fusing SpO2 features in the model, i.e., the OSA branch, cross-validation was conducted on four datasets under the same experimental conditions, with the model without the SpO2 branch as input. The experimental results are shown in Table 2. To better illustrate the results, they were grouped according to the severity of OSA. The four datasets were divided into four groups according to the same criteria: no OSA (AHI < 5), mild OSA (5 ≤ AHI < 15), moderate OSA (15 ≤ AHI < 30), and severe OSA (AHI ≥ 30). It should be noted that the results for the ISRUC1 dataset are divided by the generated (number of events / TST) AHI value. The overall results and the results for each group are listed in Table 2. Due to the different sample distributions between groups in each dataset, the datasets show some consistency and differences.

[0075] Considering the overall performance of different models, OSABLSleep showed a significant advantage over the model without the SpO2 branch, especially in MF1, where the average MF1 increased by 0.54% across the four data points.

[0076] Ignoring the influence of different models and considering only the groups, various evaluation metrics for each group decreased as the severity of OSA increased. The no-OSA and mild OSA groups performed significantly better than the other two groups, while the severe OSA group performed the worst. Compared to the no-OSA group, the average overall ACC, MF1, and Kappa of the four datasets decreased by 2.95%, 3.19%, and 0.03, respectively. This difference between the severe OSA and no-OSA groups was more pronounced in datasets with larger sample sizes. This result is also consistent with the conventional wisdom that the severe OSA group performs the worst.

[0077] When examining the results across different models and groupings, the two models show essentially the same Kappa score, but exhibit the same growth trend in ACC and MF1 as the overall results. The MF1 of OSABLSleep in each group is significantly higher than the model without the OSA branch, especially in the group with OSA. For the ISURC1, SOF, and CFS datasets, the increment in each OSA group is significantly higher than the increment in the group without OSA, but this phenomenon is not observed in the UCDDB dataset due to the randomness caused by its small sample size. These results support the positive effect of fusing SpO2 features on improving sleep stage segmentation in OSA patients. Furthermore, the improvement for OSA patients is greater than for healthy controls because the OSA patient data contains a large number of sleep-related breathing event samples.

[0078] Table 2 Comparison of results between OSABLSleep and the model without SpO2 branch as input

[0079] To further explore the model's performance on subjects with different OSA severity levels, the results in Table 2 were weighted by sample size to obtain the weighted increments of OSABLSleep for the non-OSA branch model across the four datasets, as shown in Table 3. The results demonstrate a clear trend in the model's performance on OSA subjects: overall, OSABLSleep's MF1 improvement effect is stronger as the OSA severity increases. Specifically, within each group, except for the severe OSA group, the ACC and Kappa scores were roughly the same as other groups, with a significant increase only in MF1; while the severe OSA group showed the largest increases in ACC, MF1, and kappa, at 0.18%, 1.14%, and 0.006, respectively. From an inter-group perspective, the non-OSA group showed the smallest increase in MF1, at only 0.54, while the mild and moderate OSA groups exhibited increases exceeding 0.8, both significantly higher than the non-OSA group. The severe OSA group was the only one to show significant improvements across all three evaluation metrics. Therefore, we can conclude that with the incorporation of SpO2 characteristics, OSABLSleep significantly improves the staging performance of OSA participants, and this improvement increases with the severity of OSA, being particularly effective for participants with severe OSA.

[0080] Table 3 shows the incremental results of OSABLSleep for models without the SpO2 branch as input.

[0081] In summary, OSABLS can effectively improve the accuracy of sleep staging in OSA patients, and its effect is more pronounced in patients with severe OSA.

[0082] 1.2 Comparison of OSABLS results with other models To verify the performance of OSABLSleep, its results on the ISURC1 dataset were compared with those of other studies. To eliminate the interference of SpO2 signal, the results of the model without SpO2 input were also compared. The results are shown in Table 4.

[0083] The results show that OSABLSleep outperforms other studies. For the ISRUC1 dataset, OSABLSleep outperforms the best-performing study by 2.26, 2.53, and 0.03 dB on ACC, MF1, and Kappa, respectively, and achieves the best F1 score across all stages, especially in the N1 and REM stages. Furthermore, the model without SpO2 signaling also outperforms other models, showing overall improvements of 2.1, 2.24, and 0.03 dB over JK-STGCN, respectively.

[0084] The above comparison demonstrates that the two-branch context model without SpO2 input exhibits superior performance, while OSABLSleep, by incorporating OSA features into sleep stages, further improves performance, reaching the best level.

[0085] Table 4 Comparison of OSABLSleep results with other studies on the ISURC1 and UCDDB datasets.

[0086] 1.3. Results of sleep apnea event discrimination.

[0087] How are the results of the sleep breathing event discrimination branch affected by the sleep stage segmentation results? To explore this question, a separate sleep breathing event model was constructed under the same conditions as the original experiment to compare with the sleep breathing event discrimination results in OSABLSleep. Since the ISRUC1 dataset lacks OSA event labels, and the generated OSA labels differ from those in other datasets, it was excluded from this experiment.

[0088] The comparison results of the two models are presented in Table 5. It is clear that OSABLSleep shows significant improvements across all metrics compared to the control experiment, especially in MF1, precision, and recall, with average increases of 3.55, 3.66, and 9.02 respectively. The increase in precision and recall clearly demonstrates an improvement in the recognition rate of OSA event samples. Furthermore, this improvement is more stable on larger datasets than on smaller datasets. Therefore, the above results demonstrate that incorporating sleep staging results into the sleep breathing event discrimination model significantly improves its performance.

[0089] The combined sleep stage segmentation and respiratory event discrimination experiments clearly demonstrate the mutually reinforcing effect between these two tasks. Integrating information from the other task can improve performance and yield better results. SpO2 represents the model that did not utilize stage segmentation information.

[0090] Table 5 Comparison of Sleep-Discrimination Events Results

[0091] 2. Based on the statistical results of the participants.

[0092] In addition to the performance results at the time window level, this study conducted statistical analyses at the subject level for two groups of subjects to verify the reliability and clinical value of the performance improvement of the OSABLSleep model relative to the baseline model: (1) the statistical significance of the performance difference was verified by the paired Wilcoxon signed-rank test, and the complete results are shown in Table 6; (2) the effect size was quantified by Cohen's d-value analysis, and the complete results are shown in Table 7.

[0093] 2.1. Paired Wilcoxon signed-rank test at the subject level.

[0094] This study used the paired Wilcoxon signed-rank test (a nonparametric test for paired designs) to assess the statistical significance of the performance difference between the OSABLSleep model and the baseline model at the individual subject level.

[0095] Table 6. P-values ​​of Wilcoxon signed-rank test for paired subjects in different subgroups of the three datasets.

[0096] The paired Wilcoxon signed-rank test results at the subject level showed heterogeneity in the performance differences between the OSABLSleep model and the baseline model across different datasets and subgroups: In the large CFS dataset (sample size n=730), except for the accuracy (P=0.88) and Kappa coefficient (P=0.94) of the moderate obstructive sleep apnea subgroup, the mean F1 score of all subgroups showed extremely significant statistical differences (P=0.00), and the accuracy and Kappa coefficient of the non-obstructive sleep apnea and mild obstructive sleep apnea subgroups also reached significant levels. The significance level was low (P=0.00). In the SOF dataset (sample size n=453), the mean F1 score of all subgroups showed a significant improvement (P=0.00), and the accuracy and Kappa coefficient of the severe obstructive sleep apnea subgroup were close to statistical significance (P=0.06). Conversely, the ISRUC1 dataset, with the smallest sample size (only 50 subjects, of which only 5 were patients with severe obstructive sleep apnea), had extremely low statistical power (approximately 15%), resulting in no statistically significant differences detected in any indicators (P≥0.05), failing to reflect the true improvement effect of the model. This is consistent with the general pattern in sleep staging studies, namely that small sample datasets are prone to statistical "false negative" results, which do not necessarily indicate that the model is invalid. The above results confirm that the performance improvement of the OSABLSleep model is a real statistical effect, with particularly significant improvements in the mean F1 score and the performance of the severe obstructive sleep apnea subgroup, and the results from larger sample datasets are more reliable.

[0097] 2.2. Cohen d-value effect size analysis at the subject level.

[0098] This study calculated the Cohen d-value to quantify the magnitude of the performance difference between the two models. This metric is independent of sample size and can compensate for the limitations of the p-value in significance testing. The results for paired subject-level data are shown in Table 7. Table 7 Results of Cohen's d-value effect size analysis at the subject level

[0099] Combining the results in Tables 6 and 7, it is evident that the effect sizes and sample sizes of each dataset are consistent with the significance test results: the severe obstructive sleep apnea subgroups in the large-sample CFS and SOF datasets exhibit moderate effect sizes, indicating that the model's performance improvement has clinical significance; for the ISRUC1 dataset, although the mean F1 score and Cohen's d-value of the 5 severe obstructive sleep apnea subgroup were as high as 6.49, the Wilcoxon test did not detect a significant difference; the effect size increased with the severity of obstructive sleep apnea, and the mean F1 score of all subgroups showed a consistently higher effect size. These results confirm the clinical application value of the model, with particularly significant effects on patients with severe obstructive sleep apnea, and the effect size, compared to the p-value alone, more reliably reflects the true performance improvement of the model.

[0100] A comprehensive interpretation of the two sets of statistical analysis results completed the full validation of the model: the significant P-value in the large sample dataset and the moderate effect size provided double validation, proving that the performance improvement of the model is reliable and has practical significance; the lack of significance of the P-value in the small subgroup sample was due to insufficient statistical power, rather than the model having no real improvement effect, which can be verified by the large effect size; the trend of effect size increasing with the severity of obstructive sleep apnea directly confirms the core hypothesis of this study; the mean F1 score performed well in both statistical analyses, verifying the effectiveness of the label-balanced BLS algorithm in alleviating the problem of sleep stage category imbalance.

[0101] 3. Ablation experiments to demonstrate the effectiveness of the model structure.

[0102] Next, two ablation experiments were conducted on four datasets to verify the effectiveness of OSABLSleep in the fusion of BLS units and context.

[0103] 3.1. LBBLS performance verification.

[0104] The purpose of introducing LBBLS is to improve the inherent disadvantage of traditional BLS in addressing imbalance issues. To verify the performance improvement of LBBLS compared to traditional BLS, ablation experiments were used. In the comparative model of this ablation experiment, all LBBLS units were replaced with MSBLS, which has been proven to be more effective than traditional BLS, while maintaining the same experimental parameters. Furthermore, to ensure a fairer comparison, the same pre-balancing unit as OSABLSleep was used before each BLS unit in the long-range branches of the comparative model. Thus, the comparison focused on the performance differences between LBBLS and MSBLS. ACC, MF1, Kappa, specificity, and sensitivity were used to verify the model performance.

[0105] like Figure 5As shown, the comparison results of the four datasets exhibit the same characteristic: the ACC and MF1 of OSABLSleep using LBBLS are significantly higher than those of the model using MSBLS, especially in models with larger sample sizes. The average increments of ACC and MF1 for the four datasets are 0.22 and 0.19, respectively. Furthermore, the two models are essentially consistent in terms of Kappa, specificity, and sensitivity. Therefore, it can be concluded that LBBLS can further improve model performance than MSBLS, making it the better choice for OSABLSleep.

[0106] During training, based on the fragmented sleep pattern, the contextual vision of OSA-related events in long-range branches was deliberately tightened, and ablation experiments were conducted to verify the effectiveness of this approach. In the ablation experiments, a model very similar to OSABLSleep was used, which eliminated the contextual feature variation strategy and maintained consistent contextual features across all samples in long-range branches. Experimental results are presented below. Figure 6 middle.

[0107] Depend on Figure 6 The results readily lead to the conclusion that using a narrower contextual perspective for OSA-related samples helps improve the overall performance of the model. Compared to models using the same contextual perspective, OSABLSleep shows significant improvements in both ACC and MF1, with average increases of 0.15 and 0.13 across the four datasets, respectively. Other metrics show minimal differences and remain at a similar level. The design of narrowing the contextual perspective for OSA-related samples is based on sleep fragmentation features, and this experiment validates its effectiveness.

[0108] Furthermore, interestingly, the model outperformed the model without SpO2 input in both ablation experiments. This demonstrates that processing OSA-related samples and incorporating OSA features into the sleep staging process can mitigate the impact of sleep fragmentation to some extent and improve model performance. Flexible context-awareness strategies and the use of LBBLS can more fully utilize SpO2 features and enhance model performance in sleep staging and OSA detection.

[0109] 4. Model interpretability.

[0110] The interpretability of the model in this invention can be demonstrated by the weight changes of different units within the model. The model features can be divided into three categories: wide-learning system node weights, short-range branch feature weights, and long-range branch feature weights, specifically as follows: Figure 7 As shown.

[0111] The wide learning system nodes are divided into three categories, with reinforcement nodes having the lowest weight, while the other two categories together account for 80% of the weight. The weight of local feature nodes gradually increases during training, while the weight of global feature nodes shows a decreasing trend. The model is based on a proximal branch and can receive contextual changes and obstructive sleep apnea-related information through a remote branch. The final output is obtained by integrating the results of the remote branch into the proximal branch. Therefore, feature weight changes need to be analyzed from both the remote and proximal branches to clarify the model's training mechanism. To ensure the reliability of the prediction results, all units within the proximal branch of the model need to be assigned equal weights, with EEG features having the highest weight, exceeding 50%. EEG wavelet features that reflect different inherent frequency bands play a crucial role in sleep staging. Theta band (4–8Hz) corresponds to light sleep, alpha band (8–13Hz) corresponds to wakefulness and the sleep onset transition stage, and spindle waves (12–16Hz) correspond to N2 sleep. These wavelet features account for over 35% of the weight, providing core support for sleep staging. Electrooculogram (EOG) features capture eye movement information and are highly correlated with REM sleep stages. These correlated features assist in the staging of multi-channel signal samples. Contextual features account for approximately 30% of the weight, making them the single feature category with the highest weight. Their importance aligns with the American College of Sleep Medicine manual, which stipulates that some N2 and REM sleep samples require consideration of preceding and following samples for assessment. Equal weighting ensures model stability and prevents misclassification of samples with significant signal features due to overemphasis on contextual features. During model training, remote branches continuously fuse sleep staging and obstructive sleep apnea detection information through contextual features, causing their weights to dynamically change. In the baseline model, contextual feature weights are 0 under no input conditions. However, after introducing contextual features during training, their weights significantly increase in the first fusion unit, exceeding the weights of all signal features, leading to a corresponding decrease in signal feature weights. The decrease in electromyography (EMG) feature weights is the most significant, indicating their relatively low importance. As training progresses, the weight of contextual features gradually increases, reaching approximately 35% of the total weight in the terminal units of remote branches, demonstrating that the model effectively utilizes the contextual information from the fusion of obstructive sleep apnea information. In summary, the training process of this model can be summarized as follows: based on the baseline model, parameters are gradually optimized by fusing sleep stage context information and obstructive sleep apnea-related information, ultimately enhancing the sleep stage effect for patients with obstructive sleep apnea.

[0112] The beneficial effects of this invention are: improved accuracy: With the assistance of SpO2 signal, the accuracy of sleep staging in patients with severe OSA is significantly improved (especially N1 and REM stages). Superior performance: The sleep staging results of this model surpass those of similar studies, reaching the best level. Resource-friendly: Based on the BLS architecture, it can be trained using only a CPU, without the need for expensive GPUs, making it suitable for low-cost clinical deployment. Strong robustness: The LBBLS algorithm effectively solves the problem of sparse samples in Wake / N1 / N3 sleep staging.

[0113] The various embodiments described in this specification are presented in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. All or part of this invention can be used in numerous general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices, etc.

[0114] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present invention.

Claims

1. A method for enhancing OSA sleep staging based on multi-scale width learning, characterized in that, include: Acquire polysomnography and blood oxygen saturation signals of the subject under test; The polysomnography signal and the blood oxygen saturation signal are preprocessed to obtain preprocessed time-aligned polysomnography signal and preprocessed blood oxygen saturation signal. Feature extraction was performed on the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal to obtain sleep stage features and OSA detection features; Using a pre-trained OSABLSleep model, the sleep stage features and OSA detection features are processed to obtain sleep stage classification results and OSA event detection results; The OSABLSleep model includes a sleep staging unit and an OSA detection unit. The sleep staging unit performs a two-branch fusion process of long-range and short-range context on the sleep staging features to obtain sleep stage classification results. The OSA detection unit performs sequential processing on the OSA detection features to obtain OSA event detection results.

2. The OSA sleep staging enhancement method based on multi-scale width learning according to claim 1, characterized in that, The sleep staging unit is used to perform a two-branch fusion process of long-range and short-range context on the sleep staging features to obtain sleep stage classification results, including: The sleep stage features are input into the long-range context branch to extract global temporal dependencies and obtain the long-range prediction probability matrix. The sleep stage features are extended in the time domain and then input into the short-range context branch to extract local time-series details and obtain the short-range prediction probability matrix. The long-range prediction probability matrix is ​​fused with the time-domain expanded sleep stage features in the short-range context branch to obtain the first short-range fusion matrix; The first short-range fusion matrix is ​​fused with the sleep stage features in the long-range context branch to obtain the first long-range fusion matrix; The OSA event detection results output by the OSA detection unit are fused with the first short-range fusion matrix and the first long-range fusion matrix respectively to obtain the second long-range fusion matrix and the second short-range fusion matrix. The second short-range fusion matrix is ​​output as the sleep stage classification result.

3. The OSA sleep staging enhancement method based on multi-scale width learning according to claim 2, characterized in that, The long-range context branch includes: a first LBBLS unit, a first FMLBBLS unit, a first ENBLS unit, a second ENBLS unit, and a second FMLBBLS unit connected in series. The first LBBLS unit is used to receive the sleep stage features and output a first intermediate matrix; The first FMLBBLS unit is used to receive the first intermediate matrix and the short-range prediction probability matrix, update the first intermediate matrix step by step, and output the second intermediate matrix. The first ENBLS unit is used to receive the second intermediate matrix and the short-range prediction probability matrix, and output the third intermediate matrix; The second ENBLS unit is used to receive the third intermediate matrix and the short-range prediction probability matrix, and output the fourth intermediate matrix; The second FMLBBLS unit is used to receive the fourth intermediate matrix and the short-range prediction probability matrix, and output the long-range prediction probability matrix.

4. The OSA sleep staging enhancement method based on multi-scale width learning according to claim 3, characterized in that, The first LBBLS unit includes: A global feature mapping layer is used to perform feature mapping on the sleep stage features using multiple sliding windows of different widths to obtain global features; A local feature mapping layer is used to perform feature mapping on a subset of the sleep stage features to obtain local features; An enhanced node layer is used to perform a nonlinear transformation on the combination of the global mapping features and the local mapping features to obtain enhanced node features; The output computation layer is used to concatenate the global mapping features, the local mapping features, and the enhanced node features into a hidden layer matrix, and to calculate the output weights by using ridge regression to obtain the pseudo-inverse. The first intermediate matrix is ​​then calculated based on the hidden layer matrix and the output weights.

5. The OSA sleep staging enhancement method based on multi-scale width learning according to claim 2, characterized in that, The short-range context branch includes: a third ENBLS unit, a fourth ENBLS unit, a fifth ENBLS unit, a sixth ENBLS unit, and a seventh ENBLS unit connected in series. The third ENBLS unit is used to receive the result of the sleep stage features after time-domain expansion and output a short-range prediction probability matrix. The fourth ENBLS unit is used to output a first updated short-range matrix based on the short-range prediction probability matrix and the long-range prediction probability matrix. The fifth ENBLS unit is used to obtain a second updated short-range matrix based on the first updated short-range matrix and the long-range prediction probability matrix; The sixth ENBLS unit is used to output a third updated short-range matrix based on the second updated short-range matrix and the short-range prediction probability matrix; The seventh ENBLS unit is used to receive the third updated short-range matrix and the long-range prediction probability matrix, and output the fourth updated short-range matrix as the sleep stage classification result.

6. The OSA sleep staging enhancement method based on multi-scale width learning according to claim 1, characterized in that, The OSA detection unit is used to sequentially process the OSA detection features to obtain OSA event detection results, including: The second LBBLS unit, the eighth ENBLS unit, and the ninth ENBLS unit are connected in series. The second LBBLS unit is used to receive the OSA detection features, perform feature mapping and enhanced node transformation on the OSA detection features, and output the first OSA intermediate detection result; The eighth ENBLS unit is used to receive the first OSA intermediate detection result and the weighted matrix obtained by binarization and temporal expansion of the sleep stage classification result, and then fuse them to output the second OSA intermediate detection result. The ninth ENBLS unit is used to fuse the second OSA intermediate detection result with the weighting matrix and output the OSA event detection result.

7. The OSA sleep staging enhancement method based on multi-scale width learning as described in claim 6, characterized in that, The second LBBLS unit, the eighth ENBLS unit, and the ninth ENBLS unit are connected in series and share network parameters; The eighth ENBLS unit and the ninth ENBLS unit are also used to receive the binary matrix of the sleep stage classification result output by the sleep stage unit after binarization, and to perform time-domain extension on the binary matrix to obtain a weighted matrix. The OSA event detection result output by the ninth ENBLS unit is the predicted probability of respiratory events after time-domain expansion.

8. The OSA sleep staging enhancement method based on multi-scale width learning according to claim 1, characterized in that, The width learning unit in the OSABLSleep model employs a label balancing mechanism. The label balancing mechanism includes: defining the categories whose proportion of the total number of training labels is less than a given threshold as minority categories, weighting the labels of minority categories, and iteratively updating the weighting coefficients based on the prediction probability of the previous round. The OSABLSleep model employs an incremental learning mechanism. The incremental learning mechanism includes: when a new feature node or a new input sample is added, the mapping features and enhancement nodes of the new node are calculated based on the original model parameters, and the network weights are updated by ridge regression to obtain the pseudo-inverse, without retraining the entire model.

9. An OSA sleep staging enhancement system based on multi-scale width learning, used to implement the method of any one of claims 1 to 8, characterized in that, include: The signal acquisition module is used to acquire the polysomnography signal and blood oxygen saturation signal of the subject under test; The preprocessing module is used to preprocess the polysomnography signal and the blood oxygen saturation signal to obtain the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal. The feature extraction module is used to extract features from the preprocessed polysomnography signal and the preprocessed blood oxygen saturation signal to obtain sleep stage features and OSA detection features. The OSABLSleep model is used to process the sleep stage features and OSA detection features using a pre-trained OSABLSleep model, obtaining sleep stage classification results and OSA event detection results. The OSABLSleep model includes a sleep stage unit and an OSA detection unit. The sleep stage unit performs a two-branch fusion process of long-range and short-range context on the sleep stage features to obtain sleep stage classification results. The OSA detection unit performs sequential processing on the OSA detection features to obtain OSA event detection results.

Citation Information

Patent Citations

  • Automatic sleep staging and migration method based on deep neural network

    CN112869711A

  • Sleep stage classification method and system based on dynamic mode decomposition

    CN114668373A