EEG Phase Prediction Method and Related Device Based on Koopman Operator and Kalman Filter

By combining the Koopman operator and Kalman filtering, accurate modeling and noise suppression of the dynamic evolution of EEG signals are achieved, improving the accuracy of EEG phase prediction and solving the problems of nonlinearity and noise interference in traditional methods.

CN122123718APending Publication Date: 2026-06-02JIANGXI HUAHENG JINGXING MEDICAL TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGXI HUAHENG JINGXING MEDICAL TECH CO LTD
Filing Date
2026-04-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Traditional EEG phase prediction methods are difficult to accurately characterize the nonlinear dynamic evolution of EEG signals and are susceptible to noise interference, resulting in low phase prediction accuracy.

Method used

The Koopman operator is used to accurately model the dynamic evolution of EEG signals, and Kalman filtering is used for noise suppression. Through online updating of the Koopman operator and real-time correction of the Kalman filter, the amplitude of EEG is accurately predicted, and then the amplitude is converted into phase.

Benefits of technology

It improves the accuracy of EEG phase prediction, overcomes the shortcomings of linear analysis methods and noise interference, and achieves efficient prediction of EEG signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122123718A_ABST
    Figure CN122123718A_ABST
Patent Text Reader

Abstract

This application provides a method and related apparatus for EEG phase prediction based on the Koopman operator and Kalman filtering. The method includes: acquiring a preprocessed target EEG signal; determining the optimal delay embedding dimension corresponding to the target EEG signal; determining a first Koopman operator based on the target EEG signal and the optimal delay embedding dimension; updating the first Koopman operator to obtain a second Koopman operator; constructing a Kalman state equation based on the second Koopman operator; performing filtering correction and prediction based on the Kalman state equation to obtain a target EEG amplitude sequence; and determining the target EEG phase prediction result based on the target EEG amplitude sequence. By accurately modeling the dynamic evolution law of the EEG signal and updating it online using the Koopman operator, and combining it with Kalman filtering to suppress noise in real time, the accuracy of EEG phase prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of EEG phase prediction technology, and in particular to an EEG phase prediction method and related apparatus based on the Koopman operator and Kalman filter. Background Technology

[0002] Electroencephalogram (EEG) signals, as important physiological signals reflecting brain neural activity, have crucial application value in fields such as epilepsy early warning, brain-computer interfaces, and cognitive function assessment. Traditional EEG phase prediction methods are mostly based on linear analysis techniques such as Fourier transform and wavelet transform, or use deep learning models such as recurrent neural networks to directly fit the phase timing patterns.

[0003] However, EEG signals are inherently nonlinear and non-stationary complex time-series signals, making it difficult for linear analysis methods to accurately characterize their dynamic evolution. Deep learning models, on the other hand, suffer from problems such as large training data requirements, poor model interpretability, and insufficient real-time performance. Furthermore, EEG signal acquisition is susceptible to power frequency interference and electromyographic noise, the presence of which severely reduces the accuracy of phase prediction.

[0004] Therefore, improving the accuracy of EEG phase prediction is an urgent problem to be solved. Summary of the Invention

[0005] This application provides a method and related apparatus for predicting EEG phase based on the Koopman operator and Kalman filter. By accurately modeling the dynamic evolution of EEG signals using the Koopman operator, updating the Koopman operator online, and suppressing noise in real time using the Kalman filter, accurate prediction of EEG amplitude is achieved. The EEG amplitude is then converted into EEG phase, ultimately improving the accuracy of EEG phase prediction.

[0006] In a first aspect, embodiments of this application provide a method for predicting EEG phase based on the Koopman operator and Kalman filtering, the method comprising: Acquire the preprocessed target EEG signal; Determine the optimal delay embedding dimension corresponding to the target EEG signal; The first Koopman operator is determined based on the target EEG signal and the optimal delay embedding dimension. The first Koopman operator is updated to obtain the second Koopman operator; Construct the Kalman state equations based on the second Koopman operator; The target EEG amplitude sequence is obtained by filtering, correction, and prediction based on the Kalman state equation. The target EEG phase prediction result is determined based on the target EEG amplitude sequence.

[0007] Secondly, embodiments of this application provide an EEG phase prediction device based on the Koopman operator and Kalman filtering. The device includes an acquisition module, a first determination module, a second determination module, an update module, a construction module, a processing module, and a third determination module, wherein: The acquisition module is used to acquire the preprocessed target EEG signal; The first determining module is used to determine the optimal delay embedding dimension corresponding to the target EEG signal; The second determining module is used to determine the first Koopman operator based on the target EEG signal and the optimal delay embedding dimension; The update module is used to update the first Koopman operator to obtain the second Koopman operator; The construction module is used to construct the Kalman state equation based on the second Koopman operator; The processing module is used to perform filtering correction and prediction based on the Kalman state equation to obtain the target EEG amplitude sequence. The third determining module is used to determine the target EEG phase prediction result based on the target EEG amplitude sequence.

[0008] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing steps in any method of the first aspect of this application.

[0009] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in any method of the first aspect of this application.

[0010] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in any method of the first aspect of this application. The computer program product may be a software installation package.

[0011] By implementing the embodiments of this application, the precise modeling of the dynamic evolution of EEG signals using the Koopman operator, the online updating of the Koopman operator, and the real-time suppression of noise using the Kalman filter can be used to achieve accurate prediction of EEG amplitude. Then, the EEG amplitude is converted into EEG phase, which ultimately improves the accuracy of EEG phase prediction. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a system architecture diagram of an EEG phase prediction system provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application; Figure 3 This is an interactive architecture diagram of an EEG phase prediction system provided in an embodiment of this application; Figure 4 This is a schematic diagram of a Kalman filter provided in an embodiment of this application; Figure 5 This is a flowchart illustrating an EEG phase prediction method based on the Koopman operator and Kalman filtering provided in an embodiment of this application. Figure 6 This is a schematic diagram of a process for determining the optimal delay embedding dimension provided in an embodiment of this application; Figure 7 This is a flowchart illustrating a method for determining target EEG phase prediction results, provided in an embodiment of this application. Figure 8 This is a block diagram of the functional modules of an EEG phase prediction device based on the Koopman operator and Kalman filter provided in an embodiment of this application. Detailed Implementation

[0014] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0015] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0016] It should be understood that the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this application, "multiple" refers to two or more.

[0017] In the embodiments of this application, "at least one item" or its similar expression refers to any combination of these items, including any combination of a single item or a plurality of items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c; a and b; a and c; b and c; a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.

[0018] In this application embodiment, "connection" refers to various connection methods such as direct connection or indirect connection to realize communication between devices. This application embodiment does not limit this in any way.

[0019] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] The following is an explanation of the relevant terms used in this application: Koopman operator: refers to a mathematical operator used to transform the state evolution process of a nonlinear system into a linear transformation in a high-dimensional linear space. Its core function is to map low-dimensional nonlinear EEG signals to a high-dimensional state space through time-delay embedding, so that the originally nonlinear signal evolution law presents linear characteristics in the high-dimensional space, which is convenient for modeling, predicting and analyzing the dynamic changes of EEG signals.

