A Single-Channel Method and System for Detecting and Post-calibrating Sleep Apnea by Integrating Multi-Source Cardiopulmonary Function Features

By fusing single-channel abdominal respiratory signals with multi-source features of cardiopulmonary function, and utilizing an encoder-decoder architecture and a bidirectional long short-term memory network for refined feature extraction and contextual modeling, this method solves the problems of strong sensor dependence and poor individual adaptability in existing technologies, and achieves high-precision sleep apnea event detection and personalized calibration.

CN120910662BActive Publication Date: 2026-03-06SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511129436.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2026-03-06
Estimated Expiration
2045-08-13

AI Technical Summary

Technical Problem

Existing sleep apnea detection technologies rely on specialized equipment and sensors, are cumbersome to operate, have poor individual adaptability, and lack the ability to accurately locate the start and end boundaries of apnea events, making it difficult to meet the growing demand for convenient and accurate detection.

Method used

A detection method that integrates single-channel abdominal respiratory signals with multi-source features of cardiopulmonary function is adopted. Multi-scale features are extracted using an encoder-decoder architecture. Contextual modeling is performed by combining a bidirectional long short-term memory network and a masked attention mechanism. An event structure perception loss function is designed to achieve high-precision respiratory event localization and personalized calibration.

Benefits of technology

It achieves high-precision preliminary localization and personalized calibration of respiratory events, improves the model's adaptability to individual differences and the accuracy of event boundary identification, and is suitable for clinical screening and daily monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120910662B_ABST
    Figure CN120910662B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of sleep apnea detection technology, specifically disclosing a single-channel sleep apnea detection and post-calibration method and system that integrates multi-source features of cardiopulmonary function. The method includes the following steps: acquiring a single-channel abdominal respiratory signal from the subject and preprocessing it; inputting the preprocessed single-channel abdominal respiratory signal into an encoder-decoder network to extract multi-scale features and preliminarily predict sleep apnea; fusing the preliminary prediction result with the subject's cardiopulmonary static features to form a T×31-dimensional input sequence; using a bidirectional long short-term memory network for context modeling, introducing a masked attention mechanism to focus on abnormal frames, designing an event structure perception loss, and outputting the final corrected prediction result per second. Using this technical solution, refined feature extraction and second-by-second classification of the single-channel abdominal respiratory signal are achieved, enabling high-precision preliminary localization of respiratory events.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of sleep apnea detection technology, and relates to a single-channel sleep apnea detection and post-calibration method and system that integrates multi-source characteristics of cardiopulmonary function. Background Technology

[0002] Sleep apnea syndrome (SAHS) is a prevalent sleep disorder characterized by recurrent upper airway obstruction during sleep, manifesting as apnea (complete obstruction) or hypoventilation (partial obstruction). Studies have shown that SAHS has become a significant public health risk factor, with particularly high prevalence among obese and elderly populations. Untreated SAHS can lead to serious consequences such as hypertension, coronary heart disease, stroke, and diabetes.

[0003] Currently, clinical diagnosis of SAHS mainly relies on polysomnography (PSG), which is internationally recognized as the "gold standard." It comprehensively assesses the entire sleep process by collecting various physiological parameters such as nasal airflow, electroencephalography (EEG), electrooculography (EOG), chest and abdominal movement, and blood oxygen saturation.

[0004] However, PSG testing relies on a professional sleep center environment and requires the support of professional medical technicians, resulting in high costs and long appointment cycles. The contact sensors used are particularly uncomfortable and can easily affect the stability of the test in practical applications.

[0005] In recent years, automated sleep apnea detection algorithms based on deep learning and machine learning have emerged, utilizing architectures such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs) to automatically extract and classify physiological signals during sleep. However, these algorithms do not adequately consider individual differences in static physiological characteristics such as weight and cardiopulmonary function, which can easily lead to misclassification of marginal samples.

[0006] Meanwhile, existing artificial intelligence models mostly classify based on coarse-grained segmentation, lacking the ability to accurately locate the start and end boundaries of apnea events, which is not conducive to the accurate calculation of key clinical indicators such as AHI.

[0007] In summary, current detection of sleep apnea events still faces challenges such as strong sensor dependence, cumbersome operation, poor individual adaptability, and rough event localization. There is an urgent need for a more convenient detection technology that can accurately locate events and has the ability to personalize and post-calibrate to meet the growing clinical and home monitoring needs. Summary of the Invention

[0008] The purpose of this invention is to provide a single-channel sleep apnea detection and post-calibration method and system that integrates multi-source features of cardiopulmonary function, and to perform refined feature extraction and second-by-second classification of single-channel abdominal respiratory signals to achieve high-precision preliminary localization of respiratory events.

[0009] To achieve the above objectives, the basic solution of this invention is: a single-channel sleep apnea detection and post-calibration method integrating multi-source cardiopulmonary function features, comprising the following steps:

[0010] Single-channel abdominal respiratory signals were collected from the subjects and preprocessed.

[0011] The preprocessed single-channel abdominal breathing signal is input into an encoder-decoder architecture network to extract multi-scale features and make preliminary predictions of sleep apnea.

[0012] The preliminary prediction results are fused with the subject's cardiopulmonary static characteristics to form a T×31-dimensional input sequence;

[0013] Context modeling is performed using a bidirectional long short-term memory network, a masked attention mechanism is introduced to focus on abnormal frames, an event structure perception loss is designed, and the final corrected prediction results per second are output.

[0014] The working principle and beneficial effects of this basic scheme are as follows: This technical scheme utilizes an encoder network, combines skip connections to fuse multi-scale features of adjacent levels, and integrates multi-source features such as cardiopulmonary function to perform refined feature extraction and second-by-second classification of single-channel abdominal respiratory signals, thereby achieving high-precision preliminary localization of respiratory events.

[0015] Meanwhile, by combining each subject's static physiological characteristics (such as BMI and cardiopulmonary function), dynamic respiratory rate characteristics, and sleep stage information, event-guided post-calibration is performed based on multi-source information fusion. A masked self-attention mechanism is introduced to focus on abnormal misjudged frames, and the event recognition boundary and completeness are optimized through the event structure perception loss function. This significantly improves the model's adaptability to individual differences and its event-level calibration capability by combining contextual continuous information and multi-source features.

[0016] Furthermore, the method for preprocessing single-channel abdominal respiratory signals is as follows:

[0017] Data from the subjects' single-channel abdominal respiratory signals were removed for 30 minutes before and after the event to remove noise.

[0018] The single-channel abdominal respiratory signal was downsampled at a frequency of 16 Hz. The downsampled signal was segmented into 30-second segments, and each segment had 480 numerical points. Normalization was performed on each segment.

[0019] Using the HTML files provided in the CFS dataset, the labels for sleep apnea event records were obtained and aligned.

[0020] This allows for the preprocessing of single-channel abdominal respiratory signals and the optimization of data.

[0021] Furthermore, the preprocessed single-channel abdominal breathing signal is input into an encoder-decoder network to extract multi-scale features. The specific method for preliminary prediction of sleep apnea is as follows:

[0022] The encoder network includes a feature extraction encoder, a feature reconstruction decoder, and an output mapping layer;

[0023] Preprocessed single-channel abdominal respiratory signal segment Represented as:

[0024] ,

[0025] Where B is the batch size, C=1 indicates a single channel, and L=480 indicates the timing length of each segment;

[0026] The feature extraction encoder includes four downsampling modules. The single-channel abdominal respiratory signal segment X is sequentially passed through these four progressive downsampling modules. Each layer includes max pooling and double convolution operations to achieve layer-by-layer feature extraction and temporal compression. Let x be the input of the i-th layer of the feature extraction encoder. i-1 The output is x i ,but:

[0027] ,

[0028] Let X0 = DoubleConv(X) be the feature representation of the original input signal X after initial convolution processing:

[0029] ,

[0030] but , ,

[0031] in, This represents the i-th layer downsampling module, which first performs a 2×2 max pooling operation, followed by a "double convolution" operation, to progressively reduce the spatial resolution of the feature map and extract features from deeper layers. , These represent the kernel weights and biases of the first convolution, respectively. In DoubleConv, the input is first convolved with W1, and then the bias b1 is added. , These represent the kernel weights and biases of the first convolution, respectively. In DoubleConv, the input is first convolved with W2, and then the bias b2 is added. This indicates the first convolution, which is the batch normalization layer after using W2 and b2. The output of this convolution is normalized to reduce the internal covariate bias. This indicates the first convolution, which is the batch normalization layer after using W1 and b1. The output of this convolution is normalized to reduce the internal covariate bias. The unified name for the "double convolution" module is:

[0032] ,

[0033] It includes two concatenated operations: "convolution → BN → ReLU";

[0034] The feature extraction encoder continuously compresses the time axis of the original input signal through max pooling operations, resulting in a compact representation with a global receptive field at x4:

[0035] ;

[0036] The high-dimensional features x4 extracted by the encoder are input into the feature reconstruction decoder. The feature reconstruction decoder consists of 4 upsampling modules. Each layer fuses the corresponding level encoder output feature map through skip connections to gradually restore the temporal resolution while preserving local details and semantic features.

[0037] Let u be the input of the i-th layer. i The previous level features and the output x of the 4-i layer in the encoder 4−i ,but:

[0038] ;

[0039] The final output of the feature reconstruction decoder is fed into the output mapping layer, and then a 1×1 one-dimensional convolutional layer is used to generate the prediction results for each time point. :

[0040] ,

[0041] Aligning the predictions to the target of one output point per second, one-dimensional average pooling is used for time compression, reducing 480 time points to 30 time points to obtain the prediction results. :

[0042] ,

[0043] in, ( ) indicates a one-dimensional average pooling operation, which performs a sliding window average on the signal along the time dimension; kernel_size = 16 indicates that the size of the pooling window is 16 time steps; stride = 16 indicates that the pooling window shifts 16 time steps in the time dimension each time, which is equivalent to splitting the entire sequence without overlap.

[0044] Finally, the binary classification prediction for each signal segment is output per second, completing the preliminary detection of apnea events at the second-by-second level.

[0045] By utilizing a symmetrical U-shaped encoder and decoder, and combining skip connections to fuse multi-scale features from adjacent levels, a refined feature extraction and second-by-second classification of single-channel abdominal respiratory signals is performed, achieving high-precision preliminary localization of respiratory events.

[0046] Furthermore, the preliminary prediction results are fused with the static features of the subjects through multi-source fusion to form a T×31-dimensional input sequence. The specific steps are as follows:

[0047] Single-channel abdominal breathing signals for each subject throughout the night It is divided into multiple 30-second signal segments in a non-overlapping manner, each segment having a length of L=480, totaling... There are several segments, and the j-th signal segment is represented as:

[0048] ,

[0049] Each signal segment is sequentially input into the trained UNet1D model. Output the corresponding predicted label for each second of apnea: ;

[0050] By performing segment-level splicing, the prediction results of all segments are spliced ​​together to form the preliminary prediction sequence for the subject throughout the night:

[0051] ,

[0052] The sequence This represents a preliminary classification result indicating whether sleep apnea events occurred every second during the subject's entire sleep process, serving as the basic input for subsequent feature fusion and sequence modeling;

[0053] Based on frequency domain analysis, dynamic respiratory rate features are extracted from abdominal respiratory signals to reflect changes in an individual's respiratory rhythm at different times.

[0054] j signal segments The spectral energy distribution is obtained by using Fast Fourier Transform (FFT). :

[0055] ,

[0056] Within the defined respiratory rate range, find the dominant frequency. :

[0057] ,

[0058] Convert this frequency to the respiratory rate of the current segment. :

[0059] ,

[0060] Finally, a respiratory rate sequence was obtained every 30 seconds. And it is extended to every second via broadcast, aligning with the signal throughout the night:

[0061] ,

[0062] This dynamic respiratory rate characteristic It reflects the rhythmic changes of an individual throughout the night's sleep and serves as a key physiological dynamic indicator in subsequent feature fusion;

[0063] The sleep stage labels of the subjects were read and one-hot encoded to form a sleep state feature vector per second. , This represents the total duration of the subject's signal throughout the night; the final matrix formed. for:

[0064] ,

[0065] Extract the 28-dimensional static feature vector corresponding to the subject. Including BMI and resting cardiopulmonary function indicators:

[0066] ,

[0067] This static feature vector is broadcast over the entire night's signal, extending it to every second via a time dimension, thus achieving time-series alignment.

[0068] ,

[0069] The preliminary prediction results, respiratory rate characteristics after broadcasting, sleep stage characteristics, and static physiological characteristics will be used to analyze the data. The sequences are concatenated along the feature dimensions to form the final input sequence:

[0070] ,

[0071] Where d = 1+1+1+28 = 31, is the feature dimension after fusion.

[0072] By incorporating information from multiple dimensions, such as respiratory rate, sleep stage, and static physiological characteristics, into subsequent time series modeling, personalized correction and optimization can be achieved.

[0073] Furthermore, a bidirectional long short-term memory network is used for context modeling, and a masked attention mechanism is introduced to focus on abnormal frames. The specific steps are as follows:

[0074] The input sequence is represented as:

[0075] ,

[0076] Where T represents the total duration of the subject's signal throughout the night, and d is the dimension of the fused features;

[0077] A masked self-attention mechanism is introduced before the bidirectional long short-term memory network module to enhance the model's attention to potential prediction error regions. Specifically:

[0078] Based on preliminary prediction results or abnormal distributions, a frame-level attention weight mask is constructed to weight the input features:

[0079] ,

[0080] in, This represents the original feature vector (of length d) at time t, such as the features extracted by a sensor or network in a certain frame; Control the attention intensity of each frame at each time step, with abnormal frames corresponding to higher weight values, and detach(⋅) means not participating in gradient backpropagation; It is the weighted and fused feature vector, that is, the weighted input sequence, which can be represented as: ;

[0081] The masked and weighted multi-source feature input sequence is fed into a bidirectional long short-term memory network to extract context-dependent features. This process is then used to fine-tune the original second-level prediction event sequence, resulting in a post-calibrated prediction sequence. :

[0082] ,

[0083] Where h is the hidden dimension of the LSTM output, which is then mapped to a binary classification prediction through a fully connected layer:

[0084] ,

[0085] Where σ(⋅) represents the Sigmoid activation function, used to generate the probability output of apnea events per second; This represents the final output vector, with each row corresponding to the predicted probability for one second. This represents a fully connected layer that operates on a time-step basis.

[0086] Based on the fusion of multi-source feature inputs such as cardiopulmonary function, a masked self-attention mechanism is introduced to enhance the model's sensitivity to abnormal frames. The guided post-calibration model combines a bidirectional long short-term memory network to complete context modeling and correct the sequence, ultimately outputting a more complete and accurate sleep apnea event prediction sequence. This improves the model's ability to model multi-scale joint second-level and global temporal contexts, the overall nature of apnea events, and individual adaptability.

[0087] Furthermore, an event structure-aware loss function is designed to achieve higher-quality boundary recognition and fragment integrity modeling at the event level, and a joint loss function is designed accordingly. :

[0088] ,

