Sleep monitoring and intervention method and system based on electroencephalogram signals

By employing a deep learning-based EEG signal monitoring and intervention method, combined with graph neural networks and Transformer encoders, we have achieved accurate identification and personalized intervention for sleep stages. This solves the problems of cumbersome equipment and insufficient signal quality in existing technologies, and improves the accuracy of sleep monitoring and the level of personalization of intervention.

CN121015212AActive Publication Date: 2025-11-28CHANGCHUN UNIV OF SCI & TECH

Patent Information

Application Number
CN202511556423.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2025-11-28
Estimated Expiration
2045-10-29

AI Technical Summary

Technical Problem

Existing sleep monitoring and intervention technologies suffer from problems such as cumbersome equipment, insufficient signal quality, and poor model robustness, making it difficult to achieve accurate sleep stage identification and personalized intervention.

Method used

A deep learning-based EEG signal monitoring method is used, which combines graph neural networks and Transformer encoders for automatic sleep staging. EEG signals are collected through flexible dry electrodes, analyzed in real time, and transcranial alternating current stimulation signals are generated for intervention. The method integrates artifact recognition and closed-loop intervention mechanisms.

Benefits of technology

It improves the accuracy of sleep stage monitoring and the level of personalized intervention, ensures the reliability and safety of the system in complex environments, and achieves comfortable and precise closed-loop sleep intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121015212A_ABST
    Figure CN121015212A_ABST
Patent Text Reader

Abstract

The invention discloses a sleep monitoring and intervention method and system based on electroencephalogram signals, and belongs to the technical field of sleep monitoring and intervention. The method comprises the steps that electroencephalogram signals are collected through a dry electrode worn on the head of a user; the signals are preprocessed; performing automatic sleep staging on the pre-processed signal based on a layered space-time joint modeling network, and outputting a waking period label, an N1 period label, an N2 period label, an N3 period label and an REM period label; whether intervention conditions are met or not is judged based on the staging labels and the real-time electroencephalogram spectrum features; and if yes, generating and applying an alternating current stimulation signal for intervention. The system comprises a wearable electroencephalogram acquisition device, a signal analysis module and an intervention module. According to the method, the deep learning model integrating front-end self-adaptive processing, the graph neural network and Transform is adopted for sleep staging, closed-loop phase synchronous stimulation driven by the digital phase-locked loop is combined on the basis, connection from sleep monitoring to closed-loop intervention is achieved, and the sleep monitoring accuracy and the intervention effect are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of sleep monitoring and intervention, and particularly relates to a sleep monitoring and intervention method and system based on electroencephalogram signals. BACKGROUND

[0002] Quality sleep is essential for physical and mental health, and sleep disorders can indicate serious health problems such as hypertension, arrhythmia, narcolepsy, and insomnia. According to statistics, 10%-30% of the population suffers from insomnia. Accurate identification of sleep stages is crucial for diagnosing and treating these disorders. Sleep disorder patients may be at risk of hypertension, heart failure, etc. Polysomnography (PSG) is considered the gold standard for sleep scoring, used to assess typical sleep disorders such as sleep apnea, hypersomnia, and sleepwalking. The R&K standard divides sleep stages into wakefulness (W), rapid eye movement (REM), and non-rapid eye movement (NREM), with NREM further subdivided into S1, S2, S3, S4, or N1, N2, N3, N4. The AASM rule combines N3 and N4 into N3 and divides PSG into 5 sleep stages. The AASM rule is widely used in artificial sleep scoring, which requires experts to analyze the whole night's sleep, which is complex and time-consuming. In contrast, machine learning algorithms can complete sleep scoring in a few minutes, with results comparable to experts, so automatic sleep scoring is very important for healthcare systems.

[0003] Automatic sleep staging methods are mainly divided into traditional machine learning and the popular neural network method in recent years. Traditional machine learning extracts rich information from input signals through different size receptive field feature maps. For example, EEG patterns exhibit different frequency and temporal features: sleep spindles in the N2 stage appear in the 12-14 Hz range, lasting 0.5 to 2 seconds; while slow wave activity in the N3 stage is in the 0.5-2 Hz range throughout the stage. However, traditional methods have difficulty utilizing multi-level features that can cover a wider time scale and frequency range. In addition, existing automatic scoring methods, while addressing the lack of labeled PSG data, pay insufficient attention to the accuracy of the scoring and fail to fully utilize the large amount of annotated PSG data.

[0004] In terms of sleep intervention, research has shown that the brain exhibits characteristic neural oscillation patterns during different sleep stages. In particular, when the system detects that an individual is having difficulty falling asleep or is in a light sleep state, specific mild external stimuli can be applied through a closed-loop system to induce the brain's neural oscillation activity to shift towards the characteristic patterns of deep sleep, which constitutes the basic principle of electroencephalogram regulation for sleep aid.

[0005] The deficiencies of existing technologies mainly manifest in the following aspects:

[0006] 1. Traditional PSG system: requires a large number of lead electrodes, installation is cumbersome, wearing is not comfortable, and is not suitable for long-term home use;

[0007] 2. Existing wearable EEG device: although it relieves some burden, it is still insufficient in signal quality assurance and automatic identification of artifacts;

[0008] 3. Existing sleep staging model: mostly relies on manual annotation or is not robust in real-world scenarios, making it difficult to accurately distinguish different sleep stages.

[0009] In summary, how to design a closed-loop intervention strategy that can improve sleep quality is a problem that needs to be solved by the technical personnel in the field. SUMMARY

[0010] The technical solution of the present application to solve the above technical problems is to provide a sleep monitoring and intervention method based on electroencephalogram signals, comprising the following steps:

[0011] S1, collecting electroencephalogram signals through dry electrodes worn on the user's head;

[0012] S2, preprocessing the collected electroencephalogram signals, the preprocessing including amplification, band-pass filtering and power frequency notch filtering;