[0021] Kalman filtering refers to a recursive optimal estimation algorithm based on a state-space model. Its core function is to achieve accurate estimation of the state of a dynamic system by fusing noisy measurement data and system state evolution model through closed-loop iteration of prior prediction and posterior correction, while suppressing interference from process noise and measurement noise.

[0022] Delayed embedding dimension: refers to the core parameter that maps a one-dimensional nonlinear EEG amplitude sequence to a high-dimensional state space. It represents the size of the dimension of the high-dimensional state vector, and its value directly determines whether the high-dimensional space can completely reproduce the nonlinear dynamic characteristics of the EEG signal.

[0023] High-dimensional state vector: refers to the vector obtained by reconstructing a one-dimensional EEG amplitude sequence after delay according to the optimal delay embedding dimension. It is used to fully represent the nonlinear dynamic characteristics of EEG signals in a high-dimensional space.

[0024] False nearest neighbor ratio: refers to a quantitative indicator used to determine the rationality of the delayed embedding dimension. Its core function is to measure the authenticity of neighboring vectors in a high-dimensional state vector, thereby judging whether the selected dimension is sufficient to fully characterize the dynamic characteristics of the nonlinear signal.

[0025] A Hankel matrix is ​​a symmetric square matrix whose core characteristic is that all elements on each antidiagonal line have the same value.

[0026] Electroencephalogram (EEG) signals, as important physiological signals reflecting brain neural activity, have crucial application value in fields such as epilepsy early warning, brain-computer interfaces, and cognitive function assessment. Traditional EEG phase prediction methods are mostly based on linear analysis techniques such as Fourier transform and wavelet transform, or use deep learning models such as recurrent neural networks to directly fit the phase timing patterns.

[0027] However, EEG signals are inherently nonlinear and non-stationary complex time-series signals, making it difficult for linear analysis methods to accurately characterize their dynamic evolution. Deep learning models, on the other hand, suffer from problems such as large training data requirements, poor model interpretability, and insufficient real-time performance. Furthermore, EEG signal acquisition is susceptible to power frequency interference and electromyographic noise, the presence of which severely reduces the accuracy of phase prediction.

[0028] Therefore, improving the accuracy of EEG phase prediction is an urgent problem to be solved.

[0029] To address the aforementioned issues, this application provides a method and related apparatus for EEG phase prediction based on the Koopman operator and Kalman filtering. First, a preprocessed target EEG signal is acquired; then, the optimal delay embedding dimension corresponding to the target EEG signal is determined; next, a first Koopman operator is determined based on the target EEG signal and the optimal delay embedding dimension; the first Koopman operator is updated to obtain a second Koopman operator; then, a Kalman state equation is constructed based on the second Koopman operator; filtering correction and prediction are performed based on the Kalman state equation to obtain a target EEG amplitude sequence; finally, the target EEG phase prediction result is determined based on the target EEG amplitude sequence.

[0030] It is evident that by accurately modeling the dynamic evolution of EEG signals using the Koopman operator, updating the Koopman operator online, and suppressing noise in real time using the Kalman filter, accurate prediction of EEG amplitude is achieved. Then, the EEG amplitude is converted into EEG phase, ultimately improving the accuracy of EEG phase prediction.

[0031] For easier understanding, please refer to Figure 1 , Figure 1 This is a system architecture diagram of an EEG phase prediction system provided in an embodiment of this application. The EEG phase prediction system includes a data input layer, a model training layer, a filtering prediction layer, a phase extraction layer, and a verification and evaluation layer. The functions of each layer are connected step by step from top to bottom to realize the whole process of EEG signal processing from raw input to phase prediction result output.

[0032] The data input layer receives raw EEG signals and performs preprocessing operations such as average reference correction, bandpass filtering, and ICA artifact removal on them. It outputs target EEG signals with uniform format and preliminary noise suppression, providing high-quality input data for subsequent model training and prediction.

[0033] The model training layer is used to construct a high-dimensional state space of EEG signals. The first Koopman operator is obtained by training through truncated singular value decomposition. At the same time, a recursive least squares algorithm is integrated to iteratively update the operator parameters based on the time-varying characteristics of EEG signals, and output a second Koopman operator that adapts to the dynamic evolution of the signal, which serves as the state transition matrix for filtering prediction.

[0034] The filtering prediction layer is used to embed the second Koopman operator into the Kalman filtering framework, construct the state equation and the observation equation, and sequentially perform prior state prediction, prior error covariance update, Koopman gain calculation, posterior state correction and posterior error covariance update. It also utilizes the power property of the Koopman operator to achieve multi-step prediction of EEG amplitude for the next n steps based on the posterior optimal state, and outputs the target EEG amplitude sequence.

[0035] The phase extraction layer is used to perform Hilbert transform on the target EEG amplitude sequence point by point, construct the target analytical signal and extract the target amplitude. Through the phase interval mapping algorithm, the target amplitude is normalized to the preset interval [0, 2π) and the target EEG phase prediction result is output.

[0036] The verification and evaluation layer is used to extract the corresponding real EEG amplitude sequence from the offline EEG data, obtain the real EEG phase sequence through the same Hilbert transform process, calculate the deviation between the predicted phase and the real phase by combining the phase periodicity characteristics, and count the proportion of correct predictions that meet the deviation threshold to the total number of predictions. Finally, the EEG phase prediction accuracy is output to complete the performance verification of the EEG phase prediction system.

[0037] The following is combined Figure 2 The electronic devices in the embodiments of this application will be described. Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 2 As shown, the electronic device includes one or more processors, a memory, a communication interface, and one or more programs. The processor is connected to the memory and the communication interface via an internal communication bus.

[0038] The processor can be used for: Acquire the preprocessed target EEG signal; Determine the optimal delay embedding dimension corresponding to the target EEG signal; The first Koopman operator is determined based on the target EEG signal and the optimal delay embedding dimension. The first Koopman operator is updated to obtain the second Koopman operator; Construct the Kalman state equations based on the second Koopman operator; The target EEG amplitude sequence is obtained by filtering, correction, and prediction based on the Kalman state equation. The target EEG phase prediction result is determined based on the target EEG amplitude sequence.

[0039] The one or more programs are stored in the aforementioned memory and configured to be executed by the aforementioned processor, and the one or more programs include instructions for performing any step in the above method embodiments.

[0040] The processor can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, cells, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication unit can be a communication interface, transceiver, transceiver circuit, etc., and the storage unit can be a memory.

[0041] The memory can be volatile or non-volatile, or a combination of both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0042] It is understood that the electronic device may include more or fewer structural elements than those shown in the block diagram above, such as a power module, physical buttons, a Wi-Fi module, a speaker, a Bluetooth module, sensors, a display module, etc., without limitation. It is understood that the electronic device may incorporate elements such as... Figure 1 The system architecture described above.

