Deep learning-based narcolepsy automatic identification method

By combining the feature extraction modules and external attention mechanisms of KAN and ResNet18, and dynamically learning nonlinear activation functions and channel attention, the problem of insufficient feature extraction and fusion capabilities in automatic narcolepsy identification is solved, achieving efficient sleep staging and narcolepsy identification, and improving the accuracy and generalization ability of the model.

CN121313097APending Publication Date: 2026-01-13HEBEI UNIV OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511342074.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing deep learning-based automatic identification methods for narcolepsy lack the ability to extract and fuse features, resulting in low accuracy and an inability to effectively replace traditional methods for clinical judgment. In particular, the accuracy of N1 stage is very low when the data is imbalanced.

Method used

A feature extraction module based on Kolmogorov-Arnold Network (KAN) and ResNet18 is used, combined with external attention mechanism and gating fusion scheme, to dynamically learn nonlinear activation function and channel attention, extract features of EEG and ECG signals, and use classifier to perform sleep staging and narcolepsy identification.

Benefits of technology

It significantly improves the accuracy of sleep staging and the efficiency of narcolepsy identification. Through the effective integration of multimodal information, it solves the problem of data class imbalance and improves the model's generalization ability and recognition accuracy, especially in the identification of N1 stage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121313097A_ABST
    Figure CN121313097A_ABST
Patent Text Reader

Abstract

The invention discloses a deep learning-based narcolepsy automatic identification method, and relates to the technical field of narcolepsy identification. The method comprises the following steps: reading, preprocessing and segmenting EEG / ECG sleep data of multiple subjects; an electroencephalogram feature extraction module based on a Kollogov-Arnod network (KAN) is adopted; an electrocardio feature extraction module based on ResNet18 transfer learning is adopted; feature integration is realized through a feature fusion module combining an external attention mechanism and a gating fusion scheme; and inputting the fused sleep heart-brain electrical features into a classifier for classification. Through innovative application of the deep learning technology, the defects of an existing method in feature extraction, fusion and classification are overcome, the efficiency and accuracy of sleep staging and narcolepsy recognition are remarkably improved, and the method has important clinical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of narcolepsy identification technology, and in particular to a deep learning-based automatic identification method for narcolepsy. Background Technology

[0002] Narcolepsy is a serious sleep disorder characterized by excessive daytime sleepiness, cataplexy, hypnagogic hallucinations, and sleep paralysis, which severely impact patients' quality of life, work capacity, and social activities. Timely and accurate diagnosis is crucial for developing effective treatment plans and improving patient prognosis.

[0003] The essence of narcolepsy is an imbalance in the sleep-wake regulatory network, especially the abnormal intrusion of REM sleep-related mechanisms into the waking phase. By analyzing the disturbances in sleep stages (such as the loss of control of muscle tone inhibition during SOREMP and REM sleep), not only can a definitive diagnosis be made, but it also provides key evidence for understanding the pathological mechanisms and developing targeted therapies.

[0004] Sleep stages are typically classified into non-rapid eye movement (NREM) sleep and rapid eye movement (REM) sleep. NREM sleep is further divided into N1, N2, and N3 stages, where N1 is light sleep, N2 is moderate sleep, and N3 is deep sleep. REM sleep is an active stage in the sleep cycle, often accompanied by rapid eye movements and dreaming.

[0005] Traditional methods such as polysomnography (PSG) and multiple sleep latency tests (MSLT) are important tools for diagnosing narcolepsy. PSG can monitor the structure and quality of a patient's nighttime sleep, while MSLT is used to quantify the degree of daytime sleepiness. However, traditional methods have some limitations, such as requiring specialized equipment and personnel, high cost, and long processing time.

[0006] Automated sleep scoring methods utilize advanced algorithms to analyze sleep data, offering advantages such as speed, convenience, and low cost. However, existing deep learning-based solutions also have some shortcomings, such as insufficient feature extraction capabilities and suboptimal feature fusion methods, resulting in lower accuracy, high data quality requirements, and the inability to completely replace traditional clinical judgment methods.