[0089] Binary cross-entropy loss per second The pointwise classification error between the model's prediction and the true label is measured every second and is defined as:

[0090] ,

[0091] in,

[0092] Event-level IoU loss : Measures the degree of overlap between predicted and actual event segments on the timeline, with the loss defined as 1 minus the Intersection over Union (IoU).

[0093] ,

[0094] in, This represents the set of indices for predicted event frames, such as time periods that are consecutively predicted as sleep apnea. This represents the set of indices of the real event frames; the larger the value of loU, the more the predicted segment overlaps with the real segment, and the smaller the loss. The loss is calculated for each event pair, and the average of the losses for multiple events is taken.

[0095] Event boundary offset loss This measure is used to determine the offset between the start and end boundaries of each predicted event and the actual event boundaries, using the absolute difference as the metric.

[0096] ,

[0097] Where M represents the number of events. , It reflects the start and end times of the p-th predicted event; , It reflects the start and end times of the i-th real event;

[0098] The weights of each part in the combined event structure-aware loss function are taken as follows: =0.45, =0.35.

[0099] The designed event structure-aware loss function, which integrates second-by-second and event-dimensional errors, can obtain global structural guidance from the integrity and boundary alignment capabilities of event fragments.

[0100] Furthermore, it also includes a comprehensive evaluation of the output predictions per second to measure the accuracy of detecting the timing of sleep apnea, with the following specific steps:

[0101] Second-level point-to-point prediction evaluation: Directly compare the model's predicted sequence with the actual labeled second by second, calculate the point-level confusion matrix and F1 score, and comprehensively measure the model's accuracy in predicting the timing of apnea.

[0102] Four-category event-level confusion matrix assessment: Based on the final output of apnea event fragments, calculate the apnea-hypopnea index (AHI) for each subject:

[0103] ,

[0104] According to international standard classification: AHI < 5 is normal, 5-15 is mild, 15-30 is moderate, and ≥ 30 is severe. A four-category confusion matrix analysis was performed on all subjects, and their F1 scores were calculated. Specifically:

[0105] Calculate the F1 score for second-level point-to-point predictions: Construct a confusion matrix: Compare the model's second-by-second predicted labels: "apnea" / "non-apnea", with the actual second-by-second labels, and calculate the following:

[0106] True example TP: The model predicts "pause" and the actual value is "pause";

[0107] False positive (FP): The model predicts "pause" but the actual value is "non-pause";

[0108] False negatives (FN): The model predicts "non-pause" but the actual value is "pause";

[0109] Calculate precision and recall:

[0110] ;

[0111] Calculate in seconds : ;

[0112] Calculate the event-level (four-category AHI) macro average F1:

[0113] Based on each person's predicted event fragments, the corresponding AHI classification is calculated: AHI<5 (normal), 5–15 (mild), 15–30 (moderate), ≥ 30 (severe).

[0114] For all subjects, a 4×4 confusion matrix of the true grading vs. the predicted grading is calculated, and for each gradation q, precision, recall, and F1 score are calculated for one class.

[0115]

[0116] ,

[0117] in, All are aimed at the first One-to-many statistics for categories.

[0118] By employing a dual evaluation strategy, the effectiveness and potential for application of the proposed method in single-channel scenarios are verified from two dimensions: micro-time series accuracy and macro-event trend. This method is applicable to clinical screening and routine monitoring.

[0119] The present invention also provides a single-channel sleep apnea detection system based on the method described in the present invention, including a data acquisition module, a preprocessing module, a second-by-second segmentation detection module based on UNet1D, a multi-source individual feature fusion module, and an event-oriented post-calibration optimization module.

[0120] The data acquisition module is used to acquire the subject's single-channel abdominal respiratory signal;

[0121] The input of the preprocessing module is connected to the output of the data acquisition module. The preprocessing module is used to preprocess the subject's single-channel abdominal respiratory signal.

[0122] The input of the second-by-second segmentation detection module is connected to the output of the preprocessing module. The second-by-second segmentation detection module is used to extract multi-scale features and make preliminary predictions of sleep apnea.

[0123] The input end of the multi-source individual feature fusion module is connected to the output end of the second-by-second segmentation detection module. The multi-source individual feature fusion module is used to fuse the preliminary prediction results with the static features of the subject to form a T×31-dimensional input sequence.

[0124] The input of the event-oriented post-calibration optimization module is connected to the output of the multi-source individual feature fusion module. The event-oriented post-calibration optimization module is used to obtain the final corrected sleep apnea detection result.

[0125] This system combines multi-scale feature fusion to achieve higher accuracy in apnea event localization. The guided post-calibration model, combined with temporal context information, effectively corrects the initial prediction sequence and generates more complete, continuous, and boundary-accurate sleep apnea event predictions.

[0126] Furthermore, the second-by-second segmentation and detection module includes a feature extraction encoder, a feature reconstruction decoder, and an output mapping layer connected in sequence;

[0127] The feature extraction encoder includes a 4-layer downsampling module, which sequentially passes the single-channel abdominal respiratory signal segment X through the 4-layer progressive downsampling module. Each layer includes max pooling and double convolution operations to achieve layer-by-layer feature extraction and temporal compression.

[0128] The feature reconstruction decoder consists of four upsampling modules. Each layer fuses the corresponding level encoder output feature map through skip connections to gradually restore the temporal resolution while preserving local details and semantic features.

[0129] The final output of the feature reconstruction decoder is fed into the output mapping layer, which then generates the prediction results for each time point through a 1×1 one-dimensional convolutional layer. .

[0130] The second-by-second segmentation detection module can perform refined feature extraction and second-by-second classification of single-channel abdominal respiratory signals, achieving high-precision preliminary localization of respiratory events.

[0131] Furthermore, the event-driven post-calibration optimization module includes a mask self-attention mechanism unit and a bidirectional long short-term memory network unit connected in sequence;

[0132] The mask self-attention mechanism unit is used to construct a frame-level attention weight mask and weight the input features;

[0133] The bidirectional long short-term memory network unit extracts context-dependent features based on the masked weighted multi-source feature input sequence, fine-tunes the original second-level prediction event sequence, and forms a post-calibrated prediction sequence.

[0134] The event-oriented post-calibration optimization module focuses on key frames through a masked self-attention mechanism, guiding the post-calibration model to correct the sequence by combining contextual information, and finally generating more complete, continuous and boundary-accurate sleep apnea event predictions. Attached Figure Description

[0135] Figure 1 This is a flowchart illustrating the single-channel sleep apnea detection and post-calibration method of the present invention, which integrates multi-source features of cardiopulmonary function. Detailed Implementation

[0136] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0137] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0138] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.

[0139] This invention discloses a single-channel sleep apnea detection and post-calibration method that integrates multi-source features of cardiopulmonary function. It integrates multi-source features such as cardiopulmonary function, utilizes a symmetrical U-shaped encoder and decoder, and combines skip connections to integrate multi-scale features of adjacent levels to perform refined feature extraction and second-by-second classification of single-channel abdominal respiratory signals, thereby achieving high-precision preliminary localization of respiratory events.

[0140] By combining each subject's static physiological characteristics (such as BMI and cardiopulmonary function), dynamic respiratory rate characteristics, and sleep stage information, an event-level guided post-calibration module integrating multi-source information was designed. A masked self-attention mechanism was introduced to address abnormal misjudged frames, and the event recognition boundary and completeness were optimized through an event structure-aware loss function. This significantly improved the model's adaptability to individual differences and its event-level calibration capability by combining continuous contextual information and multi-source features. Figure 1 As shown, the single-channel sleep apnea detection and post-calibration method integrating multi-source cardiopulmonary function features includes the following steps:

[0141] Single-channel abdominal respiratory signals were collected from the subjects and preprocessed.

[0142] The preprocessed single-channel abdominal breathing signal is input into an encoder-decoder architecture network (using the existing UET architecture, with skip connections enabled in the corresponding layers) to extract multi-scale features and make preliminary predictions of sleep apnea.

[0143] The preliminary prediction results are fused with the subject's cardiopulmonary static characteristics to form a T×31-dimensional input sequence;

[0144] Context modeling is performed using a bidirectional long short-term memory network, a masked attention mechanism is introduced to focus on abnormal frames, an event structure perception loss is designed, and the final corrected prediction results per second are output.

[0145] The present invention also provides a preferred embodiment of a method for preprocessing single-channel abdominal respiratory signals as follows:

[0146] Data from the subjects' single-channel abdominal respiratory signals were removed for 30 minutes before and after the event to remove noise.

[0147] The single-channel abdominal respiratory signal was downsampled at a frequency of 16 Hz. The downsampled signal was segmented into 30-second segments, and each segment had 480 numerical points. Normalization was performed on each segment.

[0148] Labels were retrieved and aligned for records of sleep apnea events using HTML files provided in the CFS dataset (the Cleveland Family Study (CFS) is the world's largest family-based study of sleep apnea, including 2,284 individuals from 361 families, conducted in four studies over 16 years. The study began in 1990 with the initial goal of quantifying family clusters of sleep apnea).

[0149] The present invention also provides a preferred embodiment, in which the preprocessed single-channel abdominal respiratory signal is input into an encoder-decoder architecture network to extract multi-scale features and preliminarily predict sleep apnea. The specific method is as follows:

[0150] The encoder network includes a feature extraction encoder, a feature reconstruction decoder, and an output mapping layer;

[0151] Preprocessed single-channel abdominal respiratory signal segment Represented as:

[0152] ,

[0153] Where B is the batch size, C=1 indicates a single channel, and L=480 indicates the timing length of each segment;

[0154] The feature extraction encoder includes four downsampling modules. The single-channel abdominal respiratory signal segment X is sequentially passed through these four progressive downsampling modules. Each layer includes max pooling and double convolution operations to achieve layer-by-layer feature extraction and temporal compression. Let x be the input to the i-th layer of the feature extraction encoder. i-1 The output is x i ,but:

[0155]

[0156] Let X0 = DoubleConv(X) be the feature representation of the original input signal X after initial convolution processing: ,

[0157] but, , ,

[0158] Where Pool() represents 2×2 max pooling with a downsampling factor of 2; W (i,1) ,b (i,1) This represents the weights and biases of the first convolution of the i-th downsampling module; BN (i,1) Indicates the first batch of normalization; W (i,2) ,b (i,2) This represents the weights and biases of the second convolution in the i-th downsampling module; BN (i,2) This represents the second batch normalization; σ(⋅) represents the ReLU activation function; This represents the i-th layer downsampling module, which first performs a 2×2 max pooling operation, followed by a "double convolution" operation, to progressively reduce the spatial resolution of the feature map and extract features from deeper layers. , These represent the kernel weights and biases of the first convolution, respectively. In DoubleConv, the input is first convolved with W1, and then the bias b1 is added. , These represent the kernel weights and biases of the first convolution, respectively. In DoubleConv, the input is first convolved with W2, and then the bias b2 is added. This indicates the first convolution, which is the batch normalization layer after using W2 and b2. The output of this convolution is normalized to reduce the internal covariate bias. This indicates the first convolution, which is the batch normalization layer after using W1 and b1. The output of this convolution is normalized to reduce the internal covariate bias. The unified name for the "double convolution" module is:

[0159] ,

[0160] It includes two concatenated operations: "convolution → BN → ReLU";

[0161] The feature extraction encoder continuously compresses the time axis of the original input signal through max pooling operations, resulting in a compact representation with a global receptive field at x4:

[0162] ;

[0163] The high-dimensional features x4 extracted by the encoder are input into the feature reconstruction decoder. The feature reconstruction decoder consists of 4 upsampling modules. Each layer fuses the corresponding level encoder output feature map through skip connections to gradually restore the temporal resolution while preserving local details and semantic features.

[0164] Let u be the input of the i-th layer. i The previous level features and the output x of the 4-i layer in the encoder 4−i ,but:

[0165] ;

[0166] The final output of the feature reconstruction decoder is fed into the output mapping layer, and then a 1×1 one-dimensional convolutional layer is used to generate the prediction results for each time point. :

[0167] ,

[0168] Aligning the predictions to the target of one output point per second, one-dimensional average pooling is used for time compression, reducing 480 time points to 30 time points to obtain the prediction results. :

[0169] ,

[0170] in, ( ) indicates a one-dimensional average pooling operation, which performs a sliding window average on the signal along the time dimension; kernel_size = 16 indicates that the size of the pooling window is 16 time steps; stride = 16 indicates that the pooling window shifts 16 time steps in the time dimension each time, which is equivalent to splitting the entire sequence without overlap.

[0171] Finally, the binary classification prediction for each signal segment is output per second, completing the preliminary detection of apnea events at the second-by-second level.

[0172] Based on a symmetrical one-dimensional U-shaped encoder and decoder structure, second-by-second segmentation prediction is performed, overcoming the problem of blurred event boundaries caused by fixed segment length classification in traditional methods. Combined with a multi-scale feature extraction module, higher accuracy in apnea event localization is achieved, significantly enhancing the model's ability to characterize apnea event boundaries and providing a reliable basis for more accurate calculation of the apnea-hypopnea index (AHI) in clinical practice.

[0173] The present invention also provides a preferred embodiment. In order to improve the model’s ability to adapt to individual differences, the present invention designs a multi-source individual feature fusion module based on the preliminary prediction, which introduces information from multiple dimensions such as respiratory rate, sleep stage and static physiological characteristics into the subsequent time series modeling, thereby achieving personalized correction and optimization.

[0174] The preliminary prediction results are fused with the static features of the subjects through multi-source fusion to form a T×31-dimensional input sequence. The specific steps are as follows:

[0175] Single-channel abdominal breathing signals for each subject throughout the night The signal was divided into multiple 30-second segments in a non-overlapping manner, each segment with a length of L=480 (sampling rate of 16 Hz), totaling... There are several segments, and the j-th signal segment is represented as:

[0176] ,

[0177] Each signal segment is sequentially input into the trained UNet1D model. Output the corresponding apnea prediction label per second (out of 30 seconds): ;

[0178] By using a segment-level concatenation operation, the prediction results of all segments are concatenated to form the preliminary prediction sequence for the subject throughout the night:

[0179] ,

[0180] The sequence This represents a preliminary classification result indicating whether sleep apnea events occurred every second during the subject's entire sleep process, serving as the basic input for subsequent feature fusion and sequence modeling;

[0181] Based on frequency domain analysis, dynamic respiratory rate (RR) features are extracted from abdominal respiratory signals to reflect changes in an individual's respiratory rhythm at different time periods.

[0182] For the j-th signal segment The spectral energy distribution is obtained by using Fast Fourier Transform (FFT). :

[0183] ,

[0184] Within the defined respiratory rate range, find the dominant frequency. :

[0185] ,

[0186] Convert this frequency to the respiratory rate of the current segment. :

[0187] ,

[0188] Finally, a respiratory rate sequence was obtained every 30 seconds. And it is extended to every second via broadcasting, aligning with the signal throughout the night:

[0189] ,

[0190] This dynamic respiratory rate characteristic It reflects the rhythmic changes of an individual throughout the night's sleep and serves as a key physiological dynamic indicator in subsequent feature fusion;

[0191] The sleep stage labels (such as Wake, N1, N2, N3, REM, etc.) of the subjects are read and one-hot encoded to form a sleep state feature vector per second. , This represents the total duration of the subject's signal throughout the night; the final matrix is:

[0192] ,

[0193] Extract the 28-dimensional static feature vector corresponding to the subject. This includes BMI and static cardiopulmonary function indicators (such as forced vital capacity (FVC) and peak expiratory flow (PEF)).

[0194] ,

[0195] This static feature vector is broadcast over the entire night's signal, extending it to every second via a time dimension, thus achieving time-series alignment.

[0196] ,

[0197] The preliminary prediction results, respiratory rate characteristics after broadcasting, sleep stage characteristics, and static physiological characteristics will be used to analyze the data. The sequences are concatenated along the feature dimensions to form the final input sequence:

[0198] ,

[0199] Where d = 1+1+1+28 = 31, is the fused feature dimension. This sequence serves as the input to the subsequent event-driven post-calibration optimization model, enabling temporal context modeling that combines local predictions with individual features.

[0200] This invention creatively integrates static physiological indicators such as BMI, FVC (forced vital capacity), and PEF (peak expiratory flow) with dynamic sleep state characteristics such as respiratory rate and sleep stages. By combining static and dynamic features, it effectively captures physiological differences between individuals and the dynamic changes in breathing patterns during sleep.

[0201] This multi-source fusion mechanism significantly improves the model's adaptability to the physiological characteristics of different subjects, fundamentally overcoming the problem of insufficient generalization performance of existing methods and achieving higher clinical consistency and applicability.

[0202] The present invention also provides a preferred embodiment, which uses a bidirectional long short-term memory network for context modeling and introduces a mask attention mechanism to focus on abnormal frames. The specific steps are as follows:

[0203] The input sequence is represented as:

[0204] ,

[0205] Where T represents the total duration of the subject's signal throughout the night (in seconds), and d is the fused feature dimension (including preliminary predicted value, respiratory rate, sleep stage coding, static features, etc.).

[0206] A masked self-attention mechanism is introduced before the bidirectional long short-term memory network module to enhance the model's attention to potential prediction error regions (abnormal frames). Specifically:

[0207] Based on preliminary prediction results or abnormal distributions, a frame-level attention weight mask is constructed to weight the input features:

[0208] ,

[0209] in, This represents the original feature vector (of length d) at time t, such as the features extracted by a sensor or network in a certain frame; Control the attention intensity of each frame at each time step, with abnormal frames corresponding to higher weight values, and detach(⋅) means not participating in gradient backpropagation; It is the weighted and fused feature vector, that is, the weighted input sequence, which can be represented as: ;

[0210] The masked and weighted multi-source feature input sequence is fed into a bidirectional long short-term memory network to extract context-dependent features. This process is then used to fine-tune the original second-level prediction event sequence, resulting in a post-calibrated prediction sequence. :

[0211] ,

[0212] Where h is the hidden dimension of the LSTM output, which is then mapped to a binary classification prediction through a fully connected layer:

[0213] ,

[0214] Where σ(⋅) represents the Sigmoid activation function, used to generate the probability output of apnea events per second; This represents the final output vector, with each row corresponding to the predicted probability for one second. This represents a fully connected layer that operates on a time-step basis.

[0215] (In sleep apnea event detection, consecutive frame segments that appear in isolation in time, are significantly different from the normal breathing frames before and after them, or whose model prediction confidence is significantly lower than the global average are called "abnormal sequences".)

[0216] Isolated 1-label sequence: If the model predicts apnea at a certain moment (label 1), but no similar event occurs in the seconds before and after, this "isolated 1" is more likely to be noise or a misjudgment and should be classified as an abnormal sequence.

[0217] Low confidence interval: When the probability of apnea in all frames within a certain period of time is lower than the global average confidence (or lower than the preset threshold), even if the predicted label is 0, it indicates that the signal characteristics in this interval are different from most normal breathing and can be regarded as abnormal.

[0218] Short-term sharp fluctuations: The prediction probability curve of normal respiratory signals is relatively smooth, while abnormal frames are often accompanied by peaks / sharp drops in attention weight or prediction probability—these intervals that change rapidly within a short window can also be identified as abnormal sequences.

[0219] In the model, frame-level attention weights Mt are used to "amplify" the features corresponding to these abnormal frames, enabling BiLSTM to better capture and suppress false positives or false negatives during subsequent calibration predictions, thereby improving overall robustness and accuracy.

[0220] This invention creatively designs an event-oriented post-calibration optimization module, introduces a mask self-attention mechanism, focuses on abnormal frames that appear in the initial prediction process, and significantly improves the model's attention intensity to error-prone prediction positions.

[0221] This invention also provides a preferred embodiment, designing an event structure-aware loss function to achieve higher-quality boundary recognition and fragment integrity modeling at the event level, and designing a joint loss function. :

[0222] ,

[0223] Binary cross-entropy loss per second The pointwise classification error between the model's prediction and the true label is measured every second and is defined as:

[0224] ,

[0225] in,

[0226] Event-level IoU loss : Measures the degree of overlap between predicted and actual event segments on the timeline, with the loss defined as 1 minus the Intersection over Union (IoU).

[0227] ,

[0228] in, This represents the set of indices for predicted event frames, such as time periods that are consecutively predicted as sleep apnea. This represents the set of indices of the real event frames; the larger the value of loU, the more the predicted segment overlaps with the real segment, and the smaller the loss. The loss is calculated for each event pair, and the average of the losses for multiple events is taken.

[0229] Event boundary offset loss This measure is used to determine the offset between the start and end boundaries of each predicted event and the actual event boundaries, using the absolute difference as the metric.

[0230] ,

[0231] Where M represents the number of events. , It reflects the start and end times of the p-th predicted event; , It reflects the start and end times of the i-th real event; the event boundary offset loss encourages the model to learn a boundary position closer to the truth, preventing the segment prediction from being too short or truncated.

[0232] The weights of each part in the combined event structure-aware loss function are taken as follows: =0.45, =0.35, specifically:

[0233] 1. Grid search

[0234] Within the range of α,β∈{0.0,0.05,0.10,…,1.0}, construct all (α,β) combinations with a step size of 0.05, and let γ=1−α−β (ensuring that the sum of the three is 1).

[0235] 2. Comprehensive evaluation indicators

[0236] For each set of weights, the same training strategy is used to train the model, and key metrics such as F1 score, average precision (AP), and average boundary offset of event detection are calculated on the validation set.

[0237] 3. Optimal weight selection

[0238] Ultimately, when α=0.45 and β=0.35, the model reaches its peak performance in both AP and F1, while the boundary offset loss is also effectively controlled; the remaining weights γ=0.20 correspond to the temporal consistency loss, which compensates for the overall effect.

[0239] Therefore, α=0.45 and β=0.35 are the optimal loss weight ratios automatically selected through grid search and comprehensive comparison of multiple indicators in a large number of validation experiments.

[0240] The post-calibration module innovatively designs an event structure-aware loss function, which jointly optimizes the classification error in the second-by-second dimension with the overall matching integrity of the event (IoU loss) and the event boundary alignment deviation (boundary offset loss). This guides the post-calibration model to combine temporal context information, effectively correct the initial prediction sequence, and generate more complete, continuous, and boundary-accurate sleep apnea event predictions, providing global structure and individual difference constraints for the second-level segmentation method.

[0241] Through joint optimization of the three parts, the model not only has high classification accuracy at the frame level, but also obtains global structural guidance from the integrity of event fragments and boundary alignment capabilities, realizing deep calibration from point to event.

[0242] This invention focuses on keyframes through a masked self-attention mechanism, designs an event structure-aware loss function, integrates second-by-second classification error, event-level matching completeness, and event boundary alignment deviation, and guides a post-calibration model to correct the sequence in conjunction with contextual information, ultimately generating more complete, continuous, and boundary-accurate sleep apnea event predictions.

[0243] This invention addresses the need for portable, deployable, and precisely localized sleep apnea detection. It features systematic technological innovations in areas such as signal simplification, multi-scale joint modeling based on second-level segmentation and global temporal context, event-guided post-calibration, and individualized adaptive methods. The aim is to provide an efficient, accurate, personalized, and clinically and home-based detection method for sleep disorder screening.

[0244] The present invention also provides a preferred embodiment, which further includes a comprehensive evaluation of the output predictions per second to measure the accuracy of detecting the timing of apnea, the specific steps of which are as follows:

[0245] Second-level point-to-point prediction evaluation: Directly compare the model's predicted sequence with the actual labeled second by second, calculate the point-level confusion matrix and F1 score, and comprehensively measure the model's accuracy in predicting the timing of apnea.

[0246] Four-category event-level confusion matrix assessment: Based on the final output of apnea event segments, calculate the AHI (Apnea-Hypopnea Index, i.e., the respiratory disturbance index or sleep apnea-hypopnea index) for each subject:

[0247] ,

[0248] According to international standard classification: AHI < 5 is normal, 5-15 is mild, 15-30 is moderate, and ≥ 30 is severe. A four-category confusion matrix analysis was performed on all subjects, and their F1 scores were calculated. Specifically:

[0249] Calculate the F1 score for second-level point-to-point predictions: Construct a confusion matrix: Compare the model's second-by-second predicted labels: "apnea" / "non-apnea", with the actual second-by-second labels, and calculate the following:

[0250] True example TP: The model predicts "pause" and the actual value is "pause";

[0251] False positive (FP): The model predicts "pause" but the actual value is "non-pause";

[0252] False negatives (FN): The model predicts "non-pause" but the actual value is "pause";

[0253] Calculate precision and recall:

[0254] ;

[0255] Calculate in seconds : ;

[0256] Calculate the event-level (four-category AHI) macro average F1:

[0257] Based on each person's predicted event fragments, the corresponding AHI classification is calculated: AHI<5 (normal), 5–15 (mild), 15–30 (moderate), ≥ 30 (severe).

[0258] For all subjects, a 4×4 confusion matrix of the true grading vs. the predicted grading is calculated, and for each gradation q, precision, recall, and F1 score are calculated for one class.

[0259] ,

[0260] ,

[0261] in, All are aimed at the first One-to-many statistics for categories.

[0262] This dual evaluation strategy verifies the effectiveness and potential for application of the proposed method in single-channel scenarios from two dimensions: micro-time series accuracy and macro-event trend. It is applicable to clinical screening and routine monitoring.

[0263] To fully verify the effectiveness of the single-channel sleep apnea detection and post-calibration method that integrates multiple features such as cardiopulmonary function proposed in this invention, the dataset was first divided into training set, validation set and test set in proportions of 70%, 15% and 15% to ensure the independence and representativeness of the training and validation data.

[0264] This invention divides the model development process into two stages: the training stage and the validation stage.

[0265] During the training phase, the time-series data of single-channel abdominal respiratory signals are first standardized and segmented into 30-second windows to construct sample sequences, which are then input into a U-shaped symmetric encoder-decoder network for training. The output layer compresses the original sequence from 480 points to 30 predicted values ​​per second through average pooling, thereby achieving preliminary detection of apnea events at the second-by-second granularity.

[0266] The training process employs a positive-negative sample balancing strategy and a Weighted Focal Loss function to effectively alleviate class imbalance. The optimizer is Adam, with a learning rate initialized to 0.001. AUPRC is used as the early stopping monitoring metric to record the weights of the best-performing model.

[0267] After completing the basic training, the second stage, optimization module training, begins. This stage uses the preliminary prediction sequence output from the first stage as input, further incorporating static individual features (such as cardiopulmonary indicators like BMI, FVC, and PEF) for fusion. The model employs a bidirectional long short-term memory network to extract temporal context, and a masking mechanism corrects only the incorrect prediction locations, avoiding overfitting to correct frames. The output is concatenated with the original confidence logits at the mask position to achieve selective rescoring.

[0268] The loss function employs a three-term combined perceptual loss structure: Focal BCE loss to improve attention to hard-to-classify samples; IoU loss to measure the overlap between predicted and actual events; and boundary loss to optimize for the bias in the start and end positions of events. Training uses the Adam optimizer, focusing on the convergence of the loss at the corrected position and the improvement of event quality.

[0269] During the validation phase, the optimal model weights saved during the training phase are loaded, and inference is performed on the test set. The model output first obtains an initial prediction at the second level through the basic detection module, then performs post-calibration through the event optimization module, and the final prediction result is comprehensively evaluated in two ways.

[0270] The present invention also provides a single-channel sleep apnea detection system based on the method described in the present invention, including a data acquisition module, a preprocessing module, a second-by-second segmentation detection module based on UNet1D, a multi-source individual feature fusion module, and an event-oriented post-calibration optimization module.

[0271] The data acquisition module is used to acquire the subject's single-channel abdominal respiratory signal; the input of the preprocessing module is connected to the output of the data acquisition module, and the preprocessing module is used to preprocess the subject's single-channel abdominal respiratory signal.

[0272] The input of the second-by-second segmentation detection module is connected to the output of the preprocessing module. The second-by-second segmentation detection module is used to extract multi-scale features and make preliminary predictions of sleep apnea.

[0273] The input end of the multi-source individual feature fusion module is connected to the output end of the second-by-second segmentation detection module. The multi-source individual feature fusion module is used to fuse the preliminary prediction results with the static features of the subjects to form a T×31-dimensional input sequence.

[0274] The input of the event-oriented post-calibration optimization module is connected to the output of the multi-source individual feature fusion module. The event-oriented post-calibration optimization module is used to obtain the final corrected sleep apnea detection results.

[0275] In a preferred embodiment of the present invention, the second-by-second segmentation and detection module includes a feature extraction encoder, a feature reconstruction decoder, and an output mapping layer connected in sequence.

[0276] The feature extraction encoder includes a 4-layer downsampling module, which sequentially passes the single-channel abdominal respiratory signal segment X through the 4-layer progressive downsampling module. Each layer includes max pooling and double convolution operations to achieve layer-by-layer feature extraction and temporal compression.

[0277] The feature reconstruction decoder consists of four upsampling modules. Each layer fuses the corresponding level encoder output feature map through skip connections to gradually restore the temporal resolution while preserving local details and semantic features.

[0278] The final output of the feature reconstruction decoder is fed into the output mapping layer, which then generates the prediction results for each time point through a 1×1 one-dimensional convolutional layer. .

[0279] In a preferred embodiment of the present invention, the event-driven post-calibration optimization module includes a mask self-attention mechanism unit and a bidirectional long short-term memory network unit connected in sequence.

[0280] The mask self-attention mechanism unit is used to construct a frame-level attention weight mask and weight the input features;

[0281] The bidirectional long short-term memory network unit extracts context-dependent features based on the masked weighted multi-source feature input sequence, fine-tunes the original second-level prediction event sequence, and forms a post-calibrated prediction sequence.

[0282] To further enhance the model's ability to model multi-scale joint second-level and global temporal contexts, the overall nature of sleep apnea events, and individual adaptability, this invention designs an event-oriented post-calibration optimization module. This module is based on the fusion of multi-source feature inputs such as cardiopulmonary function, introduces a masked self-attention mechanism to enhance the model's sensitivity to abnormal frames, designs an event structure-aware loss function, fuses second-by-second and event-dimensional errors, guides the post-calibration model to complete context modeling and correct the sequence by combining a bidirectional long short-term memory network, and finally outputs a more complete and accurate sleep apnea event prediction sequence.

[0283] This invention innovatively implements an end-to-end joint modeling architecture based on convolutional feature extraction and post-sequence calibration optimization, requiring only a single-channel abdominal respiratory signal input. This extremely simplified signal acquisition scheme completely avoids the drawbacks of traditional methods, such as cumbersome and uncomfortable equipment, effectively reducing the difficulty and cost of home monitoring and clinical auxiliary diagnosis.

[0284] Meanwhile, while ensuring high-precision prediction performance, this invention also takes into account the low power consumption and high real-time performance of the model, enabling sleep monitoring based on single-channel respiratory signals to be rapidly and widely applied in continuous health monitoring scenarios such as portable devices and wearable medical devices, demonstrating excellent industrialization prospects and practical value.

[0285] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0286] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A single-channel sleep apnea detection and post-correction method fusing multi-source features of cardiopulmonary function, characterized in that, The method comprises the following steps: Collecting a single-channel abdominal respiration signal of a subject and pre-processing the signal; Inputting the pre-processed single-channel abdominal respiration signal into an encoder-decoder architecture network, extracting multi-scale features, and preliminarily predicting sleep apnea; Multi-source fusion of the preliminary prediction result and the broadcasted respiration rate features, sleep staging features, and cardiopulmonary static features of the subject to form a T×31-dimensional input sequence, where T represents the total duration of the whole-night signal of the subject; Context modeling using bidirectional long short-term memory networks, introducing a mask attention mechanism to focus on abnormal frames, and designing event structure-aware loss To achieve higher quality boundary recognition and segment integrity modeling at the event level, including: per-second binary cross-entropy loss : measures the point-by-point classification error between the model's prediction and the true label for each second; event-level IoU loss : measures the degree of overlap between the predicted event segment and the real event segment on the time axis; event boundary offset loss : used to measure the degree of offset between the start and end boundaries of each predicted event and the real event boundaries; Outputting the final corrected per-second prediction result.