[0013] S3, real-time analysis of the preprocessed electroencephalogram signals, automatic sleep staging based on a deep learning model, and output of a current sleep stage label; the sleep stage label at least includes a wake period, an N1 period, an N2 period, an N3 period and an REM period;

[0014] S4, determining whether a preset intervention trigger condition is met based on the sleep stage label and real-time electroencephalogram frequency spectrum features;

[0015] S5, generating and applying a transcranial alternating current stimulation signal to intervene in the user's sleep when the intervention trigger condition is met.

[0016] Further, the automatic sleep staging based on a deep learning model in step S3 specifically includes:

[0017] S31, dividing the preprocessed electroencephalogram signals into a plurality of data epochs according to a preset time window;

[0018] S32, each data epoch is first passed through a front-end adaptive module (including dynamic segmentation, double-scale convolution and adaptive pooling) to extract its high-quality multi-channel deep features;

[0019] S33. The DG2T-SleepNet is modeled by introducing a graph neural network (GNN) to model the topological relationship between multi-lead signals, and the Transformer encoder is used to capture long-range dependency features across time periods, and finally outputs the sleep stage classification results corresponding to each data epoch.

[0020] Furthermore, step S3 also includes a motion artifact recognition step:

[0021] The median and median absolute deviation of the EEG signal amplitude for each data epoch are calculated in real time, and the upper and lower limits of the amplitude are dynamically set based on this.

[0022] If the amplitude of the EEG signal in the data epoch exceeds the upper and lower thresholds, further verification is performed by combining electrode impedance change information.

[0023] The data epochs that are confirmed as artifacts after verification are marked as a separate "artifact" category.

[0024] Furthermore, the intervention triggering conditions described in step S4 include those based on The specific steps for determining the significance of a wave include:

[0025] S41. Calculate real-time EEG signals. Average power of the frequency band;

[0026] S42, Calculation and The average power of adjacent frequency bands;

[0027] S43, Calculation The ratio of the power of a frequency band to the power of an adjacent frequency band, and converting this ratio into a decibel value;

[0028] S44. If the decibel value exceeds the first preset threshold, then determine... The wave is significant, satisfying the intervention triggering conditions.

[0029] Furthermore, in step S44, the intervention triggering condition further includes: calculating The ratio of frequency band power to total power; if this ratio exceeds a second preset threshold, then the intervention triggering condition is further confirmed.

[0030] Furthermore, the generation and application of transcranial alternating current stimulation signals described in step S5 specifically refers to closed-loop phase-synchronized stimulation, which includes the following steps:

[0031] S51. Bandpass filtering is performed on the preprocessed EEG signal to extract the neural oscillation signal of the target frequency band.

[0032] S52. Perform Hilbert transform on the filtered signal to calculate the instantaneous phase and instantaneous frequency of the neural oscillation signal;

[0033] S53. Calculate a target phase based on the instantaneous phase, wherein the target phase maintains a preset fixed phase difference with the instantaneous phase of the neural oscillation signal;

[0034] S54. Based on the target phase and the instantaneous frequency, generate a transcranial alternating current stimulation waveform with a specific phase and frequency;

[0035] S55. Apply the transcranial alternating current stimulation waveform to the user.

[0036] Furthermore, prior to step S52, an adaptive filtering step is included to suppress artifacts in the electroencephalogram signal caused by previously applied stimuli.

[0037] Furthermore, the preset fixed phase difference mentioned in step S53 is used to compensate for the total time delay generated by the system from signal acquisition to stimulus application.

[0038] To address the aforementioned technical problems, this invention also proposes a sleep monitoring and intervention system based on electroencephalogram (EEG) signals, comprising:

[0039] A wearable EEG acquisition device for acquiring a user's EEG signals, the device comprising a flexible wearable shell and a dry electrode assembly disposed inside it;

[0040] The signal processing module, connected to the EEG acquisition device, is used to preprocess the acquired EEG signals, identify artifacts, and automatically stage sleep.

[0041] A closed-loop intervention module, connected to the signal processing module, is used to generate and apply intervention stimuli based on sleep staging results and EEG rhythm analysis results.

[0042] The signal processing module is the DG2T-SleepNet model proposed in this paper. This model uses graph neural networks (GNN) to model the spatial dependencies between multi-channel sleep physiological signals and combines them with a Transformer encoder to capture their temporal dependencies, so as to achieve accurate classification of sleep stages and output stage results including wake, N1, N2, N3 and REM categories.

[0043] The closed-loop intervention module includes A saliency detection unit and a digital phase-locked loop (DPLL) unit are used to detect wave saliency. When the wave intensity is significantly enhanced, a transcranial alternating current stimulation (tACS) signal that is phase-locked with the intrinsic neural oscillation is generated.

[0044] Furthermore, the dry electrodes of the wearable EEG acquisition device are comb-shaped or dome-shaped silver / silver chloride dry electrodes, and the flexible wearing shell is an arc-shaped flexible structure adapted to the contour of the human head.

[0045] The technical solution of the present invention has the following beneficial effects:

[0046] 1. Enhanced monitoring accuracy and robustness:

[0047] By introducing the proposed DG2T-SleepNet model, which innovatively integrates graph neural networks (GNNs) and Transformer encoders, it can effectively model the spatial topological relationships between signals from multi-channel sleep physiological signals (PSGs) and capture long-range contextual dependencies, thereby significantly improving the accuracy of automatic staging of sleep stages such as N1, N2, N3, REM, and wakefulness in complex real-world scenarios.

[0048] Traditional multi-scale convolutional neural networks (MMCNN) and sliding window structures commonly employ fixed-length signal segmentation strategies. However, this rigid segmentation method, unrelated to dynamic signal changes, has inherent drawbacks: it may forcibly truncate key physiological waveforms (such as K-complexes or sleep spindles) midway, leading to feature fragmentation; simultaneously, fixed window overlap introduces unnecessary information redundancy. Both of these problems disrupt the temporal continuity of local waveforms, thus limiting model performance. This paper integrates an automatic dynamic motion artifact recognition and labeling mechanism. Through joint verification using amplitude statistics and impedance changes, it effectively distinguishes EEG signals from artifacts, labeling artifacts as independent categories to avoid their interference with the segmentation results, further ensuring the system's reliability and robustness in real-world environments such as user movement.