[0007] Physicians diagnose narcolepsy based on sleep staging results from nocturnal polysomnography (nPSG) and multiple daytime sleep latency tests (MSLT). Automated sleep scoring methods, as auxiliary tools, can improve diagnostic efficiency to some extent; however, due to insufficient feature extraction and fusion capabilities in current methods, the accuracy of automated staging is insufficient. Furthermore, the accuracy of N1 stage is very low due to data class imbalance, limiting its diagnostic value. Therefore, improving feature extraction and fusion methods in the automated identification of narcolepsy is of significant research value.

[0008] A patent search of existing technologies revealed that Chinese invention patent CN118749911B discloses a method for constructing a narcolepsy prediction model based on sleep stage characteristics. However, this patent uses a traditional MLP model architecture, which has limitations in linear modeling and insufficient feature extraction capabilities. In terms of feature fusion mechanism, it adopts a simple weighted fusion, which fails to solve the class imbalance problem and the feature fusion effect is not obvious. Therefore, the accuracy is low and the algorithm performance is insufficient. Summary of the Invention

[0009] One of the objectives of this application is to provide a deep learning-based method for automatic identification of narcolepsy.

[0010] To achieve the above objectives, the technical solution adopted in this application is as follows: an automatic identification method for narcolepsy based on deep learning, including: reading, preprocessing, and segmenting EEG / ECG sleep data from multiple subjects; resampling, label correction, shuffling, and training / validation set partitioning; and saving the data as a .npz file for subsequent sleep staging and narcolepsy research; employing an EEG feature extraction module based on Kolmogorov-Arnold Network (KAN) to extract EEG signal features through dynamic learning of nonlinear activation functions and channel attention mechanisms; employing an ECG feature extraction module based on ResNet18 transfer learning to extract ECG signal features by loading a pre-trained model and reusing its weights, combined with residual connection structures; achieving feature integration through a feature fusion module combining external attention mechanisms and gating fusion schemes, where the external attention mechanism captures global cross-domain associations and the gating fusion mechanism dynamically adjusts the modality weight distribution; inputting the fused sleep ECG-EEG features into a classifier for classification to obtain sleep staging results, which are then used for narcolepsy identification.

[0011] Preferably, the reading, preprocessing, and segmentation of EEG / ECG sleep data from multiple subjects includes: data loading and preprocessing; label loading and processing; data shuffling and segmentation; and data storage.

[0012] Preferably, the EEG feature extraction module based on Kolmogorov-Arnold Network (KAN) includes: after EEG signal input, features are extracted through convolutional layers, dimensionality is reduced through pooling layers, and dropout layers are used to prevent overfitting and enhance generalization; shallow features are extracted by the KAN module, two convolutional layers enhance the expression, and after pooling again, the features are entered into a second KAN module for in-depth feature extraction, and residual connections are used to fuse the features; in the parallel path, features are reduced in dimensionality through two rounds of convolution and pooling, and then dropped out to prevent overfitting, and key features are highlighted by weighting through an attention mechanism; the features of the main path and the parallel path are concatenated, and the generalization ability is enhanced by the dropout layer to form the final feature representation.

[0013] Preferably, the ECG feature extraction module based on ResNet18 transfer learning includes: fine-tuning the ResNet18 structure used in image recognition for the sleep stage feature extraction task in this paper; after ECG signal preprocessing, features are extracted through a 7×7 convolutional layer, and then reduced in dimensionality through a 3×3 max pooling layer; the feature map is sequentially passed through a four-stage residual block, with the number of convolutional kernels increasing and the resolution decreasing in stages, and the feature representation becoming increasingly abstract; it is compressed into a 512-dimensional feature vector through a global average pooling layer, and then input into a fully connected layer to output the final result.

[0014] Preferably, the feature integration achieved by the feature fusion module combining an external attention mechanism and a gating fusion scheme includes: dimensionally expanding and concatenating EEG and ECG features to generate a gating weight vector, providing basic weights for fusion; normalizing the weights and multiplying them with the original features and summing them to obtain preliminary fused features, where the weights reflect modal contribution; applying an external attention mechanism to EEG and ECG features, generating attention-enhanced features through high-dimensional mapping and double normalization; and adding the attention features, original features, and gating fused features to form a comprehensive feature expression that retains original information and enhances it.

