Slow wave regulation and control method based on forehead electroencephalogram
Through the slow wave regulation method based on prefrontal EEG, and using technical means such as real-time signal processing and feature extraction, the problems of limited applicability and inefficiency of slow wave identification and tracking in the existing technology are solved, and high-precision and stable slow wave regulation are achieved, which is suitable for situations where individuals vary greatly.
Patent Information
- Application Number
- CN202510261570.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-06-20
AI Technical Summary
The prior art has problems of limited applicability and inefficiency in slow wave identification and tracking, especially when individual differences are large, it is difficult to achieve high-precision and stable slow wave regulation.
The slow wave regulation method based on prefrontal EEG is adopted, and through real-time signal processing, feature extraction, sleep staging judgment, slow wave recognition and rising edge tracking, technical means such as DFA removal of baseline drift, median filter removal of eye movement artifacts, Butterworth bandpass filter division frequency bands, envelope extraction and DNN model identification of rising edges, etc., to achieve adaptive slow wave regulation.
It improves the accuracy and stability of slow wave recognition, and can quickly and accurately identify the rising edge of the signal. It is suitable for scenarios where rapid feedback and real-time applications are required, eliminating the impact of individual differences on the recognition results.
Smart Images

Figure CN120168812A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electroencephalogram regulation, and particularly to a slow wave regulation method based on frontal electroencephalogram. Background Art
[0002] There are various intervention methods for slow wave sleep, including drugs, low-frequency electrical stimulation, transcranial magnetic stimulation, traditional Chinese medicine manipulation therapy, light therapy, etc.; among them, "noise stimulation" is a non-drug, effective, easy-to-implement, highly compliant, and side-effect-free treatment method for sleep disorders. In the closed-loop slow wave noise intervention, accurately identifying slow waves and performing directional stimulation at their rising edges is the key factor in enhancing the effects of closed-loop slow wave noise intervention on enhancing slow wave sleep and memory consolidation.
[0003] Existing slow wave tracking algorithms usually superimpose a phase-locked loop (PLL) signal (such as a sine signal) on the electroencephalogram signal, and trigger acoustic stimulation when the slow wave signal approaches the PLL signal. The current technology has the following two main problems:
[0004] (1) Slow wave identification problem:
[0005] Slow wave identification usually relies on the dual characteristics of frequency and amplitude. However, due to individual differences, the slow wave frequencies and amplitudes of different populations are widely distributed, and fixed frequency and amplitude thresholds are difficult to comprehensively cover all individuals, so the applicability of this method is limited;
[0006] (2) Slow wave tracking problem:
[0007] The currently commonly used slow wave tracking methods mainly include methods based on phase-locked loop (PLL) and morphological features. Among them, the slow wave tracking efficiency of the PLL method is low, while the method based on morphology has insufficient robustness and is easily affected by signal noise and individual differences. Therefore, it is necessary to develop a more efficient and adaptive slow wave tracking method, especially in the identification of the rising edge of slow waves, to improve the accuracy and stability;
[0008] Based on the above problems, we propose a slow wave regulation method based on frontal electroencephalogram. Summary of the Invention
[0009] In order to solve the problems existing in the prior art, the present invention proposes a slow wave regulation method based on frontal electroencephalogram.
[0010] In order to achieve the above object, the present invention adopts the following technical solutions:
[0011] A slow wave regulation method based on frontal electroencephalogram, comprising the following steps:
[0012] S1: Real-time signal processing: Wear the EEG monitoring device, turn on the monitoring software of the EEG monitoring device for monitoring, and send the original monitored data to the host computer. Then, take 6 s as a judgment period, and extract 30 s of original data from the data buffer of the host computer. The original data is successively processed by DFA to remove baseline drift and by median filtering to remove eye movement artifacts. The formula for median filtering is F(x) = med(F(x - k));
[0013] S2: Feature extraction: First, divide the frequency band through a Butterworth band-pass filter into: δ R (0.5 - 3 Hz), θ(4 - 7 Hz), α(8 - 12 Hz), β(18 - 30 Hz), EMG(> 32 Hz), and AF(0.5 - 7 Hz). Extract the envelope of the separated waveforms of each frequency band. At the same time, extract the peak-to-peak value and the maximum slope of AF. Secondly, derive 5 sleep macrostructure features and 3 microstructure features. The 3 microstructure features are respectively spindle waves (NSP), the number of awakenings (NAR), and the total length of all awakenings within a period (LAR);
[0014] S3: Sleep staging: Based on the features extracted in S2, first judge whether the data is OK according to the motion artifact ratio. If the motion artifact ratio is less than or equal to 50%, the data is OK; if the motion artifact ratio is greater than 50%, the data is NG. Then, use the rule judgment method for real-time sleep staging. The rule judgment method includes Conditions 1 - 6. According to the corresponding conditions, the current sleep state can be judged as N1 stage, N2 stage, N3 stage, WK stage, or REM stage;
[0015] S4: Slow wave identification: Judge whether the sleep staging is N3 stage. When the sleep staging is not N3 stage, return to S1. If the sleep staging is N3 stage, calculate the power spectral density by the Welch method, calculate the energy proportion of the δ R wave, then find the peak value by setting the interval parameter and height, then multiply the original data by -1, and find the valley value by the same method. Finally, judge that if the energy proportion of the δ R wave and the peak-to-peak value meet the set threshold, then identify the current as the slow wave stage;
[0016] S5: Rising edge tracking: If the current belongs to the slow wave stage, then perform rising edge tracking. Take the current data window length as 2 s and the sliding window as 20 ms, then filter through a low-latency FIR filter, and then input the filtered data into the trained DNN model. The DNN model identifies whether it is a rising edge and determines whether the last data is at zero;
[0017] S6: Acoustic wave stimulation: When the DNN model in S5 identifies a rising edge and determines that there is a zero point in the last data, then it judges whether to perform acoustic wave stimulation 5 times continuously. When acoustic wave stimulation is not performed 5 times continuously, acoustic wave stimulation is carried out, and then it returns to step S4. When acoustic wave stimulation is performed 5 times continuously, cold cutting is carried out for 5 s.
[0018] Preferably, in S1, the specific process of removing baseline drift by DFA is as follows:
[0019] S110: First, integrate the original data to obtain an integration sequence, and its integration formula
[0020]
[0021] where t represents the time unit and k represents the kth timestamp in the EEG sequence;
[0022] S111: Divide y(k) into non-overlapping self-intervals, and then perform polynomial fitting.
[0023]
[0024] where, y fit (i) represents the value of polynomial fitting at point i.
[0025] Preferably, in S2, the formula for envelope extraction:
[0026] Env(F band (x)) = Amp(Hilbert(F band (x)))
[0027] where Env(.) represents the envelope-taking function, Amp(.) represents the instantaneous amplitude-taking function, Hilbert(.) represents the Hilbert transform, and F band (x) represents the EEG signal in different frequency bands x;
[0028] The formula for extracting the peak-to-peak value: P(F AF (x)) = |Max(F AF (x)) - Min(F AF (x))|
[0029] where F AF (x) represents the instantaneous amplitude of the EEG;
[0030] The formula for extracting the maximum slope: Sl max (F AF (x)) = Max i∈M |F AF (x i+1 ) - F AF (xi )|。
[0031] Preferably, in the S2, the five sleep macrostructure features are respectively the sigma-beta index (SBI), the delta-beta index (DBI), the beta-electromyogram index (BEI), the average electromyogram activity (EMG), and the average beta activity (β).
[0032] sigma-beta index (SBI):
[0033] delta-beta index (DBI):
[0034] beta-electromyogram index (BEI):
[0035] Average electromyogram activity (EMG): Mean(Env 2 (F EMG (x)))
[0036] Average beta activity (β): Mean(Env 2 (F beta (x))).
[0037] Preferably, in the S3, the specific contents of conditions 1 - 6 are as follows:
[0038] Condition 1: When SBI≥1 or NSP≥1;
[0039] Condition 2: When DBI≥10 and β<2;
[0040] Condition 3: When {SBI<0.85 and BEI>1.50} or {0.85≤SBI<1 and BEI>1.25};
[0041] Condition 4: When {NAR = 1 and NSP = 0} or {NAR≥2 and NSP<2 and LAR>5s};
[0042] Condition 5: When NAR(with EMG)≥1 or ≤2 minutes of REM / N1;
[0043] Condition 6: When SBI<0.9 and (BEI<1).
[0044] Preferably, in the S5, the DNN model contains 3 hidden layers and an output layer, and uses the cross-entropy loss function. The input of the DNN model is the filtered 2-second electroencephalogram data, and the output of the DNN model is the probability of the slow wave rising edge.
[0045] Compared with the prior art, the present invention extracts time-frequency features of different bands from EEG signals, determines the current sleep stage state according to the extracted features using rules, and then determines whether there is slow wave oscillation by analyzing the energy ratio and peak-to-peak value of the δ R wave in the EEG signal. It adjusts the threshold based on the dynamic change of the current EEG signal, thereby eliminating the influence of individual differences on the recognition result and improving the accuracy and stability of slow wave recognition; in addition, it can quickly and accurately identify the rising edge of the signal, making it applicable to scenarios that require quick feedback and real-time applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flowchart of the slow wave regulation method based on frontal EEG proposed by the present invention;
[0047] Figure 2 is a waveform diagram after median filtering in the slow wave regulation method based on frontal EEG proposed by the present invention;
[0048] Figure 3 is a judgment flowchart of the rule judgment method in the slow wave regulation method based on frontal EEG proposed by the present invention;
[0049] Figure 4 is a schematic diagram of peak-to-peak value search in the slow wave regulation method based on frontal EEG proposed by the present invention;
[0050] Figure 5 is a schematic diagram of the DNN model in the slow wave regulation method based on frontal EEG proposed by the present invention;
[0051] Figure 6 is an effect diagram of acoustic wave stimulation in the slow wave regulation method based on frontal EEG proposed by the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0052] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.
[0053] Referring to Figure 1 , the slow wave regulation method based on frontal EEG includes the following steps:
[0054] S1: Real-time signal processing: Wear the EEG monitoring device, turn on the monitoring software of the EEG monitoring device for monitoring, and send the monitored raw data to the host computer. Then, take 6s as a judgment period and extract 30s of raw data from the data buffer of the host computer. The raw data is successively processed by DFA to remove baseline drift and by median filtering to remove eye movement artifacts. The formula for median filtering is F(x) = med(F(x - k)). The waveform diagram after median filtering is as shown in Figure 2 shown;
[0055] S2: Feature extraction: First, divide the frequency band through a Butterworth band-pass filter into: δ R (0.5 - 3Hz), θ(4 - 7Hz), α(8 - 12Hz), β(18 - 30Hz), EMG(>32Hz), and AF(0.5 - 7Hz). Extract the envelope of each separated frequency band waveform, and at the same time extract the peak-to-peak value and the maximum slope of AF. Secondly, derive 5 sleep macrostructure features and 3 microstructure features. The 3 microstructure features are respectively spindle waves (NSP), the number of awakenings (NAR), and the total length of all awakenings within a period (LAR). The 5 sleep macrostructure features are respectively the sigma-beta index (SBI), the delta-beta index (DBI), the beta-electromyogram index (BEI), the average electromyogram activity (EMG), and the average beta activity (β). The sigma-beta index (SBI):
[0056] The delta-beta index (DBI):
[0057] The beta-electromyogram index (BEI):
[0058] The average electromyogram activity (EMG): Mean(Env 2 (F EMG (x)))
[0059] The average beta activity (β): Mean(Env 2 (F beta (x)));
[0060] S3: Sleep staging: Based on the features extracted in S2, first judge whether the data is OK according to the motion artifact ratio. If the motion artifact ratio is less than or equal to 50%, the data is OK; if the motion artifact ratio is greater than 50%, the data is NG. Then, use the rule judgment method for real-time sleep staging. The judgment process of the rule judgment method is as shown in Figure 3 shown. The rule judgment method includes conditions 1 - 6. The specific contents of conditions 1 - 6 are:
[0061] Condition 1: when SBI ≥ 1 or NSP ≥ 1;
[0062] Condition 2: when DBI ≥ 10 and β < 2;
[0063] Condition 3: when {SBI < 0.85 and BEI > 1.50} or {0.85 ≤ SBI < 1 and BEI > 1.25};
[0064] Condition 4: when {NAR = 1 and NSP = 0} or {NAR ≥ 2 and NSP < 2 and LAR > 5s};
[0065] Condition 5: when NAR (with EMG) ≥ 1 or ≤ 2 minutes of REM / N1;
[0066] Condition 6: when SBI < 0.9 and (BEI < 1), the current sleep stage can be judged as N1 stage, N2 stage, N3 stage, WK stage or REM stage according to the corresponding conditions;
[0067] S4: Slow wave identification: Judge whether the sleep stage is N3 stage. When the sleep stage is not N3 stage, return to S1. If the sleep stage is N3 stage, calculate the power spectral density by the Welch method, calculate the energy proportion of the δ wave, then find the peak value by the set interval parameter and height, and then multiply the original data by -1 and find the valley value by the same method. The search for the peak-to-peak value is as shown, and finally judge whether the energy proportion of the δ wave and the peak-to-peak value meet the set threshold, then identify the current as the slow wave stage; R Wave energy ratio, and then find the peak value by the set interval parameter and height, and then multiply the original data by -1 and find the valley value by the same method. The search for the peak-to-peak value is as shown, and finally judge whether the energy ratio of the δ wave and the peak-to-peak value meet the set threshold, then identify the current as the slow wave stage; Figure 4 shown, and finally judge whether the energy proportion of the δ R wave and the peak-to-peak value meet the set threshold, then identify the current as the slow wave stage;
[0068] S5: Rising edge tracking: If the current belongs to the slow wave stage, perform rising edge tracking. Take the current data window length as 2 seconds and the sliding window as 20 milliseconds, then filter through a low-latency FIR filter, and then input the filtered data into the trained DNN model. The DNN model identifies whether it is a rising edge and determines whether the last data is at zero. The DNN model contains 3 hidden layers and an output layer, and uses the cross-entropy loss function. The input of the DNN model is the 2-second EEG data after filtering, and the output of the DNN model is the probability of the slow wave rising edge. The schematic diagram of the DNN model is as shown; Figure 5 shown;
[0069] S6: Acoustic wave stimulation: When the DNN model in S5 identifies a rising edge and determines that the last data exists at zero, then judge whether to continuously stimulate with acoustic waves 5 times. If not continuously stimulated with acoustic waves 5 times, then perform acoustic wave stimulation. The effect diagram of the acoustic wave stimulation is as shown Figure 6As shown, then return to step S4. When the acoustic wave stimulation is continuously performed 5 times, cold cutting is performed for 5 s;
[0070] In this embodiment, the time-frequency features of different bands are extracted from the EEG signals. According to the extracted features, the current sleep stage state is judged using rules, and then by analyzing the energy ratio and peak-to-peak value of the δ R waves in the EEG signals, it is judged whether there is a slow wave oscillation. It adjusts the threshold based on the dynamic change of the current EEG signal, thereby eliminating the influence of individual differences on the recognition result and improving the accuracy and stability of slow wave recognition; in addition, it can quickly and accurately identify the rising edge of the signal, making it applicable to scenarios that require quick feedback and real-time applications.
[0071] In S1 of this embodiment, the specific process of removing baseline drift by DFA is as follows:
[0072] S110: First, integrate the original data to obtain an integration sequence, and its integration formula
[0073]
[0074] where t represents the time unit and k represents the kth timestamp in the EEG sequence;
[0075] S111: Divide y(k) into non-overlapping self-intervals, and then perform polynomial fitting,
[0076]
[0077] where, y fit (i) represents the value of the polynomial fitting at point i.
[0078] In S2 of this embodiment, the formula for envelope extraction:
[0079] Env(F band (x)) = Amp(Hilbert(F band (x)))
[0080] where Env(.) represents the envelope-taking function, Amp(.) represents the instantaneous amplitude-taking function, Hilbert(.) represents the Hilbert transform, and F band (x) represents the EEG signal in different frequency bands x;
[0081] The formula for extracting the peak-to-peak value: P(F AF (x)) = |Max(F AF (x)) - Min(F AF (x))|
[0082] where F AF (x) represents the instantaneous amplitude of the EEG;
[0083] Extraction formula for the maximum slope: Sl max (F AF (x)) = Max i∈M |F AF (x i+1 ) - F AF (x i )|.
[0084] As described above, it is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention, according to the technical solution and inventive concept of the present invention, making equivalent substitutions or changes, shall be covered by the protection scope of the present invention.
Claims
1. A slow wave control method based on frontal electroencephalogram, characterized in that: The following steps are involved: S1: Real-time signal processing: Wear the EEG monitoring device, open the monitoring software of the EEG monitoring device for monitoring, and send the monitored raw data to the host computer. Then, take 6 seconds as a judgment cycle, and extract 30 seconds of raw data from the data buffer of the host computer. The raw data is successively removed by DFA to remove baseline drift and by median filtering to remove eye movement artifacts. The formula of median filtering is F(x)=med(F(xk)); S2: Feature extraction: First, the frequency band is divided into: δ R (0.5-3Hz), θ (4-7Hz), α (8-12Hz), β (18-30Hz), EMG (>32Hz) and AF (0.5-7Hz), the envelope of each separated frequency band waveform was extracted, and the peak-to-peak value and maximum slope of AF were extracted. Then, 5 sleep macro-structure characteristics and 3 micro-structure characteristics were derived. The 3 micro-structure characteristics were spindle wave (NSP), number of awakenings (NAR) and the total length of all awakenings in the period (LAR); S3: Sleep staging: Based on the features extracted by S2, the data is first judged whether it is OK according to the motion artifact ratio. If the motion artifact ratio is less than or equal to 50%, the data is OK. If the motion artifact ratio is greater than 50%, the data is NG. Then, the rule judgment method is used to perform real-time sleep staging. The rule judgment method includes conditions 1 to 6. According to the corresponding conditions, the current sleep state can be judged as N1 stage, N2 stage, N3 stage, WK stage or REM stage. S4: Slow wave identification: Determine whether the sleep stage is N3. If the sleep stage is not N3, return to S1. If the sleep stage is N3, calculate the power spectrum density by the Welch method and calculate δ R The energy proportion of the wave, then find the peak value by setting the interval parameters and height, then multiply the original data by -1, and find the valley value in the same way, and finally determine δ R If the energy proportion and peak-to-peak value of the wave meet the set threshold, the current phase is identified as the slow wave phase; S5: Rising edge tracking: If the current phase is a slow wave phase, the rising edge tracking is performed. The current data window length is 2 seconds and the sliding window is 20 milliseconds. The data is then filtered through a low-latency FIR filter. The filtered data is then input into the trained DNN model. The DNN model identifies whether it is a rising edge and determines whether the last data is at zero. S6: Acoustic wave stimulation: When the DNN model in S5 recognizes a rising edge and determines that the last data has a zero point, it then judges whether the acoustic wave stimulation is performed 5 times continuously. If the acoustic wave stimulation is not performed 5 times continuously, then the acoustic wave stimulation is performed, and then returns to step S4. When the acoustic wave stimulation is performed 5 times continuously, a cold cut is performed for 5 seconds.
2. The method for slow wave control based on frontal electroencephalogram according to claim 1, characterized in that: In S1, the specific process of removing the baseline drift by DFA is as follows: S110: First, integrate the original data to obtain an integral sequence, whose integral formula is Where t represents the time unit, and k represents the kth timestamp in the EEG sequence; S111: Split y(k) into non-overlapping intervals and then perform polynomial fitting. Among them, y fit (i) represents the value of the polynomial fit at point i.
3. The method for slow wave control based on frontal electroencephalogram according to claim 1, characterized in that: In S2, the envelope extraction formula is: Env(F band (x))=Amp(Hilbert(F band (x))) Where Env(.) represents the envelope function, Amp(.) represents the instantaneous amplitude function, Hilbert(.) represents the Hilbert transform, and F band (x) represents the EEG signal in different frequency bands x; Peak-to-peak value extraction formula: P(F AF (x))=|Max(F AF (x))-Min(F AF (x))| where F AF (x) represents the instantaneous amplitude of EEG; The maximum slope extraction formula: Sl max (F AF (x))=Max i∈M |F AF (x i+1 )-F AF (x i )|.
4. The method for slow wave control based on frontal electroencephalogram according to claim 1, characterized in that: In S2, the five sleep macrostructure features are sigma-beta index (SBI), delta-beta index (DBI), beta-electromyographic index (BEI), average electromyographic activity (EMG) and average beta activity (β), Sigma-beta Index (SBI): Delta-Beta Index (DBI): Beta-EMG Index (BEI): Mean electromyographic activity (EMG): Mean(Env 2 (F EMG (x))) Mean beta activity (β): Mean(Env 2 (F beta (x))).
5. The method for slow wave control based on frontal electroencephalogram according to claim 1, characterized in that: In S3, the specific contents of conditions 1 to 6 are: Condition 1: When SBI ≥ 1 or NSP ≥ 1; Condition 2: When DBI ≥ 10 and β < 2; Condition 3: When {SBI<0.85 and BEI>1.50} or {0.85≤SBI<1 and BEI>1.25}; Condition 4: When {NAR=1 and NSP=0} or {NAR≥2 and NSP<2 and LAR>5s}; Condition 5: When NAR (with EMG) ≥ 1 or ≤ 2 minutes of REM / N1; Condition 6: When SBI<0.9 and (BEI<1).
6. The method for slow wave control based on frontal electroencephalogram according to claim 1, characterized in that: In S5, the DNN model includes 3 hidden layers and one output layer, and adopts a cross entropy loss function, wherein the input of the DNN model is the filtered 2-second EEG data, and the output of the DNN model is the probability of the rising edge of the slow wave.