2. The single-channel sleep apnea detection and post-correction method fusing multi-source features of cardiorespiratory function according to claim 1, wherein, The method for pre-processing the single-channel abdominal respiration signal is as follows: Deleting the data 30 minutes before and after the single-channel abdominal respiration signal of the subject to remove noise; Down-sampling the single-channel abdominal respiration signal at a frequency of 16hz, segmenting the down-sampled signal into segments of 30s, and performing normalization on each signal segment, where each signal segment has 480 numerical points; Obtaining and aligning the labels of the sleep apnea event records through the html file provided in the CFS dataset.

3. The single-channel sleep apnea detection and post-correction method fusing cardiorespiratory function multi-source features according to claim 1, wherein, The specific method for inputting the pre-processed single-channel abdominal respiration signal into the encoder-decoder architecture network, extracting multi-scale features, and preliminarily predicting sleep apnea is as follows: The encoder network comprises a feature extraction encoder, a feature reconstruction decoder, and an output mapping layer; A pre-processed single-channel abdominal respiration signal segment is represented as: , Wherein, B is the batch size, C = 1 represents a single channel, and L = 480 represents the time sequence length of each segment; The feature extraction encoder comprises 4 layers of down-sampling modules, and a single-channel abdominal respiration signal segment X is sequentially passed through 4 layers of progressive down-sampling modules, each layer comprising a max-pooling and double convolution operation, realizing layer-by-layer feature extraction and time compression, wherein the input of the i-th layer of the feature extraction encoder is x i-1 , and the output is x i , and the feature extraction encoder is configured to perform the following operations: , Let X0 = DoubleConv(X) be the feature representation of the original input signal X after initial convolution processing: , Then , where Pool() represents 2x2 max-pooling with a down-sampling factor of 2; W (i,1) (i,1) represents the weights and bias of the first convolution of the i-th down-sampling module; BN (i,1) represents the first batch normalization; W (i,2) (i,2) represents the weights and bias of the second convolution of the i-th down-sampling module; BN (i,2) represents the second batch normalization; σ(·) represents the ReLU activation function; represents the i-th down-sampling module, i.e., first do a 2x2 max-pooling, and then do a "double convolution" operation, to gradually reduce the spatial resolution of the feature map and extract deeper features, respectively represent the convolution kernel weights and bias of the first convolution, and in DoubleConv, the input is first convolved with W1, and then the bias b1 is added; respectively represent the convolution kernel weights and bias of the second convolution, and in DoubleConv, the input is first convolved with W2, and then the bias b2 is added; represents the second convolution, i.e., the batch normalization layer after using W2, b2, to standardize the output of the convolution, to reduce the internal covariate shift; represents the first convolution, i.e., the batch normalization layer after using W1, b1, to standardize the output of the convolution, to reduce the internal covariate shift; represents the unified name of the "double convolution" module, i.e.:​​​​ , Which contains two "convolution -> BN -> ReLU" series operations; The feature extraction encoder continuously compresses the time axis of the original input signal segment through a maximum pooling operation, so that a compact representation with a global receptive field is formed at x4: ; The high-dimensional features x4 extracted through the encoder are input into the feature reconstruction decoder, which is composed of 4 up-sampling modules. Each layer fuses the corresponding level encoder output feature map through a jump connection, gradually restores the time resolution, and preserves local details and semantic features; Let the input u of the i-th layer be i the output x of the 4−i-th layer in the encoder 4−i Then: ; The final output of the feature reconstruction decoder is input to an output mapping layer, and a prediction result at each time point is generated through a 1x1 one-dimensional convolution layer : , The prediction is aligned to the target of one output point per second, time compression is performed using one-dimensional average pooling, 480 time points are compressed into 30 time points, and the prediction result is obtained : , wherein, ( ) represents a one-dimensional average pooling operation, which does a sliding window average of the signal along the time dimension; kernel_size = 16 means that the size of the pooling window is 16 time steps; stride = 16 means that the pooling window is shifted by 16 time steps in the time dimension at a time, which is equivalent to splitting the whole sequence without overlap; Finally, the binary classification prediction of each second in each signal segment is output, completing the preliminary detection of the apnea event at the per-second level.