[0015] Preferably, the step of inputting the fused sleep ECG-EEG features into a classifier for classification includes: inputting the fused features into the classifier and outputting sleep staging results; using a model trained on the ISRUC-S3 dataset to perform sleep staging on the entire night and five daytime short sleep PSG data of suspected narcolepsy patients; counting the number of REM episodes in the first eight minutes; and identifying narcolepsy within the average sleep latency.

[0016] Preferably, in the process of reading, preprocessing, and segmenting EEG / ECG sleep data from multiple subjects, the KAN architecture can directly learn and optimize a non-linear activation function, compared to an MLP model using a fixed activation function. The calculation formula is as follows:

[0017]

[0018] in, The learnable activation function is parameterized in spline function form as equation (2), which allows each weight parameter to be replaced by a single variable function, providing extremely high flexibility.

[0019]

[0020] coefficient c i During training, optimization methods such as gradient descent are used to minimize the loss function.

[0021] Preferably, in the feature integration achieved by combining an external attention mechanism and a gating fusion scheme, the gating mechanism is borrowed from information propagation control in recurrent networks, and can be formally expressed as: g = σ(W g x+b g )#(3).

[0022] Where g is the gate vector, σ is the sigmoid activation function, and W... g and b g These are the weights and biases of the gating mechanism, respectively.

[0023] Preferably, in the feature integration process achieved by combining an external attention mechanism and a gating fusion scheme, the final feature integration after gating fusion is given by the following formula:

[0024] h=g⊙h a +(1-g)⊙h x #(4)

[0025] Where ⊙ denotes element-wise multiplication, h a These are features that have undergone external attention processing, h x These are the original input features.

[0026] Preferably, the feature integration is achieved by combining an external attention mechanism and a gating fusion scheme in the feature fusion module;

[0027] z=σ(W x +b)#(5) The gated fusion module learns and adjusts the importance of features, which helps to solve the problem of data class imbalance; the external attention mechanism realizes flexible customization of the feature extraction process by finely adjusting parameters, thereby enhancing the model's adaptability to multimodal data features and improving its ability to process multimodal inputs;

[0028]

[0029] Where α i It is the attention weight of the i-th input, e i This is the corresponding energy score calculated by the model, used to evaluate the importance of each input modality; the feature adjustment using attention weights is as follows:

[0030]

[0031] Compared with the prior art, the beneficial effects of this application are as follows:

[0032] (1) The narcolepsy automatic identification method based on deep learning utilizes deep learning methods to establish a narcolepsy identification model based on sleep stages through feature extraction structures based on KAN and ResNet18 and feature fusion structures combining external attention mechanisms and gating fusion schemes.

[0033] (2) The KAN network is used to dynamically learn nonlinear activation functions, which effectively overcomes the shortcomings of traditional deep learning models in processing complex nonlinear signals and has strong generalization ability.

[0034] (3) The channel attention mechanism, by applying attention to different channels separately, can more accurately understand the complex relationships in the feature map. The introduction of transfer learning strategy effectively alleviates the problem of insufficient data labeling and enhances the generalization ability of the model.

[0035] (4) External attention mechanisms can more accurately understand the complex relationships in multimodal inputs by applying attention to different modalities separately.

[0036] (5) The gating mechanism can effectively integrate multimodal information by adaptively adjusting feature weights and nonlinear transformations.

[0037] (6) By using multimodal joint processing technology, the model improves its performance through information sharing and collaborative optimization, providing an efficient intelligent auxiliary tool for the clinical diagnosis of narcolepsy. Attached Figure Description

[0038] Figure 1 This is a flowchart of the narcolepsy automatic identification method based on deep learning according to the present invention.

[0039] Figure 2 This is a diagram illustrating the experimental results of sleep staging according to the present invention.

[0040] Figure 3 This is a confusion matrix diagram of the sleep staging results of this invention.

[0041] Figure 4 This is a schematic diagram of the sleep staging results of the advanced model of this invention on the ISRUC-S3 dataset.