[0043] For easier understanding, please refer to Figure 3 , Figure 3 This is an interactive architecture diagram of an EEG phase prediction system provided in this application embodiment. The system can collect EEG signals from a target user (e.g., an epilepsy patient) using an EEG acquisition device (e.g., an electrode cap) to obtain raw EEG signals. These raw EEG signals provide physiological data input for the EEG phase prediction system. The EEG phase prediction system receives the raw EEG signals from the target user and sequentially performs preprocessing operations, Koopman operator training and updating, Kalman filtering for noise reduction, multi-step amplitude prediction, and phase extraction, ultimately generating a target EEG phase prediction result. A terminal device (e.g., a medical clinical terminal, a neurofeedback training terminal) can receive the target EEG phase prediction result output by the EEG phase prediction system and present it as a visual interface (e.g., phase change curves, warning prompts), control commands (e.g., brain-computer interface operations), or feedback signals (e.g., neurofeedback training prompts), depending on the application scenario, enabling the practical application of the prediction results and user interaction.

[0044] For easier understanding, please refer to Figure 4 , Figure 4This is a schematic diagram of a Kalman filtering process provided in an embodiment of this application. The Kalman filtering process includes prior state prediction, prior error covariance update, Kalman gain calculation, posterior state correction, posterior error covariance update, and denoised amplitude output. First, based on the previous time step's posterior optimal state estimate, the current time step's prior state estimate is obtained through linear mapping using the second Koopman operator. Simultaneously, the uncertainty of the prior state is updated by combining the operator and process noise covariance. Then, the fusion weights of the predicted and measured values ​​are dynamically determined by fusing the prior error covariance and measurement noise covariance to obtain the Kalman gain. Subsequently, the prior state estimate is weighted and corrected using this Kalman gain to fuse the measured EEG amplitude information, obtaining the current time step's posterior optimal state. Its uncertainty is updated based on the Kalman gain and observation matrix contraction, providing a confidence benchmark for the next time step iteration. Finally, the posterior optimal state is mapped to a one-dimensional amplitude using the observation matrix, outputting the denoised EEG amplitude, providing a basis for subsequent multi-step phase prediction. Specifically, by using the second Koopman operator as the state transition matrix and fusing the estimation of process noise and measurement noise, accurate correction and denoising of the high-dimensional state of EEG signals can be achieved, providing a reliable state basis for subsequent EEG phase prediction.

[0045] After understanding the software and hardware architecture of this application, the following will be combined with... Figure 5 This application describes an EEG phase prediction method based on the Koopman operator and Kalman filtering in its embodiments. Figure 5 This is a flowchart illustrating an EEG phase prediction method based on the Koopman operator and Kalman filtering provided in an embodiment of this application, specifically including the following steps: Step S501: Acquire the preprocessed target EEG signal.

[0046] Specifically, raw EEG signals from the occipital region of the human body can be acquired using EEG acquisition equipment, and preprocessing operations can be performed on the raw EEG signals to obtain the preprocessed target EEG signals. Preprocessing operations include, but are not limited to, average reference correction, bandpass filtering, and ICA artifact removal, without specific limitations. Average reference correction: The mean of the raw EEG signals acquired by all acquisition electrodes is calculated and used as a global reference benchmark to correct the output signals of each electrode point by point, effectively eliminating baseline shifts introduced by electrode differences and environmental common-mode interference, thus improving signal consistency. Bandpass filtering: A second-order Butterworth filter is used, with a passband frequency range of 8-13Hz, to filter the raw EEG signals after average reference correction, accurately extracting alpha band signals closely related to brain cognitive activity and neural rhythms, while filtering out low-frequency baseline drift noise below 0.5Hz and high-frequency electromyography interference and electromagnetic radiation noise above 30Hz; the smoothing effect of convolution operations is introduced during the filtering process to further suppress high-frequency non-stationary noise in the alpha band and reduce random fluctuations in the signal. ICA artifact removal: Independent component analysis is performed on the original alpha band EEG signal after bandpass filtering to decompose the mixed signal into multiple statistically independent components. By calculating the time-domain waveform, power spectral density and spatial distribution characteristics of each independent component, non-EEG power source components such as electrooculogram artifacts, electrocardiogram artifacts and power frequency interference artifacts are identified and separated. These interference components are then removed from the mixed signal to reconstruct a pure alpha band EEG signal, i.e., the target EEG signal.

[0047] Step S502: Determine the optimal delay embedding dimension corresponding to the target EEG signal.

[0048] For easier understanding, please refer to Figure 6 , Figure 6 This is a flowchart illustrating the determination of the optimal delay embedding dimension provided in an embodiment of this application. The target EEG signal includes N raw EEG amplitudes and N EEG sampling points, with each raw EEG amplitude corresponding to one EEG sampling point. The specific steps for determining the optimal delay embedding dimension corresponding to the target EEG signal include: A1. Delayed embedding is performed based on the first EEG amplitude value to obtain multiple first high-dimensional state vectors; the first EEG amplitude value is any one of the N original EEG amplitude values. A2. Determine multiple candidate delay embedding dimensions corresponding to the multiple first high-dimensional state vectors; each first high-dimensional state vector corresponds to a candidate delay embedding dimension; A3. Calculate the false nearest neighbor ratio of each of the plurality of first high-dimensional state vectors to obtain a plurality of false nearest neighbor ratios; the false nearest neighbor ratio is used to determine whether the delay embedding dimension is sufficient to characterize the nonlinear features of the signal; A4. Obtain the smallest false nearest neighbor ratio that is less than a preset threshold among the multiple false nearest neighbor ratios, and obtain the optimal false nearest neighbor ratio. A5. Determine the candidate delay embedding dimension corresponding to the optimal false nearest neighbor ratio among the multiple candidate delay embedding dimensions as the optimal delay embedding dimension.

[0049] The target EEG signal comprises N raw EEG amplitudes and N EEG sampling points, with each raw EEG amplitude corresponding to one EEG sampling point. The target EEG signal is essentially a one-dimensional discrete-time series, which can be denoted as: , where x(t) is the original EEG amplitude corresponding to the t-th sampling point, and N is the total number of EEG sampling points. Its evolution law can be expressed as: x(t+1)=F(x(t)), that is, the original EEG amplitude of the (t+1)-th EEG sampling point can be obtained from the original EEG amplitude of the t-th EEG sampling point through the nonlinear mapping relationship F. However, this nonlinear mapping relationship F is almost impossible to solve directly. Therefore, it is necessary to transform the nonlinear problem into a linear problem through dimensionality increase transformation.

[0050] In a specific embodiment, firstly, delayed embedding is performed based on a first EEG amplitude value to obtain multiple first high-dimensional state vectors. The first EEG amplitude value is any one of N original EEG amplitude values. For this first EEG amplitude value, continuous amplitude sequences of different lengths are selected according to a preset delay step size and combined to generate multiple first high-dimensional state vectors corresponding to different dimensions. Then, multiple candidate delayed embedding dimensions corresponding to the multiple first high-dimensional state vectors are determined, with each first high-dimensional state vector corresponding to one candidate delayed embedding dimension. The value of each candidate delayed embedding dimension is the number of original EEG amplitude values ​​contained in the corresponding first high-dimensional state vector.