4. The single-channel sleep apnea detection and post-correction method fusing cardiopulmonary function multi-source features according to claim 1, wherein, The specific steps for multi-source fusion of the preliminary prediction result and the broadcasted respiration rate features, sleep staging features, and static features of the subject to form a T×31-dimensional input sequence are as follows: Single-channel abdominal respiration signal for the whole night for each subject The signal is divided into non-overlapping segments of 30 seconds each, with a segment length of L = 480, resulting in segments, the jth segment is denoted by , Each signal segment is sequentially input into the trained UNet1D model , and the corresponding predicted label of apnea per second is output: ; Through a segment-level splicing operation, the prediction results of all segments are spliced to form the preliminary prediction sequence of the subject for the whole night: , The sequence represents the preliminary classification results of whether sleep apnea events occur every second throughout the sleep process of the subject, as the basis for subsequent feature fusion and sequence modeling input; Based on frequency domain analysis, dynamic respiration rate features are extracted from the abdominal respiration signal to reflect the respiratory rhythm changes of the individual at different time periods; for the jth signal segment , a fast Fourier transform (FFT) is used to obtain the frequency spectrum energy distribution : , Finding the dominant frequency within a defined breathing frequency range : , converts the frequency into a respiration rate of the current segment : , The final result is a sequence of respiratory rates, one every 30 seconds , and broadcasted to every second, aligned with the whole night signal: , The dynamic respiration rate feature Reflects the rhythmic changes of the individual during the whole night sleep and participates in the subsequent feature fusion as a key physiological dynamic indicator; Read the sleep staging labels of the subject and one-hot encode them to form a sleep state feature vector per second , represents the total length of the signal for the entire night of the subject; the final matrix formed is: ​ , extracting a 28-dimensional static feature vector corresponding to the subject including BMI, static cardiopulmonary function indicators: , The static feature vector is broadcasted and expanded to each second through the time dimension of the whole-night signal, achieving time sequence alignment: , The preliminary prediction result, the respiratory rate feature after broadcasting, the sleep staging feature, and the static physiological feature Splice along the feature dimension to form the final input sequence: , Wherein, d = 1+1+1+28 = 31, which is the feature dimension after fusion.