[0042] Figure 5 This is a schematic diagram of hyperparameter training according to the present invention.

[0043] Figure 6 This is a schematic diagram showing the number of samples and their proportions for each sleep stage in this invention. Detailed Implementation

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

[0045] like Figures 1 to 6 As shown, the narcolepsy automatic identification method based on deep learning provided by the present invention includes:

[0046] S1: Read, preprocess, and segment EEG / ECG sleep data from multiple participants, resample, correct labels, shuffle, and split the training / validation sets, and save the data as .npz files for subsequent sleep staging and narcolepsy studies.

[0047] The specific implementation of S1 is as follows:

[0048] S101: Data Loading and Preprocessing: Define the extracted EEG data, raw data, and output path. Specify the EEG and ECG channels to be processed. Use the `loadmat` function to load the EEG and ECG data from the MAT file. Resample the data using the `resample` function to ensure that all channels have the same sampling frequency. Concatenate the processed channel data along the channel dimension into a three-dimensional array (number of samples × number of channels × time step).

[0049] S102: Tag Loading and Processing: Read sleep stage tags line by line from the text file and convert them into an integer array. Assign a one-to-one correspondence between the numbers in the tags and the sleep stages. Use an assert statement to ensure the number of tags matches the length of the EEG and ECG data.

[0050] S103: Data Shuffling and Splitting: Concatenate all subjects' EEG and ECG data and their corresponding labels into a global array along the sample dimension. Use the shuffle function to synchronously and randomly shuffle the EEG and ECG data and their labels to ensure uniform data distribution. Split the data into training and validation sets in a 90:10 ratio.

[0051] S104: Data Saving: Use the unique function to statistically analyze the label distribution of the training and validation sets. Save the EEG and ECG data and their labels from the training and validation sets as .npz files for later use.

[0052] S2: An EEG feature extraction module based on Kolmogorov-Arnold Network (KAN) is used to extract features of EEG signals by dynamically learning nonlinear activation functions and channel attention mechanisms.

[0053] The specific implementation of S2 is as follows:

[0054] S201: The model's input is an EEG signal. First, the EEG signal undergoes preliminary feature extraction through convolutional layers, extracting temporal or spatial features. Next, max pooling layers reduce the feature dimensionality while preserving key features. Then, through...

[0055] The Dropout layer randomly discards some of the neuron outputs to prevent overfitting and enhance the model's generalization ability.

[0056] S202: Next, the features enter the first KAN module to extract shallow sleep EEG features. Then, two convolutional layers further extract features to enhance their representation. A max-pooling layer is then used to reduce the feature dimensionality. The features then enter the second KAN module to further mine deeper features. Residual connections are used to fuse the original features with the extracted features, enhancing feature representation.

[0057] S203: Simultaneously, another set of convolutional and pooling layers extracts features in parallel. First, features are extracted through convolutional layers, then the feature dimensionality is reduced through max pooling layers. Then, features are extracted again through convolutional layers, and finally, max pooling layers further reduce the dimensionality. Features are protected against overfitting through dropout layers, and key features are weighted using a channel attention mechanism.

[0058] S204: Finally, the features from the main path and parallel paths are concatenated to form the final feature representation. The concatenated features are then further enhanced with a Dropout layer to improve generalization.

[0059] S3: An ECG feature extraction module based on ResNet18 transfer learning is adopted. By loading a pre-trained model and reusing its weights, combined with the residual connection structure, the features of the ECG signal are extracted.

[0060] The specific implementation method of S3 is as follows:

[0061] S301: The ResNet18 architecture is adopted and fine-tuned for the sleep phase feature extraction task presented in this paper. First, the ECG signal is input into the network as a one-dimensional time series. After preprocessing, it passes through a 7×7 convolutional layer with 64 kernels and a stride of 2 to extract local features. This layer outputs a feature map with 64 channels. Subsequently, the feature map passes through a 3×3 max-pooling layer with a stride of 2 to reduce resolution while preserving key feature information.

