K-complex wave detection method and device based on XGBoost algorithm

Through the K composite wave detection method based on the XGBoost algorithm, the problem of K composite wave detection is solved, the detection accuracy is improved, and efficient identification of K composite waves is achieved.

CN118319328BActive Publication Date: 2025-08-12KUNMING UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410424571.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-10
Publication Date
2025-08-12
Estimated Expiration
2044-04-10

AI Technical Summary

Technical Problem

In the prior art, K composite wave detection is susceptible to noise interference and has low accuracy in detection results.

Method used

The K composite wave detection method based on the XGBoost algorithm is adopted, including pre-processing of sleep EEG signals, extracting feature parameters of time domain, frequency domain and chaos domain, selecting important features using the XGBoost feature selection model, and detecting them through the LS-SVM classifier and decision tree C4.5.

Benefits of technology

The accuracy of K composite wave detection is improved and the impact of noise interference on the detection results is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118319328B_ABST
    Figure CN118319328B_ABST
Patent Text Reader

Abstract

The present invention provides a K-complex wave detection method and device based on the XGBoost algorithm, comprising: reading a sleep EEG signal, and obtaining a plurality of sleep EEG signal segments by preprocessing the sleep EEG signal; extracting characteristic parameters of each of the sleep EEG signal segments in the time domain, frequency domain and chaotic domain, and obtaining a plurality of eigenvectors; performing feature selection on the plurality of eigenvectors based on an XGBoost feature selection model, and obtaining target features exceeding an importance threshold; detecting the K-complex wave based on the target features, and outputting the detection results, selecting target features with high importance through the XGBoost feature selection model, and identifying the K-complex wave through the target features, thereby improving the accuracy of the K-complex wave.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of K complex wave detection, and in particular to a K complex wave detection method and device based on an XGBoost algorithm. Background Art

[0002] One of the brain's primary functions is sleep, which plays a vital role in repairing and healing a person's mental and physical health. Any disturbance in the human brain can lead to lifelong complications that permanently impair a person's mental and physical performance. Sleep disorders can negatively impact cognitive functions such as attention, learning, and memory. Lack of sleep can also reduce a person's daytime physical performance. Furthermore, many researchers have revealed that sleep stages exhibit unique waveforms and characteristics in EEG signals. These waveforms reflect changes in muscles and brain neurons during each sleep stage. Therefore, analyzing EEG waveforms recorded from the brain is a crucial process for neurologists to score sleep stages and understand sleep disorders.

[0003] The K complex (KC), the largest brain wave on the EEG, is a crucial component of sleep electroencephalograms and a key indicator of sleep staging. Since its discovery, it has garnered significant attention from physiologists, psychologists, and sleep medicine. Its location in the brain, its mechanism of generation, its function, and its relationship to various sleep disorders remain a matter of debate. KCs can reflect the presence of stimuli, changes in brain age, sleep quality, sleep disorders, and even cognitive function. Ultimately, however, KCs reflect a brain state induced by stimulation. With the advancement of neuroscience and the deepening of sleep research, KCs are becoming more than just a window into brain status. Due to their unique properties, they may even be a window into higher-level brain function.

[0004] Traditional methods for detecting KCs rely primarily on manual labor, which is not only time-consuming and labor-intensive but also highly subjective. With the increasing research on KCs, a number of automated methods for KC identification have emerged, primarily including morphological detection and feature extraction through neural network classification. Morphological detection is susceptible to noise, and neural network classification cannot accurately determine the location of KCs. Summary of the Invention

[0005] The present invention provides a K-complex wave detection method and device based on the XGBoost algorithm, which are used to solve the defects in the prior art that the detection of K-complex waves is easily interfered by noise and the detection result has low accuracy.

[0006] The present invention provides a K complex wave detection method based on the XGBoost algorithm, and the K complex wave detection method based on the XGBoost algorithm includes:

[0007] Reading a sleep EEG signal, and obtaining a plurality of sleep EEG signal segments by preprocessing the sleep EEG signal;

[0008] Extracting characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain and chaos domain, and obtaining multiple characteristic vectors;