[0049] 2. High level of precision and personalization in intervention:

[0050] Proposed based on Intelligent intervention triggering conditions for wave saliency, through quantitative analysis The power of a frequency band and its ratio to that of adjacent frequency bands and the total power can accurately identify key moments for difficulty falling asleep or maintaining sleep (such as excessively long awake periods or excessive light sleep), providing a scientific and objective basis for initiating intervention.

[0051] Employing closed-loop phase-synchronized transcranial alternating current stimulation (tACS) technology, this method generates and applies stimulation with a fixed phase difference (compensating for system delays) by tracking the instantaneous phase of endogenous neural oscillations in real time, achieving "phase-locked" stimulation in sync with the brain's own rhythms. This "natural" intervention approach is more in line with physiological laws and, theoretically, can more effectively guide neural oscillations towards the desired sleep pattern (such as slow-wave activity), thereby improving the effectiveness and safety of the intervention and achieving truly personalized and precise sleep aid.

[0052] In summary, this invention achieves precise, comfortable, and personalized closed-loop sleep intervention while ensuring high-precision sleep staging, and has significant clinical application value and market prospects. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0054] Figure 1 This is a flowchart illustrating the steps of a sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to the present invention.

[0055] Figure 2 This is a schematic diagram of the sleep regulation structure of this invention patent;

[0056] Figure 3 This is a schematic diagram of the tACS stimulation output of the present invention.

[0057] Figure 4 This is a schematic diagram of wearing the wearable EEG acquisition device of this invention patent;

[0058] Figure 5 This is a schematic diagram of the electroencephalogram (EEG) leads used in this invention patent. Detailed Implementation

[0059] This invention proposes a sleep monitoring and intervention method and system based on electroencephalogram (EEG) signals, aiming to design a closed-loop intervention strategy that can improve sleep quality.

[0060] The following will describe a sleep monitoring and intervention method based on electroencephalogram (EEG) signals proposed in this invention through specific embodiments:

[0061] Example 1:

[0062] A sleep monitoring and intervention method based on electroencephalogram (EEG) signals, such as Figure 1 , Figure 2As shown, the method includes the following steps:

[0063] S1. Collect brain signals by wearing dry electrodes on the user's head;

[0064] Specifically, the wearable EEG acquisition device collects data from the user's head. The device includes a flexible outer shell and dry electrode components. The flexible outer shell features an arc-shaped structure adapted to the contours of the human head, formed using 3D printing technology. The overall material possesses flexible support properties and biocompatibility, allowing it to conform to multiple areas of the user's forehead, occiput, or scalp surface, ensuring no significant pressure or displacement during prolonged wear, making it suitable for continuous monitoring during nighttime sleep. The dry electrode components are fixed within pre-set electrode slots on the inner side of the outer shell and are made of a silver / silver chloride composite material with stable conductivity. The electrode heads have a comb-shaped or dome-shaped structure. This design enhances the mechanical contact area with the skin surface and reduces electrode-skin coupling impedance. The electrodes require no conductive paste or gel, offering non-invasive signal acquisition capabilities, easy cleaning, and reusability. The electrode assembly and flexible shell utilize an integrated modular design, allowing users to flexibly adjust the electrode arrangement and shell tightness according to head size and hairstyle, enabling self-wearing without professional installation. The EEG acquisition device is suitable for continuous EEG signal acquisition during natural sleep, featuring lightweight construction, stable wear, and reliable signal quality, making it ideal for personalized physiological data monitoring in home, medical, and mobile health settings.

[0065] S2. Preprocess the acquired EEG signals, including amplification, bandpass filtering, and power frequency notch filtering;

[0066] Specifically, the signal is amplified by a high input impedance differential amplifier, bandpass filtered by a 0.5-35 Hz bandpass filter (low-pass filter), and power frequency notched by a 50 Hz notch filter. A voltage follower is used to buffer the reference voltage signal to prevent signal distortion caused by load effects.

[0067] S3. Perform real-time analysis on the preprocessed EEG signals, automatically segment sleep based on a deep learning model, and output the current sleep stage label; the sleep stage label includes at least the wakefulness stage, N1 stage, N2 stage, N3 stage, and REM stage;

[0068] S4. Based on the sleep stage tags and real-time EEG spectrum characteristics, determine whether the preset intervention triggering conditions are met;

[0069] S5. When the intervention triggering conditions are met, a transcranial alternating current stimulation signal is generated and applied to intervene in the user's sleep.

[0070] Furthermore, the automatic sleep staging based on a deep learning model described in step S3 specifically includes:

[0071] S31. Divide the preprocessed EEG signal into multiple data epochs according to a preset time window;

[0072] S32. First, a continuous raw physiological signal x(t) is received and transformed into a discrete event sequence. In one embodiment, this transformation may be to convert the signal waveform into a pulse sequence or a neural pulse sequence. A sliding analysis window with a preset duration (0.5 seconds) is used to process the discrete event sequence to calculate a quantization index characterizing the local dynamic properties of the signal. In a specific embodiment, this quantization index is pulse density, i.e., the number of events (pulses) per unit time.

[0073] Set at least two predetermined thresholds: a high-activity threshold Th and a low-activity threshold Tl. Compare the quantization index calculated in step two with these two thresholds to classify the local region of the current signal into at least one of the following three types:

[0074] High-activity region: When the quantification index is greater than the high-activity threshold T h Time-based determination.

[0075] Low-activity region: When the quantification index is less than the low-activity threshold T l Time-based determination.

[0076] Transition zone: When the quantitative indicator is between or equal to T l With T h Determine the time interval between them.