[0062] S302: Next, the feature map enters the four-stage residual block. The first stage contains two 3×3 convolutional layers with 64 kernels. Each convolutional layer is followed by batch normalization and a ReLU activation function. Simultaneously, the input is directly added to the output through residual connections to avoid the vanishing gradient problem. The second stage contains two 3×3 convolutional layers with 128 kernels. The feature map resolution is further reduced by convolutional layers with a stride of 2. The third stage contains two 3×3 convolutional layers with 256 kernels, further reducing the feature map resolution. The fourth stage contains two 3×3 convolutional layers with 512 kernels, further reducing the feature map resolution and making the feature representation more abstract.

[0063] S303: After the last residual block, the feature map is compressed into a 512-bit feature vector through a global average pooling layer to represent the global features of the ECG signal. Finally, the feature vector is input into a fully connected layer (fc) to generate the final feature representation or classification result. The output dimension is adjusted according to the specific task (e.g., classification or feature extraction).

[0064] S4: Feature integration is achieved by combining the feature fusion module with the external attention mechanism and the gating fusion scheme. The external attention mechanism captures global cross-domain associations, and the gating fusion mechanism dynamically adjusts the modality weight distribution.

[0065] The specific implementation of S4 is as follows:

[0066] S401: In the multimodal gating fusion process, the EEG and ECG features are first expanded and concatenated to form an original feature matrix containing both modalities. Simultaneously, a linear layer is used to process the features of each modality separately to generate corresponding gating weight vectors. This process learns the linear relationships in the feature space, providing basic weight information for subsequent feature fusion.

[0067] S402: Normalize the above gated weight vector along the modality dimension (dim = -2) using the Softmax function, so that the sum of the weights in the corresponding dimension is 1. Multiply the normalized weights element-wise with the original concatenated feature matrix to obtain the weighted feature representation. Summate the weighted features along the modality dimension to generate the preliminary fusion features. The larger the weight, the higher the contribution of the corresponding modality in the fusion.

[0068] S403: While performing the gated fusion mechanism, an external attention mechanism is applied to the result of adding EEG and ECG features. This involves first expanding the dimensionality of the original feature matrix (adding a final dimension), then mapping the final dimension from 1D to a 512D space using an external parameter Mk, generating a high-dimensional attention basis matrix to enhance feature representation. The attention matrix undergoes dual normalization: first, Softmax is applied along the feature dimension to generate a probability distribution; then, element-wise normalization is performed along the attention dimension to generate refined attention weights. Finally, a learnable parameter Mv maps the 512D attention representation back to the original 1D space, generating attention-enhanced features.

[0069] S404: The attention-enhanced features are added to the original input features and the gated fusion features to form the final comprehensive feature representation. This operation integrates the gated weights and key attention-enhanced features while preserving the original information.

[0070] S5: Input the fused sleep cardiac-electroencephalogram features into the classifier for classification to obtain sleep staging results, and use these results to identify narcolepsy.

[0071] The specific implementation method of S5 is as follows:

[0072] S501: The fusion features of ECG and EEG signals are processed and input into the classifier to obtain sleep staging results.

[0073] like Figure 6 As shown, the selected public dataset is ISRUC-S3, which consists of 8,549 physiological signal samples from 10 subjects. It contains multi-lead signal recordings and corresponding label information. Each PSG record contains 6 EEG channels, 2 EOG channels, 3 EMG channels and 1 ECG channel, covering all stages of the sleep cycle.

[0074] like Figure 5 As shown, a 10-fold cross-validation method was used to ensure the reliability of the experimental results and the generalization ability of the model. To ensure the balance and representativeness of the data, 80% of the data was used for model training and the remaining 20% ​​for validation. The focus loss function was used to reduce the weight of samples in easy sleep stages (such as N2 and N3) and increase the weight of samples in difficult sleep stages (such as N1 and REM), effectively alleviating the class imbalance problem.

[0075] To comprehensively evaluate the model's staging performance, five metrics were selected: accuracy, precision, recall, F1 score, and Cohen's Kappa coefficient. These metrics measure the model's performance in sleep staging, and the calculation formulas are as follows:

[0076]