[0009] Perform feature selection on the multiple feature vectors based on the XGBoost feature selection model to obtain target features that exceed the importance threshold;

[0010] The K complex wave is detected based on the target feature, and the detection result is output.

[0011] According to a K-complex wave detection method based on the XGBoost algorithm provided by the present invention, the sleep EEG signal is read and preprocessed to obtain multiple sleep EEG signal segments, including:

[0012] The sleep EEG signal is collected for 30 minutes at a sampling frequency of 200 Hz;

[0013] performing bandpass filtering on the sleep EEG signal to remove environmental noise caused by muscle activity and eye movement;

[0014] The 30-minute sleep EEG signal is segmented by a sliding window technique with each window being 0.5 s and a step being 0.1 s to obtain a plurality of sleep EEG signal segments.

[0015] According to a K-complex wave detection method based on the XGBoost algorithm provided by the present invention, the characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain and chaotic domain are extracted to obtain multiple characteristic vectors, including:

[0016] Extracting time domain characteristic parameters of each sleep EEG signal in the time domain, wherein the time domain characteristic parameters include maximum value, mean value, standard deviation, skewness, kurtosis, shape factor, peak factor, impulse factor, margin factor, total energy, zero crossing rate and time centroid;

[0017] Extracting frequency domain characteristic parameters of each sleep EEG signal in the frequency domain, wherein the frequency domain characteristic parameters include band energy ratio, spectral flux, center of gravity frequency, center of gravity bandwidth, irregularity, general roll-off point and spectrum flatness measurement;

[0018] Extracting chaotic domain characteristic parameters of each sleep EEG signal in the chaotic domain, wherein the chaotic domain characteristic parameters include correlation dimension, box dimension and generalized dimension.

[0019] According to a K-complex wave detection method based on the XGBoost algorithm provided by the present invention, the process of establishing the XGBoost feature selection model includes:

[0020] Dividing the plurality of feature vectors into a training set and a test set;

[0021] Training a CART tree using the training set to obtain a current training model and obtaining a sample deviation value of the current training model;

[0022] The sample training value of the current training model is used as the training set of the next training model, and the CART tree is trained to obtain the next training model and the sample deviation value of the next training model;

[0023] Repeat the above steps until a predetermined exit condition is reached, sum the obtained training models, and test the summed training model using the test set to obtain the XGBoost feature selection model.

[0024] According to a K-complex wave detection method based on the XGBoost algorithm provided by the present invention, the process of establishing the CART tree includes:

[0025] Define the objective function of the t-th CART tree;

[0026] Traversing each of the eigenvectors and obtaining the splitting gain corresponding to each eigenvector;

[0027] Obtaining optimal features and optimal splitting points based on the splitting gain and the objective function;

[0028] For each child node, repeat the above steps until the stopping condition is reached, and the t-th CART tree is obtained.

[0029] According to a K-complex wave detection method based on the XGBoost algorithm provided by the present invention, the objective function of the t-th CART tree is defined, including:

[0030] Define L (t) represents the objective function of the t-th decision tree, Among them, the predicted value of the i-th sample in the t-th tree is Equal to the predicted value of sample i in the previous t-1 trees Add the current t-th tree prediction value f t (x i )The formula is expressed as:

[0031] Using Taylor's quadratic expansion, removing the constant term, we get the simplified loss function Among them, Ω(f t ) as the complexity of the current tree; g i and h i As the first-order derivative and second-order derivative of the loss function, respectively, Represents the loss function for each sample;

[0032] Definition Set I j is the set of all sample points on the jth leaf node of the tree, that is, given a tree, the set of all samples that are divided into the jth leaf node according to the decision rule. According to the definition of the model complexity penalty term: Among them, w j Represents the value of the jth leaf node; T in γT represents the number of leaf nodes, γ is the adjustment function for this item, and λ represents the weight of the regularization item.

[0033] Let the derivative of the objective function be 0, and the optimal prediction score of each leaf node is in, represents the sum of the first-order derivatives of all samples, represents the sum of the second-order derivatives of all samples;

[0034] Will w * Substitute the simplified objective function to obtain the minimum loss and the final objective function The final objective function is used as the objective function of the final CART tree.