[0077] Based on the determination result of step three, a corresponding segmentation parameter set is selected for the current signal region from a preset parameter library, and the original physiological signal x(t) is segmented. This parameter set includes at least the segmentation duration and overlap rate. In a preferred embodiment:

[0078] For highly active segments (corresponding to the N1 sleep stage), a shorter first segment duration (2 seconds) and a higher first overlap rate (60%) were used for refined analysis.

[0079] For the low-activity segment (corresponding to the N3 sleep stage), a longer second segment duration (4 seconds) and a lower second overlap rate (15%) are used to improve computational efficiency and capture long-term features.

[0080] For the transition section, a third segment duration (3 seconds) between the first and second segment durations and a third overlap rate (40%) between the first and second overlap rates are adopted.

[0081] It can dynamically adjust the segmentation strategy according to the inherent characteristics of the signal itself, generate a series of data epochs with variable lengths and overlapping rates, thus effectively avoiding the feature breakage problem caused by fixed segmentation and retaining the physiological relevance and time-domain continuity of the signal.

[0082] Take each of the said data epochs as a signal block and input it into a feature extraction module that includes at least two parallel convolutional branches. In a preferred embodiment, this module includes:

[0083] Input the signal block into a first one-dimensional convolutional layer, which is configured with a convolutional kernel having a first convolutional kernel size k1. The smaller convolutional kernel size k1 enables this branch to have a higher time-domain resolution and is suitable for capturing high-frequency components or rapidly changing local patterns in the signal.

[0084] In parallel, input the signal block into a second one-dimensional convolutional layer, which is configured with a convolutional kernel having a second convolutional kernel size k2, where the second convolutional kernel size k2 is greater than the first convolutional kernel size k1. The larger convolutional kernel size k2 enables this branch to have a broader temporal receptive field and is suitable for capturing low-frequency components or slowly changing macroscopic trends in the signal.

[0085] Perform a concatenation operation on the output feature maps of the first convolutional branch and the second convolutional branch along their feature dimensions to fuse them into a single, more representative combined feature vector.

[0086] ;

[0087] where the convolutional kernel k1 < k2, which are respectively used to capture high-frequency and low-frequency features. After output, perform concatenation:

[0088] ;

[0089] To process the variable-length input introduced by adaptive segmentation and provide a feature representation with a unified size for subsequent modules, the present invention introduces an adaptive pooling layer after the combined feature map F.

[0090] It can map a combined feature map F of any time length into an output feature vector with a preset fixed output size (d_out). Specifically, for each position of the output feature vector, this operation will dynamically determine a corresponding receptive field region R on the input feature map F and perform a pooling operation on the feature values within this region.

[0091] ;

[0092] Where R_ij represents the region at output position (i,j) on the input feature map F, which can be understood as a kind of dynamic resampling, mapping a feature map of arbitrary length to a fixed output size. That is:

[0093] ;

[0094] After the aforementioned dual-scale convolution and adaptive pooling operations, the system generates a feature matrix X_feat for each input data epoch. This feature matrix inherits the advantages of adaptive segmentation, exhibiting good temporal continuity; through dual-scale convolution and adaptive pooling, channel alignment and dimensionality uniformity are achieved. Feature Matrix It will be used as input for the next stage Graph Neural Network (GNN) module.

[0095] To effectively model the complex spatial dependencies between multi-lead physiological signals (several channels), a graph neural network module was introduced.

[0096] Consider the C signal channels within a single epoch as C nodes in a graph structure. Let the node feature matrix be... The adjacency matrix A can be constructed based on the lead topology; if there is no prior connection information, a fully connected graph is used. The attention weights for nodes i and j are defined as follows:

[0097] ;

[0098] 'a' represents the learnable attention parameter. The node feature update formula is:

[0099] ;

[0100] (∙) is the ELU activation function. After stacking two layers of GAT, the graph-level representation g∈R^(d_g) of a single epoch is obtained through global average pooling, realizing cross-channel feature fusion and topology preservation.

[0101] To capture the long-term temporal dependencies between different data epochs, this invention cascades a Transformer encoder module after the graph neural network module.

[0102] The time-series feature sequences generated by GNN The input is a Transformer encoder to capture long-term dependencies. Sine-cosine positional encoding is added to preserve temporal order. Subsequently, a multi-head self-attention mechanism is used to weight the context across epochs.

[0103] ;

[0104] By stacking several encoder layers and adding residual connections and layer normalization (LayerNorm), the model can simultaneously capture both short-term and long-term dependency features. .

[0105] A fully connected layer is used to map the output of the transformer layer to the class space, and softmax is used to obtain the class probabilities. During the training phase, a label-smooth weighted cross-generation loss function and contrastive learning are used.

[0106] ;

[0107] Where L is the number of samples and C is the number of categories. Let i be the true label of the i-th sample. The output is the logit of the i-th sample in the j-th class. For smoothing parameters, This is an indicator function.

[0108] The aforementioned neural network structure supports outputting corresponding sleep stage labels at a 30-second epoch granularity, with classification results available in five categories (Wake, N1, N2, N3, REM). The model supports dynamic inference window length adjustment, enabling high-precision offline analysis of complete historical segments as well as real-time prediction at a single epoch, making it suitable for various application scenarios such as closed-loop stimulus triggering and trend assessment.

[0109] Furthermore, step S3 also includes a motion artifact recognition step:

[0110] The median and median absolute deviation of the EEG signal amplitude for each data epoch are calculated in real time, and the upper and lower limits of the amplitude are dynamically set based on this.

[0111] If the amplitude of the EEG signal in the data epoch exceeds the upper and lower thresholds, further verification is performed by combining electrode impedance change information.

[0112] The data epochs that are confirmed as artifacts after verification are marked as a separate "artifact" category.

[0113] Specifically, artifact recognition employs a multi-dimensional dynamic analysis method. The system calculates the median amplitude and median absolute deviation (MAD) of the EEG amplitude in real time for each 30-second epoch through a sliding time window, and dynamically sets upper and lower thresholds to adapt to the physiological differences and nighttime state changes of different individuals.