[0077] Where TP represents correctly classified positive examples, TN represents correctly classified negative examples, FP represents negative examples that were misclassified as positive examples, and FN represents positive examples that were misclassified as negative examples. o For consistency in actual classification, P e Consistency for random classification.

[0078] like Figure 2 As shown, the performance metrics of this model at various sleep stages are presented, confirming its effectiveness in the five-stage sleep classification. The metrics for Wake and N3 stages are all high, indicating that the model can effectively extract and integrate the signal features of these stages. The REM stage shows high accuracy but low recall, suggesting that the model may miss some samples actually in this stage, but once detected, the probability of correct identification is high. The N2 stage shows high recall but low accuracy, indicating that samples in this stage are well captured, but samples from other stages are incorporated.

[0079] like Figures 4-6 As shown, the sleep staging results of state-of-the-art models on the ISRUC-S3 dataset in recent years are presented. The proposed model achieves the highest accuracy of 85.6%, especially with F1 scores of 0.933 and 0.923 for the W and N3 stages, respectively. Among all models related to sleep staging tasks, the accuracy for the N1 stage is generally the lowest, but it performs excellently in identifying the wakefulness (W) stage. The model can not only accurately identify the W stage, but also significantly improves the staging performance of the N1 stage compared to other models. Since the sample size for the N1 stage is smaller than that for the N2 and N3 stages, it effectively improves the class imbalance problem. As for the staging performance of the N2, N3 stages and the rapid eye movement (REM) stage, the performance of other models is relatively similar, and none of them can surpass the model in this study.

[0080] like Figure 3 As shown, correct predictions are on the diagonal, while incorrect predictions are off-diagonal. Correct predictions are significantly more numerous than misclassified predictions. Darker colors correspond to a greater number of correctly or incorrectly classified samples within the same category. In the off-diagonal region, the intersection of stages N1 and N2 is the darkest, indicating that stages N1 and N2 are prone to confusion in the automatic sleep staging task. In contrast, the intersection of stages N3 and REM is pure white, suggesting that these stages can be accurately distinguished.

[0081] S502: Using an automatic sleep staging model trained on the ISRUC-S3 dataset, sleep staging is performed on PSG data records of the entire night's sleep and five short daytime sleep episodes in patients suspected of having narcolepsy.

[0082] S503: Record the number of REM periods occurring within the first eight minutes of the phase results.

[0083] S504: Analyzing the experimental results, if the average sleep latency (time to fall asleep) is ≤8 minutes, and if rapid eye movement sleep (REM) occurs in at least 2 out of 5 daytime naps (MSLT test), or if REM occurs in 1 daytime nap, and REM is also recorded in the previous nighttime polysomnography (nPSG), then narcolepsy can be considered for diagnosis.

[0084] In step S1, compared to MLP models using fixed activation functions, the KAN architecture can directly learn and optimize nonlinear activation functions, calculated as follows:

[0085]

[0086] in, Let represent the learnable activation function, parameterized in spline function form as equation (2). This allows each weight parameter to be replaced by a univariate function, providing extremely high flexibility.

[0087]

[0088] coefficient c i During training, optimization methods such as gradient descent are used to minimize the loss function.

[0089] Second, in step S4, the gating mechanism borrows from the information propagation control in a recurrent network, and can be formally expressed as:

[0090] g=σ(W g x+b g )#(3)

[0091] Where g is the gate vector, σ is the sigmoid activation function, and W... g and b g These represent the weights and biases of the gating mechanism, respectively. The final feature integration after gating fusion is given by the following formula:

[0092] h=g⊙h a +(1-g)⊙h x #(4)

[0093] Where ⊙ denotes element-wise multiplication, h a These are features that have undergone external attention processing, h x These are the original input features.

[0094] z=σ(W x +b)#(5)

[0095] The gating fusion module helps address the problem of data class imbalance by learning and adjusting the importance of features.

[0096] External attention mechanisms enable flexible customization of the feature extraction process through fine-tuning of parameters, thereby enhancing the model's adaptability to multimodal data features and improving its ability to process multimodal inputs.

[0097]