[0035] According to a K-complex wave detection method based on the XGBoost algorithm provided by the present invention, the optimal features and the optimal splitting points are obtained based on the splitting gain and the objective function, including:

[0036] The feature with the largest split gain is used as the split feature of the current node;

[0037] For the split feature of the current node, traverse all categories of the split feature, calculate the split gain on the feature with the maximum split gain, and use the category with the maximum split gain as the split node of the current node;

[0038] Split the left node I at the split node L and right node I R , and let the derivative of the objective function be 0, the expression of the split point is Among them, G R Represents the sum of the first-order derivatives of all input samples of the right node, H R Represents the sum of the second-order derivatives of all input samples of the right node, GL Represents the sum of the first-order derivatives of all input samples of the right node, H L Represents the sum of the second-order derivatives of all input samples of the left node;

[0039] The optimal feature and the optimal split point are obtained through the split point expression.

[0040] According to a K-complex wave detection method based on an XGBoost algorithm provided by the present invention, the stopping condition is specifically any one of the following conditions: the depth of the tree reaches a preset maximum depth, the number of samples in the node is less than a sample threshold, and the splitting gain is less than a gain threshold. According to a K-complex wave detection method based on an XGBoost algorithm provided by the present invention, the K-complex wave is detected based on the target feature and the detection result is output, including:

[0041] Classification and detection of the target features are performed using LS-SVM classifier and decision tree C4.5;

[0042] When the detection result is 1, the sleep EEG signal segment is a K complex wave;

[0043] If the detection result is 0, the sleep EEG signal segment is not a K complex wave.

[0044] The present invention also provides a K-complex wave detection device based on the XGBoost algorithm, comprising:

[0045] A preprocessing module is used to read the sleep EEG signal and obtain multiple sleep EEG signal segments by preprocessing the sleep EEG signal;

[0046] A feature extraction module is used to extract the characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain and chaos domain, and obtain multiple feature vectors;

[0047] A feature selection module is used to perform feature selection on the multiple feature vectors based on the XGBoost feature selection model to obtain target features that exceed an importance threshold;

[0048] The detection module is used to detect the K complex wave based on the target characteristics and output the detection result.

[0049] The present invention provides a K complex wave detection method based on the XGBoost algorithm. The K complex wave detection method based on the XGBoost algorithm includes: reading a sleep EEG signal, and obtaining a plurality of sleep EEG signal segments by preprocessing the sleep EEG signal; extracting characteristic parameters of each of the sleep EEG signal segments in the time domain, frequency domain and chaotic domain, and obtaining a plurality of feature vectors; performing feature selection on the plurality of feature vectors based on an XGBoost feature selection model to obtain target features exceeding an importance threshold; detecting the K complex wave based on the target features, and outputting the detection results, selecting target features with high importance through the XGBoost feature selection model, and identifying the K complex wave through the target features, thereby improving the accuracy of the K complex wave. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0051] Figure 1 1 is a flow chart of a K-complex wave detection method based on the XGBoost algorithm provided in an embodiment of the present invention;

[0052] Figure 2 This is an example diagram of the effect of a sliding window of a sleep EEG signal provided by an embodiment of the present invention;

[0053] Figure 3 Schematic diagram of the feature parameter extraction process provided by an embodiment of the present invention;

[0054] Figure 4 Schematic diagram of the principle of the XGBoost feature selection model provided by an embodiment of the present invention;

[0055] Figure 5 1 is a schematic structural diagram of a K-complex wave detection device based on the XGBoost algorithm provided in an embodiment of the present invention;

[0056] Figure 6 It is a structural diagram of a computing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0057] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0058] The following combination Figures 1-6 The present invention describes a K-complex wave detection method based on the XGBoost algorithm.

[0059] Figure 1 4 is a flow chart of a K-complex wave detection method based on the XGBoost algorithm provided in an embodiment of the present invention.

[0060] like Figure 1 As shown, this embodiment provides a K-complex wave detection method based on the XGBoost algorithm, which mainly includes the following steps:

[0061] Step S101 : reading a sleep EEG signal, and preprocessing the sleep EEG signal to obtain a plurality of sleep EEG signal segments.