[0051] Next, the proportion of false nearest neighbors for each of the multiple first high-dimensional state vectors is calculated, resulting in multiple false nearest neighbor proportions. The false nearest neighbor proportion is used to determine whether the delay embedding dimension is sufficient to characterize the nonlinear features of the signal, and is calculated as follows:

[0052] Where FNN(d) represents the proportion of false nearest neighbors when the delay embedding dimension is d, and its value ranges from 0 to 1. 1; x(t) represents the raw EEG amplitude corresponding to the t-th EEG sampling point of X(t); x(t ′ ) represents X(t) ′ The corresponding t-th ′ The original EEG amplitude values ​​corresponding to the t+d-th EEG sampling point; x(t+d) represents the original EEG amplitude value corresponding to the t+d-th EEG sampling point of X(t); x(t ′ +d) represents X(t) ′The corresponding t-th ′ +d original EEG amplitude values ​​corresponding to EEG sampling points; threshold represents the preset distance change judgment threshold (usually 10~15), used to distinguish whether it is a false proximity.

[0053] It should be noted that X(t) represents the first high-dimensional state vector corresponding to the t-th EEG sampling point constructed based on the delay embedding dimension d; X(t) ′ Let denote the high-dimensional state vector that is closest to X(t) in Euclidean distance. X(t) is shown below:

[0054] The last element of this first high-dimensional state vector is the EEG amplitude at the latest moment, i.e., the EEG amplitude x(t+d-1) corresponding to the last EEG sampling point. The high-dimensional state vector of the next EEG sampling point is Y(t), which is shown below:

[0055] Then, the smallest false nearest neighbor ratio among multiple false nearest neighbor ratios that is less than a preset threshold is obtained to obtain the optimal false nearest neighbor ratio. This preset threshold can be set to 5%, and no specific limitation is made here. The candidate delay embedding dimension corresponding to the optimal false nearest neighbor ratio among multiple candidate delay embedding dimensions is the optimal delay embedding dimension, which can be denoted as d.

[0056] It is evident that by selecting the optimal delay embedding dimension through the spurious nearest neighbor ratio method, the high-dimensional state space dimension that is sufficient to fully characterize the nonlinear dynamic features of EEG signals can be accurately determined while minimizing computational overhead, thus avoiding feature loss due to insufficient dimensions or computational burden caused by dimensional redundancy.

[0057] Step S503: Determine the first Koopman operator based on the target EEG signal and the optimal delay embedding dimension.

[0058] The specific steps of determining the first Koopman operator based on the target EEG signal and the optimal delay embedding dimension include: B1. Divide the N original EEG amplitudes and the N EEG sampling points according to a preset ratio to obtain a training set and an update set; B2. Construct a first matrix and a second matrix based on the optimal delay embedding dimension and the training set; both the first matrix and the second matrix are d×M dimensional Hankel matrices; d is the optimal delay embedding dimension; M is the number of effective high-dimensional state vectors corresponding to the training set; B3. Perform full-rank singular value decomposition on the first matrix to obtain the decomposition result; B4. Determine the linear relationship between the first matrix and the second matrix; B5. Determine the first Koopman operator based on the decomposition result and the linear relationship.

[0059] In a specific embodiment, firstly, a preset ratio (e.g., 7:3) is selected to divide the N original EEG amplitudes and corresponding N EEG sampling points corresponding to the target EEG signal into a training set and an update set. The training set is used for the initial solution of the first Koopman operator, and the update set is used for subsequent online iterative optimization of the first Koopman operator. During the partitioning process, the temporal continuity of the EEG sampling points must be maintained to avoid disrupting the dynamic evolution of the target EEG signal, ensuring that both the training set and the update set have the ability to independently represent signal characteristics.

[0060] Then, all valid data in the training set are traversed, and a first matrix and a second matrix are constructed based on the optimal delay embedding dimension. Both the first and second matrices are d×M dimensional Hankel matrices, where d is the optimal delay embedding dimension, and M is the number of valid high-dimensional state vectors corresponding to the training set, i.e., M = len(train_data) - d - 1, where len(train_data) represents the total number of original EEG amplitude data points contained in the training set. The first and second matrices are shown below:

[0061] in, Represents the first matrix; This represents the second matrix.

[0062] Next, full-rank singular value decomposition is performed on the first matrix to obtain the decomposition result, which is shown below:

[0063] Where U represents a left orthogonal matrix, U H U=I d U H I represents the conjugate transpose of U. d Let U represent a d-order identity matrix, where U∈R d ×d Σ represents a diagonal matrix (where the diagonal elements are singular values ​​arranged in descending order), and Σ∈R d×d V H V represents a right orthogonal matrix. H V=I d V H Let V denote the conjugate transpose of V, and V H ∈R d×d .

[0064] Then, determine the linear relationship between the first matrix and the second matrix, which is used to characterize the linear evolution law of the state vector in the high-dimensional space. The linear relationship is as follows:

[0065] Finally, determine the first Koopman operator according to the decomposition result and the linear relationship. Set the truncation rank r < d, process the decomposition result according to the truncation rank to obtain the truncated decomposition result. Only retain the first r largest singular values (corresponding to the principal components of the target EEG signal), and discard the remaining small singular values (corresponding to the noise components). Then substitute the truncated decomposition result into the linear relationship between the first matrix and the second matrix, and deduce the first Koopman operator. The first Koopman operator is as follows:

[0066] It can be seen that by dividing the training set and the update set and combining the construction of the Hankel matrix, full-rank singular value decomposition, and linear relationship solution to determine the first Koopman operator, the high-dimensional linear evolution law of the EEG signals in the training set can be accurately mined, providing a reliable initial model support for the subsequent operator iteration update.

[0067] Step S504: Update the first Koopman operator to obtain the second Koopman operator.

[0068] The specific steps of updating the first Koopman operator to obtain the second Koopman operator include: C1. Obtain the initial step size and the initial weight matrix; C2. Determine the reference EEG sampling points corresponding to the update set according to the initial step size; C3. Determine the reference EEG amplitudes corresponding to the reference EEG sampling points; C4. Construct a reference high-dimensional state vector according to the optimal delay embedding dimension and the reference EEG amplitude; C5. Predict the reference high-dimensional state vector according to the first Koopman operator to obtain the predicted high-dimensional state vector; C6. Determine the prediction error according to the predicted high-dimensional state vector and the reference high-dimensional state vector; C7. Determine the gain matrix according to the initial weight matrix; C8. Update the first Koopman operator according to the gain matrix and the prediction error to obtain the second Koopman operator.

[0069] In a specific embodiment, the iteration index k=1 is set as the initial step size, which corresponds to the first reference EEG sampling point to be processed in the update set. For each subsequent new sampling point processed, the step size k is incremented by 1. The initial weight matrix P(0)=λ is set. -1 I, where λ is the forgetting factor, and λ=0.98, used to give higher weight to recent data and weaken the interference of historical data on time-varying signals; I is a d×d identity matrix matching the optimal delay embedding dimension d. The first Koopman operator K is assigned the value of the initial operator K(0)=K.

