Apnea syndrome detection method and device, computer equipment and medium
By constructing the TMNet neural network model, using convolutional layer and LSTM module to extract and capture physiological signal characteristics, and combining the feature distance loss function for training, the problem of large OSAS monitoring error is solved, and a more accurate and generalized monitoring effect is achieved.
Patent Information
- Application Number
- CN202510028938.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-08
- Publication Date
- 2025-04-15
AI Technical Summary
Monitoring of obstructive sleep apnea syndrome (OSAS) through machine learning has large errors and cannot be applied to practice, mainly due to the scarcity of data samples.
The TMNet neural network model is constructed, physiological signal features are extracted through convolutional layers and the time resolution is reduced, and the time dependence relationship is captured in combination with the LSTM module, and the feature distance is used as a loss function for training to achieve domain adaptation to reduce data dependence.
It improves the accuracy of OSAS monitoring and generalization capabilities of the model, can more accurately monitor the respiratory status of patients with special OSAS, and reduces the dependence on data of patients with special OSAS.
Smart Images

Figure CN119830111A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical analysis, and in particular relates to a method, device, computer equipment and medium for detecting sleep apnea syndrome. Background Art
[0002] Obstructive sleep apnea syndrome is a common sleep breathing disorder. It is characterized by apnea or hypopnea caused by pharyngeal stenosis during sleep, has a high prevalence, and is a disease with potentially fatal complications. The pathogenesis of OSAS is a clinical syndrome of chronic intermittent hypoxia and sleep fragmentation, accompanied by hypoxemia, hypercapnia and a series of physiological changes, which can easily cause systemic multi-system damage and lead to multi-organ and multi-system complications such as coronary heart disease, hypertension and diabetes. Common diagnostic methods include polysomnography (PSG) and cardiopulmonary recordings. Cardiopulmonary recordings usually include four or more channels (airflow, respiratory effort, ECG, SaO2 and / or snoring), single-channel or multi-channel recordings (especially including ECG and SaO2). Among them, polysomnography (PSG) is the gold standard for diagnosing obstructive sleep apnea syndrome.
[0003] For stroke patients, the detection of OSAS is particularly important. Stroke is an acute cerebrovascular disease, a group of diseases that cause brain tissue damage due to sudden rupture of brain blood vessels or blockage of blood vessels that prevent blood from flowing into the brain, including ischemic and hemorrhagic strokes. The incidence of ischemic stroke is higher than that of hemorrhagic stroke, accounting for 60% to 70% of the total number of strokes. Different types of strokes have different treatments. Due to the lack of effective treatment methods, prevention is considered the best measure. Among them, hypertension and OSAS are important controllable risk factors for stroke. Therefore, the detection of OSAS is particularly important for preventing the onset and recurrence of stroke.
[0004] At present, the sleep apnea recognition methods mainly include sleep apnea recognition methods based on traditional machine learning, deep learning, and the fusion of deep learning and machine learning. Traditional machine learning methods mainly rely on manual feature extraction, and then use machine learning to find the rules contained in the features, making decisions more complicated. The deep learning method only requires simple preprocessing of the data and does not require additional feature extraction, but this method often relies on a large amount of data. Due to the scarcity of medical data, this method still has shackles in the diagnosis and identification of sleep apnea. The fusion of deep learning and machine learning mainly uses the deep neural network's ability to extract features to make classification decisions on the extracted features, but this method does not achieve end-to-end training and is still relatively cumbersome.
[0005] Therefore, due to the limitation of data samples, the error of OSAS monitoring through machine learning is large and cannot be applied in practice. Summary of the invention
[0006] In order to solve the problem of large errors in OSAS monitoring through machine learning, the present invention provides a method, device, computer equipment and medium for detecting sleep apnea syndrome.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] First, a method for detecting sleep apnea syndrome is provided, the method comprising:
[0009] Construct a TMNet neural network model, including an input layer, a convolutional layer, an LSTM module, a fully connected layer, and an output module connected in sequence, and integrate a regularization module Dropout and a 1×1 convolutional module in the convolutional layer;
[0010] The physiological signals of common OSAS patients are obtained as source domain data, and the physiological signals of special OSAS patients are obtained as target domain data; the source domain and target domain data are respectively input into the TMNet neural network model, and the physiological signal features of the source domain and target domain data are respectively extracted through the convolution layer and the time resolution of the physiological signal features is reduced, and then the time dependency between the physiological signal features of the source domain and the target domain is captured through the LSTM module, and based on the time dependency, the characteristic distance between the physiological signal features corresponding to the source domain and the target domain is determined through the fully connected layer as the loss function, and the TMNet neural network model is trained with the goal of minimizing the loss function to obtain a respiratory monitoring model;
[0011] The target physiological signal of the OSAS patient to be monitored is obtained, and the target physiological signal is input into the respiratory monitoring model to obtain the physiological signal characteristics of the OSAS patient to be monitored.
[0012] Optionally, determining the feature distance between the physiological signal features corresponding to the source domain and the target domain as a loss function through the fully connected layer includes:
[0013] Based on the feature distribution distance of high-dimensional features, the similarity between source domain and target domain features is calculated using the L2 norm;
[0014] Determine the cross entropy loss between the physiological signal features corresponding to the source domain and the target domain;
[0015] The loss function of the fully connected layer is determined according to the similarity and the cross entropy loss.
[0016] Optionally, the formula for calculating the similarity between the source domain and the target domain features by using the L2 norm is:
[0017]
[0018] Among them, x ti ,xoi They are high-dimensional features belonging to the target domain data and the source domain data respectively, and m is the current batch size.
[0019] Optionally, the formula for determining the cross entropy loss between the physiological signal features corresponding to the source domain and the target domain is:
[0020]
[0021] in, is the cross entropy loss function, m is the batch of data, x oi represents the deep features of the i-th source domain data, x ti represents the deep features of the i-th target domain data, belonging to the y-th category. W represents the j-th column represented by the weight j of the last layer of full connection, and b represents the bias term, where the size of the data subset is m and the number of target categories is n.
[0022] Optionally, the loss function of the fully connected layer is:
[0023]
[0024] L is the overall loss function, λ is the penalty coefficient, and λ is set to 0.5.
[0025] Secondly, a sleep apnea syndrome detection device is provided, the device comprising:
[0026] The construction module is used to build the TMNet neural network model, including the sequentially connected input layer, convolution layer, LSTM module, fully connected layer and output module, and the regularization module Dropout and 1×1 convolution module are integrated in the convolution layer;
[0027] An acquisition module is used to acquire physiological signals of common OSAS patients as source domain data and physiological signals of special OSAS patients as target domain data;
[0028] A training module, which is used to input the source domain and target domain data into the TMNet neural network model respectively, extract the physiological signal features of the source domain and target domain data respectively through the convolution layer and reduce the time resolution of the physiological signal features, and then capture the time dependency between the physiological signal features of the source domain and the target domain through the LSTM module, and based on the time dependency, determine the characteristic distance between the physiological signal features corresponding to the source domain and the target domain through the fully connected layer as the loss function, and train the TMNet neural network model with the goal of minimizing the loss function to obtain a respiratory monitoring model;
[0029] The prediction module is used to obtain the target physiological signal of the OSAS patient to be monitored, and input the target physiological signal into the respiratory monitoring model to obtain the physiological signal characteristics of the OSAS patient to be monitored.
[0030] In addition, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned apnea syndrome detection method is implemented.
[0031] Finally, a computer device is provided, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the above-mentioned sleep apnea syndrome detection method when executing the program.
[0032] A sleep apnea syndrome detection method provided by the present invention has the following beneficial effects: first, a TMNet neural network model is constructed, wherein a 1×1 convolution operation helps to reduce the number of channels of a feature map or increase the nonlinear combination between channels, thereby increasing the expressive power of the model without significantly changing the size of the feature space, and the Dropout regularization technology prevents the model from overfitting by randomly discarding a portion of neurons, and the ReLU activation function introduces nonlinearity, so that the model can learn complex feature representations. At the same time, the ReLU has high computational efficiency and helps to accelerate the training process. In this way, the physiological signal features of the source domain and the target domain data are extracted through the convolution layer, and their time resolution is reduced, which helps to reduce the computational complexity of the model, while retaining key information, and capturing the time dependency between the physiological signal features through the LSTM module, which is conducive to accurately predicting the patient's respiratory state, and finally, by calculating the feature distance between the physiological signal features corresponding to the source domain and the target domain as the loss function and minimizing the loss function, the model is helped to learn the similarity of the physiological signal features between different patient groups, thereby improving the generalization ability of the model. In this way, by solving the difference in data distribution between the source domain and the target domain, especially for OSAS patients with special diseases, the domain adaptation method is used to make the features of the source domain data (ordinary OSAS patients) that are easier to classify easier to migrate to the target domain data (special OSAS patients), reducing the data dependence on special OSAS patients and being able to accurately monitor the respiratory status of special OSAS patients based on their physiological signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiment of the present invention and its design scheme, the following briefly introduces the drawings required for this embodiment. The drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 A schematic diagram of a TMNet neural network model provided by the present invention according to an exemplary embodiment.
[0035] Figure 2 The present invention is a flowchart of a method for detecting sleep apnea syndrome according to an exemplary embodiment of the present invention.
[0036] Figure 3 A schematic diagram of a migration weight provided according to an exemplary embodiment of the present invention.
[0037] Figure 4 The present invention is a block diagram of an apnea syndrome detection device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the technical solution of the present invention and implement it, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of protection of the present invention.
[0039] The present invention designs a neural network model, TMNet, which adopts a domain adaptation method. Figure 1 As shown, the source domain data is OSAS patients after special selection, and the target domain data is OSAS patients with complications such as heart and respiratory diseases. The model aims to enable the easy-to-classify features in the source domain data to be more efficiently migrated to the target domain data, ensuring that similar feature representations can be extracted from the source domain and target domain data. In deep learning, convolutional neural networks (CNNs) are well-known for their powerful feature extraction capabilities. It can effectively identify simple patterns in data and use these simple patterns to generate more complex feature representations in higher-level layers. Since the input data of the present invention is a physiological signal, the present invention particularly uses a 1*1 convolution layer. This design helps to capture local features in the signal while reducing computational complexity and the number of parameters.
[0040] In order to further improve the generalization ability of the model, the present invention shares the parameters of the convolutional layer. The advantage of this is that the model can learn more common representations of similar patterns in the signal, thereby achieving more effective knowledge transfer between different domains. In addition, in order to reduce the size of the parameter matrix and reduce the risk of overfitting, the present invention uses an average pooling layer. This operation not only helps to reduce the complexity of the model, but also increases its robustness to changes in input data. Batch Normalization is also used in the model to reduce internal covariate shifts, so that the model can converge to the optimal solution faster during training.
[0041] In general, the model will perform its own classification tasks (n classification tasks on the source domain and the target domain), and use the task as a driving force to help the convolution module extract effective features faster. At the same time, the present invention uses a distance-based distribution measurement method to measure the similarity of model features, aiming to achieve the feature representation extracted from different categories as consistent as possible in data distribution, while ensuring the separability between features, thereby improving the classification performance of the model.
[0042] The technical solutions provided by various embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0043] First, the present invention provides a method for detecting sleep apnea syndrome, specifically as follows Figure 2 As shown, the following steps are included:
[0044] S201. Build a TMNet neural network model.
[0045] In this step, a TMNet neural network model is first constructed. The TMNet neural network model includes an input layer, a convolution layer, an LSTM module, a fully connected layer, and an output module connected in sequence. A regularization module Dropout, a ReLU activation function, a normalization function, and a 1×1 convolution module are integrated in the convolution layer.
[0046] In this step, the present invention integrates Dropout (with a probability of 0.5), ReLU activation function, normalization, and 1×1 convolution operations in the convolution layer. In this method, due to the particularity of medical data and the scarcity of pre-training data, the present invention does not adopt the Freezing strategy. On the contrary, the present invention adopts the Share-not-Freeing approach, which can assist the model in learning more effective representations during the iteration process while reducing the temporal resolution. After being processed by the convolution module, the temporal resolution of the output is reduced, and more detailed representations can be extracted. Subsequently, these features containing time information are input into the LSTM module to capture the temporal dependencies between feature blocks.
[0047] In addition, the present invention also uses three fully connected layers, whose outputs are 128, 64, and n, respectively, where n is the specific classification number. In the first fully connected layer, the present invention uses a distance-based distribution measurement method to measure the similarity of features. The specific method is to calculate the geometric distance of the output of the first fully connected layer in the high-dimensional space, minimize the minimum distance, and make the feature representation data distribution extracted from different types of data as close to the same as possible.
[0048] Among them, for the loss function in the fully connected layer, the present invention introduces a generated feature distance representation loss function based on the distribution distance metric constraint method, and minimizes the generated feature distance representation loss function to achieve the most consistent distribution of feature representation data extracted from different classes while keeping the features separable.
[0049] By way of example, the present invention calculates the similarity of source domain and target domain features through the L2 norm based on the feature distribution distance of high-dimensional features; determines the cross entropy loss between the physiological signal features corresponding to the source domain and the target domain; and determines the loss function of the fully connected layer based on the similarity and the cross entropy loss.
[0050] For example, the formula for calculating the similarity between source domain and target domain features using the L2 norm is:
[0051]
[0052] Among them, x ti ,x oi are high-dimensional features belonging to the target domain data and the source domain data, respectively, and m is the current batch size. In an ideal case, x t ,x o As the number of network layers increases, the extracted features become more representative, but less interpretable. The classifier cannot extract understandable information from numerous redundant features for classification, especially for patients with special OSAS. For professional doctors, whether they are special OSAS patients or ordinary OSAS patients, the features they use for diagnosis are almost the same. The difference is that the physiological signals of special OSAS patients have more noise. Therefore, in order to make the target domain data (special OSAS patients) and the source domain data (ordinary OSAS patients) as consistent as possible in high-dimensional data distribution, the l2 norm is used to constrain the two high-dimensional features.
[0053] For the task loss function of assessing severity that the model needs to complete, the present invention still uses cross entropy loss. Therefore, the present invention uses lc and cross entropy loss together to complete this task. The formula for determining the cross entropy loss between the physiological signal features corresponding to the source domain and the target domain is:
[0054]
[0055]
[0056] in, is the cross entropy loss function, m is the batch of data, x oi represents the deep features of the i-th source domain data, x tirepresents the deep features of the i-th target domain data, belonging to the y-th category. W represents the j-th column represented by the weight j of the last layer of full connection, and b represents the bias term, where the size of the data subset is m and the number of target categories is n.
[0057] Finally, the loss function of the fully connected layer is determined by combining the feature distance and cross entropy loss:
[0058]
[0059] L is the overall loss function, λ is the penalty coefficient, and λ is set to 0.5.
[0060] The method of the present invention is mainly a domain adaptation method based on distance metric, so the model and loss function of the present invention are also designed based on the domain adaptation method of distance metric, and the model relies on the loss function to optimize the parameters so that feature alignment can be achieved at the end of the model. The loss function also requires the model to provide different domain data with the same latitude and differences.
[0061] Strengthening effect of domain adaptation methods: The introduction of feature distance loss combined with the convolution structure of shared parameters allows the source domain and target domain features to be effectively aligned in the shared convolution module. The design of the shared convolution layer maximizes the migration ability of features, which is consistent with the goal of feature distance loss, that is, to reduce the difference in feature distribution between the two domains. Consideration of temporal features and classification: The LSTM module captures time-dependent features, while the cross entropy loss is responsible for optimizing classification performance. The combination of the two ensures that the model can capture dynamic signal features and make accurate judgments on different categories of data. Dimensionality reduction supports loss optimization: The 1×1 convolution layer reduces feature complexity, making the optimization of feature distance loss more efficient while reducing the risk of overfitting.
[0062] Compared with other common loss functions (such as mean square error and single cross entropy), the combined loss function of the present invention has the following unique advantages: Stronger feature alignment capability: The feature distance loss makes the model's feature representation in the source domain and the target domain more consistent through explicit constraints, which is particularly suitable for processing data with significant domain differences. Improve the processing capability of specific cases: For complex complication data in the target domain, the introduction of feature distance loss significantly improves the generalization ability of the model, making it perform better in the classification of special cases. More efficient end-to-end training: The joint loss function integrates feature extraction and classification optimization, avoiding the complexity of multi-step training in traditional methods.
[0063] The introduction of feature distance loss makes transfer learning more effective by narrowing the distribution differences between domains. At the same time, combined with cross entropy to optimize classification performance, the performance of the model can be improved on complex and diverse data. This design is more adaptable to data distribution with high noise and complex background than the traditional single loss function, and helps to improve the robustness and accuracy in classification tasks.
[0064] In summary, the TMNet model proposed in this paper is a domain adaptation neural network based on deep learning, which focuses on solving the problem of data distribution differences between the source domain (common OSAS patients) and the target domain (special OSAS patients with complex complications). The main features of the TMNet model are as follows:
[0065] Convolutional module (Conv-Block): uses a 1×1 convolution kernel to enhance signal processing capabilities by reducing feature dimensionality and extracting local features, while reducing computational complexity. The shared parameter strategy shares convolutional layer parameters to facilitate feature migration and knowledge sharing between the source domain and the target domain.
[0066] Temporal dependency capture: The temporal dependency between sequence features is captured through the LSTM module.
[0067] Fully connected layer: gradually reduce the dimension and finally output the classification result.
[0068] Dropout and Batch Normalization: used to prevent overfitting and accelerate training convergence.
[0069] S202 , obtaining physiological signals of common OSAS patients as source domain data, and physiological signals of special OSAS patients as target domain data.
[0070] Source domain data refers to those representative and universal data that can reflect the general physiological characteristics of OSAS patients. For ordinary OSAS patients, their physiological signals usually include the following categories:
[0071] Respiratory signal: obtained through a respiratory belt or respiratory sensor, which can reflect the patient's respiratory rate, breathing depth and breathing pattern.
[0072] Blood oxygen saturation: measured by a blood oxygen saturation meter, which can reflect the oxygen content in the patient's blood during sleep.
[0073] Electrocardiogram: Obtained through an electrocardiograph, it can reflect the patient's heart activity and heart rate changes.
[0074] Electromyographic signals: obtained through electromyographic sensors, can reflect the patient's muscle activity, especially the muscle relaxation and tension during sleep.
[0075] These physiological signals usually show certain regularities and characteristics in common OSAS patients, which can be used to train the TMNet neural network model so that it can learn the general physiological characteristics of OSAS patients.
[0076] Target domain data refers to data that is special, different, or difficult to obtain directly, and can reflect certain special physiological characteristics or pathological conditions of OSAS patients. For special OSAS patients, their physiological signals may include the following special data:
[0077] Physiological signals of patients with severe OSAS: These patients may have more disordered respiratory signals, lower blood oxygen saturation, and more abnormal electrocardiogram and electromyographic signals.
[0078] Physiological signals of OSAS patients with other complications: For example, the physiological signals of OSAS patients with hypertension, diabetes or obesity may be affected by these complications and present more complex characteristics.
[0079] Physiological signals within a specific time period: For example, physiological signals obtained during a specific stage of a patient's sleep (such as rapid eye movement) may have more significant characteristics or changes.
[0080] These special physiological signals may show different patterns and characteristics in special OSAS patients than those in ordinary OSAS patients. Therefore, it is necessary to transfer the knowledge learned from the source domain data to the target domain data through transfer learning to improve the monitoring accuracy of the model for special OSAS patients.
[0081] For example, a physiological signal dataset containing 100 common OSAS patients can be obtained as source domain data, and the physiological signals of these patients include respiratory signals, blood oxygen saturation, electrocardiograms, and electromyographic signals. At the same time, the present invention also has a physiological signal dataset containing 20 special OSAS patients as target domain data, and these patients are all severe OSAS patients with hypertension.
[0082] When training the TMNet neural network model, the present invention first uses the physiological signals in the source domain data set to train the model so that it can learn the general physiological characteristics of ordinary OSAS patients. Then, the present invention inputs the physiological signals in the target domain data set into the model to capture the special physiological characteristics of special OSAS patients through transfer learning. During the training process, the present invention continuously adjusts the parameters of the model to minimize the feature distance between the source domain and target domain data as the loss function, thereby improving the monitoring accuracy of the model for special OSAS patients.
[0083] Finally, the respiratory monitoring model obtained by the present invention can accurately monitor the physiological signal characteristics of the OSAS patients to be monitored, and accurate monitoring results can be obtained for both ordinary patients and special patients.
[0084] S203. Based on the source domain and target domain data, transfer learning training is performed on the TMNet neural network model.
[0085] Specifically, the source domain and target domain data are respectively input into the TMNet neural network model, and the physiological signal features of the source domain and target domain data are respectively extracted through the convolution layer and the temporal resolution of the physiological signal features is reduced. The temporal dependency between the physiological signal features of the source domain and the target domain is captured through the LSTM module. Based on the temporal dependency, the characteristic distance between the physiological signal features corresponding to the source domain and the target domain is determined through the fully connected layer as the loss function. The TMNet neural network model is trained with the goal of minimizing the loss function to obtain a respiratory monitoring model.
[0086] After acquiring the source and target domain data, the TMNet neural network model is pre-trained using the source domain data. During the pre-training phase, the model extracts the spatial features of physiological signals through the convolutional layer and captures the temporal dependencies between these features through the LSTM module. The ReLU activation function is used to increase the nonlinearity of the model, the Dropout regularization technique is used to prevent overfitting, and normalization is used to ensure the stability of the data during training. The 1×1 convolution operation is used in the convolutional layer to change the number of channels of the feature map while keeping the spatial resolution of the feature map unchanged, which helps the model learn the features of physiological signals more effectively.
[0087] Based on the pre-training, some or all of the parameters of the model are transferred to the target domain data. This usually involves freezing some layers (such as convolutional layers) of the pre-trained model, that is, sharing the parameters of the convolutional layers so as to retain the feature extraction capabilities learned on the source domain, while adjusting other layers (such as LSTM modules and fully connected layers) to adapt to the particularities of the target domain data. Continue to train the model on the target domain data to minimize the feature distance between the source domain and target domain physiological signal features as a loss function. This can be achieved by calculating the feature distance metric between the feature vectors output by the fully connected layer. The parameters of the model are continuously adjusted through iterative optimization algorithms (such as Adam, SGD, etc.) to minimize the loss function, thereby improving the performance of the model on the target domain.
[0088] Use the validation set on the target domain data to evaluate the performance of the model, including indicators such as accuracy, recall, and F1 score. Tune the model based on the evaluation results, such as adjusting the learning rate, optimizer parameters, regularization strength, etc. If the model performance is not ideal, consider using more data enhancement techniques, adjusting the model structure, or trying other transfer learning strategies.
[0089] Through such a transfer learning training process, the present invention can effectively transfer the TMNet neural network model to the physiological signal data of special OSAS patients to obtain a respiratory monitoring model, thereby improving the performance of the model in the target domain.
[0090] S204 , obtaining a target physiological signal of the OSAS patient to be monitored, and inputting the target physiological signal into a respiratory monitoring model to obtain physiological signal characteristics of the OSAS patient to be monitored.
[0091] Specifically, physiological signals are collected first. For OSAS patients to be monitored, professional medical equipment is needed to collect their physiological signals. These devices may include breathing belts, blood oxygen saturation meters, electrocardiographs, etc., which are used to measure key physiological indicators such as the patient's respiratory rate, blood oxygen saturation, and electrocardiogram.
[0092] The acquisition process should be performed while the patient is sleeping to ensure that any apnea or other abnormal physiological phenomena that may occur during sleep can be captured.
[0093] Then, data preprocessing is performed. The collected raw physiological signals may contain noise or outliers, so preprocessing is required. This includes data cleaning (removing noise and outliers) and data standardization (converting data to the same scale).
[0094] The preprocessed data should be formatted in the same format as the source and target domain data used when training the model so that it can be directly input into the respiration monitoring model.
[0095] The pre-processed physiological signal data of the OSAS patient to be monitored is input into the trained TMNet neural network model by loading the data into the model and calling the prediction function of the model.
[0096] After receiving the input data, the model will process it in sequence through the input layer, convolution layer, LSTM module, fully connected layer and other structures. In the convolution layer, the model uses Dropout regularization technology, ReLU activation function, normalization and 1×1 convolution operation to extract the spatial features of physiological signals and reduce the temporal resolution of the features. The LSTM module is responsible for capturing the temporal dependency between these features, that is, the changing pattern of physiological signals at different time points.
[0097] After being processed by the fully connected layer, the model will output a feature vector that represents the physiological signal characteristics of the OSAS patient to be monitored. These characteristics may include key indicators such as respiratory rate, blood oxygen saturation changes, and electrocardiogram abnormalities. These characteristics can be used by doctors to further analyze and diagnose the conditions of the OSAS patients to be monitored, helping doctors to better understand the patients' sleep conditions and health conditions.
[0098] In order to further verify the effectiveness of the TMNet neural network model provided by the present invention, the present invention also conducted comparative experiments and ablation experiments.
[0099] In the comparative experiment, the present invention mainly compares the TMNet model with a variety of machine learning models (such as RUSBoost, KNN, SVM, LR) and deep learning models (such as LSTM, CNN+Dense, CNN+LSTM) applied to OSAS apnea events. The purpose of using the Apnea-ECG database is to compare the performance of these models on specially screened data. On private data, the present invention focuses on comparing the effect of the model on OSAS patient data with respiratory and other disease syndromes that have not been specially screened, in order to verify the generalization ability and practical application value of the model.
[0100] In the ablation experiment, the present invention mainly tests whether the domain adaptation method is effective on data with respiratory and other disease syndromes that have not been specially screened. By comparing the performance of the model using the domain adaptation method and the model without the domain adaptation method, the present invention can have a deeper understanding of the impact of the domain adaptation technology on the model performance and its effectiveness in processing complex and diverse data sets.
[0101] Through these two sets of experiments, the present invention hopes to comprehensively evaluate the performance of the TMNet model in the OSAS event classification task and provide strong support for its optimization and improvement in practical applications.
[0102] In the classification task of OSAS events, the present invention comprehensively compares the proposed TMNet model with a variety of existing machine learning models (such as RUSBoost, KNN, SVM, LR) and deep learning models (such as LSTM, CNN+Dense, CNN+LSTM). In order to ensure the fairness of the comparison, on the public database ApneaECG, the present invention strictly refers to the experimental data in the original literature for comparison. However, on the private data set of the present invention, due to the difference between input and output, the present invention appropriately reproduces and adjusts these models. In the specific experimental process, batch_size: 128, learning_rate: 0.001, Adam optimizer is used, and 200 training cycles (epochs). In order to allow the model to fully learn and converge, the present invention sets 200 training cycles (epochs). In terms of model evaluation, the present invention uses multiple indicators such as accuracy, specificity and sensitivity to measure the quality of the model.
[0103] In the comparative experiment, the present invention conducted two groups of experiments. In the first experiment, the present invention selected the Apnea-ECG database to verify whether the model of the present invention is also applicable to the specific selected OSAS data.
[0104] exist Figure 3 In the present invention, a special transfer learning strategy is adopted, that is, only the weights of the convolutional layer and LSTM module of the source domain are transferred. In order to obtain these weights, the present invention uses private domain data for pre-training. The advantage of this method is that even in the absence of target domain data, the present invention can still use domain adaptation technology to ensure that the model can be compared in a relatively fair environment. In this way, the present invention can not only utilize the knowledge of the source domain, but also avoid the information loss caused by the lack of target domain data to a certain extent, thereby improving the generalization ability and performance of the model.
[0105] Among the various models compared, the Ours-single model showed significant advantages. Its sensitivity was as high as 0.956, far exceeding other models, indicating its excellent ability to accurately capture OSAS events. Relatively speaking, the performance of other models in terms of sensitivity was generally inferior, especially the LSTM model, whose sensitivity was only 0.590. In terms of the ability to recognize negative examples, the RandomForest model performed best with a specificity of 0.949. Despite this, the Ours-single model also showed a high specificity of 0.941, which was only slightly lower than the RandomForest model. This result means that the Ours-single model also has excellent performance in distinguishing non-Apnea events, effectively reducing the possibility of misjudgment.
[0106] In addition, the accuracy of the Ours-Single model reached a high level of 0.963. This result not only ranks first among all models, but also fully proves that the Ours-Single model performs well in identifying both positive and negative examples, and has high accuracy and stability.
[0107] On the self-sampled data set, the present invention performs a four-classification task, including four categories: severe, moderate, mild, and normal. By using different models, the present invention compares their performance in terms of sensitivity, specificity, and accuracy. According to the tabel2 analysis, the Ours-double model stands out with an accuracy of 0.814, which is significantly better than other models. This shows that the Ours-double model can classify samples more accurately as a whole, whether it is severe, moderate, mild, or normal. The Ours-double model also ranks first with a high sensitivity of 0.845. This means that when identifying abnormal categories such as severe, moderate, and mild, the Ours-double model has a stronger ability and can capture more true positive examples. In terms of specificity, the Ours-double model also performs well, reaching 0.833. Specificity measures the model's ability to recognize negative examples (i.e., normal categories), and high specificity means that the model can avoid misjudging normal samples as abnormal.
[0108] Compared with other models, the Ours-double model shows significant advantages in all indicators. For example, although the RandomForest model performs relatively well in accuracy and specificity, its sensitivity is still inferior to that of Ours-double. Similarly, although deep learning models such as LSTM and CNN+Dense have certain advantages in processing complex data, their performance in this task is not outstanding.
[0109] In order to further verify the effectiveness of the domain adaptation method in the model, the present invention designed an ablation experiment. In the experiment, the present invention set up two groups of controls: for the self-sampling dataset, one group applied the domain adaptation method, namely Ours-double, which fully utilized the advantages of the domain adaptation technology; the other group did not use the domain adaptation method, named Ours-s ingle-N, this group did not perform the migration of pre-trained weights during the model construction process, and the present invention used the cross entropy loss function for measurement. For the Apnea-ECG dataset, since the dataset does not have OSAS patient data of respiratory and cardiac syndrome, in order to ensure fairness, the present invention can only use one for comparison, namely Ours-s ingle, which migrated the pre-trained weights, and its loss function, the present invention selected the mean square error (MSE) as the evaluation criterion; and in the self-sampling dataset. In order to ensure the consistency and comparability of the experiments, the remaining hyperparameters of the two groups of models strictly follow the settings of Experiment 1.
[0110] By analyzing the experimental data, it is found that the method using domain adaptation on the two datasets is better than the method without domain adaptation.
[0111] On the Apnea-ECG database, the Ours-single model using domain adaptation is far superior to the Ours-single-N model without domain adaptation. On the Ours dataset, the Ours-double using domain adaptation is also superior to the Ours-single-N model without domain adaptation.
[0112] Using the above method, the TMNet neural network model is first constructed, in which the 1×1 convolution operation helps to reduce the number of channels of the feature map or increase the nonlinear combination between channels, thereby increasing the expressiveness of the model without significantly changing the size of the feature space. The Dropout regularization technology prevents the model from overfitting by randomly discarding a part of the neurons. The ReLU activation function introduces nonlinearity, enabling the model to learn complex feature representations. At the same time, ReLU has high computational efficiency and helps to accelerate the training process. In this way, the physiological signal features of the source domain and target domain data are extracted through the convolution layer and their temporal resolution is reduced, which helps to reduce the computational complexity of the model while retaining key information. The temporal dependency between the physiological signal features is captured through the LSTM module, which is conducive to accurately predicting the patient's respiratory state. Finally, by calculating the feature distance between the physiological signal features corresponding to the source domain and the target domain as the loss function and minimizing the loss function, the model can learn the similarity of physiological signal features between different patient groups, thereby improving the generalization ability of the model. In this way, by solving the difference in data distribution between the source domain and the target domain, especially for OSAS patients with special diseases, the domain adaptation method is used to make the features of the source domain data (ordinary OSAS patients) that are easier to classify easier to migrate to the target domain data (special OSAS patients), reducing the data dependence on special OSAS patients and being able to accurately monitor the respiratory status of special OSAS patients based on their physiological signals.
[0113] Secondly, the present invention also provides a sleep apnea syndrome detection device, such as Figure 4 As shown, including:
[0114] The construction module 401 is used to construct a TMNet neural network model, including an input layer, a convolution layer, an LSTM module, a fully connected layer and an output module connected in sequence, and a regularization module Dropout and a 1×1 convolution module are integrated in the convolution layer.
[0115] The acquisition module 402 is used to acquire the physiological signals of common OSAS patients as source domain data and the physiological signals of special OSAS patients as target domain data.
[0116] The training module 403 is used to input the source domain and target domain data into the TMNet neural network model respectively, extract the physiological signal features of the source domain and target domain data respectively through the convolution layer and reduce the time resolution of the physiological signal features, and then capture the time dependency between the physiological signal features of the source domain and the target domain through the LSTM module, and based on the time dependency, determine the characteristic distance between the physiological signal features corresponding to the source domain and the target domain through the fully connected layer as the loss function, and train the TMNet neural network model with the goal of minimizing the loss function to obtain a respiratory monitoring model.
[0117] The prediction module 404 is used to obtain the target physiological signal of the OSAS patient to be monitored, and input the target physiological signal into the respiratory monitoring model to obtain the physiological signal characteristics of the OSAS patient to be monitored.
[0118] Using the above device, a TMNet neural network model is first constructed, in which a 1×1 convolution operation helps to reduce the number of channels of the feature map or increase the nonlinear combination between channels, thereby increasing the expressiveness of the model without significantly changing the size of the feature space. The Dropout regularization technology prevents the model from overfitting by randomly discarding a part of the neurons. The ReLU activation function introduces nonlinearity, so that the model can learn complex feature representations. At the same time, ReLU has high computational efficiency and helps to accelerate the training process. In this way, the physiological signal features of the source domain and target domain data are extracted through the convolution layer and their temporal resolution is reduced, which helps to reduce the computational complexity of the model while retaining key information. The temporal dependency between the physiological signal features is captured through the LSTM module, which is conducive to accurately predicting the patient's respiratory state. Finally, by calculating the feature distance between the physiological signal features corresponding to the source domain and the target domain as the loss function and minimizing the loss function, the model can learn the similarity of the physiological signal features between different patient groups, thereby improving the generalization ability of the model. In this way, by solving the difference in data distribution between the source domain and the target domain, especially for OSAS patients with special diseases, the domain adaptation method is used to make the features of the source domain data (ordinary OSAS patients) that are easier to classify easier to migrate to the target domain data (special OSAS patients), reducing the data dependence on special OSAS patients and being able to accurately monitor the respiratory status of special OSAS patients based on their physiological signals.
[0119] The present invention also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 Steps of a method for detecting sleep apnea syndrome are provided.
[0120] The present invention also provides a computer device. At the hardware level, the computer device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Steps of a method for detecting sleep apnea syndrome are provided.
[0121] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0122] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0125] It should be noted that the above specific implementation methods can enable those skilled in the art to more fully understand the invention, but do not limit the invention in any way. Therefore, although the invention has been described in detail in this specification, those skilled in the art should understand that the invention can still be modified or replaced by equivalents; and all technical solutions and improvements that do not deviate from the spirit and scope of the invention are included in the protection scope of the patent for the invention. Any figure mark in the claims should not be regarded as limiting the claims involved.
Claims
1. A method for detecting sleep apnea syndrome, characterized in that: The method comprises: Construct a TMNet neural network model, including an input layer, a convolutional layer, an LSTM module, a fully connected layer, and an output module connected in sequence, and integrate a regularization module Dropout and a 1×1 convolutional module in the convolutional layer; The physiological signals of common OSAS patients are obtained as source domain data, and the physiological signals of special OSAS patients are obtained as target domain data; the source domain and target domain data are respectively input into the TMNet neural network model, and the physiological signal features of the source domain and target domain data are respectively extracted through the convolution layer and the time resolution of the physiological signal features is reduced, and then the time dependency between the physiological signal features of the source domain and the target domain is captured through the LSTM module, and based on the time dependency, the characteristic distance between the physiological signal features corresponding to the source domain and the target domain is determined through the fully connected layer as the loss function, and the TMNet neural network model is trained with the goal of minimizing the loss function to obtain a respiratory monitoring model; The target physiological signal of the OSAS patient to be monitored is obtained, and the target physiological signal is input into the respiratory monitoring model to obtain the physiological signal characteristics of the OSAS patient to be monitored.
2. A method for detecting sleep apnea syndrome according to claim 1, characterized in that: Determining the feature distance between the physiological signal features corresponding to the source domain and the target domain through the fully connected layer as the loss function includes: Based on the feature distribution distance of high-dimensional features, the similarity between source domain and target domain features is calculated using the L2 norm; Determine the cross entropy loss between the physiological signal features corresponding to the source domain and the target domain; The loss function of the fully connected layer is determined according to the similarity and the cross entropy loss.
3. A method for detecting sleep apnea syndrome according to claim 1, characterized in that: The formula for calculating the similarity between the source domain and the target domain features by L2 norm is: Among them, x ti ,x oi They are high-dimensional features belonging to the target domain data and the source domain data respectively, and m is the current batch size.
4. A method for detecting sleep apnea syndrome according to claim 3, characterized in that: The formula for determining the cross entropy loss between the physiological signal features corresponding to the source domain and the target domain is: Among them, l is the cross entropy loss function, m is the batch of data, and x oi represents the deep features of the i-th source domain data, x ti represents the deep features of the i-th target domain data, belonging to the y-th category. W represents the j-th column represented by the weight j of the last layer of full connection, and b represents the bias term, where the size of the data subset is m and the number of target categories is n.
5. A method for detecting sleep apnea syndrome according to claim 4, characterized in that: The loss function of the fully connected layer is: L is the overall loss function, λ is the penalty coefficient, and λ is set to 0.
5.
6. A sleep apnea syndrome detection device, characterized in that: The device comprises: The construction module is used to build the TMNet neural network model, including the sequentially connected input layer, convolution layer, LSTM module, fully connected layer and output module, and the regularization module Dropout and 1×1 convolution module are integrated in the convolution layer; An acquisition module is used to acquire physiological signals of common OSAS patients as source domain data and physiological signals of special OSAS patients as target domain data; A training module, which is used to input the source domain and target domain data into the TMNet neural network model respectively, extract the physiological signal features of the source domain and target domain data respectively through the convolution layer and reduce the time resolution of the physiological signal features, and then capture the time dependency between the physiological signal features of the source domain and the target domain through the LSTM module, and based on the time dependency, determine the characteristic distance between the physiological signal features corresponding to the source domain and the target domain through the fully connected layer as the loss function, and train the TMNet neural network model with the goal of minimizing the loss function to obtain a respiratory monitoring model; The prediction module is used to obtain the target physiological signal of the OSAS patient to be monitored, and input the target physiological signal into the respiratory monitoring model to obtain the physiological signal characteristics of the OSAS patient to be monitored.
7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the program.
Citation Information
Cited By
Respiration-related electromyographic signal online extraction method and system and storage medium
CN121071315A
Apnea syndrome evaluation method and system based on smart watch
CN121101472A