[0098] Where α i It is the attention weight of the i-th input, e i It is the corresponding energy score calculated by the model, used to evaluate the importance of each input mode.

[0099] The feature adjustment using attention weights is as follows:

[0100]

[0101] Where z i This represents the adjusted feature for the i-th input.

[0102] In summary, the feature extraction module based on Kolmogorov-Arnold Network (KAN) and ResNet18 transfer learning can dynamically learn nonlinear activation functions, overcoming the shortcomings of traditional deep learning models in handling complex nonlinear signals and significantly improving the robustness and adaptability of feature extraction. It addresses the problem of class imbalance in data; for sleep stages with fewer samples, such as N1, the introduction of gating fusion and external attention mechanisms effectively improves class imbalance and enhances the model's recognition accuracy in rare stages. It enhances the model's generalization ability; the introduction of transfer learning effectively alleviates the problem of insufficient data labeling, enabling the model to exhibit strong generalization ability even on small datasets. It optimizes feature fusion; the combination of external attention and gating fusion schemes can dynamically adjust modality weight distribution, capture global cross-domain correlations, and thus more comprehensively integrate multimodal information from EEG and ECG signals, improving the model's staging performance and robustness. This invention significantly improves the accuracy of sleep staging. Experimental results on the ISRUC-S3 dataset show that the proposed model achieves an accuracy (ACC) of 85.6%, with F1 scores of 0.933 and 0.923 in the W and N3 stages, respectively, significantly outperforming other state-of-the-art methods. It can efficiently identify narcolepsy. Through an automatic sleep staging model combined with feature analysis from nocturnal polysomnography (nPSG) and multiple daytime sleep latency tests (MSLT), it can quickly and accurately identify narcolepsy, providing strong support for clinical diagnosis. This invention, through the innovative application of deep learning technology, overcomes the shortcomings of existing methods in feature extraction, fusion, and classification, significantly improving the efficiency and accuracy of sleep staging and narcolepsy identification, and has significant clinical application value.

[0103] The basic principles, main features, and advantages of this application have been described above. Those skilled in the art should understand that this application is not limited to the above embodiments. The embodiments and descriptions in the specification are merely the principles of this application. Various changes and modifications can be made to this application without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claims. The scope of protection claimed by this application is defined by the appended claims and their equivalents.

Claims

1. A method for automatic identification of narcolepsy based on deep learning, characterized in that, include: EEG / ECG sleep data from multiple participants were read, preprocessed, and segmented. Resampling, label correction, shuffling, and training / validation set partitioning were performed, and the data were saved as .npz files for subsequent sleep staging and narcolepsy research. An EEG feature extraction module based on Kolmogorov-Arnold Network (KAN) was used to extract EEG signal features through dynamic learning of nonlinear activation functions and channel attention mechanisms. An ECG feature extraction module based on ResNet18 transfer learning was used to extract ECG signal features by loading a pre-trained model, reusing its weights, and combining residual connection structures. Feature integration was achieved through a feature fusion module combining external attention mechanisms and a gating fusion scheme. The external attention mechanism captured global cross-domain associations, while the gating fusion mechanism dynamically adjusted the modality weight distribution. The fused sleep ECG-EEG features were input into a classifier for classification to obtain sleep staging results, which were then used to identify narcolepsy.

2. The method for automatic identification of narcolepsy based on deep learning as described in claim 1, characterized in that: The process of reading, preprocessing, and segmenting EEG / ECG sleep data from multiple subjects includes: data loading and preprocessing; label loading and processing; data shuffling and segmentation; and data storage.

3. The method for automatic identification of narcolepsy based on deep learning as described in claim 1, characterized in that: The EEG feature extraction module based on Kolmogorov-Arnold Network (KAN) includes: after EEG signal input, features are extracted through convolutional layers, dimensionality reduction through pooling layers, and overfitting and generalization enhancement through dropout layers; shallow features are extracted by the KAN module, enhanced by two convolutional layers, and then pooled again before entering a second KAN module for deeper feature extraction, with residual connections fusing features; in the parallel path, features undergo dimensionality reduction through two rounds of convolution and pooling, and then overfitting is prevented by dropout layers, with key features highlighted by an attention mechanism; features from the main path and parallel paths are concatenated, and the generalization ability is enhanced by dropout layers to form the final feature representation.