[0070] Then, starting with an initial step size k=1, the reference EEG sampling point corresponding to the k-th iteration update is determined. For each subsequent iteration update, the step size k increases by 1, and the reference EEG sampling point is synchronously shifted backward, ensuring that all valid EEG sampling points in the update set are traversed in temporal order. The reference EEG amplitude x(t) corresponding to this reference EEG sampling point is then extracted from the update set. Finally, a reference high-dimensional state vector x is constructed based on the optimal delay embedding dimension d and the reference EEG amplitude. k =X(t).

[0071] Next, the reference high-dimensional state vector is predicted using the first Koopman operator to obtain the predicted high-dimensional state vector. Then, the true high-dimensional state vector X(t+1) for the next EEG sampling point corresponding to the reference high-dimensional state vector is extracted.

[0072] Next, calculate the prediction error vector between the true high-dimensional state vector and the predicted high-dimensional state vector. The formula for calculating the prediction error vector is as follows:

[0073] Where ε(k) represents the prediction error vector of the k-th iteration; X(t+1) represents the true high-dimensional state vector; K(k-1)x k Let x represent the predicted high-dimensional state vector. In this case, k is 1, then K(k-1) is K(0); k This represents the reference high-dimensional state vector.

[0074] Then, the gain matrix is ​​determined based on the initial weight matrix, and the formula for updating the gain matrix is ​​as follows:

[0075] Where G(k) represents the gain matrix of the k-th iteration; P(k-1) represents the weight matrix of the previous iteration. When k=1, P(k-1)=P(0), which is the initial weight matrix. Represents the reference high-dimensional state vector x k The transpose of .

[0076] Next, the first Koopman operator is updated based on the gain matrix and the prediction error vector to obtain the second Koopman operator. The calculation formula for the operator update is as follows:

[0077] Where K(k) represents the updated Koopman operator obtained after the k-th iteration, i.e., the second Koopman operator; K(k-1) represents the Koopman operator obtained in the previous iteration; ε(k) T This represents the transpose of the prediction error vector ε(k).

[0078] The weight matrix P(k) can be updated to provide a confidence benchmark for the next round of Koopman operator updates. The update formula for the weight matrix P(k) is shown below:

[0079] Where P(k) represents the weight matrix updated after the k-th iteration; λ -1 This represents the reciprocal of the forgetting factor λ.

[0080] It is evident that by updating the first Koopman operator to adaptively match the time-varying drift characteristics of EEG signals, a second Koopman operator that better reflects the actual evolution of the current signal is obtained, thereby improving the accuracy and robustness of subsequent filtering and prediction.

[0081] Step S505: Construct the Kalman state equation based on the second Koopman operator.

[0082] The specific steps for constructing the Kalman state equation based on the second Koopman operator include: D1. Obtain the reference posterior state estimate corresponding to the first EEG sampling point; the first EEG sampling point is any one of the N EEG sampling points; D2. Calculate the reference prior state estimate corresponding to the second EEG sampling point based on the preset process noise, the second Koopman operator, and the reference posterior state estimate; the second EEG sampling point is the next EEG sampling point after the first EEG sampling point. D3. Construct the Kalman state equation based on the reference posterior state estimate, the reference prior state estimate, the process noise, and the second Koopman operator.

[0083] In a specific embodiment, a reference posterior state estimate corresponding to the first EEG sampling point is obtained. This first EEG sampling point is any one of N EEG sampling points. Then, based on the preset process noise, the second Koopman operator, and the reference posterior state estimate, a reference prior state estimate corresponding to the second EEG sampling point is calculated. This second EEG sampling point is the next EEG sampling point after the first EEG sampling point. It should be noted that the process noise approximately follows a Gaussian distribution N(0, Q(t)) with a mean of 0 and a covariance of Q(t), used to characterize the model uncertainty and random perturbation in the EEG signal evolution process.

[0084] Next, based on the reference posterior state estimate, the reference prior state estimate, process noise, and the second Koopman operator, the Kalman state equations are constructed. The Kalman state equations are shown below:

[0085] Where X(t|t-1) represents the reference prior state estimate corresponding to the second EEG sampling point; K(k) represents the second Koopman operator; X(t-1|t-1) represents the reference posterior state estimate of the first EEG sampling point; and w(t) represents the process noise.

[0086] It is evident that by constructing the Kalman state equation based on the reference posterior state estimation and the second Koopman operator, the time-varying evolution law of EEG signals can be embedded into the filtering framework, providing an accurate state evolution model for subsequent prior prediction and posterior correction, and ensuring the pertinence and effectiveness of the filtering process.

[0087] Step S506: Filtering, correction, and prediction are performed based on the Kalman state equation to obtain the target EEG amplitude sequence.

[0088] The specific steps for obtaining the target EEG amplitude by filtering, correcting, and predicting based on the Kalman state equation include: E1. Obtain the historical posterior state estimate and historical posterior error covariance of the previous EEG sampling point corresponding to the current EEG sampling point; E2. Determine the current prior state estimate of the current EEG sampling point based on the Kalman state equation and the historical posterior state estimate; E3. Obtain the measurement noise covariance and the process noise covariance corresponding to the process noise; E4. Determine the current prior error covariance based on the process noise covariance, the second Koopman operator, and the historical posterior error covariance. E5. Calculate the Kalman gain based on the current prior error covariance, the preset observation matrix, and the measurement noise covariance. E6. Obtain the deviation between the current EEG amplitude corresponding to the current EEG sampling point and the predicted EEG amplitude corresponding to the current prior state estimation, and obtain the first deviation. E7. Correct the current prior state estimate based on the Kalman gain and the first bias to obtain the current posterior state estimate of the current EEG sampling point; E8. Determine the current posterior error covariance based on the Kalman gain, the observation matrix, and the current prior error covariance; the historical posterior error covariance of the next EEG sampling point corresponding to the current EEG sampling point is the current posterior error covariance. E9. Based on the preset prediction step size and the second Koopman operator, the current posterior state estimate is predicted to obtain the predicted posterior state estimate. E10. A linear mapping is performed on the predicted posterior state estimate based on the observation matrix to obtain the target EEG amplitude sequence; the length of the target EEG amplitude sequence is consistent with the prediction step size.

[0089] In a specific embodiment, firstly, the historical posterior state estimate and historical posterior error covariance of the previous EEG sampling point corresponding to the current EEG sampling point are obtained. Then, the current prior state estimate of the current EEG sampling point is determined based on the Kalman state equation and the historical posterior state estimate. The calculation formula for the current prior state estimate is as follows:

[0090] Where X(t|t-1) represents the current prior state estimate of the current EEG sampling point; X(t-1|t-1) represents the historical posterior state estimate. It should be noted that the calculation of this current prior state estimate does not require explicit inclusion of process noise. The influence of this process noise can be reflected in the subsequent prior error covariance update formula through the process noise covariance Q(t).