5. The single-channel sleep apnea detection and post-correction method fusing cardiorespiratory functional multi-source features according to claim 1, wherein, The specific steps for using a bidirectional long short-term memory network for context modeling and introducing a mask attention mechanism to focus on abnormal frames are as follows: The input sequence is represented as: , Wherein, T represents the total duration of the whole-night signal of the subject, and d is the feature dimension after fusion. Masked self-attention mechanism is introduced before the bidirectional long short-term memory network module to enhance the model's attention to the area of potential prediction error, specifically: Based on the preliminary prediction results or abnormal distribution, a frame-level attention weight mask is constructed to weight the input features: , wherein, represents the original feature vector at time t, with length d; controls the attention strength of each time frame, and the abnormal frame corresponds to a higher weight value, detach(·) represents not participating in gradient backpropagation; is the weighted fused feature vector, that is, the weighted input sequence, which can be represented as ; The mask-weighted multi-source feature input sequence is input into a bidirectional long short-term memory network to extract context-dependent features, fine-tune the original second-level prediction event sequence, and form a post-calibration prediction sequence : , where h is the hidden dimension of the LSTM output, which is then mapped to a binary classification prediction through a fully connected layer: , where, σ(·) represents a Sigmoid activation function, used to generate the probability output of apnea events per second; represents the final output vector, each row corresponds to the prediction probability of one second; represents a fully connected layer acting on each time step respectively.