[0062] In a specific implementation process, the sleep EEG signal is read. The reading method is not specifically limited here. Those skilled in the art can reasonably choose different sleep EEG signal reading methods according to actual needs. After reading the sleep EEG signal, the sleep EEG signal is preprocessed. The preprocessing includes but is not limited to noise filtering and segmentation. The purpose of preprocessing is to reduce noise interference and improve the accuracy of the final judgment result. Correspondingly, the sleep EEG signal is divided into multiple sleep EEG signal segments to improve processing efficiency.

[0063] Step S102 , extracting characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain and chaotic domain, and obtaining a plurality of characteristic vectors.

[0064] In a specific implementation process, characteristic parameters are extracted in the time domain, frequency domain and chaos domain respectively, which can extract the influencing features affecting the judgment result of the K complex wave to the greatest extent and ensure the accuracy of the judgment result of the K complex wave.

[0065] Step S103: performing feature selection on the multiple feature vectors based on the XGBoost feature selection model to obtain target features that exceed the importance threshold.

[0066] In a specific implementation process, an XGBoost feature selection model is established, and the importance of each feature is ranked by the XGBoost feature selection model. The feature parameters that exceed the importance threshold are used as target features to participate in the judgment process of the K complex wave.

[0067] Step S104: Detect the K complex wave based on the target feature and output the detection result.

[0068] In a specific implementation process, the target feature is used as input to detect whether each sleep EEG signal is a K-complex wave, and the detection result is output.

[0069] Furthermore, based on the above embodiment, the sleep EEG signal is read in this embodiment, and multiple sleep EEG signal segments are obtained by preprocessing the sleep EEG signal, including:

[0070] The sleep EEG signal is collected for 30 minutes at a sampling frequency of 200 Hz;

[0071] performing bandpass filtering on the sleep EEG signal to remove environmental noise caused by muscle activity and eye movement;

[0072] The 30-minute sleep EEG signal is segmented by a sliding window technique with each window being 0.5 s and a step being 0.1 s to obtain a plurality of sleep EEG signal segments.

[0073] In a specific implementation process, the sliding window technology is used to segment the EEG signal every 30 minutes. Since the duration of the K complex wave is about 0.5 to 2 seconds, in this embodiment, the size of each window is 0.5 seconds and the step is 0.1 seconds. Figure 2 As shown, a 30-minute EEG signal is bandpass filtered using a 4th-order Butterworth filter in the 0.5 Hz to 30 Hz frequency range to smooth the original signal and remove environmental noise caused by muscle activity and eye movement. This example analyzes the Cz-A1 channel of the EEG electrode with a sampling frequency of 200 Hz.

[0074] Furthermore, based on the above embodiment, the feature parameters of each sleep EEG signal segment in the time domain, frequency domain and chaos domain are extracted in this embodiment, and multiple feature vectors are obtained, including:

[0075] Extracting time domain characteristic parameters of each sleep EEG signal in the time domain, wherein the time domain characteristic parameters include maximum value, mean value, standard deviation, skewness, kurtosis, shape factor, peak factor, impulse factor, margin factor, total energy, zero crossing rate and time centroid;

[0076] Extracting frequency domain characteristic parameters of each sleep EEG signal in the frequency domain, wherein the frequency domain characteristic parameters include band energy ratio, spectral flux, center of gravity frequency, center of gravity bandwidth, irregularity, general roll-off point and spectrum flatness measurement;

[0077] Extracting chaotic domain characteristic parameters of each sleep EEG signal in the chaotic domain, wherein the chaotic domain characteristic parameters include correlation dimension, box dimension and generalized dimension.

[0078] Specifically, such as Figure 3 As shown, multiple characteristic parameters are extracted from each segment, a total of 22 features are extracted, and the 22 characteristic parameters are obtained as a characteristic vector for judging the K complex wave.

[0079] Furthermore, based on the above embodiment, the process of establishing the XGBoost feature selection model in this embodiment includes:

[0080] Dividing the plurality of feature vectors into a training set and a test set;

[0081] Training a CART tree using the training set to obtain a current training model and obtaining a sample deviation value of the current training model;

