K-complex wave detection method, device, equipment and storage medium during sleep
By constructing a K-complex wave detection model with technical means such as convolutional neural network and downsampling network with jump connection, the accuracy and speed problems in multi-channel EEG data detection are solved, and efficient and accurate K-complex waves are achieved. Test.
Patent Information
- Application Number
- CN202411563548.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-11-05
AI Technical Summary
In multi-channel EEG data detection, the anisotropy of the feature space leads to a decrease in the judgment accuracy of the classifier, and when the data is input into the model according to the channel for discrimination, the detection speed is significantly reduced.
A K-composite wave detection model is constructed using convolutional neural networks, downsampling networks with jump connections, feature fusion extraction networks, standardized streams and classifiers. The first hidden encoding is transformed through a standardized stream to make it obey the standard Gaussian distribution and eliminate anisotropy; a downsampling network with jump connection and feature fusion extraction network extracts multi-scale features to improve the semantic richness of the feature vector.
It improves the accuracy and speed of K-composite wave detection, solves the accuracy and speed problems of multi-channel EEG data detection, and realizes the ability to perform multi-channel input and overall judgment while maintaining high accuracy.
Smart Images

Figure CN119055254B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sleep monitoring, and in particular to a method, device, equipment and storage medium for detecting K-complex waves during sleep. Background Art
[0002] For the detection of K-complex waves in EEG (Electroencephalogram), the most common automated detection method is to use a deep neural network to extract the dynamic association between the morphological features of EEG and the time span, and then use a multi-layer perceptron classifier for classification, and then determine whether there is a K-complex wave in the current waveform segment. However, in actual medical scenarios, EEG obtained from electrodes at multiple locations in the patient's brain is often used for detection and judgment, that is, the data input into the neural network is multi-channel, and as long as the EEG of any channel is detected with a K-complex wave, it can be determined that a K-complex wave has appeared. In the context of multiple channels, if the network is used directly to extract features from the data, the distribution of the feature space will inevitably be anisotropic. The data in the anisotropic space has problems such as uneven distribution and unclear semantic relationships, which will lead to a significant decrease in the judgment accuracy of the classifier compared to the results in the context of single-channel data. If the data is input into the model for judgment by channel, although the judgment accuracy can be guaranteed not to decrease, the detection speed will be significantly reduced in the face of several hours of patient data. Summary of the invention
[0003] In response to the above-mentioned technical problems, the purpose of the present application is to provide a method, device, equipment and storage medium for detecting K-complex waves during sleep, aiming to solve the technical problems that the anisotropy generated in the feature space when detecting multi-channel EEG leads to a decrease in the judgment accuracy of the classifier and a significant decrease in the speed of inputting data into the model for discrimination detection by channel, so as to improve the accuracy and speed of K-complex wave detection.
[0004] In a first aspect, an embodiment of the present application provides a method for detecting K-complex waves during sleep, comprising:
[0005] Inputting EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model comprises a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalization stream and a classifier; wherein the skip connections in the downsampling network provide the outputs of each layer of the downsampling network to the feature fusion extraction network;
[0006] The EEG data of the N channels are processed by the convolutional neural network, the downsampling network with skip connection and the feature fusion extraction network in sequence, and then a first latent code is output;
[0007] Transform the vector space where the first latent code is located using a standardized flow to obtain a second latent code that obeys a standard Gaussian distribution;
[0008] The second latent code is input into the classifier for processing, and after processing, a judgment result of whether a K-complex wave exists in the current EEG segment is output.
[0009] Furthermore, the K-complex wave detection model uses negative log likelihood NLL as the loss function of the standardized flow during the training phase. The NLL of the standardized flow is expressed as:
[0010]
[0011] Among them, z is the first hidden code, To normalize the reverse process of the flow, is the complex distribution of input data, is the standard normal distribution, is the logarithm of the Jacobian value corresponding to the normalized flow reverse process.
[0012] Furthermore, the K-complex wave detection model also includes an artifact elimination module. The EEG data of the N channels also pass through the artifact elimination module before passing through the convolutional neural network. The artifact elimination module is used to perform artifact elimination processing on the EEG data of the N channels and input the artifact elimination processing results into the convolutional neural network.
[0013] Furthermore, the convolutional neural network includes a two-dimensional convolutional layer, a fully connected layer and an activation function; the two-dimensional convolutional layer performs a convolution downsampling operation on the input time dimension T and channel dimension N, and then the output of the two-dimensional convolutional layer is processed by the fully connected layer and the activation function in turn, and its output result is input into the downsampling network with jump connection.
[0014] Furthermore, the downsampling network with jump connections includes n serially connected downsampling modules, each of which includes a fully connected layer, an activation function and a gated recurrent unit GRU connected in sequence; the output of each downsampling module is input into the feature fusion extraction network and the next downsampling module.
[0015] Furthermore, the feature fusion extraction network is a bidirectional feature pyramid network, which receives the downsampling results of each level of the downsampling network with jump connections, performs bidirectional feature fusion on the downsampling results of each level, and finally outputs the first latent code through a multi-layer perceptron.
[0016] Furthermore, the classifier is a multi-layer perceptron classifier.
[0017] In a second aspect, an embodiment of the present application provides a device for detecting K-complex waves during sleep, the device comprising:
[0018] An input module, used to input EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model includes a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalization stream and a classifier;
[0019] A processing module, for outputting a first latent code after the EEG data of the N channels are processed by the convolutional neural network, the downsampling network with skip connection and the feature fusion extraction network in sequence;
[0020] A normalization flow module, configured to transform the vector space where the first latent code is located using a normalization flow to obtain a second latent code that obeys a standard Gaussian distribution;
[0021] The classification module is used to input the second latent code into the classifier for processing, and after processing, output a judgment result on whether a K-complex wave exists in the current EEG segment.
[0022] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for detecting K-complex waves during sleep as described in any one of the above items are implemented.
[0023] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method for detecting K-complex waves during sleep as described in any one of the above items are implemented.
[0024] The embodiments of the present application introduce technologies such as standardized flow, skip connection, and multi-scale feature fusion, which effectively improve the accuracy, speed, and ease of use of K-complex wave detection. Specifically, the standardized flow is introduced to transform the first latent code output by the feature fusion extraction network so that it obeys the standard Gaussian distribution, and the standard Gaussian distribution is an isotropic space. In the isotropic feature space, the distribution of vectors is uniform, and vectors with similar semantics will be closer in distance, so the classifier can make more accurate judgments, thereby improving the accuracy of K-complex wave detection. In addition, the embodiments of the present application use a downsampling network with skip connections and a feature fusion extraction network in the feature extraction stage, and the skip connections in the downsampling network provide the outputs of each layer of the downsampling network to the feature fusion extraction network. In this way, while effectively extracting EEG information, it also greatly improves the semantic richness of the feature vector, which can effectively improve the discrimination accuracy of the K-complex wave detection model. In addition, when faced with multi-channel EEG data, the traditional K-complex wave detection model can only perform detection on a channel-by-channel basis in order not to sacrifice accuracy, which reduces the detection speed. The K-complex wave detection model proposed in the embodiment of the present invention achieves the ability of multi-channel input and overall discrimination while maintaining high accuracy, thereby improving the detection speed, which makes it more likely that this technology will be implemented in actual medical scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the implementation manner will be briefly introduced below. Obviously, the drawings described below are only some implementation manners of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 is a flow chart of a method for detecting K-complex waves during sleep provided in one embodiment of the present application;
[0027] Figure 2 is a structural schematic diagram of a K-complex wave detection model provided in an embodiment of the present application;
[0028] Figure 3 is a structural schematic diagram of a K-complex wave detection model provided in another embodiment of the present application;
[0029] Figure 4 It is a schematic diagram of the structure of the bidirectional feature pyramid network and its input and output;
[0030] Figure 5 is a schematic diagram of the structure of a device for detecting K-complex waves during sleep provided in an embodiment of the present application;
[0031] Figure 6It is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0033] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "a", "an", "above", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any module and all combinations of one or more associated listed items.
[0034] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0035] like Figure 1 , Figure 2 As shown, the embodiment of the present application provides a method for detecting K-complex waves during sleep, the method comprising S1-S4:
[0036] S1. Inputting EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model comprises a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalization stream and a classifier; wherein the skip connections in the downsampling network provide the outputs of each layer of the downsampling network to the feature fusion extraction network.
[0037] In step S1, electroencephalogram (EEG) is a method of recording brain activity using electrophysiological indicators. When the brain is active, the postsynaptic potentials of a large number of neurons that occur synchronously are summed up. It records the changes in electric waves during brain activity and is a general reflection of the electrophysiological activity of brain nerve cells on the surface of the cerebral cortex or scalp. K-complex waves are a type of brain wave that appears in the top or central area during non-rapid eye movement sleep stage II. The convolutional neural network, the downsampling network with jump connections, the feature fusion extraction network, the normalization stream, and the classifier are connected in sequence. Specifically, EEG data of N channels are collected when the user is sleeping, N is a positive integer, and the EEG data of N channels are input into the K-complex wave detection model.
[0038] S2. The EEG data of the N channels are processed in sequence by the convolutional neural network, the downsampling network with skip connection and the feature fusion extraction network, and then the first latent code is output.
[0039] In step S2, the convolutional neural network is used to extract channel dimension features and time dimension features. The downsampling network is used to perform downsampling processing, and the jump connection in the downsampling network provides the output of each layer of the downsampling network to the feature fusion extraction network to improve the semantic richness of the network extracted features. The feature fusion extraction network realizes multi-scale feature fusion and extraction. The first hidden code is a hidden code containing rich information, which carries the fused extracted features.
[0040] S3. Use a standardized flow to transform the vector space where the first latent code is located to obtain a second latent code that obeys a standard Gaussian distribution.
[0041] In step S3, Normalizing Flow (NF) is a generative modeling method whose goal is to transform a complex probability distribution into a simpler known distribution (such as Gaussian distribution or uniform distribution) through a series of reversible transformations. In the embodiment of the present application, the vector space where the first latent code is located is transformed by using the normalizing flow to transform it into a second latent code that obeys the standard Gaussian distribution. The second latent code obeys the standard Gaussian distribution. variables, and the standard Gaussian distribution is an isotropic space, thereby eliminating the anisotropy of the vector space where the first latent code is located. This solves the problem that the existing model method directly uses the network to extract features from the data, and the distribution of the feature space becomes anisotropic, resulting in a significant decrease in the judgment accuracy of the classifier. The present application uses a standardized flow to transform the vector space where the first latent code is located, so that the second latent code obtained after the transformation obeys the standard Gaussian distribution, and realizes the transformation to an isotropic feature space. In the isotropic feature space, the vectors are evenly distributed, and semantically similar vectors are also closer in distance, so the classifier can make more accurate judgments. Specifically, it is achieved through the following formula, ;in, represents a normalized stream, is the first hidden code, is the second hidden code.
[0042] S4. Input the second latent code into the classifier for processing, and after processing, output a judgment result on whether a K-complex wave exists in the current EEG segment.
[0043] In the embodiment of the present application, the classifier performs binary classification on the second latent code, and finally outputs a judgment result on whether a K-complex wave exists in the current EEG segment.
[0044] The embodiments of the present application introduce technologies such as standardized flow, skip connection, and multi-scale feature fusion, which effectively improve the accuracy, speed, and ease of use of K-complex wave detection. Specifically, the standardized flow is introduced to transform the first latent code output by the feature fusion extraction network so that it obeys the standard Gaussian distribution, and the standard Gaussian distribution is an isotropic space. In the isotropic feature space, the distribution of vectors is uniform, and vectors with similar semantics will be closer in distance, so the classifier can make more accurate judgments, thereby improving the accuracy of K-complex wave detection. In addition, the embodiments of the present application use a downsampling network with skip connections and a feature fusion extraction network in the feature extraction stage, and the skip connections in the downsampling network provide the outputs of each layer of the downsampling network to the feature fusion extraction network. In this way, while effectively extracting EEG information, it also greatly improves the semantic richness of the feature vector, which can effectively improve the discrimination accuracy of the K-complex wave detection model. In addition, when faced with multi-channel EEG data, the traditional K-complex wave detection model can only perform detection on a channel-by-channel basis in order not to sacrifice accuracy, which reduces the detection speed. The K-complex wave detection model proposed in the embodiment of the present invention achieves the ability of multi-channel input and overall discrimination while maintaining high accuracy, thereby improving the detection speed, which makes it more likely that this technology will be implemented in actual medical scenarios.
[0045] like Figure 3As shown, in one embodiment, the K-complex wave detection model also includes an artifact elimination module. The EEG data of the N channels also pass through the artifact elimination module before passing through the convolutional neural network. The artifact elimination module is used to perform artifact elimination processing on the EEG data of the N channels and input the artifact elimination processing results into the convolutional neural network.
[0046] In the embodiment of the present application, specifically, the input of the K-complex wave detection model is N-channel EEG data with a sampling rate of 500 Hz. , where N is the number of EEG channels, F is the number of sampled frames, T is the length of the sampled frame, and R is a real number. The artifact removal module uses the PureEEG algorithm to remove N channels of EEG data. Perform preprocessing to obtain artifact elimination processing results , the specific formula is as follows:
[0047] .
[0048] PureEEG is an algorithm that automatically removes artifacts from EEG signals, including noise introduced by eye movements, electromyography, and electrocardiogram. The algorithm can effectively remove artificial artifacts from EEG signals, thereby improving the readability of EEG signals affected by artifacts. This is very helpful for applications such as epilepsy monitoring, and can better analyze and diagnose patients' EEG activities. The PureEEG algorithm includes three main steps: 1. Use independent component analysis (ICA) to decompose the EEG signal and identify artifact components. 2. Use support vector machine (SVM) to automatically classify artifact components. 3. Remove the identified artifact components from the original EEG signal.
[0049] The embodiment of the present application reduces the interference of noise and artifacts through the artifact elimination module. When processing purer EEG data, the convolutional neural network can more accurately identify the key features of the K-complex wave, thereby improving the detection accuracy.
[0050] In one embodiment, if Figure 2 As shown in the convolutional neural network in, the convolutional neural network includes a two-dimensional convolutional layer, a fully connected layer and an activation function; the two-dimensional convolutional layer performs a convolution downsampling operation on the input time dimension T and channel dimension N, and then the output of the two-dimensional convolutional layer is processed by the fully connected layer and the activation function in turn, and its output result is input into the downsampling network with skip connection.
[0051] In the embodiment of the present application, the convolutional neural network includes a two-dimensional convolutional layer, a fully connected layer and an activation function. By designing the convolutional neural network to include a two-dimensional convolutional layer, the network has the ability to extract channel dimension and time dimension features at the same time, which helps the network to more finely identify the K-complex wave in the EEG signal and improve the detection accuracy. The activation function can specifically be a sigmoid activation function, and of course other activation functions can also be used. The convolutional neural network inputs The processing formula is as follows, and the final output is ;
[0052]
[0053] in, represents a two-dimensional convolutional layer, represents the fully connected layer, is an activation function, Represents the output of the convolutional neural network.
[0054] In one embodiment, if Figure 2 As shown, the downsampling network with jump connection includes n serially connected downsampling modules, each of which includes a fully connected layer, an activation function and a gated recurrent unit GRU connected in sequence; the output of each downsampling module is input into the feature fusion extraction network and the next downsampling module.
[0055] In the embodiment of the present application, the downsampling network includes N downsampling modules connected in series. The time dimension T is halved after each downsampling module. Each downsampling module includes a fully connected layer and a gated recurrent unit GRU, thereby effectively capturing local features and timing information. The processing flow of the ith downsampling module is shown in the following formula:
[0056] ;
[0057] in, represents the output of the ith downsampling module, represents a gated recurrent unit, is an activation function, represents a fully connected layer.
[0058] In an embodiment of the present application, the output of each downsampling module is a feature of a scale. The downsampling network extracts multi-scale features and inputs the multi-scale features into a feature fusion extraction network for processing. This effectively extracts EEG information while greatly improving the semantic richness of the feature vector, and can effectively improve the discrimination accuracy of the K-complex wave detection model.
[0059] Specifically, the downsampling network with skip connection can use the downsampling network of ResNet architecture, wherein the skip connection provides the output of each layer of the downsampling network to the feature fusion extraction network, and the downsampling module is specifically a ResNet Block module, which includes a fully connected layer, an activation function sigmoid, and a gated recurrent unit GRU connected in sequence. The downsampling network of ResNet architecture can learn richer and more complex feature representations and improve the discrimination accuracy of the model. In addition, by introducing residual connections, the ResNet architecture makes it easier for the network to maintain the stability of the gradient during training.
[0060] In one embodiment, the feature fusion extraction network is a bidirectional feature pyramid network, which receives the downsampling results of each level of the downsampling network with jump connections, performs bidirectional feature fusion on the downsampling results of each level, and finally outputs the first latent code through a multi-layer perceptron.
[0061] In the embodiment of the present application, the feature fusion extraction network is a bidirectional feature pyramid network BiFPN, which receives the downsampling results of each level of the downsampling network. , perform cross-scale bidirectional feature fusion on them, and finally pass through a multi-layer perceptron MLP to output the first latent code containing rich information , as follows and Figure 4 As shown:
[0062]
[0063] in, is a multi-layer perceptron, is the output of the ith downsampling module, It is a bidirectional feature pyramid network. is the first hidden code.
[0064] The embodiment of the present application uses a bidirectional feature pyramid network (BiFPN) as a feature fusion extraction network. Compared with the traditional feature pyramid network, BiFPN can reduce false detection and missed detection through multi-level feature fusion and dynamic feature weight allocation. At the same time, since BiFPN uses an efficient structure and algorithm when fusing features, it can improve detection efficiency and reduce computing costs while maintaining high detection accuracy.
[0065] In one embodiment, the K-complex wave detection model uses negative log likelihood NLL as the loss function of the normalized flow during the training phase. The NLL of the normalized flow is expressed as:
[0066]
[0067] Among them, z is the first hidden code, To normalize the reverse process of the flow, is the complex distribution of input data, is the standard normal distribution, is the logarithm of the Jacobian value corresponding to the normalized flow reverse process.
[0068] In one embodiment, the classifier is a multi-layer perceptron classifier.
[0069] In the embodiment of the present application, the classifier is a multi-layer perceptron classifier, which performs binary classification on the second latent code to obtain a determination result of whether a K complex wave exists. , the specific formula is as follows:
[0070]
[0071] in, is a multi-layer perceptron, Indicates the result of the determination whether there is a K complex wave. is the second hidden code.
[0072] MLP performs well in dealing with classification problems. It can learn complex nonlinear relationships through multiple hidden layers to achieve classification of input data. As a classifier, it can more accurately determine whether the current EEG segment contains a K-complex wave.
[0073] In one embodiment, the classification loss is a cross entropy loss, and the specific formula is as follows:
[0074]
[0075] in, is a normalized exponential function, is a logarithmic function, represents the cross entropy loss.
[0076] The cross entropy loss function shows good optimization efficiency in optimization algorithms such as gradient descent. When the difference between the predicted probability and the actual label is large, the cross entropy loss will produce a larger gradient, thereby promoting a larger update of the model parameters. On the contrary, when the predicted probability gradually approaches the actual label, the gradient will gradually decrease, avoiding excessive adjustment of the model near the optimal solution. This feature helps the model converge to the optimal solution faster. Therefore, the embodiment of the present application uses cross entropy loss as a classification loss to enable the model to find the optimal solution in a shorter time. In addition, during the training process, even if there is a small amount of noise or outliers, the cross entropy loss can guide the model to focus on most samples with correct labels and reduce attention to noise or outliers. This feature helps the model maintain stable performance in complex and uncertain data environments.
[0077] In one embodiment, after the step of obtaining the determination result of the K-complex wave, the method further comprises:
[0078] If a K-complex wave is detected, the K-complex wave is combined with other physiological signals (such as electrocardiogram, electromyogram, respiratory signal) and environmental data (such as temperature, humidity, noise level) for cross-modal fusion analysis. Through the comprehensive evaluation of multi-source data, the user's sleep state and environmental influencing factors can be more comprehensively understood, providing a richer basis for precise sleep intervention.
[0079] In one embodiment, blockchain technology can also be introduced to provide users with a safe and transparent sleep data management method. The user's K-complex wave detection data will be encrypted and stored on the blockchain to ensure the privacy and non-tamperability of the data. At the same time, users can choose to share data with research institutions or medical institutions to obtain more personalized health advice or participate in sleep science research.
[0080] like Figure 5 As shown, the embodiment of the present application also provides a device for detecting K-complex waves during sleep, the device comprising:
[0081] An input module 11 is used to input EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model includes a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalization flow and a classifier;
[0082] A processing module 12, for outputting a first latent code after the EEG data of the N channels are processed in sequence by the convolutional neural network, the downsampling network with skip connection and the feature fusion extraction network;
[0083] A normalization flow module 13, configured to transform the vector space where the first latent code is located using a normalization flow to obtain a second latent code that obeys a standard Gaussian distribution;
[0084] The classification module 14 is used for inputting the second latent code into the classifier for processing, and outputting a judgment result on whether a K-complex wave exists in the current EEG segment after processing.
[0085] In one embodiment, the K-complex wave detection model uses negative log likelihood NLL as the loss function of the normalized flow during the training phase. The NLL of the normalized flow is expressed as:
[0086]
[0087] Among them, z is the first hidden code, To normalize the reverse process of the flow, is the complex distribution of input data, is the standard normal distribution, is the logarithm of the Jacobian value corresponding to the normalized flow reverse process.
[0088] In one embodiment, the K-complex wave detection model also includes an artifact elimination module. The EEG data of the N channels also pass through the artifact elimination module before passing through the convolutional neural network. The artifact elimination module is used to perform artifact elimination processing on the EEG data of the N channels and input the artifact elimination processing results into the convolutional neural network.
[0089] In one embodiment, the convolutional neural network includes a two-dimensional convolutional layer, a fully connected layer and an activation function; the two-dimensional convolutional layer performs a convolution downsampling operation on the input time dimension T and channel dimension N, and then the output of the two-dimensional convolutional layer is processed by the fully connected layer and the activation function in turn, and its output result is input into the downsampling network with skip connection.
[0090] In one embodiment, the downsampling network with skip connections includes n serially connected downsampling modules, each of which includes a fully connected layer, an activation function and a gated recurrent unit GRU connected in sequence; the output of each downsampling module is input into the feature fusion extraction network and the next downsampling module.
[0091] In one embodiment, the feature fusion extraction network is a bidirectional feature pyramid network, which receives the downsampling results of each level of the downsampling network with jump connections, performs bidirectional feature fusion on the downsampling results of each level, and finally outputs the first latent code through a multi-layer perceptron.
[0092] In one embodiment, the classifier is a multi-layer perceptron classifier.
[0093] Reference Figure 6The present application also provides a computer device, the internal structure of which can be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed for the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating device, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as a method for detecting K-complex waves during sleep. The network interface of the computer device is used to communicate with an external terminal through a network connection. Furthermore, the above-mentioned computer device can also be provided with an input device and a display screen, etc. When the above computer program is executed by a processor, a method for detecting K-complex waves during sleep is implemented, comprising the following steps: inputting EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model comprises a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalized stream and a classifier; wherein the skip connections in the downsampling network provide the outputs of each layer of the downsampling network to the feature fusion extraction network; the EEG data of the N channels are processed in turn by the convolutional neural network, the downsampling network with skip connections and the feature fusion extraction network to output a first latent code; the vector space where the first latent code is located is transformed using a normalized stream to obtain a second latent code that obeys a standard Gaussian distribution; the second latent code is input into the classifier for processing, and after processing, a judgment result on whether a K-complex wave exists in the current EEG segment is output. A person skilled in the art will understand that Figure 6 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.
[0094] Embodiment 4:
[0095] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a method for detecting K-complex waves during sleep is implemented, comprising the following steps: inputting EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model comprises a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalized stream and a classifier; wherein the skip connections in the downsampling network provide the outputs of each layer of the downsampling network to the feature fusion extraction network; the EEG data of the N channels are processed by the convolutional neural network, the downsampling network with skip connections and the feature fusion extraction network in sequence, and then a first latent code is output; the vector space where the first latent code is located is transformed using the normalized stream to obtain a second latent code that obeys a standard Gaussian distribution; the second latent code is input into the classifier for processing, and after processing, a judgment result of whether a K-complex wave exists in the current EEG segment is output.
[0096] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0097] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0098] The above description is only a preferred embodiment of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for detecting K-complex waves during sleep, characterized in that: The method comprises: Inputting EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model comprises a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalization stream and a classifier; wherein the skip connections in the downsampling network provide the outputs of each layer of the downsampling network to the feature fusion extraction network; The EEG data of the N channels are processed by the convolutional neural network, the downsampling network with skip connections and the feature fusion extraction network in sequence, and then a first latent code is output; wherein the skip connection in the downsampling network provides the output of each layer of the downsampling network to the feature fusion extraction network; Transform the vector space where the first latent code is located using a standardized flow to obtain a second latent code that obeys a standard Gaussian distribution; Inputting the second latent code into the classifier for processing, and outputting a judgment result on whether a K-complex wave exists in the current EEG segment after processing; The K-complex wave detection model uses negative log likelihood NLL as the loss function of the standardized flow during the training phase. The NLL of the standardized flow is expressed as: Among them, z is the first hidden code, To normalize the reverse process of the flow, is the complex distribution of input data, is the standard normal distribution, is the logarithm of the Jacobian value corresponding to the reverse process of the normalized flow; The downsampling network with skip connections includes n serially connected downsampling modules, each of which includes a fully connected layer, an activation function and a gated recurrent unit GRU connected in sequence; the output of each downsampling module is input into the feature fusion extraction network and the next downsampling module.
2. The method for detecting K-complex waves during sleep according to claim 1, characterized in that: The K-complex wave detection model also includes an artifact elimination module. The EEG data of the N channels also pass through the artifact elimination module before passing through the convolutional neural network. The artifact elimination module is used to perform artifact elimination processing on the EEG data of the N channels and input the artifact elimination processing results into the convolutional neural network.
3. The method for detecting K-complex waves during sleep according to claim 1, characterized in that: The convolutional neural network includes a two-dimensional convolutional layer, a fully connected layer and an activation function; the two-dimensional convolutional layer performs a convolution downsampling operation on the input time dimension T and channel dimension N, and then the output of the two-dimensional convolutional layer is processed by the fully connected layer and the activation function in turn, and its output result is input into the downsampling network with skip connection.
4. The method for detecting K-complex waves during sleep according to claim 1, characterized in that: The feature fusion extraction network is a bidirectional feature pyramid network, which receives the downsampling results of each level of the downsampling network with jump connections, performs bidirectional feature fusion on the downsampling results of each level, and finally outputs the first latent code through a multi-layer perceptron.
5. The method for detecting K-complex waves during sleep according to claim 1, characterized in that: The classifier is a multi-layer perceptron classifier.
6. A device for detecting K-complex waves during sleep, used to perform the method according to any one of claims 1 to 5, characterized in that: The device comprises: An input module, used to input EEG data of N channels into a K-complex wave detection model; wherein the K-complex wave detection model includes a convolutional neural network, a downsampling network with skip connections, a feature fusion extraction network, a normalization stream and a classifier; A processing module, for outputting a first latent code after the EEG data of the N channels are processed by the convolutional neural network, the downsampling network with skip connection and the feature fusion extraction network in sequence; A normalization flow module, configured to transform the vector space where the first latent code is located using a normalization flow to obtain a second latent code that obeys a standard Gaussian distribution; The classification module is used to input the second latent code into the classifier for processing, and after processing, output a judgment result on whether a K-complex wave exists in the current EEG segment.
7. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method for detecting K-complex waves during sleep according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for detecting K-complex waves during sleep according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Image blind deblurring network and method based on blurring kernel prior learning
CN116485664A
Sleep characteristic wave detection system based on deep learning
CN118606639A
Cited By
Automatic aMCI risk identification system based on polysleep electroencephalogram
CN121795835A