[0114] ;

[0115] Lower threshold:

[0116] ;

[0117] Upper limit threshold:

[0118] ;

[0119] When the amplitude of a certain epoch signal exceeds the limit, a multi-modal joint verification mechanism is further triggered to analyze the changes in electrode impedance (such as impedance greater than 50kΩ or change rate exceeding 20%).

[0120] ;

[0121] If the verification passes, it is directly marked as Phantom; if the verification fails, it is sent to the network for micro-artifact recognition, and the final judgment result is output to the staging model.

[0122] Furthermore, the intervention triggering conditions described in step S4 include those based on The specific steps for determining the significance of a wave include:

[0123] S41. Calculate real-time EEG signals. Average power of the frequency band;

[0124] S42, Calculation and The average power of adjacent frequency bands;

[0125] S43, Calculation The ratio of the power of a frequency band to the power of an adjacent frequency band, and converting this ratio into a decibel value;

[0126] S44. If the decibel value exceeds the first preset threshold, then determine... The wave is significant, satisfying the intervention triggering conditions.

[0127] In step S44, the intervention triggering condition further includes: calculating The ratio of frequency band power to total power; if this ratio exceeds a second preset threshold, then the intervention triggering condition is further confirmed.

[0128] Specifically, the average value of the spectral intensity of adjacent frequency bands can be expressed as:

[0129] ;

[0130] To be comparable to the neighborhood average, first define Average power of the wave:

[0131] ;

[0132] In order to quantify The relative salience of the wave is calculated by comparing the ratio of the two values:

[0133] ;

[0134] This indicator indicates The degree to which the wave power is enhanced relative to the neighborhood power. To more intuitively characterize the significance, it is converted to dB form:

[0135] ;

[0136] Threshold setting principles: >3 dB (indicated) (The energy is approximately twice that of the neighborhood), it is believed that... The wave is in a significant state.

[0137] It also defines Threshold for the ratio of wave power to total power:

[0138] ;

[0139] in This indicates the total power outside the target frequency band.

[0140] In the closed-loop mechanism, if the set threshold is met... Then the system determines The wave was significantly enhanced, triggering corresponding neural intervention operations.

[0141] Furthermore, the generation and application of transcranial alternating current stimulation signals described in step S5 specifically refers to closed-loop phase-synchronized stimulation, which includes the following steps:

[0142] S51. Bandpass filtering is performed on the preprocessed EEG signal to extract the neural oscillation signal of the target frequency band.

[0143] S52. Perform Hilbert transform on the filtered signal to calculate the instantaneous phase and instantaneous frequency of the neural oscillation signal;

[0144] S53. Calculate a target phase based on the instantaneous phase, wherein the target phase maintains a preset fixed phase difference with the instantaneous phase of the neural oscillation signal;

[0145] S54. Based on the target phase and the instantaneous frequency, generate a transcranial alternating current stimulation waveform with a specific phase and frequency;

[0146] S55. Apply the transcranial alternating current stimulation waveform to the user.

[0147] Specifically, signal cleaning is first performed through hardware-level preprocessing (including 50 Hz power frequency suppression and 0.5–35 Hz bandpass filtering) to ensure signal stability and effectiveness. Then, an Nth-order Butterworth digital bandpass filter is used to effectively extract EEG activity within the target frequency band (13–30 Hz), providing a reliable basis for subsequent phase estimation. Subsequently, a specially designed adaptive filtering method is used to suppress tACS artifacts. The processed signal... It is then sent to the subsequent feature extraction module.

[0148] Instantaneous phase and frequency tracking: The Hilbert transform can convert a real signal into an analytic signal (containing real and imaginary parts), and by calculating these two parts, the instantaneous amplitude and phase information of the signal can be extracted.

[0149] ;

[0150] By superimposing the original signal with the signal obtained from the Hilbert transform, an analytic signal in complex form can be generated.

[0151] ;

[0152] The instantaneous amplitude and instantaneous phase of this analytical signal are calculated as follows:

[0153] ;

[0154] ;

[0155] The core strategy of closed-loop tACS is to maintain a fixed target phase difference between the applied tACS waveform and the tracked endogenous neural oscillation. .

[0156] ;

[0157] ;

[0158] in This represents a real-time estimate of the instantaneous phase of a neural network. Used to compensate for the total delay between acquisition, calculation, D / A converter, power amplifier, and electrodes.

[0159] DPLL with the target phase Using the reference input, dynamic tracking of the instantaneous frequency and phase of the stimulus signal is achieved through phase comparison, loop filtering, and a numerically controlled oscillator (NCO) structure. When the reference phase and the internal NCO output phase... When there is a deviation in _nco[n], the loop filter adjusts the control quantity according to the error signal, so that... Approaching step by step This is used to achieve phase-locked loop (PLL).

[0160] tACS Parameter Determination and Waveform Generation: Except for the instantaneous phase, the other parameters of the tACS waveform are determined by the control logic. Amplitude It is typically set within a safe and effective range, and can be a fixed value or adaptively adjusted based on the amplitude of intrinsic oscillations. tACS frequency It is usually set to the center frequency of the target intrinsic oscillation, and the instantaneous frequency estimated by DPLL is tracked in real time. .

[0161] The system generates tACS digital waveform sequences using a principle similar to that of a direct digital synthesizer (DDS). A schematic diagram of the tACS stimulus output is shown below. Figure 3 As shown. The real-time target instantaneous phase calculated based on the control logic. and amplitude Generate waveform samples at each sampling point :

[0162] ;

[0163] This digital sequence is converted into an analog tACS current output by a digital-to-analog converter (DAC) and a current drive circuit and applied to the electrodes. By directly controlling the instantaneous phase of the output waveform, it is ensured that the applied tACS waveform maintains a precise phase-locked relationship with the endogenous neural oscillation.