[0082] The sample training value of the current training model is used as the training set of the next training model, and the CART tree is trained to obtain the next training model and the sample deviation value of the next training model;

[0083] Repeat the above steps until a predetermined exit condition is reached, sum the obtained training models, and test the summed training model using the test set to obtain the XGBoost feature selection model.

[0084] In this embodiment, Figure 4 As shown, for a training set, XGBoost first uses CART tree training to obtain a model, so that a deviation value will be generated for each sample; then the sample deviation value is used as a new training set, and CART tree training is continued to obtain a new model; this is repeated until a certain exit condition is reached, wherein the exit condition is not limited here, and those skilled in the art can set the exit condition according to specific needs.

[0085] Furthermore, based on the above embodiment, the process of establishing the CART tree in this embodiment includes:

[0086] Define the objective function of the t-th CART tree;

[0087] Traversing each of the eigenvectors and obtaining the splitting gain corresponding to each eigenvector;

[0088] Obtaining optimal features and optimal splitting points based on the splitting gain and the objective function;

[0089] For each child node, repeat the above steps until the stopping condition is reached, and the t-th CART tree is obtained.

[0090] In this embodiment, the establishment of the CART tree mainly includes two steps: determining the objective function and constructing the decision tree. First, the expression of the objective function is simplified and used in the decision tree construction process. During the decision tree construction process, the optimal features and optimal splitting points of each child node are determined by splitting gain, and then the CART decision tree is formed.

[0091] Furthermore, based on the above embodiment, the objective function of defining the t-th CART tree in this embodiment includes:

[0092] Define L (t) represents the objective function of the t-th decision tree, Among them, the predicted value of the i-th sample in the t-th tree is Equal to the predicted value of sample i in the previous t-1 trees Add the current t-th tree prediction value f t (x i )The formula is expressed as:

[0093] Using Taylor's quadratic expansion, removing the constant term, we get the simplified loss function Among them, Ω(f t ) as the complexity of the current tree; g i and h i As the first-order derivative and second-order derivative of the loss function, respectively, Represents the loss function for each sample;

[0094] Definition Set I j is the set of all sample points on the jth leaf node of the tree, that is, given a tree, the set of all samples that are divided into the jth leaf node according to the decision rule. According to the definition of the model complexity penalty term: Among them, w j Represents the value of the jth leaf node; T in γT represents the number of leaf nodes, γ is the adjustment function for this item, and λ represents the weight of the regularization item.

[0095] Let the derivative of the objective function be 0, and the optimal prediction score of each leaf node is in, represents the sum of the first-order derivatives of all samples, represents the sum of the second-order derivatives of all samples;

[0096] Will w * Substitute the simplified objective function to obtain the minimum loss and the final objective function The final objective function is used as the objective function of the final CART tree.

[0097] In this embodiment, the process of determining the objective function specifically includes the following steps:

[0098] ①Define L (t) Represents the objective function of the t-th decision tree. The smaller the value, the better the tree structure, as follows:

[0099]

[0100] Among them, the predicted value of the i-th sample in the t-th tree is Equal to the predicted value of sample i in the previous t-1 trees Add the current t-th tree prediction value (f t (x i ))The formula is expressed as:

[0101]

[0102] ② Using Taylor’s quadratic expansion and removing the constant term, we can obtain the simplified loss function as follows:

[0103]

[0104] Among them, Ω(f t ) as the complexity of the current tree; g i and h i They are respectively used as the first-order derivative and second-order derivative of the loss function, that is, the first-order derivative and second-order derivative of each sample; Represents the loss function of each sample, but these values will eventually be attributed to a leaf node and used to calculate the predicted value of the leaf node.

[0105] Definition Set I j is the set of all sample points on the jth leaf node of the tree, that is, given a tree, the set of all samples that are divided into the jth leaf node according to the decision rule. According to the definition of the model complexity penalty term:

[0106]

[0107] Among them, w jRepresents the value of the jth leaf node; T in γT represents the number of leaf nodes. Generally speaking, the more leaf nodes there are, the taller, larger and more complex the tree is; γ is the adjustment function for this item, which usually indicates the reduction of the minimum loss of the tree; λ usually represents the weight of the regularization term.