[0091] Then, the measurement noise covariance and the process noise covariance corresponding to the process noise are obtained. Among them, the measurement noise covariance R(t) is determined by the hardware characteristics of the EEG signal acquisition device and environmental interference, and measures the intensity of noise during the sampling process; the process noise covariance Q(t) is used to characterize the uncertainty of the Koopman operator and signal drift disturbance, and approximately follows a Gaussian distribution with a mean of 0.

[0092] Next, the process noise covariance, the second Koopman operator, and the historical posterior error covariance are calculated according to the preset prior error covariance update formula to obtain the current prior error covariance. The prior error covariance update formula is shown below:

[0093] Where P(t|t-1) represents the current prior error covariance; P(t-1|t-1) represents the historical posterior error covariance; and Q(t) represents the process noise covariance.

[0094] Then, based on the current prior error covariance, the preset observation matrix, and the measurement noise covariance, the Kalman gain is calculated. The formula for calculating the Kalman gain is as follows:

[0095] Among them, K g (t) represents the Kalman gain of the t-th EEG sampling point, i.e., the Kalman gain of the current EEG sampling point; H represents the observation matrix, used to linearly map the high-dimensional state vector to a one-dimensional EEG amplitude; H T R(t) represents the transpose of the observation matrix; R(t) represents the measurement noise covariance.

[0096] Next, the current EEG amplitude corresponding to the current EEG sampling point is obtained, and then the current prior state estimate is mapped to the predicted EEG amplitude using the observation matrix. Then, the deviation between the current EEG amplitude and the predicted EEG amplitude is calculated to obtain the first deviation. The current prior state estimate is then corrected based on the Kalman gain and the first deviation to obtain the current posterior state estimate for the current EEG sampling point. The formula for calculating the current posterior state estimate is as follows:

[0097] Where X(t|t) represents the current posterior state estimate of the current EEG sampling point; X(t|t-1) represents the current prior state estimate of the current EEG sampling point; z(t) represents the current EEG amplitude corresponding to the current EEG sampling point; and z(t)-HX(t|t-1) represents the first bias.

[0098] Then, the current posterior error covariance is determined based on the Kalman gain, the observation matrix, and the current prior error covariance. This current posterior error covariance is used as the historical posterior error covariance for the next EEG sampling point corresponding to the current EEG sampling point. The formula for calculating the current posterior error covariance is shown below:

[0099] Wherein, P(t|t) represents the current posterior error covariance, which is used to measure the degree of deviation and uncertainty between the current posterior state estimate and the actual high-dimensional EEG state.

[0100] Then, based on the preset prediction step size and the second Koopman operator, the current posterior state estimate is predicted to obtain the predicted posterior state estimate. The power-law property of the Koopman operator can be used to extend the single-step linear evolution law to multi-step prediction, enabling continuous deduction of the high-dimensional state of future EEG signals. Let the preset prediction step size be n (corresponding to n future EEG sampling points). Taking the current posterior state estimate X(t|t) of the current EEG sampling point as the prediction starting point, and the second Koopman operator K(k) as the state transition matrix, the predicted posterior state estimates corresponding to the next n EEG sampling points are derived. The predicted posterior state estimate is shown below:

[0101] Where X(t+n|t) represents the predicted posterior state estimate.

[0102] Then, a linear mapping is performed on the predicted posterior state estimate based on the observation matrix to obtain the target EEG amplitude sequence. The length of this target EEG amplitude sequence is consistent with the prediction step size. The target EEG amplitude sequence is shown below:

[0103] Where, x p (t+n) represents the target EEG amplitude sequence.

[0104] It is evident that by using the prior prediction, gain calculation, posterior correction, and error covariance iterative update process of Kalman filtering, combined with the exponentiality of the second Koopman operator to achieve multi-step amplitude prediction, EEG signal noise can be effectively suppressed and its dynamic evolution can be accurately captured, outputting a target EEG amplitude sequence that matches the prediction step size.

[0105] Step S507: Determine the target EEG phase prediction result based on the target EEG amplitude sequence.

[0106] For easier understanding, please refer to Figure 7 , Figure 7 This is a flowchart illustrating a method for determining a target EEG phase prediction result according to an embodiment of this application. The specific steps for determining the target EEG phase prediction result based on the target EEG amplitude sequence include: F1. Perform Hilbert transform on each target EEG amplitude value in the target EEG amplitude sequence to obtain the target analytical signal; F2. Extract the target argument corresponding to the target analytical signal; F3. Map the target phase angle to a preset phase interval to obtain the target EEG phase prediction result.

[0107] In a specific embodiment, firstly, a Hilbert transform is performed on each target EEG amplitude in the target EEG amplitude sequence to obtain the orthogonal component corresponding to each target EEG amplitude. Then, the target EEG amplitude in the target EEG amplitude sequence is used as the real part, and its corresponding orthogonal component is used as the imaginary part to construct the target analytical signal. Next, the target argument angle corresponding to the target analytical signal is extracted. This target argument angle reflects the angle between the target analytical signal and the real axis in the complex plane, and is the original representation of the EEG signal phase, with a value range of (-π, π). Finally, the target argument angle is mapped to a preset phase interval to obtain the target EEG phase prediction result. The preset phase interval can be [0, 2π). The numerical value of the target EEG phase prediction result is continuous and completely matches the phase interval, and can be directly used for subsequent EEG signal phase analysis.

[0108] This process involves selecting offline EEG data, obtaining the predicted EEG phase sequence for the next n steps corresponding to this offline EEG data, and extracting the corresponding true EEG amplitude sequence from the offline EEG data. Then, the true EEG phase sequence corresponding to the true EEG amplitude sequence is obtained through a Hilbert transform. Finally, the deviation between the predicted and true EEG phases is compared point by point, and the proportion of correct predictions meeting the deviation threshold is calculated to obtain the EEG phase prediction accuracy.

[0109] It is evident that by constructing an analytical signal and extracting the amplitude through Hilbert transform, and then obtaining continuous and unambiguous target EEG phase prediction results through phase interval mapping, the phase characteristics of the EEG signal can be accurately restored, providing reliable phase data support for subsequent clinical diagnosis, brain-computer interface and other applications.

[0110] The above primarily describes the solutions of the embodiments of this application from the perspective of the method execution process. It is understood that, in order to achieve the above functions, the electronic device includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments provided herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed by hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0111] This application embodiment can divide the electronic device into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0112] When dividing each function into modules according to its corresponding function. Figure 8 This is a functional block diagram of an EEG phase prediction device based on the Koopman operator and Kalman filter provided in an embodiment of this application. The EEG phase prediction device 800 based on the Koopman operator and Kalman filter includes an acquisition module 810, a first determination module 820, a second determination module 830, an update module 840, a construction module 850, a processing module 860, and a third determination module 870, wherein: The acquisition module 810 is used to acquire the preprocessed target EEG signal; The first determining module 820 is used to determine the optimal delay embedding dimension corresponding to the target EEG signal; The second determining module 830 is used to determine the first Koopman operator based on the target EEG signal and the optimal delay embedding dimension; The update module 840 is used to update the first Koopman operator to obtain the second Koopman operator; The construction module 850 is used to construct the Kalman state equation based on the second Koopman operator; The processing module 860 is used to perform filtering correction and prediction based on the Kalman state equation to obtain the target EEG amplitude sequence. The third determining module 870 is used to determine the target EEG phase prediction result based on the target EEG amplitude sequence.