[0164] Furthermore, prior to step S52, an adaptive filtering step is included to suppress artifacts in the electroencephalogram signal caused by previously applied stimuli.

[0165] Furthermore, the preset fixed phase difference mentioned in step S53 is used to compensate for the total time delay generated by the system from signal acquisition to stimulus application.

[0166] Example 2:

[0167] A sleep monitoring and intervention system based on electroencephalogram (EEG) signals, comprising:

[0168] A wearable EEG acquisition device for acquiring a user's EEG signals, the device comprising a flexible wearable shell and a dry electrode assembly disposed inside it;

[0169] The signal processing module, connected to the EEG acquisition device, is used to preprocess the acquired EEG signals, identify artifacts, and automatically stage sleep.

[0170] A closed-loop intervention module, connected to the signal processing module, is used to generate and apply intervention stimuli based on sleep staging results and EEG rhythm analysis results.

[0171] The signal processing module includes a neural network model based on Feature Pyramid Network (FPN) and Transformer encoder, which is used to perform multi-scale feature extraction and sleep stage classification on single-channel EEG signals, and output stage results including wake, N1, N2, N3, REM and phantom categories.

[0172] The closed-loop intervention module includes A saliency detection unit and a digital phase-locked loop (DPLL) unit are used to detect wave saliency. When the wave intensity is significantly enhanced, a transcranial alternating current stimulation (tACS) signal that is phase-locked with the intrinsic neural oscillation is generated.

[0173] Furthermore, the dry electrodes of the wearable EEG acquisition device are comb-shaped or dome-shaped silver / silver chloride dry electrodes, and the flexible wearing shell is an arc-shaped flexible structure adapted to the contour of the human head.

[0174] Specifically, the wearable EEG acquisition device includes an electrode assembly, an analog front-end circuit, an analog-to-digital converter (ADC), a microcontroller unit (MCU), a power system, a wireless communication module, and a local storage unit, forming a complete EEG acquisition and data processing pathway for continuous monitoring during natural sleep.

[0175] The electrode assembly adopts a silver chloride dry electrode structure. The electrode surface is treated with a silver / silver chloride coating to reduce the skin electrode contact resistance and has reusable characteristics. The electrode has a comb-shaped or dome-shaped structure and is attached to the user's forehead or occipital region to adapt to different head shapes.

[0176] The analog front-end circuit includes a high input impedance differential amplifier, a 0.5–35 Hz bandpass filter, a 50 Hz notch filter, and a voltage reference follower. The voltage follower is used to buffer the reference voltage signal to prevent signal distortion caused by load effects.

[0177] The analog-to-digital converter uses the multi-channel high-performance sampling chip ADS1299, which supports 24-bit resolution and a sampling rate of no less than 256Hz, and has high common-mode rejection ratio and low input bias current characteristics; the microcontroller unit uses the STM32F407 chip based on the ARM Cortex-M4 architecture, which is responsible for ADC control, data buffering, power consumption scheduling and communication command parsing.

[0178] The power system is powered by a 3.7V lithium battery, and together with a boost / buck circuit, a charging management chip and multiple linear voltage regulator modules, it provides 3.3V, ±2.5V and -5V voltages to each unit of the system.

[0179] The wireless communication module is based on the nRF24L01 chip to build a low-power bidirectional communication link. It uses a serial port protocol to interact with the host computer or mobile terminal in real time. It has a frequency hopping anti-interference mechanism and an automatic retransmission protocol to improve the reliability of data transmission in complex environments.

[0180] The local storage unit is an SD card module that automatically activates a cache-storage collaboration mechanism when the wireless channel is unstable or interrupted, records raw EEG data, has the ability to resume transmission after interruption, ensures that more than 8 hours of continuous data are not lost, and achieves data redundancy storage through real-time upload and offline backup.

[0181] Example 3:

[0182] A sleep monitoring and intervention method based on electroencephalogram (EEG) signals includes the following steps:

[0183] S10: Signal Acquisition and Preprocessing

[0184] Under the guidance of clinicians or researchers, subjects wore the wearable EEG acquisition device described in this invention during natural sleep to record electroencephalogram (EEG) signals throughout the sleep process. Figure 5 As shown, only four leads (Fp1, Fp2, AFZ, EOG) are needed in the forehead area during the acquisition process, with CZ serving as the reference electrode, ensuring the system is lightweight and easy to wear while maintaining high signal stability. The sampling rate is set to 512 Hz.

[0185] During EEG acquisition, the signal first undergoes hardware-level preprocessing, including 0.5–35 Hz bandpass filtering and power frequency notch filtering (50 Hz) to remove electromyographic and power frequency interference.

[0186] ;

[0187] ;

[0188] Furthermore, software-level preprocessing includes operations such as rereference (AFZ, CZ). The final EEG data is divided into epoch sequences of 30 seconds each.

[0189] ;

[0190] To remove DC drift and stabilize the EEG around zero, baseline correction (mean removal) is performed.

[0191] ;

[0192] Divided into 30-second epochs: [Record the epoch number] one epoch is , length is Meets AASM sleep staging standards.

[0193] S20: Motion artifact detection mechanism:

[0194] S21, Derivation of upper and lower bounds

[0195] Calculate the median amplitude for each epoch. and median absolute deviation (MAD):

[0196] ;

[0197] ;

[0198] Robust standard deviation estimation:

[0199] ;

[0200] Construct upper and lower limits; if the EEG amplitude exceeds the range, it is initially marked as a suspicious artifact.

[0201] ;

[0202] ;

[0203] S22, Joint Validation

[0204] When an epoch exceeds the limit, the system further verifies the data by combining electrode impedance and accelerometer information. If the data matches, it is marked as "Phantom".

[0205] ;

[0206] S30: Automatic Sleep Staging

[0207] First, for each epoch, waveform integrity is preserved through adaptive segmentation. Multi-scale features are captured using dual-scale convolution, and dimensionality is normalized via adaptive pooling. This stage aims to extract high-quality, uniformly formatted deep feature matrices for each epoch from the original signal. .