[0108] ③ Determine the final objective function (i.e., formula (4)). In order to minimize the objective function, set its derivative to 0, and solve the optimal prediction score of each leaf node as:

[0109]

[0110] Will w * Substitute the simplified objective function to get the minimum loss, and then replace represents the sum of the first-order derivatives of all samples, Represents the sum of the second-order derivatives of all samples, then:

[0111]

[0112] Furthermore, based on the above embodiment, the method of obtaining the optimal feature and the optimal splitting point based on the splitting gain and the objective function in this embodiment includes:

[0113] The feature with the largest split gain is used as the split feature of the current node;

[0114] For the split feature of the current node, traverse all categories of the split feature, calculate the split gain on the feature with the maximum split gain, and use the category with the maximum split gain as the split node of the current node;

[0115] Split the left node I at the split node L and right node I R , and let the derivative of the objective function be 0, the expression of the split point is Among them, G R Represents the sum of the first-order derivatives of all input samples of the right node, H R Represents the sum of the second-order derivatives of all input samples of the right node, G L Represents the sum of the first-order derivatives of all input samples of the right node, H L Represents the sum of the second-order derivatives of all input samples of the left node;

[0116] The optimal feature and the optimal split point are obtained through the split point expression.

[0117] The process of constructing a decision tree in this embodiment is specifically as follows:

[0118] ① Given the initial values, including the initial predicted value and true value of each sample, it is convenient to calculate the sample residual.

[0119] ② Select the best split feature. Traverse all features, calculate the split gain for each feature, and select the feature with the largest split gain as the split feature of the current node.

[0120] ③ Select the best split point (optimal split point). For the selected split feature, traverse all possible categories, calculate the split gain on the feature, and select the category with the largest split gain as the split point of the current node.

[0121] ④ Split the node. Split the left I at a certain node L , right node I R In order to minimize the objective function, its derivative can be set to 0, and the best prediction score for each leaf node is: I = I L ∪I R , then the split L, that is, the split point can be expressed as:

[0122]

[0123] L split The larger the value, the more the objective function can be reduced after splitting, and the better. This is used to determine the optimal features and the optimal split point.

[0124] Among them, G R Represents the sum of the first-order derivatives of all input samples of the right node, H R Represents the sum of the second-order derivatives of all input samples of the right node, G L Represents the sum of the first-order derivatives of all input samples of the right node, H L Represents the sum of the second-order derivatives of all input samples of the left node.

[0125] 5. Recursively construct subtrees. For each child node, repeat the above steps until a stopping condition is reached. The stopping condition can be when the tree depth reaches a preset maximum depth, the number of samples in the node is less than a certain threshold, or the splitting gain is less than a certain threshold.

[0126] Furthermore, based on the above embodiment, the stopping condition in this embodiment is specifically any one of the following conditions: the depth of the tree reaches a preset maximum depth, the number of samples in the node is less than the sample threshold, and the splitting gain is less than the gain threshold.

[0127] Furthermore, based on the above embodiment, the present embodiment detects the K complex wave based on the target feature and outputs the detection result, including:

[0128] Classification and detection of the target features are performed using LS-SVM classifier and decision tree C4.5;

[0129] When the detection result is 1, the sleep EEG signal segment is a K complex wave;

[0130] If the detection result is 0, the sleep EEG signal segment is not a K complex wave.

[0131] The present invention provides a K complex wave detection method based on the XGBoost algorithm. The K complex wave detection method based on the XGBoost algorithm includes: reading a sleep EEG signal, and obtaining a plurality of sleep EEG signal segments by preprocessing the sleep EEG signal; extracting characteristic parameters of each of the sleep EEG signal segments in the time domain, frequency domain and chaotic domain, and obtaining a plurality of feature vectors; performing feature selection on the plurality of feature vectors based on an XGBoost feature selection model to obtain target features exceeding an importance threshold; detecting the K complex wave based on the target features, and outputting the detection results, selecting target features with high importance through the XGBoost feature selection model, and identifying the K complex wave through the target features, thereby improving the accuracy of the K complex wave.