6. The single-channel sleep apnea detection and post-correction method fusing cardio-respiratory function multi-source features according to claim 5, wherein, Design event structure perception loss To achieve higher quality boundary recognition and segment integrity modeling at the event level: , Binary cross-entropy loss at the per-second level : measures the point-wise classification error between the model's prediction and the true label for each second, defined as: , wherein ; Event-level IoU loss : measures the degree of overlap between the predicted event segment and the ground truth event segment on the time axis, defined as the loss by 1 minus the intersection over union, IoU: , wherein, represents a set of indices of predicted event frames, represents a set of indices of real event frames; the larger the loU value, the more the predicted segment overlaps with the real segment, the smaller the loss, and the loss is calculated for each event pair and averaged for multiple events; Event boundary offset loss : To measure the degree of offset between the start and end boundaries of each predicted event and the true event boundary, the absolute difference is used as a measurement indicator: , wherein M represents the number of events, , reflects the start and end time of the pth predicted event; , reflects the start and end time of the ith real event; The weights of the parts in the combined event structure perception loss function are taken, and the best loss weight is taken = 0.45, = 0.

35.

7. The single-channel sleep apnea detection and post-correction method fusing cardio-respiratory function multi-source features of claim 1, wherein, It also includes a comprehensive evaluation of the output per-second prediction to measure the accuracy of detecting the occurrence time of apnea, with the following specific steps: Second-level point-to-point prediction evaluation: directly compare the model prediction sequence with the true labeled second-by-second label, calculate the point-level confusion matrix and F1 score, and comprehensively measure the accuracy of the model in detecting the occurrence time of apnea; Four-class event-level confusion matrix evaluation: based on the final output of the apnea event segment, calculate the sleep apnea hypopnea index AHI of each subject: , According to the international standard classification: AHI < 5 is normal, 5-15 is mild, 15-30 is moderate, and ≥ 30 is severe. The four-class confusion matrix analysis is performed on all subjects to calculate the F1 score, specifically: Calculate the F1 of the second-level point-to-point prediction: construct the confusion matrix: compare the model's second-by-second prediction label: "apnea" / "non-apnea" with the true second-by-second label one by one, and count: True positives TP: the model predicts "apnea" and the true value is "apnea"; False positives FP: the model predicts "apnea" but the true value is "non-apnea"; False negatives FN: the model predicts "non-apnea" but the true value is "apnea"; Calculate the precision Precision and recall Recall: ; Computing seconds : ; Calculate the event-level macro-average F1: According to the predicted event segment of each person, calculate the corresponding AHI classification: AHI < 5, normal; 5-15, mild; 15-30, moderate; ≥ 30, severe; For all subjects, a 4x4 confusion matrix is constructed for the true classification vs. the predicted classification, and the precision, recall, and F1 for each class q are calculated: , , wherein, are one-to-many statistics for the first category.

8. A single channel sleep apnoea detection system based on the method of any one of claims 1 to 7, characterised in that, It includes a data acquisition module, a preprocessing module, a UNet1D-based second-by-second segmentation detection module, a multi-source individual feature fusion module, and an event-level guided post-calibration optimization module; The data acquisition module is used to collect the single-channel abdominal respiration signals of the subjects; The input end of the preprocessing module is connected with the output end of the data acquisition module, and the preprocessing module is used to preprocess the single-channel abdominal respiration signals of the subjects; The input end of the second-by-second segmentation detection module is connected with the output end of the preprocessing module, and the second-by-second segmentation detection module is used to extract multi-scale features and preliminarily predict sleep apnea; The input end of the multi-source individual feature fusion module is connected with the output end of the second-by-second segmentation detection module, and the multi-source individual feature fusion module is used to perform multi-source fusion of the preliminary prediction results and the static features of the subjects to form a Tx31-dimensional input sequence; The input end of the event-level guided post-calibration optimization module is connected with the output end of the multi-source individual feature fusion module, and the event-level guided post-calibration optimization module is used to obtain the final corrected sleep apnea detection results.

9. The single channel sleep apnea detection system of claim 8, wherein, The second-by-second segmentation detection module comprises a feature extraction encoder and a feature reconstruction decoder connected in sequence and an output mapping layer; The feature extraction encoder comprises four down-sampling modules, and a single-channel abdominal respiration signal segment X is sequentially passed through the four down-sampling modules in a progressive manner, each layer comprising a max-pooling operation and a double convolution operation, to realize layer-by-layer feature extraction and time series compression; The feature reconstruction decoder is composed of four up-sampling modules, each layer fusing the corresponding level encoder output feature map through a skip connection to gradually restore the time resolution while retaining local details and semantic features; The final output of the feature reconstruction decoder is input to an output mapping layer, which generates the prediction results at each time point through a 1x1 one-dimensional convolution layer .

10. The single channel sleep apnea detection system of claim 8, wherein, The event-level guided post-calibration optimization module comprises a mask self-attention mechanism unit and a bidirectional long short-term memory network unit connected in sequence; The mask self-attention mechanism unit is used to construct a frame-level attention weight mask to weight the input features; The bidirectional long short-term memory network unit extracts context-dependent features based on the mask-weighted multi-source feature input sequence, fine-tunes the original second-level predicted event sequence, and constructs a post-calibration prediction sequence.

Citation Information

Patent Citations

  • ECG sleep apnea detection method and system based on time sequence contrast learning

    CN117838062A

  • Sleep spindle wave automatic detection method and device fusing time sequence relevance and soft attention mechanism

    CN118035825A