[0208] ;

[0209] Secondly, the feature matrix output from the previous stage The input is fed into the Graph Attention Network (GAT), which treats multiple channels as graph nodes, is responsible for modeling the spatial topological relationships within a single epoch, and refines them into a comprehensive graph-level representation.

[0210] Finally, the graph-level representations of spatiotemporal snapshots from different epochs are aggregated into a time series. The model is fed into a Transformer encoder. This module is responsible for global context modeling to capture long-range temporal dependencies across epochs. The model can capture both short-term and long-term dependency features simultaneously, and outputs... .

[0211] A fully connected layer is used to map the output of the Transformer layer to the class space, and softmax is used to obtain the class probabilities. After training on the dataset, the final output is a five-class label.

[0212] S40: Wave significance detection:

[0213] Before entering closed-loop intervention, it is necessary to confirm that the individual is in a state of... Wave salience state.

[0214] S41, Power Spectrum Estimation:

[0215] Calculate the smoothed power spectrum for each epoch:

[0216] ;

[0217] Let the three-band index set be defined. (3–8 Hz) (8–13 Hz) (13–18 Hz), corresponding to the number of sample points .

[0218] S42, Neighborhood Power and Significance:

[0219] Calculate the neighborhood average power, Wave average power and significance:

[0220] ;

[0221] Can be adopted (Approximately twice the energy), then it is considered Once the wave is significant, the intervention phase can begin.

[0222] S50: Closed-loop intervention mechanism:

[0223] S51, Analyzing the signal and instantaneous phase:

[0224] For the target frequency band (α wave 8–13 Hz), first extract using a bandpass filter, then calculate the analytic signal:

[0225] ;

[0226] Then calculate the instantaneous phase and instantaneous frequency:

[0227] ;

[0228] S52, Delay Compensation and Target Phase Setting:

[0229] Total system latency (Acquisition → Calculation → DAC → Drive → Electrode) Compensation is performed using estimated phase shift:

[0230] ;

[0231] Target tACS phase:

[0232] ;

[0233] S53, DPLL (Digital Phase-Locked Loop):

[0234] The NCO phase is updated using a first-order DPLL:

[0235] ;

[0236] ;

[0237] in , For loop gain, If the phase error is less than the given threshold, the PLL is considered to have been successfully locked.

[0238] S54, output waveform and amplitude adaptive:

[0239] Generate tACS samples:

[0240] ;

[0241] To achieve amplitude adaptation:

[0242] ;

[0243] in It can reflect the strength of the current brainwave oscillation. For safety limits, As a proportionality coefficient, the intensity of the stimulation current can be adaptively adjusted according to the amplitude of brain waves (stronger stimulation for larger brain waves, weaker stimulation for smaller brain waves), thus avoiding overstimulation.

[0244] Electrical stimulator output test

[0245] The frequency of the electrostimulator was tested below. Taking the output sinusoidal signal as an example, the frequency of the output sinusoidal signal was set from 10Hz to 1000Hz, the amplitude was 2.5V and the phase was 0°. The output frequency was collected by the oscilloscope mentioned above and the corresponding error accuracy was calculated. The experimental results are shown in Table 1.

[0246] Table 1 Partial Frequency Output Tests:

[0247] As shown in Table 1, the output frequencies of the electrical stimulators are all normal, and the error accuracy is controlled within 1%, indicating that the overall output error of the equipment is unrelated to the input frequency and remains within 1%.

[0248] The current output of the electrical stimulator is represented by the amplitude input to the host computer. Since it is inconvenient to observe the current output, the peak-to-peak value and RMS value acquired by an oscilloscope are used instead of calculations. This experiment... The error of different input amplitudes was tested under load, 500Hz frequency, no time delay and phase conditions. The specific test data is shown in Table 2.

[0249] Table 2. Amplitude Tests of Electrical Stimulators:

[0250] As can be seen from the table, the amplitude parameter signal can be successfully output, the output error can be controlled within 1%, and the minimum amplitude unit can be controlled within 0.1mA. According to the amplitude test results and the waveform measured by the oscilloscope, the signal output meets the setting requirements.

[0251] Each cell in the matrix represents the percentage of predictions for each actual category, indicated by the intensity of the color in the matrix. The rows correspond to different sleep stages, including W, N1, N2, N3, and REM, while the columns represent the stages predicted by the model. Darker colors indicate higher consistency between the predictions and the actual categories, and the diagonal lines represent the accuracy of classification at each stage.

[0252] Based on publicly available datasets, 10-fold cross-validation was performed, as shown in Table 3, to test the overall performance of the sleep staging method of this invention.

[0253] Table 3 shows the specific performance parameters:

[0254] In the preliminary experiment of this invention, five healthy subjects were initially included, and the performance of the system in the automatic sleep staging task was compared and tested before and after the intervention. The experiment used the wearable EEG acquisition device and staging network model described in this invention, combined with a closed-loop intervention method, to analyze and staging the EEG data of the subjects throughout their sleep. The method of this invention significantly improved the staging performance of each sleep stage after the intervention: N3 stage (deep sleep): after the intervention, the N3 stage increased from 72.94% to 83.94%, and the average duration and proportion of the N3 stage both increased after the intervention, verifying that the closed-loop intervention can effectively improve the deep sleep time and help assess the proportion of deep sleep in individuals; REM stage (rapid eye movement): after the intervention, the duration and proportion both increased to a certain extent, suggesting potential benefits for memory consolidation and emotion regulation; Wake, N1, and N2 stages: the recognition accuracy remained at a high level, without being negatively affected by artifacts or the intervention.