[0132] Figure 5 3 is a schematic structural diagram of a K-complex wave detection device based on the XGBoost algorithm provided in an embodiment of the present invention.

[0133] like Figure 5 As shown, this embodiment provides a K-complex wave detection device based on the XGBoost algorithm, the device comprising:

[0134] A preprocessing module 10 is used to read the sleep EEG signal and obtain multiple sleep EEG signal segments by preprocessing the sleep EEG signal;

[0135] A feature extraction module 20 is used to extract the characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain and chaotic domain, and obtain multiple feature vectors;

[0136] A feature selection module 30 is configured to perform feature selection on the plurality of feature vectors based on an XGBoost feature selection model to obtain target features exceeding an importance threshold;

[0137] The detection module 40 is configured to detect the K complex wave based on the target characteristics and output a detection result.

[0138] Figure 6The block diagram of a computing device 400 according to one embodiment of the present disclosure is shown. Components of the computing device 400 include, but are not limited to, a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and a database 450 is used to store data.

[0139] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, or a near field communication (NFC) interface.

[0140] In one embodiment of the present specification, the above components of the computing device 400 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 6 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.

[0141] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). Computing device 400 may also be a mobile or stationary server.

[0142] The processor 420 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the aforementioned K-complex wave detection method based on the XGBoost algorithm. The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the aforementioned K-complex wave detection method based on the XGBoost algorithm are based on the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the aforementioned K-complex wave detection method based on the XGBoost algorithm.

[0143] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned K-complex wave detection method based on the XGBoost algorithm.

[0144] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of this storage medium and the technical scheme of the K-complex wave detection method based on the XGBoost algorithm described above are based on the same concept. For details not described in detail in the technical scheme of the storage medium, please refer to the description of the technical scheme of the K-complex wave detection method based on the XGBoost algorithm described above.

[0145] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned K-complex wave detection method based on the XGBoost algorithm.

[0146] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of this computer program and the technical scheme of the K-complex wave detection method based on the XGBoost algorithm described above are based on the same concept. For details not described in detail in the technical scheme of the computer program, please refer to the description of the technical scheme of the K-complex wave detection method based on the XGBoost algorithm described above.