4. The method for automatic identification of narcolepsy based on deep learning as described in claim 1, characterized in that: The ECG feature extraction module based on ResNet18 transfer learning includes: fine-tuning the ResNet18 structure used in image recognition for the sleep stage feature extraction task in this paper; after ECG signal preprocessing, features are extracted through a 7×7 convolutional layer, and then reduced in dimensionality through a 3×3 max pooling layer; the feature map is sequentially passed through a four-stage residual block, with the number of convolutional kernels increasing and the resolution decreasing in each stage, and the feature representation becoming increasingly abstract; the feature is compressed into a 512-dimensional feature vector through a global average pooling layer, and then input into a fully connected layer to output the final result.

5. The method for automatic identification of narcolepsy based on deep learning as described in claim 1, characterized in that: The feature fusion module, which combines an external attention mechanism and a gating fusion scheme, achieves feature integration by: extending and concatenating the dimensions of EEG and ECG features to generate a gating weight vector, providing basic weights for fusion; normalizing the weights, multiplying them with the original features, and summing the results to obtain preliminary fused features, where the weights reflect modal contributions; applying an external attention mechanism to the EEG and ECG features, generating attention-enhanced features through high-dimensional mapping and double normalization; and adding the attention features, original features, and gating fused features to form a comprehensive feature expression that retains original information and enhances it.

6. The method for automatic identification of narcolepsy based on deep learning as described in claim 1, characterized in that: The process of inputting the fused sleep ECG-EEG features into a classifier for classification includes: inputting the fused features into the classifier and outputting sleep staging results; using a model trained on the ISRUC-S3 dataset to perform sleep staging on the entire night and five daytime short sleep PSG data of suspected narcolepsy patients; counting the number of REM episodes in the first eight minutes; and identifying narcolepsy within the average sleep latency.

7. The method for automatic identification of narcolepsy based on deep learning as described in claim 2, characterized in that: The process of reading, preprocessing, and segmenting EEG / ECG sleep data from multiple subjects utilizes the KAN architecture, which, compared to MLP models using fixed activation functions, can directly learn and optimize nonlinear activation functions. The calculation formula is as follows: in, The learnable activation function is parameterized in spline function form as equation (2), which allows each weight parameter to be replaced by a single variable function, providing extremely high flexibility. coefficient c i During training, optimization methods such as gradient descent are used to minimize the loss function.

8. The method for automatic identification of narcolepsy based on deep learning as described in claim 5, characterized in that: In the feature integration module that combines an external attention mechanism and a gating fusion scheme, the gating mechanism is borrowed from information propagation control in recurrent networks and can be formally expressed as: g = σ(W g x+b g )#(3) Where g is the gate vector, σ is the sigmoid activation function, and W... g and b g These are the weights and biases of the gating mechanism, respectively.

9. The method for automatic identification of narcolepsy based on deep learning as described in claim 8, characterized in that: In the feature integration process achieved by combining an external attention mechanism and a gating fusion scheme, the final feature integration after gating fusion is given by the following formula: h=g⊙h a +(1-g)⊙h x #(4) Where ⊙ denotes element-wise multiplication, h a These are features that have undergone external attention processing, h x These are the original input features.

10. The method for automatic identification of narcolepsy based on deep learning as described in claim 9, characterized in that: The feature integration is achieved by combining an external attention mechanism and a gating fusion scheme in the feature fusion module. z=σ(W x +b)#(5) The gated fusion module learns and adjusts the importance of features, which helps to solve the problem of data class imbalance; the external attention mechanism realizes flexible customization of the feature extraction process by finely adjusting parameters, thereby enhancing the model's adaptability to multimodal data features and improving its ability to process multimodal inputs; Where α i It is the attention weight of the i-th input, e i This is the corresponding energy score calculated by the model, used to evaluate the importance of each input modality; the feature adjustment using attention weights is as follows:

Citation Information

Patent Citations

  • A sleep staging method based on deep learning

    CN118749911B