[0113] Optionally, the target EEG signal includes N raw EEG amplitudes and N EEG sampling points, with each raw EEG amplitude corresponding to one EEG sampling point; in determining the optimal delay embedding dimension corresponding to the target EEG signal, the first determining module 820 is specifically used for: Based on the first EEG amplitude value, a delay embedding is performed to obtain multiple first high-dimensional state vectors; the first EEG amplitude value is any one of the N original EEG amplitude values. Determine multiple candidate delay embedding dimensions corresponding to the multiple first high-dimensional state vectors; each first high-dimensional state vector corresponds to one candidate delay embedding dimension; The proportion of false nearest neighbors for each of the plurality of first high-dimensional state vectors is calculated to obtain a plurality of false nearest neighbor proportions; the false nearest neighbor proportions are used to determine whether the delay embedding dimension is sufficient to characterize the nonlinear features of the signal; The smallest false nearest neighbor ratio less than a preset threshold among the multiple false nearest neighbor ratios is obtained to obtain the optimal false nearest neighbor ratio; The candidate delay embedding dimension corresponding to the optimal false nearest neighbor ratio among the multiple candidate delay embedding dimensions is determined as the optimal delay embedding dimension.

[0114] Optionally, in determining the first Koopman operator based on the target EEG signal and the optimal delay embedding dimension, the second determining module 830 is specifically used for: The N original EEG amplitudes and N EEG sampling points are divided according to a preset ratio to obtain a training set and an update set; Based on the optimal delay embedding dimension and the training set, a first matrix and a second matrix are constructed; both the first matrix and the second matrix are d×M dimensional Hankel matrices; d is the optimal delay embedding dimension; M is the number of effective high-dimensional state vectors corresponding to the training set; Perform full-rank singular value decomposition on the first matrix to obtain the decomposition result; Determine the linear relationship between the first matrix and the second matrix; The first Koopman operator is determined based on the decomposition results and the linear relationship.

[0115] Optionally, in updating the first Koopman operator to obtain the second Koopman operator, the update module 840 is specifically used for: Obtain the initial step size and initial weight matrix; The reference EEG sampling points corresponding to the updated set are determined based on the initial step size; Determine the reference EEG amplitude corresponding to the reference EEG sampling point; Construct a reference high-dimensional state vector based on the optimal delay embedding dimension and the reference EEG amplitude; The reference high-dimensional state vector is predicted based on the first Koopman operator to obtain the predicted high-dimensional state vector. The prediction error vector is determined based on the predicted high-dimensional state vector and the reference high-dimensional state vector; The gain matrix is ​​determined based on the initial weight matrix; The first Koopman operator is updated based on the gain matrix and the prediction error vector to obtain the second Koopman operator.

[0116] Optionally, in the process of constructing the Kalman state equation based on the second Koopman operator, the construction module 850 is specifically configured to: Obtain the reference posterior state estimate corresponding to the first EEG sampling point; the first EEG sampling point is any one of the N EEG sampling points. The reference prior state estimate corresponding to the second EEG sampling point is calculated based on the preset process noise, the second Koopman operator, and the reference posterior state estimate; the second EEG sampling point is the next EEG sampling point after the first EEG sampling point. The Kalman state equation is constructed based on the reference posterior state estimate, the reference prior state estimate, the process noise, and the second Koopman operator.

[0117] Optionally, in the process of filtering, correcting, and predicting based on the Kalman state equation to obtain the target EEG amplitude, the processing module 860 is specifically used for: Obtain the historical posterior state estimate and historical posterior error covariance of the previous EEG sampling point corresponding to the current EEG sampling point; The current prior state estimate of the current EEG sampling point is determined based on the Kalman state equation and the historical posterior state estimate. Obtain the measurement noise covariance and the process noise covariance corresponding to the process noise; The current prior error covariance is determined based on the process noise covariance, the second Koopman operator, and the historical posterior error covariance. The Kalman gain is calculated based on the current prior error covariance, the preset observation matrix, and the measurement noise covariance. The deviation between the current EEG amplitude corresponding to the current EEG sampling point and the predicted EEG amplitude corresponding to the current prior state estimation is obtained to obtain the first deviation. The current prior state estimate is corrected based on the Kalman gain and the first bias to obtain the current posterior state estimate of the current EEG sampling point; The current posterior error covariance is determined based on the Kalman gain, the observation matrix, and the current prior error covariance; the historical posterior error covariance of the next EEG sampling point corresponding to the current EEG sampling point is the current posterior error covariance. The current posterior state estimate is predicted based on the preset prediction step size and the second Koopman operator to obtain the predicted posterior state estimate. The target EEG amplitude sequence is obtained by linearly mapping the predicted posterior state estimate to the observation matrix; the length of the target EEG amplitude sequence is consistent with the prediction step size.

[0118] Optionally, in determining the target EEG phase prediction result based on the target EEG amplitude sequence, the third determining module 870 is specifically used for: Perform Hilbert transform on each target EEG amplitude in the target EEG amplitude sequence to obtain the target analytical signal; Extract the target argument corresponding to the target analytical signal; The target phase angle is mapped to a preset phase interval to obtain the target EEG phase prediction result.

[0119] It is evident that by accurately modeling the dynamic evolution of EEG signals using the Koopman operator, updating the Koopman operator online, and suppressing noise in real time using the Kalman filter, accurate prediction of EEG amplitude is achieved. Then, the EEG amplitude is converted into EEG phase, ultimately improving the accuracy of EEG phase prediction.

[0120] It should be noted that the specific implementation of each operation can be described in the corresponding description of the method embodiments shown above. The EEG phase prediction device 800 based on the Koopman operator and Kalman filter can be used to execute the above method embodiments of this application, and will not be described again here.

[0121] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.

[0122] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.

[0123] It should be noted that, for the sake of simplicity, the above embodiments are all described as a series of actions. Those skilled in the art should understand that this application is not limited to the described order of actions, as some steps in the embodiments of this application can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions, steps, modules, or units involved are not necessarily essential to the embodiments of this application.

[0124] In the above embodiments, the descriptions of each embodiment in this application have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0125] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0126] The steps of the methods or algorithms described in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disk, portable hard disk, read-only optical disk (CD-ROM), or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Furthermore, the ASIC can reside in a terminal device or management device. Alternatively, the processor and storage medium can exist as discrete components in the terminal device or management device.