[0147] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0148] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0149] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0150] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0151] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A K-complex wave detection method based on XGBoost algorithm, characterized in that: The K complex wave detection method comprises: Reading a sleep EEG signal, and obtaining a plurality of sleep EEG signal segments by preprocessing the sleep EEG signal; Extracting characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain and chaos domain, and obtaining multiple characteristic vectors; Perform feature selection on the multiple feature vectors based on the XGBoost feature selection model to obtain target features that exceed the importance threshold; Detecting the K complex wave based on the target feature and outputting the detection result; The step of extracting characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain, and chaos domain, and obtaining multiple characteristic vectors, includes: Extracting time domain characteristic parameters of each sleep EEG signal in the time domain, wherein the time domain characteristic parameters include maximum value, mean value, standard deviation, skewness, kurtosis, shape factor, peak factor, impulse factor, margin factor, total energy, zero crossing rate and time centroid; Extracting frequency domain characteristic parameters of each sleep EEG signal in the frequency domain, wherein the frequency domain characteristic parameters include band energy ratio, spectral flux, center of gravity frequency, center of gravity bandwidth, irregularity, general roll-off point and spectrum flatness measurement; Extracting chaotic domain characteristic parameters of each sleep EEG signal in the chaotic domain, wherein the chaotic domain characteristic parameters include correlation dimension, box dimension and generalized dimension; The process of establishing the XGBoost feature selection model includes: Dividing the plurality of feature vectors into a training set and a test set; Training a CART tree using the training set to obtain a current training model and obtaining a sample deviation value of the current training model; The sample training value of the current training model is used as the training set of the next training model, and the CART tree is trained to obtain the next training model and the sample deviation value of the next training model; Repeat the above steps until a predetermined exit condition is reached, summing up the obtained training models, and testing the summed training model with the test set to obtain the XGBoost feature selection model; The process of establishing the CART tree includes: Define the objective function of the t-th CART tree; Traversing each of the eigenvectors and obtaining the splitting gain corresponding to each eigenvector; Obtaining optimal features and optimal splitting points based on the splitting gain and the objective function; Repeat the above steps for each child node until the stopping condition is reached and the t-th CART tree is obtained; The objective function of defining the t-th CART tree comprises: Define L (t) represents the objective function of the t-th decision tree, Among them, the predicted value of the i-th sample in the t-th tree is Equal to the predicted value of sample i in the previous t-1 trees Add the current t-th tree prediction value f t (x i )The formula is expressed as: Using Taylor's quadratic expansion, removing the constant term, we get the simplified loss function Among them, Ω(f t ) as the complexity of the current tree; g i and h i As the first-order derivative and second-order derivative of the loss function, respectively, Represents the loss function for each sample; Definition Set I j is the set of all sample points on the j-th leaf node of the tree, that is, given a tree, the set of all samples that are divided into the j-th leaf node according to the decision rule; according to the definition of the model complexity penalty term: Among them, w j Represents the value of the jth leaf node; T in γT represents the number of leaf nodes, γ is the adjustment function for this term, and λ represents the weight of the regularization term; Let the derivative of the objective function be 0, and the optimal prediction score of each leaf node is in, represents the sum of the first-order derivatives of all samples, represents the sum of the second-order derivatives of all samples; Will w * Substitute the simplified objective function to obtain the minimum loss and the final objective function And use the final objective function as the objective function of the final CART tree; The obtaining of the optimal feature and the optimal splitting point based on the splitting gain and the objective function includes: The feature with the largest split gain is used as the split feature of the current node; For the split feature of the current node, traverse all categories of the split feature, calculate the split gain on the feature with the maximum split gain, and use the category with the maximum split gain as the split node of the current node; Split the left node I at the split node L and right node I R , and let the derivative of the objective function be 0, the expression of the split point is Among them, G R Represents the sum of the first-order derivatives of all input samples of the right node, H R Represents the sum of the second-order derivatives of all input samples of the right node, G L Represents the sum of the first-order derivatives of all input samples of the right node, H L Represents the sum of the second-order derivatives of all input samples of the left node; The optimal feature and the optimal split point are obtained through the split point expression.

2. The K-complex wave detection method based on the XGBoost algorithm according to claim 1, wherein the step of reading the sleep EEG signal and obtaining a plurality of sleep EEG signal segments by preprocessing the sleep EEG signal comprises: The sleep EEG signal is collected for 30 minutes at a sampling frequency of 200 Hz; performing bandpass filtering on the sleep EEG signal to remove environmental noise caused by muscle activity and eye movement; The 30-minute sleep EEG signal is segmented by a sliding window technique with each window being 0.5 s and a step being 0.1 s to obtain a plurality of sleep EEG signal segments.

3. The K-complex wave detection method based on the XGBoost algorithm according to claim 1, characterized in that: The stopping condition is specifically any one of the following conditions: the depth of the tree reaches a preset maximum depth, the number of samples in the node is less than a sample threshold, and the splitting gain is less than a gain threshold.

4. The K-complex wave detection method based on the XGBoost algorithm according to claim 1, characterized in that: The detecting the K complex wave based on the target feature and outputting the detection result includes: Classification and detection of the target features are performed using LS-SVM classifier and decision tree C4.5; When the detection result is 1, the sleep EEG signal segment is a K complex wave; If the detection result is 0, the sleep EEG signal segment is not a K complex wave.

5. A K complex wave detection device based on the XGBoost algorithm, wherein the K complex wave detection device is applied to the K complex wave detection method according to any one of claims 1 to 4, characterized in that: include: A preprocessing module is used to read the sleep EEG signal and obtain multiple sleep EEG signal segments by preprocessing the sleep EEG signal; A feature extraction module is used to extract the characteristic parameters of each sleep EEG signal segment in the time domain, frequency domain and chaos domain, and obtain multiple feature vectors; A feature selection module is used to perform feature selection on the multiple feature vectors based on the XGBoost feature selection model to obtain target features that exceed an importance threshold; The detection module is used to detect the K complex wave based on the target characteristics and output the detection result.

Citation Information

Patent Citations

  • Radar target feature extraction and recognition method based on XGBoost

    CN114442064A