Coherent network atlas-based electroencephalogram rhythm disturbance detection and sleep-aiding regulation and control method
By constructing a coherent network graph and a generalized Kulamoto model, and optimizing phase prediction and stimulation parameters, the problems of false detection, missed detection, and individual differences in micro-arousal detection in existing sleep aid technologies have been solved, achieving a highly sensitive and personalized sleep aid regulation effect.
Patent Information
- Application Number
- CN202610356614.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-23
- Publication Date
- 2026-05-12
Smart Images

Figure CN122004903A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sleep-aid regulation technology, and in particular to a method for detecting and regulating brain electrical rhythm disturbances based on coherent network maps. Background Technology
[0002] Sleep disorders have become a prevalent public health problem worldwide. Chronic insomnia can cause organic damage to multiple systems, including the nervous, endocrine, and metabolic systems. Conventional drug treatments carry risks of addiction, residual effects, and long-term side effects. Non-invasive closed-loop neuromodulation based on brain electrical activity is currently the core research direction for non-invasive sleep aid technology. Slow-wave brainwave rhythms are a core biomarker of deep sleep, and the phase synchronization between brain channels directly determines the ability to maintain sleep homeostasis. Micro-awakening, the core trigger for sleep fragmentation, is preceded by early topological perturbations in brainwave rhythms. Current closed-loop sleep aid technologies mostly focus on detecting one-dimensional features such as amplitude and phase of single-channel brainwaves, failing to adequately utilize the rhythmic coherence between multiple channels and the dynamic topological changes in brain networks. This makes it difficult to achieve advanced detection and precise phase-locked modulation of micro-awakening. There is an urgent need to develop highly sensitive, adaptive closed-loop sleep aid technology solutions based on the dynamic characteristics of brain networks.
[0003] Firstly, most existing mainstream solutions are based on single-channel EEG features for detection, which can only capture one-dimensional time-domain and frequency-domain attributes such as amplitude and frequency. They cannot characterize the rhythmic synchronicity changes between multiple channels in the whole brain, and can only be identified after micro-awakening occurs. They cannot achieve early warning, and single-channel signals are easily interfered with by electrooculography and electromyography artifacts, resulting in a high rate of false detection and false negative detection of micro-awakening events.
[0004] Secondly, existing phase-locked stimulation schemes rely on single-channel phase detection, without considering the coupling relationship between channels in the whole brain. Phase prediction is easily affected by local noise, the accuracy of ascending phase time delay calculation is insufficient, and stimulation cannot stably lock the optimal control window of slow-wave ascending phase. The sleep-aiding control effect varies greatly from person to person and has poor stability.
[0005] Third, existing closed-loop regulation schemes mostly use fixed baselines and fixed stimulation parameters, which cannot adapt to the natural dynamic changes of slow wave rhythms during the sleep cycle, nor can they adaptively optimize for individualized rhythm characteristics of users. Long-term use is prone to neural adaptation effects, and the regulation effect continues to decline.
[0006] Fourth, existing technologies have not established a quantitative correlation between brain network topological differences and sleep homeostasis, cannot construct a differentiable closed-loop optimization objective function, are difficult to achieve end-to-end iterative optimization of regulation parameters, and cannot balance regulation effect and stimulation safety. Summary of the Invention
[0007] The main objective of this invention is to provide a method for detecting and regulating brainwave rhythm disturbances based on coherent network maps. A dynamic coherent network map is constructed based on multi-channel EEG signals, encoding spatiotemporal synchronicity of EEG as graph topological features. This method can capture early rhythmic topological disturbances before micro-awakening, exhibiting higher sensitivity and stronger anti-interference capabilities compared to single-channel feature detection, enabling early warning of rhythm collapse risks. Secondly, a whole-brain coupled oscillator phase equation is constructed based on a generalized Kulamoto model. Phase prediction is optimized by combining the connectivity weights of the slow-wave coherent network. Compared to single-channel phase detection, the accuracy of ascending phase time delay calculation is higher, ensuring that exogenous stimuli accurately lock the optimal regulation window for the slow-wave ascending phase, significantly improving the enhancement effect of slow-wave synchronicity. Thirdly, an exponential moving average method is used to update the slow-wave steady-state manifold memory baseline, adapting to the natural dynamic changes of slow-wave rhythms within the sleep cycle, eliminating detection errors caused by fixed baselines, and improving the accuracy of disturbance detection. Fourth, a cost function for maintaining sleep homeostasis is constructed, and the core parameters of the model are fine-tuned in the reverse direction of gradient descent to achieve adaptive optimization of stimulation parameters. This can accurately adapt to the individual rhythm characteristics of users, ensuring the regulation effect while strictly constraining the stimulation intensity, and taking into account both the safety and long-term effectiveness of regulation.
[0008] To achieve the above objectives, the present invention proposes a method for detecting and regulating brainwave rhythm disturbances based on coherent network maps, comprising the following steps: S1. Collect multi-channel raw EEG signals, and after artifact removal, frequency band separation and analytical signal conversion, obtain EEG analytical signals of slow wave frequency band and high frequency band; S2. Based on the EEG analysis signal, extract the instantaneous phase of the channel, calculate the phase-locked value between channels and correct it by distance penalty, and construct a dynamic coherent network graph; S3. Calculate the graph Laplacian matrix based on the dynamic coherent network graph, update the slow wave steady-state manifold memory baseline, and extract the transient topological features of the high-frequency band. S4. Calculate the Riemann distance between the transient topological features of the high-frequency band and the slow-wave steady-state manifold memory baseline, infer the posterior probability of micro-awakening based on the Riemann distance, and solve the slow-wave upphase time delay when the micro-awakening probability exceeds a preset threshold. S5. Based on the posterior probability of micro-awakening and the time delay of the slow wave ascending phase, combined with the user's individualized slow wave dominant frequency, a phase-locked closed-loop stimulation parameter vector is generated. Stimulation is performed according to the closed-loop stimulation parameter vector to complete the sleep-aid regulation.
[0009] A further improvement of the present invention is that step S1 specifically includes: Acquire microvolt-level analog EEG signals from the scalp, perform analog-to-digital conversion at a preset sampling rate, and window the continuous signal according to a preset time window length T to obtain a multi-channel EEG spatiotemporal matrix. C is the number of channels; Based on pre-trained spatial filtering matrix Multichannel EEG spatiotemporal matrix Perform linear projection operations to remove spatial artifacts related to electrooculography (EOG) and electromyography (EMG), and obtain the artifact-free spatiotemporal matrix of EEG. ; Using a zero-phase-shift Chebyshev type II bandpass filter to analyze the spatiotemporal matrix of EEG Frequency band separation was performed to extract real-valued EEG signals from the 0.5-4Hz slow wave band and the 8-13Hz high frequency band, respectively. Hilbert transform is applied to the filtered real-valued EEG signals for each frequency band to obtain the Hilbert transform results. ; The filtered real-valued EEG signal The corresponding Hilbert transform result Combining the analytic signals into complex form yields a frequency band-specific analytic signal tensor. f is taken as slow wave and high frequency respectively, and the corresponding slow wave frequency band analytical signal is obtained. High-frequency band analytical signals .
[0010] A further improvement of the present invention is that step S2 specifically includes: Based on the frequency band-specific analytical signal tensor Extract the instantaneous phase of the analyzed signal for each channel. ; Calculate the phase-locked value between any two channels i and g. ; Introducing a distance penalty term for the three-dimensional physical coordinates of the electrode : Wherein, the i-th acquisition channel corresponds to the p-th scalp electrode; the g-th acquisition channel corresponds to the q-th scalp electrode; p and q are electrode indices, with values ranging from... , ; Let be the Euclidean distance between the p-th electrode and the q-th electrode; Preset distance coefficient; Phase-locked value Distance penalty item Multiplication yields the corrected connectivity weights. ; Generate dynamic coherent network adjacency matrix , ; Each EEG acquisition channel is represented as a node set V, and a dynamic coherent network adjacency matrix is used. The elements in the set are the edge weights between nodes. A coherent network graph was constructed. , .
[0011] A further improvement of the present invention is that step S3 specifically includes: Based on the adjacency matrix of the dynamic coherent network Calculate the graph degree matrix Based on graph degree matrix Adjacency matrix of dynamic coherent network Solving the graph Laplace matrix , The Laplace matrix of the slow-wave frequency band diagram is calculated by taking the adjacency matrix of the slow-wave frequency band and the high-frequency frequency band respectively. Laplace matrix of high frequency band diagram ; The slow-wave steady-state manifold memory baseline was obtained using the exponential moving average method. Update: in, Forgetting factor, The slow-wave steady-state manifold memory baseline is updated for the t-th time window. The slow-wave steady-state manifold memory baseline for the (t-1)th time window, with initial values... The mean matrix of the Laplace matrix of the slow wave frequency band map during deep sleep in healthy individuals is obtained; Within a micro-awakening monitoring window that is the same length as the EEG time window, the Laplace matrix of the high-frequency band map of the current time window is extracted. As a transient topological feature.
[0012] A further improvement of this invention is that, in step S4, calculating the Riemann distance between the transient topological features of the high-frequency band and the slow-wave steady-state manifold memory baseline specifically includes: slow wave steady-state manifold memory baseline Laplace matrix of high frequency band diagram Mapped to a symmetric positive definite manifold space, where the high-frequency band diagram Laplace matrix By adding The regularization process transforms it into a symmetric positive definite matrix. Given the identity matrix, calculate the affine invariant Riemann distance between the two. .
[0013] A further improvement of this invention is that, in step S4, the posterior probability of micro-arousal is inferred based on the Riemann distance, specifically including: Affine-invariant Riemann distance Input a pre-trained Bayesian logistic regression model, and output the posterior probability P of micro-arousal; the likelihood function of the Bayesian logistic regression model is: ;in, For the sigmoid function, These are the weighting coefficients. For bias terms, This indicates that a micro-awakening event has occurred.
[0014] A further improvement of this invention is that when the posterior probability P of micro-awakening is greater than a preset threshold, a risk of rhythm collapse is determined, based on the analysis of the slow-wave frequency band signal. Slow-wave signals from the whole brain were extracted, and the phase equation of the whole brain core oscillator was constructed based on the generalized Kulamoto model. in, Let be the phase change rate of the k-th channel oscillator; Let be the natural frequency of the slow wave in the k-th channel; The coupling strength; This is the adjacency matrix for the slow wave frequency band; Let m be the phase of the m-th channel oscillator; the Runge-Kutta method with a step size of 1 ms is used to solve the numerical solution of the model, and the comprehensive phase of the whole-brain core oscillator is obtained. , ; Searching for The smallest positive real number As an up-phase time delay.
[0015] A further improvement of the present invention is that step S5 specifically includes: Based on the posterior probability P of micro-awakening and the upphase time delay By combining the user's individualized slow wave dominant frequency (iSWF), a phase-locked closed-loop stimulation parameter vector is generated. , ; Indicates trigger delay. Indicates the intensity of the stimulus. Indicates the frequency of stimulation; Among them, the user-individualized slow wave master frequency iSWF is obtained by performing spectrum analysis on the user's sleep slow wave signals from past time periods; The trigger delay in the stimulus parameter vector Assigned to uplink phase time delay , stimulation frequency The stimulus intensity is determined by assigning the user's individualized slow wave dominant frequency (iSWF). , ; This represents the maximum safe stimulus intensity for the hardware.
[0016] A further improvement of this invention is that, after stimulation according to the closed-loop stimulation parameter vector, it further includes: Collect the coherent network graph for the next time window. , The value is taken as the time window length T, and the affine invariant Riemann distance between the Laplacian matrix of the high-frequency band map within this time window and the current slow-wave steady-state manifold memory baseline is calculated. Simultaneously, the slow-wave average phase-locked value corresponding to this time window is extracted. ; Constructing the cost function for maintaining sleep homeostasis : in, These are the weighting coefficients for the affine-invariant Riemann distance; The weighting coefficient for the slow-wave average phase-locked value; The regularization coefficients of the stimulus parameter vector; for The L2 norm; According to the cost function of maintaining sleep homeostasis The gradient descent direction is reversed to fine-tune the coupling strength K, thus completing the adaptive optimization of closed-loop control.
[0017] Beneficial Effects: This invention constructs a method for detecting and regulating brainwave rhythm disturbances based on coherent network maps. Firstly, a dynamic coherent network map is constructed based on multi-channel EEG signals, encoding spatiotemporal synchronicity of EEG as graph topological features. This captures early rhythmic topological disturbances before micro-awakening, exhibiting higher sensitivity and stronger anti-interference capabilities compared to single-channel feature detection, enabling early warning of rhythm collapse risks. Secondly, a whole-brain coupled oscillator phase equation is constructed based on a generalized Kulamoto model. Phase prediction is optimized by combining the connectivity weights of the slow-wave coherent network. Compared to single-channel phase detection, the accuracy of ascending phase time delay calculation is higher, ensuring that exogenous stimuli accurately lock the optimal regulation window for the slow-wave ascending phase, significantly improving the enhancement effect of slow-wave synchronicity. Thirdly, an exponential moving average method is used to update the slow-wave steady-state manifold memory baseline, adapting to the natural dynamic changes of slow-wave rhythms within the sleep cycle, eliminating detection errors caused by fixed baselines, and improving the accuracy of disturbance detection. Fourth, a cost function for maintaining sleep homeostasis is constructed, and the core parameters of the model are fine-tuned in the reverse direction of gradient descent to achieve adaptive optimization of stimulation parameters. This can accurately adapt to the individual rhythm characteristics of users, ensuring the regulation effect while strictly constraining the stimulation intensity, and taking into account both the safety and long-term effectiveness of regulation. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the execution of the brainwave rhythm disturbance detection and sleep-aiding regulation method based on coherent network graphs according to an embodiment of the present invention.
[0019] Figure 2 This is a ROC curve showing the comparison of micro-awakening detection sensitivity in an embodiment of the present invention.
[0020] Figure 3 This is a comparison diagram of the dynamic changes in whole-brain slow-wave synchronicity before and after closed-loop stimulation in an embodiment of the present invention. Detailed Implementation
[0021] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without one or more of these details. In other instances, certain technical features well-known in the art have not been described in order to avoid obscuring the invention.
[0022] This embodiment proposes a method for detecting EEG rhythm disturbances and regulating sleep based on coherent network graphs. First, multi-channel EEG signals are converted into a dynamic coherent network graph, encoding the spatiotemporal synchronization attributes of EEG as topological attributes of the graph structure, thereby achieving proactive detection of rhythm disturbances. The Graph Laplace matrix can completely represent the network's topological structure. The Graph Laplace matrix in the slow-wave band has a stable manifold structure in a stable deep sleep state, serving as a baseline representation of sleep homeostasis. This baseline is updated using an exponential moving average method, adapting to the natural changes in slow-wave rhythms during sleep and avoiding detection errors caused by a fixed baseline. Both the Graph Laplace matrix in the high-frequency band and the slow-wave steady-state baseline matrix belong to a symmetric positive definite matrix space, which is a Riemannian manifold. Euclidean distance cannot accurately measure the intrinsic differences between two points on the manifold; therefore, affine-invariant Riemannian distance is used to quantify the topological differences between the two. This distance remains invariant under affine transformations of the matrix, eliminating measurement errors caused by differences in channel gain. Based on this distance, the probability of micro-awakening can be accurately inferred. The ascending phase of slow waves represents the optimal phase window for exogenous stimulation to regulate slow wave synchronicity. Single-channel phase detection is susceptible to noise and artifacts. Therefore, based on the generalized Kulamoto model, using the connectivity weights of the slow wave coherent network as coupling coefficients, a core oscillator phase equation for whole-brain channel coupling is constructed. By solving for the evolution of the overall brain phase, a precise ascending phase time delay can be obtained, ensuring that stimulation is locked within the optimal phase window. To achieve adaptive optimization of closed-loop regulation, a sleep homeostasis maintenance cost function is constructed. This function uses the Riemann distance after stimulation and the average slow wave phase-locking value as core optimization objectives. Regularization constraints on stimulation parameters are also incorporated to avoid safety risks caused by excessive stimulation intensity. The core parameters of the model are fine-tuned in the reverse direction of the gradient descent of the cost function, while the update coefficients of the homeostasis baseline are dynamically corrected. This allows for continuous optimization of the regulatory effect, adapting to the individualized sleep rhythm characteristics of different users.
[0023] The execution process is described in detail below. Figure 1 : S1. Collect multi-channel raw EEG signals, and after artifact removal, frequency band separation and analytical signal conversion, obtain EEG analytical signals of slow wave frequency band and high frequency band; S2. Extract the instantaneous phase of the channel based on the analytical signal, calculate the phase-locked value between channels and correct it by distance penalty, and construct a dynamic coherent network graph; S3. Calculate the graph Laplacian matrix based on the coherent network graph, update the slow-wave steady-state manifold memory baseline using the exponential moving average method, and extract the transient topological features of the high-frequency band. S4. Calculate the Riemann distance between the current high-frequency topology and the steady-state baseline, infer the posterior probability of micro-awakening based on the Riemann distance, and solve the slow wave upphase time delay when the micro-awakening probability exceeds the preset threshold. S5. Based on the posterior probability of micro-awakening and the time delay of the ascending phase, combined with the user's individualized slow wave dominant frequency, a phase-locked closed-loop stimulation parameter vector is generated. S6. Construct a sleep homeostasis maintenance cost function based on the EEG signals collected after stimulation, fine-tune the model parameters in the reverse direction of the gradient descent of the cost function, and update the slow wave homeostasis manifold memory baseline to complete the adaptive optimization of closed-loop regulation.
[0024] In this embodiment, S1 includes the following specific steps: S11. Acquire microvolt-level analog EEG signals from the scalp using a multi-channel EEG acquisition device. Perform analog-to-digital conversion using a 16-bit analog-to-digital converter at a preset sampling rate of 250Hz. Window the continuous signal according to a time window length of 2048 sampling points to obtain the multi-channel EEG spatiotemporal matrix. Where C is the number of channels, with a value of 16, T is the time window length, the element in the i-th row and n-th column of the matrix represents the EEG signal amplitude of the i-th acquisition channel at the n-th sampling time, and i is the channel index, with a value range of... ; n is the sampling time index, and its value range is ; S12, Spatial Filtering Matrix Based on Pretraining Multichannel EEG spatiotemporal matrix Perform linear projection operations to remove spatial artifacts related to electrooculography (EOG) and electromyography (EMG), and obtain the artifact-free spatiotemporal matrix of EEG. , A zero-phase-shift Chebyshev type II bandpass filter was used to analyze the spatiotemporal matrix of the EEG. Frequency band separation was performed, and real-valued EEG signals were extracted from the 0.5-4Hz slow wave band and the 8-13Hz high frequency band, respectively. A Hilbert transform was applied to the filtered real-valued EEG signals of each band. The formula for calculating the Hilbert transform is as follows: ;in, This is the filtered real-valued EEG signal. Its Hilbert transform result; obtained through the formula: The filtered real-valued EEG signal is combined with the corresponding Hilbert transform result to form a complex analytic signal, thus obtaining a frequency band-specific analytic signal tensor. , Where f takes the slow wave and high frequency respectively, the corresponding slow wave frequency band analytical signal is obtained. High-frequency band analytical signals .
[0025] In this embodiment, a multi-channel EEG acquisition device is first used to acquire microvolt-level analog EEG signals from the scalp. The acquisition electrodes are arranged according to the international 10-20 system standard, with a channel number C of 16. The corresponding electrode positions include Fp1, Fp2, F3, F4, C3, C4, P3, P4, O1, O2, F7, F8, T7, T8, Fz, and Cz. The reference electrode is a combined reference from both earlobes, and the ground electrode is AFz. The acquired analog EEG signals are converted from analog to digital by a 16-bit analog-to-digital converter at a preset sampling rate of 250Hz. The continuous signal is windowed according to a time window length of 2048 sampling points, and the overlap rate between adjacent time windows is set to 50%, resulting in a multi-channel EEG spatiotemporal matrix. Where T is the time window length, with a value of 2048; in this embodiment, the spatial filtering matrix... The training dataset, pre-trained using independent component analysis, consisted of EEG signals from 100 healthy subjects during sleep, along with simultaneously acquired EEG and EMG signals. The training objective of the filter matrix was to maximize the signal-to-noise ratio of the EEG signals and minimize the spatial projection energy of artifact signals. A zero-phase-shift Chebyshev Type II bandpass filter was used to separate the EEG spatiotemporal matrix, with the passband ripple set to 1 dB and the stopband attenuation set to 60 dB.
[0026] In this embodiment, S2 includes the following specific steps: S21. Based on frequency band-specific analytic signal tensors Extract the instantaneous phase of the analyzed signal for each channel. The calculation formula is: ; Represents a frequency band-specific analytic signal tensor The analyzed signal value of the i-th channel at the n-th sampling time. To solve for the function of complex argument, the output result has the following range: ; S22. Calculate the phase-locked value between any two channels i and g. The calculation formula is: ;in, Let be the instantaneous phase difference between channel i and g at the nth sampling time. This is Euler's formula. For modular arithmetic of complex numbers, the range of the phase-locked loop value is [0,1]. A distance penalty term for the three-dimensional physical coordinates of the electrodes is introduced. The calculation formula is: The i-th acquisition channel corresponds to the p-th scalp electrode, and the g-th acquisition channel corresponds to the q-th scalp electrode. p and q are electrode indices, with values ranging from [value range missing]. , , Let be the Euclidean distance between the p-th and q-th electrodes, calculated based on the three-dimensional coordinates of the standard electrodes in the international 10-20 system. The preset distance coefficient is preferably set to 10cm. This value is suitable for the maximum spacing range of adult scalp electrodes and can balance the connectivity weight between adjacent electrodes and distant electrodes.
[0027] S23, Set the phase-locked value Distance penalty item Multiplication yields the corrected connectivity weights. Generate a dynamic coherent network adjacency matrix. , This matrix is a symmetric matrix with diagonal elements of value 1. Each EEG acquisition channel is represented by a node set V, with the number of nodes equal to the number of channels C. The adjacency matrix of the dynamic coherence network is used. The elements in the set are the edge weights between nodes. A coherent network graph was constructed. , .
[0028] In this embodiment, S3 includes the following specific steps: S31, Based on the adjacency matrix of a dynamic coherent network Calculate the graph degree matrix , Graph degree matrix Given a diagonal matrix, the i-th element on the diagonal... This element represents the weighted degree of the i-th node, which is the sum of the connectivity weights between this node and all other nodes. (Based on the graph degree matrix) Adjacency matrix of dynamic coherent network Solving the graph Laplace matrix , The Laplace matrix of the slow-wave frequency band diagram is calculated by taking the adjacency matrix of the slow-wave frequency band and the high-frequency frequency band respectively. Laplace matrix of high frequency band diagram ; S32. Use the exponential moving average method to remember the baseline of the slow-wave steady-state manifold. Update The calculation formula is: ;in, The forgetting factor is initially preferred to be 0.05, a value that balances baseline stability and adaptive update capability. The slow-wave steady-state manifold memory baseline is updated for the t-th time window. The slow-wave steady-state manifold memory baseline for the (t-1)th time window, with initial values... The mean matrix of the Laplace matrix of the slow wave frequency band map during deep sleep in healthy individuals was obtained. This mean matrix was calculated using the N3 sleep EEG signals of 200 healthy subjects, covering subjects of different ages and genders.
[0029] S33. Within the micro-awakening monitoring window, which is the same length as the EEG time window, extract the Laplace matrix of the high-frequency band map of the current time window. As a transient topological feature, the monitoring window and the EEG window have the same time starting point, with no time offset.
[0030] In this embodiment, S4 includes the following specific steps: S41. Memory baseline of slow-wave steady-state manifold Laplace matrix of high frequency band diagram Mapped to a symmetric positive definite manifold space, where the high-frequency band diagram Laplace matrix By adding The regularization process transforms it into a symmetric positive definite matrix. For the identity matrix, the dimensions are... Consistency and regularization processes prevent singular values from appearing in the matrix, ensuring the effectiveness of the manifold mapping. The affine-invariant Riemann distance between the two is then calculated. , ; for The inverse square root matrix is obtained by solving the matrix eigenvalue decomposition. For matrix logarithm operations, The Frobenius norm of a matrix is calculated using the following formula: ; S42, Affine-invariant Riemann distance Input a pre-trained Bayesian logistic regression model, the model output is the posterior probability P of micro-arousal, and the likelihood function of the Bayesian logistic regression model is: ;in, For the sigmoid function, This is the weighting coefficient, with a preferred value of 1.2. This is a bias term, and its preferred value is -3.5. The model's training dataset contains labeled EEG data of 500 sleep micro-arousal events, with annotations based on the American Academy of Sleep Medicine's sleep staging criteria. The training process uses the maximum a posteriori probability estimation method to solve for the model parameters.
[0031] S43. When the posterior probability P of micro-awakening is greater than the preset threshold of 0.7, it is determined that there is a risk of rhythm collapse, based on the analysis of the slow wave frequency band signal. Whole-brain slow-wave signals were extracted, and the phase equation of the whole-brain core oscillator was constructed based on the generalized Kulamoto model. The formula is as follows: ;in, Let be the phase change rate of the k-th channel oscillator. Let be the natural frequency of the slow wave in the k-th channel, obtained by performing a Fast Fourier Transform on the slow wave signal in the k-th channel. The coupling strength is set to 0.5. This is the adjacency matrix for the slow wave frequency band. This represents the element in the k-th row and m-th column of the slow-wave band adjacency matrix, corresponding to the connectivity weight between the k-th and m-th channels. To determine the phase of the m-th channel oscillator, the Runge-Kutta method with a step size of 1 ms is used to solve the numerical solution of the model, thus obtaining the comprehensive phase of the whole-brain core oscillator. , ; Searching for The smallest positive real number As an up-phase time delay The midpoint of the upward phase corresponding to the transition from negative peak to positive peak in the slow wave signal is the optimal phase window for the exogenous stimulus.
[0032] To verify the micro-awakening detection effect based on coherent network graphs in this step, such as Figure 2 As shown, this embodiment compares the receiver operating characteristic (ROC) curves of the method of the present invention (based on Riemann distance of coherent network graph) and the traditional method (based on single-channel amplitude / frequency characteristics) in micro-awakening detection. Figure 2 It is known that traditional single-channel feature methods suffer from low area under the curve (AUC) due to susceptibility to local artifacts and lack of representation of whole-brain synchronicity. In contrast, this invention encodes EEG spatiotemporal synchronicity as graph topological features and utilizes affine-invariant Riemann distance to quantify topological differences. Its ROC curve significantly bulges towards the upper left corner, resulting in a substantial improvement in AUC. These experimental results fully demonstrate that this invention can capture early rhythmic topological perturbations before micro-awakening occurs, exhibiting higher early warning sensitivity and anti-interference capability compared to single-channel feature detection, effectively reducing false positive and false negative rates.
[0033] In this embodiment, S5 includes the following specific content: based on the micro-awakening posterior probability P and the uplink phase time delay By combining the user's individualized slow wave dominant frequency (iSWF), a phase-locked closed-loop stimulation parameter vector is generated. , The user-specific slow-wave dominant frequency (iSWF) is obtained by spectral analysis of the user's slow-wave signals during the previous three days of sleep. The iSWF ranges from 0.5 to 4 Hz. The spectral analysis uses the Welch method with a window length of 1024 sampling points and an overlap rate of 50%. The frequency corresponding to the peak power spectral density within the slow-wave band is taken as the iSWF. The trigger delay in the stimulus parameter vector is then used. Assigned to uplink phase time delay , stimulation frequency The stimulus intensity is determined by assigning the user's individualized slow wave dominant frequency (iSWF). The calculation formula is: ; The maximum safe stimulation intensity for the hardware is preferably 2mA. This value complies with the safe operation specifications for transcranial electrical stimulation. The stimulation intensity is dynamically adjusted according to the posterior probability of micro-awakening, which can reduce the discomfort caused by stimulation while ensuring the control effect.
[0034] In this embodiment, S6 includes the following specific steps: S61, according to the stimulus parameter vector After stimulation, collect the coherent network map for the next time window. , The value is taken as the time window length T, and the affine invariant Riemann distance between the Laplacian matrix of the high-frequency band map within this time window and the current slow-wave steady-state manifold memory baseline is calculated. Simultaneously, the slow-wave average phase-locked value corresponding to this time window is extracted. The calculation formula is: ; S62. Constructing the cost function for maintaining sleep homeostasis. , ;in, The weighting coefficient for the affine-invariant Riemann distance is preferably set to 0.6. This is the weighting coefficient for the slow-wave average phase-locked loop value, preferably set to 0.8. This is the regularization coefficient for the stimulus parameter vector, preferably set to 0.01. for The L2 norm is given by the formula: The optimization objective of the cost function is to minimize the function value, which corresponds to reducing the degree of rhythmic perturbation after stimulation, improving the global synchronicity of slow waves, and at the same time constraining the range of values of the stimulation parameters to avoid overstimulation.
[0035] S63. According to the cost function for maintaining sleep homeostasis The gradient descent direction is determined according to the fine-tuning formula: Inverse fine-tuning of coupling strength K, where, The learning rate is 0.001. The value of the coupling strength before fine-tuning. The value is the fine-tuned coupling strength. The partial derivative of the cost function with respect to the coupling strength K is obtained using the chain rule. Simultaneously, the forgetting factor is dynamically corrected according to the correction formula: ; The values for the forgetting factor before correction. To assign values to the corrected forgetting factor, Let be the partial derivative of the cost function with respect to the forgetting factor γ, which is solved using the chain rule. Using the sign function, the iteratively obtained slow-wave steady-state manifold memory baseline is obtained, completing the adaptive optimization of closed-loop control.
[0036] The threshold and weight settings can be based on the default settings of this invention, or they can be set by the operator.
[0037] To further verify the beneficial effects of the closed-loop control and adaptive optimization of this invention, such as Figure 3 As shown, this embodiment records the dynamic trajectory of the mean phase-locked value (Mean PLV) of the whole brain slow waves before and after triggering closed-loop stimulation. The figure compares the results of this invention (whole-brain Curamotto phase-locking), the traditional method (single-channel phase-locking), and a natural baseline control group without stimulation. Figure 3 It is known that after triggering closed-loop stimulation, traditional single-channel phase-locking methods are susceptible to phase calculation deviations due to local noise, resulting in a small increase in slow-wave synchronization and rapid decay. In contrast, this invention, based on the generalized Kulamoto model, accurately calculates the ascending phase time delay of the whole-brain integrated phase, ensuring that exogenous stimulation precisely locks the optimal control window, leading to a significant jump in the average slow-wave phase-locking value after stimulation. Simultaneously, thanks to the sleep homeostasis maintenance cost function constructed in step S6, the model fine-tunes the coupling strength and forgetting factor in the reverse direction of gradient descent, achieving adaptive optimization of stimulation parameters. This results in a maintenance time in a highly synchronized state that far exceeds that of traditional methods, effectively overcoming the neural adaptation effects easily generated by long-term stimulation, and balancing the precision and long-term effectiveness of regulation.
[0038] In addition, this embodiment also provides an electronic device, including: a processor and a memory, wherein the memory stores a computer program that can be called by the processor; the processor executes the above-mentioned method for detecting and regulating brain electrical rhythm disturbances based on coherent network graphs by calling the computer program stored in the memory.
[0039] The electronic device can vary considerably depending on its configuration or performance. It may include one or more Central Processing Units (CPUs) and one or more memories, wherein the memory stores at least one computer program, which is loaded and executed by the processor to implement the brainwave rhythm disturbance detection and sleep-inducing modulation method based on coherent network graphs provided in the above-described embodiments. The electronic device may also include other components for implementing its functions; for example, it may have wired or wireless network interfaces and input / output interfaces for data input and output. Details will not be elaborated upon in this embodiment.
[0040] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.
[0041] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0042] This invention is described with reference to flowchart illustrations and block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and block diagrams, as well as combinations of blocks in the flowchart illustrations and block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart. Figure 1 One or more processes and boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0043] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and boxes Figure 1 The steps of the function specified in one or more boxes.
[0044] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to any specific implementation. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for detecting and modulating sleep aids based on coherent network maps of brain electrical rhythm disturbances, characterized in that, Includes the following steps: S1. Collect multi-channel raw EEG signals, and after artifact removal, frequency band separation and analytical signal conversion, obtain EEG analytical signals of slow wave frequency band and high frequency band; S2. Based on the EEG analysis signal, extract the instantaneous phase of the channel, calculate the phase-locked value between channels and correct it by distance penalty, and construct a dynamic coherent network graph; S3. Calculate the graph Laplacian matrix based on the dynamic coherent network graph, update the slow wave steady-state manifold memory baseline, and extract the transient topological features of the high-frequency band. S4. Calculate the Riemann distance between the transient topological features of the high-frequency band and the slow-wave steady-state manifold memory baseline, infer the posterior probability of micro-awakening based on the Riemann distance, and solve the slow-wave upphase time delay when the micro-awakening probability exceeds a preset threshold. S5. Based on the posterior probability of micro-awakening and the time delay of the slow wave ascending phase, combined with the user's individualized slow wave dominant frequency, a phase-locked closed-loop stimulation parameter vector is generated. Stimulation is performed according to the closed-loop stimulation parameter vector to complete the sleep-aid regulation.
2. The method for detecting and regulating brainwave rhythm disturbances based on coherent network maps according to claim 1, characterized in that, Step S1 specifically includes: Acquire microvolt-level analog EEG signals from the scalp, perform analog-to-digital conversion at a preset sampling rate, and window the continuous signal according to a preset time window length T to obtain a multi-channel EEG spatiotemporal matrix. C is the number of channels; Based on pre-trained spatial filtering matrix Multichannel EEG spatiotemporal matrix Perform linear projection operations to remove spatial artifacts related to electrooculography (EOG) and electromyography (EMG), and obtain the artifact-free spatiotemporal matrix of EEG. ; Using a zero-phase-shift Chebyshev type II bandpass filter to analyze the spatiotemporal matrix of EEG Frequency band separation was performed to extract real-valued EEG signals from the 0.5-4Hz slow wave band and the 8-13Hz high frequency band, respectively. Hilbert transform is applied to the filtered real-valued EEG signals for each frequency band to obtain the Hilbert transform results. ; The filtered real-valued EEG signal The corresponding Hilbert transform result Combining the analytic signals into complex form yields a frequency band-specific analytic signal tensor. f is taken as slow wave and high frequency respectively, and the corresponding slow wave frequency band analytical signal is obtained. High-frequency band analytical signals .
3. The method for detecting and regulating brainwave rhythm disturbances based on coherent network maps according to claim 2, characterized in that, Step S2 specifically includes: Based on the frequency band-specific analytical signal tensor Extract the instantaneous phase of the analyzed signal for each channel. ; Calculate the phase-locked value between any two channels i and g. ; Introducing a distance penalty term for the three-dimensional physical coordinates of the electrode : Wherein, the i-th acquisition channel corresponds to the p-th scalp electrode; the g-th acquisition channel corresponds to the q-th scalp electrode; p and q are electrode indices, with values ranging from... , ; Let be the Euclidean distance between the p-th electrode and the q-th electrode; Preset distance coefficient; Phase-locked value Distance penalty item Multiplication yields the corrected connectivity weights. ; Generate dynamic coherent network adjacency matrix , ; Each EEG acquisition channel is represented as a node set V, and a dynamic coherent network adjacency matrix is used. The elements in the set are the edge weights between nodes. A coherent network graph was constructed. , .
4. The method for detecting and regulating brainwave rhythm disturbances based on coherent network maps according to claim 3, characterized in that, Step S3 specifically includes: Based on the adjacency matrix of the dynamic coherent network Calculate the graph degree matrix Based on graph degree matrix Adjacency matrix of dynamic coherent network Solving the graph Laplace matrix , The Laplace matrix of the slow-wave frequency band diagram is calculated by taking the adjacency matrix of the slow-wave frequency band and the high-frequency frequency band respectively. Laplace matrix of high frequency band diagram ; The slow-wave steady-state manifold memory baseline was obtained using the exponential moving average method. Update: in, Forgetting factor, The slow-wave steady-state manifold memory baseline is updated for the t-th time window. The slow-wave steady-state manifold memory baseline for the (t-1)th time window, with initial values... The mean matrix of the Laplace matrix of the slow wave frequency band map during deep sleep in healthy individuals is obtained; Within a micro-awakening monitoring window that is the same length as the EEG time window, the Laplace matrix of the high-frequency band map of the current time window is extracted. As a transient topological feature.
5. The method for detecting and regulating brainwave rhythm disturbances based on coherent network maps according to claim 4, characterized in that, In step S4, the Riemann distance between the transient topological features of the high-frequency band and the slow-wave steady-state manifold memory baseline is calculated, specifically including: slow wave steady-state manifold memory baseline Laplace matrix of high frequency band diagram Mapped to a symmetric positive definite manifold space, where the high-frequency band diagram Laplace matrix By adding The regularization process transforms it into a symmetric positive definite matrix. Given the identity matrix, calculate the affine invariant Riemann distance between the two. .
6. The method for detecting and regulating brainwave rhythm disturbances based on coherent network graphs according to claim 5, characterized in that, In step S4, the posterior probability of micro-arousal is inferred based on the Riemann distance, specifically including: Affine-invariant Riemann distance Input a pre-trained Bayesian logistic regression model, and output the posterior probability P of micro-arousal; the likelihood function of the Bayesian logistic regression model is: ;in, For the sigmoid function, These are the weighting coefficients. For bias terms, This indicates that a micro-awakening event has occurred.
7. The method for detecting and regulating brainwave rhythm disturbances based on coherent network maps according to claim 6, characterized in that, When the posterior probability P of micro-awakening is greater than a preset threshold, it is determined that there is a risk of rhythm collapse, based on the analysis of the slow wave frequency band signal. Slow-wave signals from the whole brain were extracted, and the phase equation of the whole brain core oscillator was constructed based on the generalized Kulamoto model. in, Let be the phase change rate of the k-th channel oscillator; Let be the natural frequency of the slow wave in the k-th channel; The coupling strength; This is the adjacency matrix for the slow wave frequency band; Let m be the phase of the m-th channel oscillator; the Runge-Kutta method with a step size of 1 ms is used to solve the numerical solution of the model, and the comprehensive phase of the whole-brain core oscillator is obtained. , ; Searching for The smallest positive real number As an up-phase time delay.
8. The method for detecting and regulating brainwave rhythm disturbances based on coherent network maps according to claim 7, characterized in that, Step S5 specifically includes: Based on the posterior probability P of micro-awakening and the upphase time delay By combining the user's individualized slow wave dominant frequency (iSWF), a phase-locked closed-loop stimulation parameter vector is generated. , ; Indicates trigger delay. Indicates the intensity of the stimulus. Indicates the frequency of stimulation; Among them, the user-individualized slow wave master frequency iSWF is obtained by performing spectrum analysis on the user's sleep slow wave signals from past time periods; The trigger delay in the stimulus parameter vector Assigned to uplink phase time delay , stimulation frequency The stimulus intensity is determined by assigning the user's individualized slow wave dominant frequency (iSWF). , ; This represents the maximum safe stimulus intensity for the hardware.
9. The method for detecting and regulating brainwave rhythm disturbances based on coherent network maps according to claim 8, characterized in that, After stimulation according to the closed-loop stimulus parameter vector, the following is also included: Collect the coherent network graph for the next time window. , The value is taken as the time window length T, and the affine invariant Riemann distance between the Laplacian matrix of the high-frequency band map within this time window and the current slow-wave steady-state manifold memory baseline is calculated. Simultaneously, the slow-wave average phase-locked value corresponding to this time window is extracted. ; Constructing the cost function for maintaining sleep homeostasis : in, These are the weighting coefficients for the affine-invariant Riemann distance; The weighting coefficient for the slow-wave average phase-locked value; The regularization coefficients of the stimulus parameter vector; for The L2 norm; According to the cost function of maintaining sleep homeostasis The gradient descent direction is reversed to fine-tune the coupling strength K, thus completing the adaptive optimization of closed-loop control.