[0127] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in the embodiments of this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0128] The modules / units included in the various devices and products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of both. For example, for devices and products applied to or integrated into a chip, all modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. For devices and products applied to or integrated into a chip module, all modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The implementation is achieved through a software program that runs on the processor integrated within the chip module. The remaining modules / units (if any) can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into terminal equipment, each of their modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal equipment. Alternatively, at least some modules / units can be implemented through a software program that runs on the processor integrated within the terminal equipment, while the remaining modules / units (if any) can be implemented using hardware methods such as circuits.

[0129] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above descriptions are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A method for predicting EEG phase based on the Koopman operator and Kalman filtering, characterized in that, The method includes: Acquire the preprocessed target EEG signal; Determine the optimal delay embedding dimension corresponding to the target EEG signal; The first Koopman operator is determined based on the target EEG signal and the optimal delay embedding dimension. The first Koopman operator is updated to obtain the second Koopman operator; Construct the Kalman state equations based on the second Koopman operator; The target EEG amplitude sequence is obtained by filtering, correction, and prediction based on the Kalman state equation. The target EEG phase prediction result is determined based on the target EEG amplitude sequence.

2. The method as described in claim 1, characterized in that, The target EEG signal includes N raw EEG amplitudes and N EEG sampling points, with each raw EEG amplitude corresponding to one EEG sampling point; Determining the optimal delay embedding dimension corresponding to the target EEG signal includes: Based on the first EEG amplitude value, a delay embedding is performed to obtain multiple first high-dimensional state vectors; the first EEG amplitude value is any one of the N original EEG amplitude values. Determine multiple candidate delay embedding dimensions corresponding to the multiple first high-dimensional state vectors; each first high-dimensional state vector corresponds to one candidate delay embedding dimension; The proportion of false nearest neighbors for each of the plurality of first high-dimensional state vectors is calculated to obtain a plurality of false nearest neighbor proportions; the false nearest neighbor proportions are used to determine whether the delay embedding dimension is sufficient to characterize the nonlinear features of the signal; The smallest false nearest neighbor ratio less than a preset threshold among the multiple false nearest neighbor ratios is obtained to obtain the optimal false nearest neighbor ratio; The candidate delay embedding dimension corresponding to the optimal false nearest neighbor ratio among the multiple candidate delay embedding dimensions is determined as the optimal delay embedding dimension.

3. The method as described in claim 2, characterized in that, Determining the first Koopman operator based on the target EEG signal and the optimal delay embedding dimension includes: The N original EEG amplitudes and N EEG sampling points are divided according to a preset ratio to obtain a training set and an update set; Based on the optimal delay embedding dimension and the training set, a first matrix and a second matrix are constructed; both the first matrix and the second matrix are d×M dimensional Hankel matrices; d is the optimal delay embedding dimension; M is the number of effective high-dimensional state vectors corresponding to the training set; Perform full-rank singular value decomposition on the first matrix to obtain the decomposition result; Determine the linear relationship between the first matrix and the second matrix; The first Koopman operator is determined based on the decomposition results and the linear relationship.

4. The method as described in claim 3, characterized in that, The step of updating the first Koopman operator to obtain the second Koopman operator includes: Obtain the initial step size and initial weight matrix; The reference EEG sampling points corresponding to the updated set are determined based on the initial step size; Determine the reference EEG amplitude value corresponding to the reference EEG sampling point; Construct a reference high-dimensional state vector based on the optimal delay embedding dimension and the reference EEG amplitude; The reference high-dimensional state vector is predicted based on the first Koopman operator to obtain the predicted high-dimensional state vector. The prediction error vector is determined based on the predicted high-dimensional state vector and the reference high-dimensional state vector; The gain matrix is ​​determined based on the initial weight matrix; The first Koopman operator is updated based on the gain matrix and the prediction error vector to obtain the second Koopman operator.

5. The method as described in claim 2, characterized in that, The construction of the Kalman state equation based on the second Koopman operator includes: Obtain the reference posterior state estimate corresponding to the first EEG sampling point; the first EEG sampling point is any one of the N EEG sampling points. The reference prior state estimate corresponding to the second EEG sampling point is calculated based on the preset process noise, the second Koopman operator, and the reference posterior state estimate; the second EEG sampling point is the next EEG sampling point after the first EEG sampling point. The Kalman state equation is constructed based on the reference posterior state estimate, the reference prior state estimate, the process noise, and the second Koopman operator.

6. The method as described in claim 5, characterized in that, The step of filtering, correcting, and predicting based on the Kalman state equation to obtain the target EEG amplitude includes: Obtain the historical posterior state estimate and historical posterior error covariance of the previous EEG sampling point corresponding to the current EEG sampling point; The current prior state estimate of the current EEG sampling point is determined based on the Kalman state equation and the historical posterior state estimate. Obtain the measurement noise covariance and the process noise covariance corresponding to the process noise; The current prior error covariance is determined based on the process noise covariance, the second Koopman operator, and the historical posterior error covariance. The Kalman gain is calculated based on the current prior error covariance, the preset observation matrix, and the measurement noise covariance. The deviation between the current EEG amplitude corresponding to the current EEG sampling point and the predicted EEG amplitude corresponding to the current prior state estimation is obtained to obtain the first deviation. The current prior state estimate is corrected based on the Kalman gain and the first bias to obtain the current posterior state estimate of the current EEG sampling point; The current posterior error covariance is determined based on the Kalman gain, the observation matrix, and the current prior error covariance; the historical posterior error covariance of the next EEG sampling point corresponding to the current EEG sampling point is the current posterior error covariance. The current posterior state estimate is predicted based on the preset prediction step size and the second Koopman operator to obtain the predicted posterior state estimate. The predicted posterior state estimate is linearly mapped based on the observation matrix to obtain the target EEG amplitude sequence; the length of the target EEG amplitude sequence is consistent with the prediction step size.

7. The method as described in claim 6, characterized in that, The step of determining the target EEG phase prediction result based on the target EEG amplitude sequence includes: Perform Hilbert transform on each target EEG amplitude in the target EEG amplitude sequence to obtain the target analytical signal; Extract the target argument corresponding to the target analytical signal; The target phase angle is mapped to a preset phase interval to obtain the target EEG phase prediction result.

8. A brainwave phase prediction device based on the Koopman operator and Kalman filtering, characterized in that, The device includes an acquisition module, a first determination module, a second determination module, an update module, a construction module, a processing module, and a third determination module, wherein: The acquisition module is used to acquire the preprocessed target EEG signal; The first determining module is used to determine the optimal delay embedding dimension corresponding to the target EEG signal; The second determining module is used to determine the first Koopman operator based on the target EEG signal and the optimal delay embedding dimension; The update module is used to update the first Koopman operator to obtain the second Koopman operator; The construction module is used to construct the Kalman state equation based on the second Koopman operator; The processing module is used to perform filtering correction and prediction based on the Kalman state equation to obtain the target EEG amplitude sequence. The third determining module is used to determine the target EEG phase prediction result based on the target EEG amplitude sequence.

9. An electronic device, characterized in that, include: Processor, memory, communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-7.