[0255] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A sleep monitoring and intervention method based on electroencephalogram (EEG) signals, characterized in that, The method includes the following steps: S1. Collect brain signals by wearing dry electrodes on the user's head; S2. Preprocess the acquired EEG signals, including amplification, bandpass filtering, and power frequency notch filtering; S3. Perform real-time analysis on the preprocessed EEG signals, automatically segment sleep based on a deep learning model, and output the current sleep stage label; the sleep stage label includes at least the wakefulness stage, N1 stage, N2 stage, N3 stage, and REM stage; S4. Based on the sleep stage tags and real-time EEG spectrum characteristics, determine whether the preset intervention triggering conditions are met; S5. When the intervention triggering conditions are met, a transcranial alternating current stimulation signal is generated and applied to intervene in the user's sleep.

2. The sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, The automatic sleep staging based on a deep learning model described in step S3 specifically includes: S31. Divide the preprocessed EEG signal into multiple data epochs according to a preset time window; S32. Each data epoch is input into a "spatial encoder" that is cascaded between a front-end adaptive module and a graph attention network. The aim is to extract and output a comprehensive graph-level representation sequence from the multi-channel signals and their inherent spatial topological relationships. S33. Input the time series consisting of these graph-level representations generated by consecutive epochs into the Transformer encoder classification module to model the sequence context information and capture long-term dependencies, and finally output the sleep stage classification results corresponding to each data epoch.

3. The sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to claim 1 or 2, characterized in that, Step S3 also includes a motion artifact recognition step: The median and median absolute deviation of the EEG signal amplitude for each data epoch are calculated in real time, and the upper and lower limits of the amplitude are dynamically set based on this. If the amplitude of the EEG signal in the data epoch exceeds the upper and lower thresholds, further verification is performed by combining electrode impedance change information. Data epochs that are confirmed as artifacts after verification are marked as independent "artifact" categories.

4. The sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, The intervention triggering conditions mentioned in step S4 include a judgment based on the significance of the alpha wave, and the specific steps include: S41. Calculate the average power of real-time EEG signals in the alpha band; S42. Calculate the average power of the frequency band adjacent to the α band; S43. Calculate the ratio of the power in the α band to the power in the adjacent band, and convert the ratio to a decibel value; S44. If the decibel value exceeds the first preset threshold, the alpha wave is determined to be significant, and the intervention triggering condition is met.

5. The sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to claim 4, characterized in that, In step S44, the intervention triggering condition further includes: calculating the ratio of α band power to total power; if the ratio exceeds a second preset threshold, then the intervention triggering condition is further confirmed to be met.

6. The sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to claim 1, characterized in that, The generation and application of transcranial alternating current stimulation signals described in step S5 specifically refers to closed-loop phase-synchronized stimulation, which includes the following steps: S51. Bandpass filtering is performed on the preprocessed EEG signal to extract the neural oscillation signal of the target frequency band. S52. Perform Hilbert transform on the filtered signal to calculate the instantaneous phase and instantaneous frequency of the neural oscillation signal; S53. Calculate a target phase based on the instantaneous phase, wherein the target phase maintains a preset fixed phase difference with the instantaneous phase of the neural oscillation signal; S54. Based on the target phase and the instantaneous frequency, generate a transcranial alternating current stimulation waveform with a specific phase and frequency; S55. Apply the transcranial alternating current stimulation waveform to the user.

7. The sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to claim 6, characterized in that, Prior to step S52, an adaptive filtering step is included to suppress artifacts in the electroencephalogram signal caused by previously applied stimuli.

8. The sleep monitoring and intervention method based on electroencephalogram (EEG) signals according to claim 6, characterized in that, The preset fixed phase difference mentioned in step S53 is used to compensate for the total time delay generated by the system from signal acquisition to stimulus application.

9. A sleep monitoring and intervention system based on electroencephalogram (EEG) signals, characterized in that, include: A wearable EEG acquisition device for acquiring a user's EEG signals, the device comprising a flexible wearable shell and a dry electrode assembly disposed inside it; The signal processing module, connected to the EEG acquisition device, is used to preprocess the acquired EEG signals, identify artifacts, and automatically stage sleep. A closed-loop intervention module, connected to the signal processing module, is used to generate and apply intervention stimuli based on sleep staging results and EEG rhythm analysis results. The signal processing module is a hierarchical spatiotemporal joint modeling network that integrates front-end adaptive feature extraction, graph neural networks, and Transformer encoders. It aims to process multi-channel physiological signals: first, it models the spatial dependencies of each channel within a single epoch using a GNN; then, it uses a Transformer to capture long-range temporal dynamics across epochs. The module ultimately outputs a classification of sleep stages, including wakefulness, N1, N2, N3, REM, and artifacts. The closed-loop intervention module includes an alpha wave saliency detection unit and a digital phase-locked loop unit, used to generate a transcranial alternating current stimulation signal phase-locked with endogenous neural oscillations when alpha wave saliency enhancement is detected.

10. The system according to claim 9, characterized in that, The dry electrodes of the wearable EEG acquisition device are comb-shaped or dome-shaped silver / silver chloride dry electrodes, and the flexible wearing shell is an arc-shaped flexible structure adapted to the contour of the human head.

Citation Information

Patent Citations

  • Acousto-optic sleep intervention system and method based on electroencephalogram signals

    CN106725462A

  • Rhythm regulation and control system, method and equipment based on neural network and storage medium

    CN118681132A

  • Automatic sleep staging method and system based on ResCNN-BiGRU

    CN119073924A

  • Self-adaptive neuro-regulation sleep optimization system and method, wearable device and medium

    CN119405966A

  • Closed-loop neuromodulation of sleep-related oscillations

    WO2024130020A1

Cited By

  • Traditional Chinese medicine children physique and pathology analysis system

    CN121445392A

  • A traditional chinese medicine child constitution and pathology analysis system

    CN121445392B

  • Real-time monitoring and judging system for sleep period arrhythmia

    CN121647633A

  • Electroencephalogram signal processing method and device based on non-invasive brain-computer interface

    CN121891026A

  • An electroencephalogram signal processing method and device based on a non-invasive brain-computer interface

    CN121891026B