K-complex wave detection method, device and system based on electroencephalogram signal
Through the convolution of wavelet basis and EEG signal and threshold training methods, the problem that traditional detection methods cannot fit k-complex wave characteristics is solved, the detection accuracy and robustness of the machine learning model are improved, and high-precision k-complex wave automated detection is achieved.
Patent Information
- Application Number
- CN202211457178.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-21
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-11-21
AI Technical Summary
When traditional methods detect k-composite waves, they cannot fully fit their characteristics, resulting in low detection accuracy and insufficient data labeling by machine learning methods, which affects the accuracy.
The wavelet basis and EEG signal are convolutionized, data normalization is performed, peaks are found and threshold training is performed, and deep sleep slow waves are eliminated, and a wavelet basis matching the k-complex wave features are constructed.
The accuracy of k-composite wave detection and the robustness of machine learning models are improved, and high-precision automated detection is achieved.
Smart Images

Figure CN115770055B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electroencephalogram (EEG) signal analysis, and in particular to a method, device and system for detecting K-complex waves based on EEG signals. Background Art
[0002] The K-complex (KC) is an important indicator of sleep staging and reflects changes in brain age, sleep quality, and sleep disorders. Accurately identifying K-complexes is crucial for studying sleep outcomes.
[0003] Traditional methods for detecting k-complexes rely mainly on manual labor, and accuracy cannot be guaranteed. With the research on k-complexes, many methods for automatically identifying k-complexes have gradually emerged, including: morphological detection, time-frequency analysis, and feature extraction through neural network classification. Generally, morphological identification of k-complexes is basically based on its frequency characteristics, duration, peak range, etc., using classical signal processing methods to analyze k-complexes. However, classical signal processing methods require fixed analysis bases, such as Haar wavelet bases and Daubechies (dbN) wavelet bases. These analysis bases cannot fully fit the characteristics of k-complexes, affecting detection accuracy.
[0004] A highly accurate K-complex wave detection method based on EEG signals needs to be developed urgently. Summary of the Invention
[0005] In order to solve the problems in the prior art, the present invention provides a K-complex wave detection method, device and system based on EEG signals, which are used to solve at least one of the aforementioned technical problems.
[0006] Specifically, the technical solution is as follows:
[0007] A K-complex wave detection method based on electroencephalogram signals, comprising:
[0008] Use the wavelet basis to convolve with the EEG signal to obtain the convolution result;
[0009] Performing data normalization processing on the convolution result to obtain normalized data;
[0010] finding peaks in the normalized data;
[0011] Threshold training is performed on the peak value to obtain the k-complex wave.
[0012] The EEG signal is obtained by the following steps:
[0013] Collect EEG data according to the preset sampling frequency and sampling duration;
[0014] Preprocessing the EEG data to obtain a waveform sequence of the EEG data;
[0015] Based on the segments, the waveform sequence is segmented according to the preset time length to obtain N segmented signals;
[0016] Selecting any one of the N segments of the segmented signal as the EEG signal;
[0017] N=2, 3, 4,…
[0018] The step of "performing threshold training on the peak value to obtain the K complex wave" includes:
[0019] According to the label of the k complex wave, an amplitude threshold and a frequency threshold are set;
[0020] Filter out effective peak values according to the amplitude threshold;
[0021] Performing morphological screening on the EEG signal according to the effective peak value to obtain the number of the k-wave complexes appearing in the EEG signal;
[0022] After excluding the deep sleep slow waves from the number, the k complex wave is obtained.
[0023] The step of “performing morphological screening on the EEG signal according to the effective peak value” includes:
[0024] Comparing the amplitude and frequency of the EEG signal at the comparison moment with the amplitude threshold and the frequency threshold, respectively, to obtain the number of the k complex waves;
[0025] The comparison time is: the time when the effective peak appears.
[0026] The method for constructing the wavelet basis comprises:
[0027] The wavelet basis is constructed by fitting a typical k-complex wave with a polynomial.
[0028] A K-complex wave detection system based on electroencephalogram signals, comprising:
[0029] Acquisition module, used to collect EEG data;
[0030] A segmentation module, which interacts with the acquisition module to segment the EEG data and obtain EEG signals;
[0031] a processing module, which interacts with the segmentation module to perform data convolution on the EEG signal using a wavelet basis and normalize the convolution result;
[0032] The analysis module performs data interaction with the processing module, and is used to search for peak values in the normalized data and perform threshold training on the peak values to obtain the K-complex wave.
[0033] The analysis module includes:
[0034] a search module, connected to the processing module, for searching for peak values in the normalized data;
[0035] a training module, connected to the search module, for performing threshold training on the peak value through a preset amplitude threshold and a preset frequency amplitude to obtain a valid peak value;
[0036] a detection module, connected to the training module, for performing morphological screening on the EEG signal according to the effective peak value to obtain a preliminary k-wave complex;
[0037] A filtering module is connected to the detection module and is used to exclude deep sleep slow waves in the pre-selected K complex wave to obtain the K complex wave.
[0038] The detection module exchanges data with the training module to complete the morphological screening by comparing the amplitude and / or frequency of the EEG signal at the comparison moment with the corresponding amplitude threshold and / or frequency threshold respectively;
[0039] The comparison time is: the time when the effective peak appears.
[0040] An electronic device for detecting K-complex waves based on electroencephalogram signals, comprising:
[0041] Storage medium for storing computer programs;
[0042] The processing unit exchanges data with the storage medium, and is used to execute the computer program through the processing unit to perform the steps of the K-complex wave detection method based on EEG signals when performing K-complex wave detection.
[0043] A computer-readable storage medium:
[0044] The computer readable storage medium stores a computer program;
[0045] When the computer program is running, the steps of the K-complex wave detection method based on EEG signals are executed.
[0046] The present invention has at least the following beneficial effects:
[0047] The method of the present invention performs convolution on an EEG signal using a wavelet basis to obtain a convolution result; then, the convolution result is subjected to data normalization processing to obtain normalized data, and a peak value is found in the normalized data; finally, a threshold value is trained on the peak value to obtain the k-wave complex; the method of the present invention can completely fit the characteristics of the k-wave complex, thereby improving the accuracy of detection;
[0048] The system of the present invention collects EEG data through an acquisition module, then segments the EEG data using a segmentation module to obtain EEG signals; then convolves the EEG signals with a wavelet basis using a processing module, and normalizes the convolution results; finally, performs peak search in an analysis module, and performs threshold training on the peaks to obtain the K-complex wave; the system of the present invention has the advantages of simple structure and accurate detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0050] Figure 1 A waveform diagram of the wavelet basis of the present invention;
[0051] Figure 2 A flow chart of the method of the present invention;
[0052] Figure 3 for Figure 2 Flowchart of obtaining EEG signals in the process;
[0053] Figure 4 for Figure 2 Flowchart for obtaining k-complex wave in the process;
[0054] Figure 5 For specific use such as Figure 1 A general flow chart of the method;
[0055] Figure 6 is a system block diagram of the system of the present invention;
[0056] Figure 7 for Figure 6 A block diagram of the analysis module in the system block diagram;
[0057] Figure 8 Schematic diagram comparing manual marking method and the method of the present invention;
[0058] exist Figure 1-8 middle:
[0059] 100. Acquisition module; 200. Segmentation module; 300. Processing module; 400. Analysis module; 41. Search module; 42. Training module; 43. Detection module; 44. Filtering module. DETAILED DESCRIPTION
[0060] Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the implementation scenario description, or can be modified accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module or further split into multiple submodules.
[0061] In recent years, with the rise of machine learning methods, various machine learning methods have been used to detect k-complexes. However, machine learning methods rely on data labeling. Currently, there are relatively few standard data sets for k-complexes, and the data volume is small, which affects the robustness of the machine learning model and also affects the accuracy of detection. Therefore, the present invention provides the following embodiments:
[0062] Specific embodiment 1:
[0063] The present invention provides an embodiment:
[0064] like Figure 1-4 , a K-complex wave detection method based on EEG signals, comprising: using Figure 1 The wavelet basis is convolved with the EEG signal to obtain a convolution result; the convolution result is subjected to data normalization processing to obtain normalized data; a peak is found in the normalized data; a threshold value is trained on the peak to obtain the k-wave complex; the EEG signal is obtained by the following steps: collecting EEG data according to a preset sampling frequency and sampling time; preprocessing the EEG data to obtain a waveform sequence of the EEG data; segmenting the waveform sequence based on a segment according to a preset time length to obtain N segments of segmented signals; and selecting any one segment of the N segments of the segmented signals as the EEG signal; N=2, 3, 4, ...;
[0065] The step of "performing threshold training on the peak value to obtain the K-wave complex" includes: setting an amplitude threshold and a frequency threshold according to the label of the K-wave complex; screening out valid peaks according to the amplitude threshold; performing morphological screening on the EEG signal according to the valid peak value to obtain the number of the K-wave complexes appearing in the EEG signal; and obtaining the K-wave complex after excluding deep sleep slow waves from the number;
[0066] Preferably, the step of "performing morphological screening of the EEG signal based on the effective peak value" includes: comparing the amplitude and frequency of the EEG signal at the comparison moment with the amplitude threshold and the frequency threshold respectively to obtain the number of the k complex waves; the comparison moment is: the moment when the effective peak value appears.
[0067] like Figure 5 , which is a specific detection step based on Specific Example 1, comprising:
[0068] S1: Use a single-channel device to collect EEG data at a preset sampling frequency of 250 Hz and sampling duration;
[0069] S2: Preprocess the collected EEG signals by downsampling to 200 Hz; remove baseline drift by local polynomial fitting and remove interference by bandpass filtering;
[0070] S3: Segment the waveform sequence according to a certain time length of 30s, and carry out the subsequent processing based on the segment to obtain each segment signal s i ;
[0071] S4: Build Figure 1 The wavelet basis w of the k-complex wave shape shown includes:
[0072] S4-1: Find the typical k-complex wave;
[0073] S4-2: Use polynomials, such as 6th-order polynomials, to fit k-complex waves and construct wavelet bases;
[0074] Because Figure 1 The shape of the wavelet basis shown is very close to that of the k-complex wave, which can improve the robustness of the machine learning model and increase the accuracy of detection;
[0075] S5: convolve S(i) with wavelet basis w;
[0076]
[0077] Among them, m = 200 is the length of the wavelet basis, s i is the EEG signal of the i-th segment, and f(t) is the result after convolution of the t-th EEG data;
[0078] S6: Data normalization;
[0079]
[0080] S7: Peak search; preferably, the following steps are performed:
[0081] S7-1: 5-point method to find the peak value;
[0082] S7-2: Set threshold: within 30 points in the time domain, the maximum value among the peaks can be selected as the true peak value of the segment;
[0083] S8: Threshold training to remove invalid k-complex waves, including:
[0084] S8-1: Based on the label of the k-complex wave, select the appropriate amplitude (>=0.42 after normalization) and filter out the valid peak;
[0085] S8-2: Further, based on the results of S8-1, confirm s i Whether the amplitude at the corresponding position meets the requirements of the k-complex wave amplitude of 80-380uv and time span, such as 0.5-2s;
[0086] S8-3: Statistics i The number of k complex waves that appear. If the number of k complex waves in each 30s EEG data segment is greater than 5, this segment is considered to be deep sleep slow wave, and finally the k complex wave is obtained.
[0087] Verification process:
[0088] The technical solution of specific embodiment 1 was verified by the following method:
[0089] like Figure 8 As shown, based on the EEG, the k complex wave is found by manual marking; the k complex wave is then re-obtained using the method described in Specific Example 1; finally, within a set threshold, the results of manual marking are statistically compared with the results obtained by the method described in Specific Example 1, and verified by the following method;
[0090]
[0091] Where, Tp: the number of prediction pairs;
[0092] Fp: the number of wrong predictions;
[0093] Fn: The number of unpredicted items;
[0094] TPR: recall rate;
[0095] PPV: accuracy rate;
[0096] The results are shown in Table 1:
[0097]
[0098] As shown in Table 1, the accuracy and recall of the method described in this embodiment are both good, which can improve the robustness of the machine learning model and further improve the accuracy of detection.
[0099] Therefore, the present invention is based on electroencephalogram (EEG) signals and adopts preprocessing, wavelet denoising and morphological methods to detect k-complex waves. It is a novel and high-precision k-complex detection method.
[0100] Specific embodiment II:
[0101] The present invention also provides the following embodiments:
[0102] like Figure 6 A k-complex wave detection system based on electroencephalogram (EEG) signals includes: an acquisition module 100, a segmentation module 200, a processing module 300, and an analysis module 400; wherein the acquisition module 100 is used to acquire EEG data; the segmentation module 200 interacts with the acquisition module 100 for segmenting the EEG data to obtain EEG signals; the processing module 300 interacts with the segmentation module 200 for convolving the EEG signals with a wavelet basis and normalizing the convolution results; the analysis module 400 interacts with the processing module 300 for searching for peaks in the normalized data and performing threshold training on the peaks to obtain the k-complex waves.
[0103] Specifically, such as Figure 7 The analysis module 400 includes: a search module 41, a training module 42, a detection module 43 and a filtering module 44; wherein the search module 41 is connected to the processing module 300 and is used to search for peak values in the normalized data; the training module 42 is connected to the search module 41 and is used to perform threshold training on the peak values using a preset amplitude threshold and a preset frequency amplitude to obtain a valid peak value; the detection module 43 is connected to the training module 42 and is used to perform morphological screening on the EEG signal based on the valid peak value to obtain a preliminary K complex wave; the filtering module 44 is connected to the detection module 43 and is used to exclude deep sleep slow waves in the preliminary K complex wave to obtain the K complex wave;
[0104] The detection module 43 exchanges data with the training module 42 to complete the morphological screening by comparing the amplitude and frequency of the EEG signal at the comparison moment with the amplitude threshold and the frequency threshold respectively.
[0105] Preferably, the comparison moment is: the moment when the effective peak appears.
[0106] Specific embodiment III:
[0107] The present invention also provides an embodiment:
[0108] An electronic device comprises: a storage medium for storing a computer program and a processing unit; wherein the processing unit exchanges data with the storage medium and is configured to execute the computer program through the processing unit when a notification is made, thereby performing the steps of the K-complex wave detection method based on electroencephalogram signals as described above.
[0109] In the above-mentioned electronic device, the storage medium is preferably a storage device such as a mobile hard disk, a solid-state hard disk, or a USB flash drive; the processing unit, preferably a CPU, exchanges data with the storage medium, and is used to execute the computer program through the processing unit when performing EEG signal detection, and perform the steps of the K-complex wave detection method based on EEG signals as described above.
[0110] The CPU can execute various appropriate actions and processes according to the program stored in the storage medium. The electronic device also includes the following peripherals, including input parts such as a keyboard and a mouse, and may also include output parts such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; in particular, according to the embodiments disclosed in the present invention, Figure 1-5 Any of the processes described in can be implemented as a computer software program.
[0111] The present invention also provides an embodiment:
[0112] A computer-readable storage medium having a computer program stored therein; when the computer program is run, the computer program executes the steps of the above-mentioned K-complex wave detection method based on EEG signals;
[0113] In this embodiment, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0114] The above disclosures are only a few specific implementation scenarios of the present invention, but the present invention is not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the scope of protection of the present invention. The above invention numbers are for descriptive purposes only and do not represent the advantages or disadvantages of the implementation scenarios.
Claims
1. A K-complex wave detection method based on EEG signals, characterized in that: include: Use the wavelet basis to convolve with the EEG signal to obtain the convolution result; Performing data normalization processing on the convolution result to obtain normalized data; finding peaks in the normalized data; According to the label of the k complex wave, an amplitude threshold and a frequency threshold are set; Filter out effective peak values according to the amplitude threshold; performing morphological screening on the EEG signal according to the effective peak value to obtain the number of k complex waves appearing in the EEG signal; The k-wave complex appearing in the electroencephalogram signal is obtained after excluding the deep sleep slow wave; The method for constructing the wavelet basis comprises: The wavelet basis is constructed by fitting a typical k-complex wave with a polynomial.
2. The method for detecting K-complex waves based on EEG signals according to claim 1, wherein: The EEG signal is obtained by the following steps: Collect EEG data according to the preset sampling frequency and sampling duration; Preprocessing the EEG data to obtain a waveform sequence of the EEG data; Based on the segments, the waveform sequence is segmented according to the preset time length to obtain N segmented signals; Selecting any one of the N segments of the segmented signal as the EEG signal; N=2,3,4,……。 3. The K-complex wave detection method based on EEG signals according to claim 1, characterized in that: The step of "performing morphological screening on the EEG signal according to the effective peak value" includes: Comparing the amplitude and frequency of the EEG signal at the comparison moment with the amplitude threshold and the frequency threshold, respectively, to obtain the number of the k complex waves; The comparison time is: the time when the effective peak appears.
4. A K-complex wave detection system based on EEG signals, characterized in that: include: Acquisition module, used to collect EEG data; A segmentation module, which interacts with the acquisition module to segment the EEG data and obtain EEG signals; a processing module, which interacts with the segmentation module to perform convolution on the EEG signal using a wavelet basis, and normalizes the convolution result; wherein the wavelet basis is obtained by fitting a typical k-complex wave with a polynomial; an analysis module, which interacts with the processing module to perform data detection on the normalized data and perform threshold training on the peak value to obtain the k-wave complex; The analysis module includes: a search module, connected to the processing module, for searching for peak values in the normalized data; a training module connected to the search module, configured to perform threshold training on the peak value through a preset amplitude threshold and a preset frequency threshold to obtain a valid peak value; a detection module, connected to the training module, for performing morphological screening on the EEG signal according to the effective peak value to obtain a preliminary k-wave complex; A filtering module is connected to the detection module and is used to exclude deep sleep slow waves in the pre-selected K complex wave to obtain the K complex wave.
5. The K-complex wave detection system based on EEG signals according to claim 4, characterized in that: The detection module exchanges data with the training module to complete the morphological screening by comparing the amplitude and / or frequency of the EEG signal at the comparison moment with the corresponding amplitude threshold and / or frequency threshold; The comparison time is: the time when the effective peak appears.
6. An electronic device for detecting K-complex waves based on electroencephalogram signals, comprising: Storage medium for storing computer programs; A processing unit exchanges data with the storage medium, and is used to execute the computer program through the processing unit when performing K-complex wave detection to perform the steps of the K-complex wave detection method based on electroencephalogram signals as described in any one of claims 1 to 3.
7. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program; When the computer program is run, the computer program executes the steps of the K-complex wave detection method based on EEG signals according to any one of claims 1 to 3.
Citation Information
Patent Citations
Method for automatically identifying and extracting K complex waves in sleep brain waves
CN104068849A
Method and system for labeling type of electroencephalographic signal data in sleep state
CN106166068A