Epilepsy early warning method based on electroencephalogram signal analysis

By using a multi-channel electrode array and time-frequency domain analysis, combined with frequency domain peak shift and historical database, we have achieved precise localization and high-sensitivity early warning of epileptic seizure risk. This solves the problem of insufficient integration of electric field information in existing technologies and improves the accuracy of epileptic seizure risk assessment.

CN121587745APending Publication Date: 2026-03-03SHANDONG MEDICAL POLICY BIG DATA INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512024548.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing epilepsy monitoring technologies cannot effectively integrate electric field information from different brain regions, making it difficult to accurately identify abnormal electric field areas and quantify the rate of electric field change, resulting in insufficient accuracy in assessing the risk of epileptic seizures.

Method used

EEG signals are acquired using a multi-channel electrode array. By analyzing the time-frequency domain feature matrix, the spatial coordinates of abnormal regions and the rate of change of electric field gradient are extracted. Risk levels are classified by combining the frequency domain peak offset. A dynamic risk association model is generated using historical databases and pattern matching technology for early warning.

Benefits of technology

It enables precise localization and highly sensitive early warning of potential epileptic seizures, improves the accuracy and predictive ability of epileptic seizure risk assessment, and provides reliable support for clinical epilepsy management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121587745A_ABST
    Figure CN121587745A_ABST
Patent Text Reader

Abstract

The invention discloses an epilepsy early warning method based on electroencephalogram signal analysis, and relates to the technical field of biomedical signal processing and neural engineering, and the method comprises the steps: S1, collecting electroencephalogram signals through a multi-channel electrode array, obtaining electric field intensity data from different brain regions, carrying out the digital conversion for the frequency spectrum amplitude difference quantification and phase deviation angle measurement, and obtaining an electroencephalogram signal; obtaining a time-frequency domain feature matrix; s2, according to the time-frequency domain characteristic matrix, a frequency band energy distribution comparison method is adopted to extract abnormal region space coordinates, if a time domain waveform correlation coefficient is lower than a preset threshold value, the abnormal region is judged to be a potential abnormal region, and an abnormal region positioning result is obtained; according to the epilepsy early warning method based on electroencephalogram signal analysis, early warning of potential epileptic seizure is achieved, the sensitivity and accuracy of an early warning system are improved, and more reliable technical support is provided for clinical epilepsy management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of biomedical signal processing and neural engineering technology, specifically to an epilepsy early warning method based on electroencephalogram (EEG) signal analysis. Background Technology

[0002] Epilepsy, the fourth most common neurological disorder worldwide, affects the quality of life of over 50 million people. Its sudden onset and unpredictability make an effective early warning system a pressing need in the field of neuromedicine. Changes in electric field intensity contained in electroencephalogram (EEG) signals are considered one of the most sensitive physiological indicators preceding epileptic seizures, providing an important biological basis for constructing a reliable early warning mechanism.

[0003] Current epilepsy monitoring technologies primarily rely on traditional electroencephalography (EEG) analysis, which has significant limitations in processing complex, multi-dimensional electrophysiological information. Existing monitoring systems are often limited to simple recording of surface potentials, lacking in-depth analysis of the distribution characteristics of the electric field within the brain, making it difficult to capture subtle yet crucial electric field change patterns in the pre-seizure phase. More importantly, these methods cannot effectively integrate electric field information from different brain regions, severely limiting the accuracy of seizure risk assessment. The core technical challenge in this field stems from the spatial complexity of electric field intensity distribution. The electric field intensity in different brain regions exhibits high spatial heterogeneity, and this complex distribution pattern makes the accurate identification of abnormal regions extremely difficult. When abnormal electric field regions cannot be accurately located, a reliable spatial reference benchmark cannot be established, leading to inaccurate quantitative analysis of electric field change rates. For example, when a weak electric field intensity abnormality occurs in the temporal lobe region, if the spatial boundaries and intensity gradient of the abnormality cannot be accurately determined, it is difficult to determine whether this change indicates an impending seizure or is merely a normal physiological fluctuation. Summary of the Invention

[0004] The purpose of this invention is to provide an epilepsy early warning method based on electroencephalogram (EEG) signal analysis, thereby solving the problems existing in the prior art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: an epilepsy early warning method based on electroencephalogram (EEG) signal analysis, comprising: S1, acquiring EEG signals through a multi-channel electrode array, obtaining electric field intensity data from different brain regions, and performing digital conversion based on quantization of spectral amplitude differences and phase offset angle measurements to obtain a time-frequency domain feature matrix; S2, extracting the spatial coordinates of abnormal regions based on the time-frequency domain feature matrix using a frequency band energy distribution comparison method; if the correlation coefficient of the time-domain waveform is lower than a preset threshold, it is judged as a potential abnormal region, and the abnormal region location result is obtained; S3, obtaining the abnormal region location result, calculating the electric field intensity gradient change rate based on the spectral density function matching degree, determining the change rate quantification index through frequency response curve fitting, and obtaining a gradient change feature vector; S4, performing feature normalization processing using a signal envelope shape comparison method based on the gradient change feature vector, determining the risk level classification based on the frequency domain peak position deviation, and obtaining... S5. Based on the risk level identification code, retrieve similar patterns from the historical EEG signal database using a threshold boundary dynamic adjustment mechanism, calculate the similarity score using pattern matching confidence intervals, and obtain a candidate matching pattern set; S6. Obtain the candidate matching pattern set, filter the matching accuracy weight allocation results using feature vector similarity scoring and pattern library index retrieval mechanisms. If the candidate pattern ranking algorithm output exceeds the matching threshold, obtain the attack risk probability value; S7. Using the attack risk probability value, fuse real-time electric field intensity data using a pattern verification backtracking mechanism, generate a three-dimensional abnormal region mapping relationship based on the credibility assessment of the matching results, and obtain a dynamic risk association model; S8. Obtain the dynamic risk association model, continuously monitor and analyze the electric field intensity change trend. If the change trend shows an acceleration mode and exceeds the warning threshold, trigger the warning signal output through probability calculation, and obtain the optimized EEG abnormality warning system.

[0006] Preferably, step S1 includes acquiring EEG signals through a multi-channel electrode array, obtaining electric field intensity data from different brain regions to obtain an original electric field intensity sequence; performing spectral amplitude difference quantization on the original electric field intensity sequence, calculating the difference by subtracting the reference spectral amplitude to obtain an amplitude difference sequence; based on the amplitude difference sequence, using phase offset angle measurement, determining the offset angle sequence by obtaining the angle difference through the arctangent function; digitally converting the offset angle sequence and amplitude difference sequence, mapping the sequence elements to a matrix grid to construct a time-frequency domain feature matrix; extracting brain inter-regional synchronization indicators from the time-frequency domain feature matrix, and obtaining the neural connection strength distribution by obtaining the inter-row cross-correlation function of the matrix.

[0007] Preferably, step S2 includes obtaining frequency band energy distribution data from the time-frequency domain feature matrix, calculating the energy difference value by subtracting the reference energy value using a comparison method to obtain the preliminary coordinates of the abnormal region; calculating the time-domain waveform correlation coefficient for the preliminary coordinates of the abnormal region, and determining the boundary sequence of the abnormal region if the correlation coefficient is lower than a preset threshold; mapping the boundary sequence of the abnormal region to a preset brain region spatial model, and using coordinate transformation processing to fuse the energy distribution data to obtain a precise positioning coordinate set; extracting the inter-brain connection strength index based on the precise positioning coordinate set, and adjusting the coordinate deviation using an offset angle correction method to obtain the abnormal region positioning result.

[0008] Preferably, step S3 includes obtaining electric field intensity data from the spectral density function matching degree; calculating the gradient change rate based on the electric field intensity data; obtaining the change rate sequence by calculating the difference ratio between intensity values ​​through difference operations; fitting the frequency response curve through the change rate sequence; matching the curve parameters using the least squares method; determining the change rate quantization index; obtaining a quantization index set; extracting gradient change feature vectors from the quantization index set; fusing the preliminary boundary of the abnormal region obtained from the time-frequency domain feature matrix; mapping the boundary adjustment vector to a preset brain region model; calculating the connection strength offset; correcting the fused offset value through angle deviation; and integrating the energy distribution differences obtained from the frequency band energy distribution data through the offset correction coordinates to determine potential abnormal brain regions and obtain the abnormal region localization result.

[0009] Preferably, step S4 includes obtaining signal envelope data from the gradient change vector; calculating the envelope amplitude using Hilbert transform on the signal envelope data; generating a shape curve through amplitude sequence smoothing to obtain a shape curve sequence; performing a comparison operation on the shape curve sequence; calculating the difference ratio between positions by fusing the frequency domain peak positions to determine the deviation value and obtain a deviation value set; extracting quantitative indicators from the deviation value set; dividing the deviation value set into low, medium, and high levels using a preset threshold range to obtain a level classification result; integrating the classification code value based on the level classification result; fusing the abnormal signal features obtained from the frequency domain peak positions to determine potential risk areas and obtain a risk level identification code.

[0010] Preferably, step S5 includes: obtaining an initial similar pattern group from a historical EEG signal database using a risk level identification code; expanding the boundary range of the initial similar pattern group using a threshold boundary dynamic adjustment mechanism, which dynamically expands the range based on changes in the threshold boundary value of the identification code, to obtain an expanded pattern group; extracting pattern feature vectors from the expanded pattern group; calculating confidence intervals using a pattern matching method, which calculates intervals by comparing distances between vectors; fusing the confidence intervals to determine a similarity score, to obtain a score sequence; sorting the score sequence; filtering high-scoring patterns based on the sorting results; and fusing abnormal EEG fluctuation features obtained from the historical EEG signal database to determine potential matching degree, to obtain a preliminary matching pattern; obtaining a temporal correlation index from the preliminary matching pattern; adjusting the matching weights using the temporal correlation index; calculating the final similarity using weight fusion, to obtain an optimized matching pattern; and integrating frequency domain abnormality identifiers obtained from frequency domain peak positions into the optimized matching pattern, using a set construction method to generate a candidate matching pattern set, which constructs a set by identifier integration; fusing the candidate matching pattern set to determine the risk similarity pattern distribution, to obtain a candidate matching pattern set.

[0011] Preferably, step S6 includes obtaining a feature vector group from a candidate matching pattern set; determining the similarity degree by calculating the Euclidean distance between vectors using a similarity scoring method, where the Euclidean distance is obtained by taking the square root of the sum of squared differences in each dimension, thus obtaining a scoring sequence; extracting matching items from the scoring sequence using a pattern library index retrieval mechanism, where the pattern library index retrieval mechanism matches similar items according to a preset index key, and fusing the retrieval results to determine an accuracy index; assigning weight values ​​from the accuracy index, and integrating the index values ​​through a weighted average using weight fusion calculation to obtain a weight allocation sequence; arranging the weight allocation sequence using a candidate pattern sorting algorithm, where the candidate pattern sorting algorithm uses quicksort to sort the sequence values ​​in descending order, and if the sorted output exceeds a matching threshold, determining a preliminary probability distribution; integrating EEG abnormality markers from the preliminary probability distribution, where EEG abnormality markers are obtained from a historical EEG signal database, and updating the distribution probability values ​​using a distribution adjustment method through Bayes' theorem to obtain an attack risk probability value.

[0012] Preferably, step S7 includes obtaining a preliminary distribution group from the risk probability value, integrating the real-time electric field intensity using a backtracking fusion data method, determining the fusion sequence by calculating the intensity deviation value, where the intensity deviation value is obtained by taking the root of the sum of squared differences between the real-time electric field intensity and the corresponding elements in the preliminary distribution group; applying a matching result evaluation to the fusion sequence to obtain a set of credibility indicators, where the matching result evaluation calculates the indicator value by comparing the similarity between each element in the fusion sequence and a preset matching template; if the credibility indicator exceeds a preset threshold, a three-dimensional anomaly region coordinate set is generated; and mapping relationships are extracted from the three-dimensional anomaly region coordinate set to generate parameters. A relation matrix is ​​constructed using coordinate transformation methods, which convert the x, y, and z axis values ​​in the coordinate set into matrix elements. An anomaly area location map is obtained through linear transformations between elements. Elements for the anomaly area location map are then integrated into the association model. Risk association update items are integrated through matrix overlay, which adds corresponding elements of the location map matrix and the update item matrix to determine the dynamic risk model framework. The update distribution is obtained from the dynamic risk model framework, and parameter values ​​are adjusted through a backtracking verification mechanism. The backtracking verification mechanism compares the differences between the update distribution and the historical distribution and iteratively corrects them to obtain the dynamic risk association model.

[0013] Preferably, step S8 includes obtaining changes in electric field intensity from dynamic risk correlation, integrating real-time data through continuous monitoring trends, and determining the criteria for judging acceleration mode; applying a warning threshold comparison to the criteria for judging acceleration mode, and if the acceleration mode exceeds the threshold, triggering the generation of a warning signal through probability calculation, the probability calculation being based on the ratio of the change trend to the threshold difference to obtain optimized parameters for EEG abnormalities.

[0014] Preferably, step S8 further includes extracting real-time data integration elements from the EEG abnormality optimization parameters, constructing a risk model update matrix using an abnormal region localization method, converting parameters into coordinate points and calculating the distance between points to generate a matrix, determining the fusion sequence evaluation index; fusing the risk model update matrix for the fusion sequence evaluation index, obtaining the abnormal region localization coordinates, and obtaining the optimized EEG abnormality early warning system.

[0015] As can be seen from the above technical solution, the present invention has the following beneficial effects:

[0016] This epilepsy early warning method based on electroencephalogram (EEG) signal analysis addresses the shortcomings of existing technologies, such as the inability to accurately identify abnormal electric field regions, the difficulty in quantifying the rate of electric field change, and the lack of multi-brain region EEG signal fusion analysis. It proposes a multi-channel EEG signal acquisition and multi-dimensional feature fusion technique. This method acquires EEG signals through a multi-channel electrode array and extracts the electric field intensity feature matrix. Combined with frequency domain energy distribution and phase difference analysis, it achieves precise localization of abnormal regions. By calculating the electric field intensity gradient change rate and matching it with the spectral response curve, a stable feature vector is obtained. Furthermore, risk classification and probability calculation are performed based on frequency domain peak shift and signal envelope changes, thereby achieving quantitative assessment and dynamic prediction of epileptic seizure risk. Compared with traditional analysis methods that rely solely on surface EEG signals, this invention can integrate electric field information from different brain regions to construct an electric field anomaly spatial model, enabling early warning of potential epileptic seizures, improving the sensitivity and accuracy of the early warning system, and providing more reliable technical support for clinical epilepsy management. Attached Figure Description

[0017] Figure 1 This is a flowchart of the epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] like Figure 1As shown, this invention provides a technical solution: an epilepsy early warning method based on electroencephalogram (EEG) signal analysis, comprising: S1, acquiring EEG signals through a multi-channel electrode array, obtaining electric field intensity data from different brain regions, and performing digital conversion based on quantization of spectral amplitude differences and phase offset angle measurements to obtain a time-frequency domain feature matrix; S2, extracting the spatial coordinates of abnormal regions based on the time-frequency domain feature matrix using a frequency band energy distribution comparison method; if the correlation coefficient of the time-domain waveform is lower than a preset threshold, it is judged as a potential abnormal region, and the abnormal region location result is obtained; S3, obtaining the abnormal region location result, calculating the electric field intensity gradient change rate based on the spectral density function matching degree, determining the change rate quantification index through frequency response curve fitting, and obtaining a gradient change feature vector; S4, performing feature normalization processing using a signal envelope shape comparison method based on the gradient change feature vector, determining the risk level classification based on the frequency domain peak position deviation, and obtaining the risk level. S5. Based on the risk level identification code, retrieve similar patterns from the historical EEG signal database using a threshold boundary dynamic adjustment mechanism, calculate the similarity score using pattern matching confidence intervals, and obtain a candidate matching pattern set; S6. Obtain the candidate matching pattern set, filter the matching accuracy weight allocation results using feature vector similarity scoring and pattern library index retrieval mechanisms, and obtain the attack risk probability value if the candidate pattern ranking algorithm output exceeds the matching threshold; S7. Based on the attack risk probability value, fuse real-time electric field intensity data using a pattern verification backtracking mechanism, generate a three-dimensional abnormal region mapping relationship based on the credibility assessment of the matching results, and obtain a dynamic risk association model; S8. Obtain the dynamic risk association model, continuously monitor and analyze the electric field intensity change trend, and if the change trend shows an acceleration mode and exceeds the warning threshold, trigger the warning signal output through probability calculation, and obtain the optimized EEG abnormality warning system.

[0020] The core principle of this method lies in achieving high-resolution EEG signal acquisition through a multi-channel electrode array and performing time-frequency joint analysis of the electric field intensity in different brain regions. First, the system generates a time-frequency domain feature matrix by digitally processing spectral amplitude differences and phase shift angles to comprehensively describe the dynamic changes in the EEG signal over time. Then, a frequency band energy distribution comparison algorithm is used to extract spatial abnormality information in brain regions, and potential lesions are identified through temporal waveform correlation. After locating the abnormal region, the system further analyzes the gradient rate of change of the electric field intensity based on the spectral density function, extracting quantitative indicators through frequency response curve fitting to form a gradient change feature vector. Through signal envelope shape comparison and frequency domain peak analysis, accurate classification of epileptic seizure risk levels can be achieved. Next, the system compares the risk level identification code with a historical EEG database, using a threshold boundary adaptive adjustment mechanism and a confidence interval matching algorithm to obtain a candidate pattern set and calculate the seizure risk probability. Finally, through pattern validation backtracking and three-dimensional mapping generation mechanisms, real-time electric field data is fused to form a dynamically updated risk association model, enabling continuous monitoring and real-time early warning output. This method implements a closed-loop data processing flow from EEG signal acquisition, feature extraction, risk assessment to early warning output, ensuring high-precision prediction and early intervention for epileptic seizures.

[0021] This invention effectively improves the spatial resolution and temporal response speed of epilepsy anomaly detection through high-precision acquisition and time-frequency feature analysis of multi-channel EEG signals. The dual judgment mechanism of frequency band energy comparison and waveform correlation coefficient significantly improves the accuracy of identifying potential abnormal regions. By matching spectral density functions and fitting frequency response curves, the system can accurately capture the dynamic changes in electric field gradients, thus more sensitively reflecting abnormal trends in EEG activity. The risk grading method based on signal envelope normalization and frequency domain peak shift analysis avoids the oversensitivity of traditional statistical feature models to individual differences. Furthermore, the use of dynamic threshold boundary adjustment and confidence interval matching algorithms achieves adaptive optimization of the pattern recognition process, ensuring the stability and reliability of the risk probability output. The introduction of three-dimensional mapping and backtracking verification mechanisms enables the system not only to perform real-time monitoring but also to generate visualized brain region risk models based on historical data association, facilitating precise localization and intervention decisions by physicians. In summary, this method outperforms existing technologies in terms of prediction accuracy, response speed, system stability, and clinical applicability.

[0022] S1 includes acquiring EEG signals through a multi-channel electrode array, obtaining electric field intensity data from different brain regions to obtain a raw electric field intensity sequence; quantizing the spectral amplitude difference of the raw electric field intensity sequence, calculating the difference by subtracting the reference spectral amplitude to obtain an amplitude difference sequence; based on the amplitude difference sequence, measuring the phase offset angle, and determining the offset angle sequence by calculating the angle difference using the arctangent function; digitally converting the offset angle sequence and the amplitude difference sequence, mapping the sequence elements to a matrix grid to construct a time-frequency domain feature matrix; extracting brain region synchronization indicators from the time-frequency domain feature matrix, and obtaining the neural connection strength distribution by calculating the inter-row cross-correlation function of the matrix.

[0023] This implementation starts data acquisition after synchronously calibrating the multi-channel electrode array at the time starting point. The sampling process acquires electric field intensity data from different brain regions at a fixed sampling period and stores it in the original electric field intensity sequence according to channel number and time order. Each sample point includes a channel number, timestamp, and electric field intensity value. To ensure the stability of subsequent time-frequency processing, baseline segment determination and noise suppression are first performed on each channel. The baseline segment is selected from 60 seconds of continuous resting state data, clinically confirmed to be free of epileptiform discharges. Noise suppression is performed sequentially as DC rejection, power frequency suppression, and... Peak rejection and power frequency suppression are performed using a band-stop method within the range of 49 to 51. Peak rejection employs a median filtering window with a length of 0.2 seconds. After obtaining the purified original electric field intensity sequence, the continuous signal is strictly divided into non-overlapping basic windows of 2 seconds in length, with a sliding step size of 0.5 seconds to form overlapping analysis frames. Within each frame, an energy-preserving spectral transformation is performed on the single-channel signal. The frequency analysis range is 0.5 to 70, with a frequency resolution of 0.5, obtaining the spectral amplitude and phase angle values ​​at each frequency position of the frame. To obtain the amplitude difference sequence, firstly... The median spectral amplitude of the same channel at the same frequency position within the baseline segment is used as the reference amplitude for that channel at that frequency position. Then, at each analysis frame and each frequency position, the actual spectral amplitude of that frame is subtracted from the corresponding reference amplitude, retaining the sign without truncation. The results are arranged sequentially by time and frequency to form the amplitude difference sequence for that channel. For phase offset angle measurement, at each analysis frame and each frequency position, the phase information of the frequency component is converted into an angle value using the arctangent function. The angle is expressed in degrees and normalized to -180 to 180 degrees. For closed intervals, to reflect the phase evolution of adjacent time frames, the angular difference between the current analysis frame and the previous analysis frame for the same channel and frequency position is calculated. The angular difference is converted to a minimum difference angle with an absolute value not exceeding 180 by adding or subtracting 360. This difference is recorded sequentially in chronological and frequency order to form the offset angle sequence of that channel. To perform digitization and map the two types of sequences to a matrix grid, a grid axis for the time-frequency domain feature matrix is ​​established. The time axis increases in 0.5-second increments with the center time of the analysis frame, and the frequency axis starts from 0 with a grid spacing of 0.5.Arranged at intervals of 5 to 70, each row of the matrix corresponds to a time position, and each column corresponds to a frequency position. The stored value of the matrix consists of two parts: one is the amplitude difference submatrix, whose unit value is equal to the value of the aforementioned amplitude difference sequence at the corresponding time and frequency position; the other is the offset angle submatrix, whose unit value is equal to the value of the aforementioned offset angle sequence at the corresponding time and frequency position. To ensure the consistency of the numerical range, the two submatrices are linearly stretched to a closed interval of zero to one. The stretching endpoints are determined by their respective percentiles within the most recent 30 seconds, with the lower endpoint being the 5th percentile and the upper endpoint being the 95th percentile, and endpoints are truncated for values ​​exceeding the limits. To extract brain region synchronization indicators and obtain the distribution of neural connectivity strength from the time-frequency domain feature matrix, the corresponding time series is first extracted for all channels at each frequency position. The time series length is fixed to the most recent 30 seconds, i.e., it contains samples of the center time of 60 analysis frames. Then, the inter-row cross-correlation function is calculated at the same frequency position on a pair-by-pair basis. The cross-correlation calculation is performed in a zero-mean normalized manner and is performed from -2 seconds to +2 seconds. Within a time lag of seconds, the maximum correlation value and corresponding time lag are calculated. The maximum correlation value is taken as the synchronization strength of the channel pair at that frequency position, and the corresponding time lag is taken as the relative delay. To obtain a single neural connection strength distribution, the synchronization strength of each channel pair at all frequency positions is weighted and averaged according to energy weights. The energy weights are taken from the non-negative values ​​of the time mean of the amplitude difference submatrix at the corresponding frequency position and normalized to a sum of 1 in the frequency dimension. The weighted result is the connection strength value of the channel pair. To organize the connection strength into a distribution form, the connection strengths of all channel pairs are constructed into a symmetric matrix according to the channel number, and zero values ​​are filled in the diagonal to indicate that self-connections do not participate in the statistics. At the same time, the overall connectivity of each channel is recorded, which is equal to the sum of the connection strengths of the channel in all channel pairs. To avoid interference from random fluctuations, a stability test for synchronization strength is set. The stability test is considered to be acceptable if the sliding standard deviation within a 30-second window does not exceed 0.2 times the mean within that window. The connection strength of a non-acceptable channel pair remains unchanged at the current time according to the acceptable value at the previous time. In the above, the baseline length is set to 60 seconds to cover multiple major rhythm cycles and provide sufficient statistics; the power frequency suppression range is set to 49 to 51 to cover the power grid center frequency and possible offsets; the spike removal window is set to 0.2 seconds to combat short-term sporadic spikes; the basic window length is set to 2 seconds to balance frequency resolution and time resolution; the sliding step size is set to 0.5 seconds to ensure information overlap between adjacent analysis frames; the frequency analysis range is set to 0.5 to 70 to cover commonly used clinical frequency bands; the frequency resolution is set to 0.5 to provide sufficient frequency band subdivision; the time delay search range is set to -2 seconds to +2 seconds to cover common cross-regional propagation delays; the numerical stretching uses the 5th and 95th percentiles as endpoints to suppress the influence of extreme values; and the stability threshold is set to 0.A multiplier of 2 is used to control short-term fluctuations. If a threshold for determining significant synchronization needs to be set, an empirical distribution method is used to collect the connection strength of all channel pairs over the past 300 seconds, and the 95th percentile is taken as the significant threshold. A connection strength greater than or equal to this threshold is marked as a significant synchronization relationship.

[0024] The reference spectrum used for amplitude difference calculation is first selected as a 60-second continuous resting data period after the start of acquisition. The median spectral amplitude at each frequency position of this reference period is used as the reference amplitude. A reference period validity threshold is set to ensure reference stability. If the amplitude fluctuation range of the reference period at any frequency position exceeds 0.5 times the median of all samples in the reference period, it is considered invalid and re-evaluated after 30 seconds until the condition is met. The upper and lower limits of amplitude difference and offset angle used for digitization conversion and matrix mapping are updated using a sliding window with a window length of 300 seconds. Within this window, the distribution of the amplitude difference sequence and offset angle sequence are statistically analyzed. The lower limit threshold is fixed at the 5th percentile, and the upper limit threshold is fixed at the 95th percentile. Values ​​below the lower limit threshold are truncated to the lower limit, and values ​​above the upper limit threshold are truncated to the upper limit to ensure that different values ​​are truncated to the upper limit. The subjects' values ​​and values ​​at different time periods are comparable and extreme value interference is suppressed. The boundary threshold for phase offset angle conversion is fixed at ±180 degrees. The angle difference between any two adjacent frames is converted to a minimum difference angle of no more than 180 degrees by adding or subtracting 360 degrees to eliminate the uncertainty caused by angle rotation. The time delay search range threshold for inter-line cross-correlation calculation is fixed at -2 seconds to +2 seconds. This range was determined based on internal historical data statistics before the method was deployed. The statistical results showed that more than 95% of the cross-brain region propagation delays fell into this range. Therefore, this range was used as a fixed search boundary and remained unchanged during the operation to ensure repeatability. In order to ensure the stable presentation of the intensity distribution and not introduce a screening module beyond the claims, no significance judgment threshold is set for the cross-correlation peak. The maximum correlation value within the search range is directly used as the connection strength. No deletion or resampling is performed. The calculation is only performed at a predetermined period when the window is updated.

[0025] S2 includes obtaining frequency band energy distribution data from the time-frequency domain feature matrix, calculating the energy difference value by subtracting the baseline energy value using a comparison method to obtain the preliminary coordinates of the abnormal region; calculating the time-domain waveform correlation coefficient for the preliminary coordinates of the abnormal region, and judging it as a potential abnormal brain region if the correlation coefficient is lower than a preset threshold, thus determining the boundary sequence of the abnormal region; mapping the boundary sequence of the abnormal region to a preset brain region spatial model, and using coordinate transformation to fuse the energy distribution data to obtain a precise positioning coordinate set; extracting the inter-brain connection strength index based on the precise positioning coordinate set, and adjusting the coordinate deviation using an offset angle correction method to obtain the abnormal region positioning result.

[0026] In this embodiment, the time-frequency domain feature matrix and phase offset angle information have been obtained from claims 1 and 2 before proceeding to this step. This step uses a fixed time window of 2 seconds and a sliding step of 0.5 seconds within each analysis time frame, and processes the data according to a frequency band set within the frequency range of 0.5 to 70. The frequency band set is fixed as five intervals: 0.5 to 4, 4 to 8, 8 to 13, 13 to 30, and 30 to 70. Energy values ​​are read channel by channel and frequency band by frequency band from the time-frequency domain feature matrix. Simultaneously, the reference energy value determined before deployment is invoked. The reference energy value is determined by selecting 60 seconds of continuous resting data during the online calibration phase, calculating the median energy for each channel within the aforementioned five frequency bands as the reference energy for that channel and frequency band, and then verifying its validity. The review process involves checking if the resting energy range of any channel within any frequency band exceeds 0.5 times the median of that channel within that frequency band. If so, the baseline is deemed unstable, and the calculation is recalculated 30 seconds later until the condition is met. For each time frame, each channel, and each frequency band, the energy difference value is obtained by subtracting the baseline energy from the current energy. Spatial location is then performed on the full-channel energy difference map within the same time frame using a two-step method. The first step is candidate point screening, where channels with energy difference values ​​greater than zero are retained. Within a fixed neighborhood of 3 cm for each channel, it is determined whether the channel is a local maximum. A local maximum is defined as an energy difference value within that neighborhood that is not less than the energy difference value of other channels within that neighborhood, and the difference between that value and the second largest value is not less than 0% of the median of all positive difference values ​​in that frequency band for that time frame.The first step is to aggregate connected components. Candidate points that meet the criteria are selected as candidates. The second step is to group candidate points with a distance of no more than 3 cm into the same connected component. For each connected component, a weighted centroid is calculated based on the energy difference value. The resulting centroids form the preliminary coordinates of the anomalous region. If the number of connected components in the same time frame exceeds 5, the top 5 are retained from highest to lowest based on the sum of energy differences within the connected components to avoid excessive splitting. After obtaining the preliminary coordinates, a temporal correlation verification neighborhood is established at each centroid. The neighborhood radius is fixed at 4 cm. The corresponding temporal waveform data is then called and processed within a range of [length missing]. Correlation coefficients are calculated for channel pairs within a 2-second window, using zero mean and unit variance. The correlation coefficient threshold is determined using a data-driven approach, remaining valid after deployment and following fixed rules. The determination method involves statistically analyzing the correlation coefficients of all channel pairs for the same subject over the past 300 seconds, using the 10th percentile of the distribution as the preset threshold. If the correlation coefficient between any neighboring channel and the centroid channel in the current frame is lower than this threshold, that neighboring channel is considered a potential outlier. All consecutive low-correlation channels are then connected in a layer-by-layer expansion order from the centroid outwards, with the expansion starting at the first correlation coefficient... The process terminates at a threshold, and the sequence of outer contour points recorded along the expansion path constitutes the boundary sequence of the abnormal region. After boundary determination, the boundary sequence is mapped to a preset brain region spatial model to obtain a spatial position consistent with the individual's scalp coordinates. The spatial model is fixedly established during system deployment based on the electrode geometry and standard brain region contours and remains unchanged during operation. The mapping uses a one-time coordinate transformation, with transformation parameters consisting of three parts: the first part is the translation amount taken from the difference between the geometric center of the electrode array and the reference center of the model; the second part is the scaling factor taken from the ratio of the average adjacent spacing of the electrode array to the average adjacent spacing of the model; and the third part is the planar rotation angle taken from the angle between the frontal midline reference direction recorded during the calibration phase and the model midline direction. These three parameters are fixedly written into the configuration file after each calibration. The channel coordinates in the abnormal region boundary sequence are batch-processed with this coordinate transformation to obtain model coordinates, which are then fused with the energy distribution data of the same time frame. The fusion process uses a defined weighting rule inside and outside the boundary, with the channel weight inside the boundary fixed at 1, and the channel weight outside the boundary and within 2 cm of the boundary fixed at 0.5. Channels with a distance greater than 2 cm have a fixed weight of 0. The coordinates are weighted according to the above weights to find the centroid, and the location of the maximum energy difference under the weighted weights is recorded simultaneously. These two factors together form a precise localization coordinate set. Within the coverage area of ​​the precise localization coordinate set, brain region connectivity strength indices are extracted. The extraction method involves calculating the peak value of the normalized cross-correlation of any two channels in the coordinate set across five frequency bands within the same time frame. The time delay search range is fixed at -2 seconds to +2 seconds. The energy weights of the channel pair across the five frequency bands are linearly summed. The energy weight is the non-negative value of the mean energy difference of the channel pair in the corresponding frequency band, normalized to a sum of 1 across the five frequency bands. The resulting single value is the connectivity strength of the channel pair. The connectivity strengths of all channel pairs form the connectivity strength distribution of the precise localization region. After completing the connectivity strength extraction, offset angle correction is performed to eliminate spatial deviations caused by propagation phase. The correction parameters are adjusted from the weighted values. Requirement 2 involves directly calculating the offset angle sequence obtained from the standard calculation. Specifically, within the most recent 10 time frames, the average offset angle of each channel in the coordinate set is statistically analyzed for sign consistency. If the absolute value of the average is not less than 20 and the sign consistency is achieved in at least 8 out of 10 time frames, the coordinates are translated once along the direction of the average angle with a fixed step size of 5 mm. After translation, the above conditions are rechecked. If the conditions are still met, translation with the same step size continues, up to a maximum of 3 times to prevent overcorrection. If the conditions are not met, translation stops. When the offset angle meets the same conditions in the opposite direction, the boundary is shrunk once. The shrinkage rule is to move each point on the boundary 5 mm towards the centroid, up to a maximum of 3 times. After correction, the abnormal area location result is output, including the corrected center coordinates, the corrected boundary sequence, and the connection strength distribution corresponding to the area.

[0027] The baseline energy threshold is determined during the online calibration phase using 60 seconds of resting data. The median energy of each channel in each frequency band is used as the baseline energy. The baseline validity threshold is set to 0.5 times this median. If the resting energy range exceeds this value, it is considered invalid and recalculated after 30 seconds. The energy difference is calculated by subtracting the baseline energy from the current energy, and a value greater than 0 is used as a candidate threshold. Within the same time frame, local maxima are determined within a 3 cm radius neighborhood. The difference between the local maximum and the second largest value is not less than 0.1 times the median of positive differences in that frame, which is used as the significance threshold. Candidate points are grouped together with a pairwise distance of no more than 3 cm to form a connected component. If the number of connected components exceeds 5, the top 5 are retained based on the sum of differences to avoid excessive splitting. The temporal waveform correlation coefficient threshold is determined using sliding statistics over the past 300 seconds within a single subject range. The 10th percentile of the correlation coefficient distribution is used as a fixed preset threshold. Any channel within a 4 cm neighborhood and the quality... If a channel's value falls below a certain threshold, it is marked as a potential anomaly and expands along the low-correlation connectivity direction. The expansion terminates when the correlation coefficient first falls above the threshold to form a boundary. Coordinate mapping is a one-time transformation without a discrimination threshold. When fusing energy, a distance weight threshold is used: channels within the boundary have a weight of 1, channels outside the boundary and within 2 cm of the boundary have a weight of 0.5, and channels beyond 2 cm have a weight of 0, to ensure boundary dominance. The time-delay search range threshold for connectivity strength is fixed at -2 seconds to +2 seconds and remains unchanged during runtime. The offset angle correction threshold is determined by statistics from the most recent 10 time frames. If the average absolute value of the offset angle of the channels within the coordinate set is not less than 20 and the number of frames with the same number is not less than 8, a dominant direction is determined to exist. The channel is translated once along the dominant direction with a step size of 5 mm, and the threshold is rechecked. This process is repeated up to 3 times. When the opposite direction meets the same threshold condition, the boundary is contracted towards the centroid with a step size of 5 mm. This process is repeated up to 3 times.

[0028] S3 includes obtaining electric field intensity data from the spectral density function matching degree, calculating the gradient rate of change for the electric field intensity data, obtaining the difference ratio between intensity values ​​through difference operations to obtain a rate of change sequence; fitting the frequency response curve with the rate of change sequence, matching the curve parameters using the least squares method, determining the quantization index of the rate of change, and obtaining a quantization index set; extracting gradient change feature vectors from the quantization index set, fusing them with the preliminary boundary of the abnormal region obtained from the time-frequency domain feature matrix to obtain a boundary adjustment vector; mapping the boundary adjustment vector to a preset brain region model, calculating the connection strength offset, correcting the fused offset value through angle deviation, and obtaining offset correction coordinates; integrating the energy distribution differences obtained from the frequency band energy distribution data through the offset correction coordinates to identify potential abnormal brain regions and obtain the abnormal region localization result.

[0029] In this embodiment, before proceeding to this step, electric field intensity data is first read from the spectral density function matching degree by channel, time frame, and frequency band. The time window length is fixed at 2 seconds, the sliding step size is fixed at 0.5 seconds, and the frequency range is 0.5 to 70, divided into five intervals: 0.5 to 4, 4 to 8, 8 to 13, 13 to 30, and 30 to 70. Within the same channel and frequency band, the intensity values ​​of adjacent time frames are differentially analyzed according to time sequence and normalized using the absolute value of the intensity of the previous frame to obtain a strictly aligned rate of change sequence. Isolated noise points are then smoothed using the median with a sample size of 5. The rate of change is then analyzed using the least squares method in each channel and each frequency band. A frequency response curve, defined by three real parameters, is fitted to the rate of change sequence. The least squares convergence threshold is fixed at a relative change in the sum of squared residuals not exceeding one-thousandth, and the maximum number of iterations is 100. The process stops and the curve parameters are recorded once either condition is met. After obtaining the curve parameters, a set of quantitative indicators for the rate of change is constructed. These indicators contain five items with fixed definitions: the first is the slope of the curve at the median time of the sequence; the second is the difference between the average rate of change in the latter half of the sequence and the average rate of change in the first half; the third is the proportion of positive rate of change samples within the sequence; the fourth is the approximate time integral value obtained by accumulating the absolute values ​​of the rate of change within the sequence over the time step; and the fifth... The five indicators represent the proportion of samples with rate of change exceeding a threshold. The threshold is determined by using the 90th percentile of the rate of change distribution of the same channel and frequency band within the past 30 seconds as a fixed threshold. These five indicators are calculated separately for each of the five frequency bands within the same time frame and then fused at the channel level. The fusion weights are taken from the average energy of the time-frequency domain feature matrix in the corresponding frequency band of the same time frame, and normalized to a sum of 1 across the five frequency bands to obtain the gradient change characteristics of that channel. The gradient change characteristics of all channels are concatenated in channel number order to form a gradient change feature vector, which is then fused with the preliminary boundary of the abnormal region obtained from the time-frequency domain feature matrix in the same time frame. Specifically… The average gradient change characteristics of adjacent channels inside and outside the boundary are calculated and the difference is calculated. This difference is defined as the boundary error. The error direction is along the boundary normal pointing towards or away from the centroid of the region. The direction of the normal is uniquely determined by the line connecting the boundary point to the boundary centroid. A boundary adjustment vector is generated based on the boundary error. The step size is fixed at 5 mm, and the maximum number of consecutive adjustments is fixed at 3. The execution order is to first move the boundary segment with the largest absolute error value once, then move the boundary segment with the second largest error value, until the maximum number of adjustments is reached or the absolute error value is lower than the boundary error threshold. The boundary error threshold is fixed as 0 times the median of the gradient change characteristics of all channels in this time frame.2x; The adjusted boundary is mapped to the preset brain region model using a one-time coordinate transformation. The coordinate transformation parameters are determined during deployment and calibration and remain unchanged during operation. These parameters include translation, scaling factor, and planar rotation angle. The translation is determined by the difference between the geometric center of the electrode array and the reference center of the model. The scaling factor is determined by the ratio of the average adjacent spacing of the electrode array to the average adjacent spacing of the model. The rotation angle is determined by the angle between the frontal midline and the model midline. The connectivity strength offset is calculated in the model coordinate system. Connectivity strength is defined as a single intensity value obtained by summing the normalized cross-correlation peak values ​​of any two channels within the boundary across five frequency bands according to energy weights. The average intensity within the boundary is represented by the arithmetic mean of the intensities of all medial channel pairs. The average intensity of adjacent band regions outside the boundary is represented by the arithmetic mean of the channel pairs within 2 cm of the boundary. The connectivity strength offset is equal to the difference between the two, retaining the positive and negative signs. Angle deviation correction is performed based on the offset direction and the dominant phase direction to obtain the offset correction coordinates. The dominant phase direction is taken from the average direction of the vector of the offset angle sequence obtained in claim 2 over the most recent 10 time frames. If the angle between the connectivity strength offset direction and the dominant phase direction is not greater than 20°, the offset is applied to the coordinates with full weight; if the angle is greater than 20° but not more than 60°, it is applied with half weight; if the angle is greater than 60°, it is not applied, and only the original coordinate position is retained. After coordinate correction, the energy distribution difference of the frequency band energy distribution data is integrated within a 2 cm radius neighborhood of the offset correction coordinate. The energy distribution difference is equal to the current energy minus the median baseline energy obtained during the 60-second resting period in the deployment and calibration phase. The final determination rule is that if all three of the following conditions are met simultaneously, it is marked as a potential abnormal brain region: the first condition is a positive connectivity strength offset; the second condition is a positive energy distribution difference; and the third condition is that the channel-level gradient change feature is not lower than the 90th percentile of the channel distribution in the past 30 seconds. The set of coordinates that meet the rules and are spatially connected is output as the abnormal region localization result.

[0030] The rate of change threshold is determined by the 90th percentile of the rate of change sequence of a single channel and single frequency band within the most recent 30 seconds. This serves as a fixed threshold for identifying high-change samples and is automatically updated with a 30-second sliding window. The convergence threshold for least squares fitting is fixed at deployment as a relative change in the sum of squared residuals not exceeding one-thousandth, and the iteration limit is fixed at 100 times. Calculation stops when either condition is met, and both thresholds remain unchanged during runtime to ensure repeatability. The boundary error threshold is determined by multiplying the median of the gradient change characteristics of all channels by 0.2 within each time frame. This threshold is used to determine whether the boundary needs further adjustment. This threshold is recalculated in real time frame to adapt to scene fluctuations. The spatial step size for boundary adjustment is fixed at 5 millimeters, and the maximum number of consecutive adjustments is fixed at 3 times. Both are set once during deployment and remain unchanged to prevent errors. To prevent excessive movement, angle deviation correction uses a three-segment consistency threshold: if the angle between the connection strength offset direction and the phase dominance direction is no greater than 20°, it is fused with full weight; if the angle is greater than 20° but not more than 60°, it is fused with half weight; if the angle is greater than 60°, it is not fused. These three angle thresholds are fixed during deployment and remain unchanged to ensure consistent judgment criteria. The width threshold of the outer strip region used for comparison is fixed at 2 cm to define the statistical range of adjacent areas outside the boundary and remains unchanged during operation. The final judgment threshold is composed of three rules with a fixed caliber: the connection strength offset must be positive, the energy distribution difference must be positive, and the channel-level gradient change feature must be no less than the 90th percentile of the distribution of the channel in the most recent 30 seconds. Among them, the two percentile thresholds remain unchanged in statistical caliber and time length as the sliding window is updated.

[0031] S4 includes obtaining signal envelope data from gradient change vectors, calculating envelope amplitude using Hilbert transform on the signal envelope data, generating shape curves through amplitude sequence smoothing, and obtaining shape curve sequences; comparing shape curve sequences, fusing frequency domain peak positions to calculate the difference ratio between positions, determining deviation values, and obtaining a deviation value set; extracting quantification indicators from the deviation value set, dividing it into low, medium, and high levels using preset threshold ranges, and obtaining level classification results; integrating classification code values ​​based on level classification results, fusing abnormal signal features obtained from frequency domain peak positions, identifying potential risk areas, and obtaining risk level identification codes.

[0032] In this embodiment, a scalar sequence per channel and per time frame has been obtained from the gradient change vector before proceeding to this step. This step uses a fixed analysis window of 2 seconds and a sliding step of 0.5 seconds to extract sequence segments along the time axis. For each segment, deDC processing is performed to eliminate the average bias. Then, a Hilbert transform is performed point-by-point on the deDC-processed segments, and the amplitude is taken to obtain the envelope amplitude sequence. To stabilize the envelope shape, the envelope amplitude sequence is first smoothed using the median of 5 samples, followed by an equal-weighted moving average of 5 samples. The smoothed sequence is defined as the shape curve. The shape curves obtained from each time window are then spliced ​​together in chronological order to form the shape curve sequence. The sequence is then compared within the same time frame. The comparison object is the target channel and its spatially neighboring channel set. The neighboring channel set consists of channels within a fixed radius of 3 cm centered on the geometric position of the target channel, and must contain at least one channel. The comparison step includes two parts. The first part is the calculation of the temporal difference, in which the shape curve of the target channel is subtracted from the shape curve of each neighboring channel point by point within the same time window according to the same time index, and the average of the absolute values ​​is taken as the temporal difference index. The second part is the calculation of the difference ratio aligned with the frequency domain peak position. The frequency domain peak position is taken from the peak positions of five fixed frequency bands in the same time frame, and the five frequency bands are 0.The positions 5 to 4, 4 to 8, 8 to 13, 13 to 30, and 30 to 70 are mapped to time points within the current time window that are synchronized with the shape curve. The amplitude difference between the target channel and neighboring channels at these time points is calculated, and the ratio of the amplitude at the same point in the target channel is used to obtain the position difference ratio. If the target amplitude is zero, the ratio at that point is defined as zero to avoid invalid ratios. The time-domain difference index and the position difference ratio are combined into a single deviation value using an equal-weighted average. A deviation value is generated for each neighboring channel, and the deviation values ​​are arranged in the order of the neighboring channel indices. Then, a quantification index is extracted from the deviation value set and graded. The quantification index is fixed at three items, the first being... The first term is the median of the deviation value set; the second term is the proportion of samples in the deviation value set that are greater than or equal to their own median; and the third term is the upper quartile of the deviation value set. The grading threshold is determined within a 30-second window using a sliding percentile method within a single subject's range. The 33rd and 66th percentiles of the three quantitative indicators are used as the two-level boundaries: values ​​below the 33rd percentile are classified as low-level; values ​​between the 33rd and 66th percentiles are classified as medium-level; and values ​​above the 66th percentile are classified as high-level. The final level of the three indicators is determined according to the rule that "if at least two indicators reach a certain level, that level is taken; otherwise, the median level of the three indicators is taken," thus obtaining the level classification result. The classification results are then converted into classification code values: low level equals 1, medium level equals 2, and high level equals 3. These values ​​are then fused with abnormal signal features to determine potential risk areas. The abnormal signal features include two frequency domain peak values, both originating from the same time frame. The first is the peak position offset, defined as the absolute difference between the current peak position and the resting reference peak position. The resting reference is determined during the deployment and calibration phase using the median peak position of 60 consecutive seconds of resting data in the corresponding frequency band and remains unchanged during operation. The second is the energy increase, defined as the non-negative difference between the current peak energy and the resting reference peak energy. The resting reference peak energy is determined during the deployment and calibration phase using the median peak position of 60 consecutive seconds of resting data in the corresponding frequency band. The median energy of the resting data is determined and remains constant throughout the operation; the thresholds for two abnormal signal characteristics are determined within a single subject using the 66th percentile of the distribution over the most recent 30-second window and are updated as the window rolls; the risk assessment rule is fixed at three levels: if the classification code value is equal to 3 and the peak position offset is not less than its 66th percentile and the energy increase is not less than its 66th percentile, then the channel and time frame are marked as high risk and risk level identifier code 3 is output; if the classification code value is equal to 2 and at least one of the above two is not lower than its 66th percentile, then it is marked as medium risk and risk level identifier code 2 is output; otherwise, it is marked as low risk and risk level identifier code 1 is output.

[0033] The preset threshold range required for shape curve grading is determined by historical statistics within a single subject over a recent 30-second window. The 33rd and 66th percentiles of three quantitative indicators—the number of deviation values, the proportion of samples with deviation values ​​not less than the median, and the upper quartile of the deviation value set—are used as two-level boundaries, forming three levels of thresholds: low (below the 33rd percentile), medium (between the 33rd and 66th percentiles), and high (above the 66th percentile). For abnormal signal characteristics, the 66th percentile is calculated for both peak position offset and energy amplification within the same 30-second window, and this percentile is used as a fixed threshold for both characteristics. In risk assessment, a classification code value of 3 and both characteristics not less than their respective 66th percentiles are marked as high risk; a classification code value of 2 and at least one characteristic not less than its 66th percentile are marked as medium risk; and all others are marked as low risk. (Restless) The baseline thresholds are determined once during the deployment and calibration phase. The peak position baseline is the median of the peak positions in the corresponding frequency band of 60 consecutive seconds of resting data. The peak energy baseline is the median of the peak energy in the same data segment. These thresholds are not changed during operation. All "positive difference" and "absolute difference" related to the baselines are referenced to this fixed baseline. The zero amplitude ratio handling threshold in the shape curve comparison is clearly defined as the difference ratio at the point where the target channel amplitude is equal to 0 at the alignment time point. This is to avoid uncertain ratios and no interpolation or amplification is performed. Parameters used for stability, such as smoothing and neighbor selection, are not used as discrimination thresholds but are executed as fixed boundaries. The analysis window length is fixed at 2 seconds, the sliding step size is fixed at 0.5 seconds, the median window and the equal-weighted moving average window of the envelope smoothing are each fixed at 5, the neighbor radius is fixed at 3 cm, and the frequency band division is fixed at 0.5 to 4, 4 to 8, 8 to 13, 13 to 30, and 30 to 70, and remains unchanged during operation.

[0034] S5 includes: obtaining an initial similar pattern group from a historical EEG signal database using risk level identification codes; expanding the boundary range of the initial similar pattern group using a threshold boundary dynamic adjustment mechanism, which dynamically expands the range based on changes in the threshold boundary value of the identification code, resulting in an expanded pattern group; extracting pattern feature vectors from the expanded pattern group; calculating confidence intervals using a pattern matching method, which calculates intervals by comparing distances between vectors; fusing the confidence intervals to determine a similarity score, resulting in a score sequence; sorting the score sequence; filtering high-scoring patterns based on the sorting results; and using abnormal EEG fluctuation features obtained from the historical EEG signal database to determine potential matching degree, resulting in a preliminary matching pattern; obtaining a temporal correlation index from the preliminary matching pattern; adjusting the matching weights using the temporal correlation index; calculating the final similarity using weight fusion, resulting in an optimized matching pattern; and integrating frequency domain abnormality identifiers obtained from frequency domain peak positions into the optimized matching pattern, using a set construction method to generate a candidate matching pattern set, which constructs a set by integrating identifiers; fusing the candidate matching pattern set to determine the risk-similar pattern distribution, resulting in a candidate matching pattern set.

[0035] In this implementation, the risk level identifier code obtained at the current moment is used as the retrieval entry point. The system simultaneously matches and returns an initial similar pattern group from the historical EEG signal database using four fields: channel number, time index, frequency band index, and spatial coordinates. The retrieval scope is fixedly mapped to three levels according to the identifier code. When the identifier code equals 1, the time tolerance is ±2 seconds, the spatial tolerance is a radius of 1 cm, and the frequency band tolerance is the same frequency band. When the identifier code equals 2, the time tolerance is ±5 seconds, the spatial tolerance is a radius of 2 cm, and the frequency band tolerance is within one adjacent frequency band. When the identifier code equals 3, the time tolerance is ±1... 0 seconds, spatial tolerance of 3 cm radius, and frequency band tolerance within two adjacent frequency bands; subsequently, a threshold boundary dynamic adjustment mechanism is applied to the initial similarity pattern group. The mechanism rule is to expand the time, space, and frequency band boundaries proportionally according to the above tolerances based on the identifier code and take effect immediately, forming an expanded pattern group; from the expanded pattern group, a pattern feature vector is extracted from each record. The feature vector contains nine items: three statistics on envelope shape, three statistics on frequency band energy, two statistics on phase offset, and one statistics on connection strength. Among them, the three statistics on envelope shape are the mean of envelope amplitude and the upper quartile of envelope amplitude. The duration of the number and envelope amplitude changes, the three frequency band energy terms (weighted sum of energy averages within five fixed frequency bands, energy peak value, and the time of energy peak occurrence), the two phase offset terms (average offset angle and the proportion of offset angles with the same sign), and the one connectivity strength term (average of normalized cross-correlation peaks of channels within the boundary) are all calculated within the same time window and frequency band aperture in the previous steps and stretched to the zero-to-one range using percentiles to unify the dimensions. The absolute difference of each feature vector in the target sample and the extended mode group is calculated item by item and summed to obtain a list of vector distances, using a fixed number of neighborhood samples. The confidence interval is determined by the nearest neighbor count of 20. The lower bound is the 10th percentile of the distance list, and the upper bound is the 90th percentile of the distance list. The distance and the interval position are mapped to a similarity score. The scoring rules are as follows: distance not greater than the lower bound is assigned a value of 1; distance not less than the upper bound is assigned a value of 0; distance in the middle of the interval is assigned a value of 0.5; distance in the lower half of the interval is divided into 4 levels with values ​​of 0.6, 0.7, 0.8, and 0.9 based on the proportion of distance to the lower bound between 0.5 and 1; distance in the upper half of the interval is divided into 4 levels with values ​​of 0.4, 0.3, 0.2, and 0 based on the proportion of distance to the upper bound between 0 and 0.5.1. Obtain the scoring sequence arranged in the order of records; sort the scoring sequence in descending order and filter high-scoring patterns. The filtering rule is that the lower of the following two conditions must be met: the top 10% and the top 50 records. For example, when the total number of records is less than 500, the top 10% is taken as the upper limit; when the total number of records is greater than or equal to 500, the top 50 records are fixed as the upper limit. After obtaining the polymer set, retrieve the abnormal EEG fluctuation features of these records for the corresponding time periods from the database. The features include three items: energy surge magnitude, surge duration, and peak occurrence order. Align these items with the current time period item by item and perform a consistency judgment. The consistency threshold is that at least two of the three items must be met simultaneously. The allowable difference in the magnitude of the sudden increase should not exceed the 20th percentile of its respective 30-second sliding distribution, and the allowable difference in the duration of the sudden increase should not exceed 1 second. The order of the peaks should be consistent, and those that meet the requirements are marked as potential matches and form a preliminary matching pattern. From the preliminary matching patterns, time-series correlation indicators are calculated one by one. The indicators include the peak correlation coefficient, the corresponding time lag, and the time lag stability. The peak correlation coefficient threshold is fixed at not less than 0.6 for strong correlation, 0.4 to 0.6 for moderate correlation, and less than 0.4 for weak correlation. The corresponding time lag threshold is fixed at an absolute value not exceeding 1 second for stable time lag. The time lag stability threshold is fixed at not less than [a certain value] within the most recent 10 adjacent windows. The correlation peak positions of the eight windows falling within ±1 second are considered stable. The similarity scores are then weighted using these three indicators. The weighting fusion rule is as follows: records with strong correlation and stable time delays are multiplied by 1.2; records with moderate correlation or unstable time delays are multiplied by 0.9; and records with weak correlations are multiplied by 0.7. The final similarity score is then used to sort the records in descending order, retaining the top 20 as the optimized matching mode. The optimized matching mode integrates frequency domain anomaly markers obtained from the frequency domain peak positions. Anomaly markers are defined as at least two frequency bands in five fixed frequency bands simultaneously exhibiting a positive shift in peak position relative to the resting reference, and the peak energy being relatively... The resting baseline is positively incremented. During deployment, the resting baseline is determined once by taking the median of the peak position and peak energy of each frequency band from 60 consecutive seconds of resting data and remains unchanged during operation. The set construction method uses an integration rule to generate a candidate matching mode set from the optimized matching patterns. The integration rule is that mode labels are consistent, frequency band labels are consistent, spatial coordinates are adjacent within a radius of 2 cm, and the time interval overlap is not less than 50% of the total time. This process is repeated until no further merging occurs. Each output entry includes the arithmetic mean and maximum of the final similarity within the set, and the average of all entries is linearly stretched from zero to one to form a risk-similar pattern distribution.

[0036] During the retrieval and expansion phase, the three-level boundaries of time, space, and frequency band tolerance are directly determined by the identifier code. When the identifier code equals 1, the time tolerance is ±2 seconds, the spatial tolerance is a radius of 1 cm, and the frequency band tolerance is the same frequency band. When the identifier code equals 2, the time tolerance is ±5 seconds, the spatial tolerance is a radius of 2 cm, and the frequency band tolerance is within one adjacent frequency band. When the identifier code equals 3, the time tolerance is ±10 seconds, the spatial tolerance is a radius of 3 cm, and the frequency band tolerance is within two adjacent frequency bands. The dynamic adjustment mechanism of the threshold boundaries takes effect after expanding outward once according to the above values. The confidence interval threshold for similarity scoring is based on the target sample and the expanded pattern group. The vector distance is calculated on a list of nearest neighbor samples with 20 samples, with the 10th percentile as the lower bound and the 90th percentile as the upper bound. The scoring threshold rules are as follows: distance not greater than the lower bound is assigned a value of 1; distance not less than the upper bound is assigned a value of 0; and distances between the two bounds are assigned a discrete value in nine levels. The lower half of the range has four levels assigned values ​​of 0.9, 0.8, 0.7, and 0.6 respectively, with the midpoint assigned a value of 0.5. The upper half has four levels assigned values ​​of 0.4, 0.3, 0.2, and 0.1 respectively. The high-score screening threshold uses the upper limit rule of "the smaller of the top 10% and the top 50" to prevent overfitting. The consistency threshold for abnormal EEG fluctuations requires at least two of the three criteria to be met. The allowable difference in the magnitude of medium-energy surges should not exceed the 20th percentile of their respective 30-second sliding distributions; the allowable difference in the duration of surges should not exceed 1 second; and the order of peak values ​​must be consistent. The temporal correlation threshold is fixed as follows: a correlation coefficient peak value greater than or equal to 0.6 indicates strong correlation; between 0.4 and 0.6 indicates moderate correlation; and less than 0.4 indicates weak correlation. The corresponding time lag threshold is that an absolute value not exceeding 1 second indicates stability. The time lag stability threshold is that the correlation peak positions in at least 8 of the most recent 10 adjacent windows fall within a range of ±1 second. The weighted fusion threshold is: for strong correlation and stability, the similarity is multiplied by 1.2; for moderate correlation, the similarity is multiplied by 1.2. For correlated or unstable results, the similarity is multiplied by 0.9; for weakly correlated results, the similarity is multiplied by 0.7. Based on this, the top 20 results are retained as optimized matching patterns. The threshold for frequency domain anomaly identification is that at least two frequency bands in five fixed frequency bands simultaneously show a positive shift in peak position relative to the resting baseline and a positive increase in peak energy relative to the resting baseline. The resting baseline is determined once by taking the median of peak position and peak energy of each frequency band from 60 consecutive seconds of resting data and remains unchanged during operation. The threshold for merging candidate sets is that if the spatial distance is no more than 2 cm and the temporal overlap is no less than 50% of the total duration, they are merged into the same entry.

[0037] S6 includes obtaining feature vector groups from a candidate matching pattern set, determining the similarity level by calculating the Euclidean distance between vectors using a similarity scoring method (the Euclidean distance is obtained by taking the square root of the sum of the squares of the differences in each dimension), and obtaining a scoring sequence; extracting matching items from the scoring sequence using a pattern library index retrieval mechanism (the pattern library index retrieval mechanism matches similar items according to a preset index key), and determining the accuracy index by fusing the retrieval results; assigning weight values ​​from the accuracy index, integrating the index values ​​through a weighted average using weight fusion calculation, and obtaining a weight allocation sequence; arranging the weight allocation sequence using a candidate pattern sorting algorithm (the candidate pattern sorting algorithm uses quicksort to sort the sequence values ​​in descending order), and determining a preliminary probability distribution if the sorted output exceeds a matching threshold; integrating EEG abnormality markers from the preliminary probability distribution (the EEG abnormality markers are obtained from a historical EEG signal database), updating the distribution probability values ​​using a distribution adjustment method through Bayes' theorem, and obtaining the attack risk probability value.

[0038] In this implementation, feature vectors are first read one by one from the candidate matching pattern set. Before comparison, all vectors are linearly normalized to zero mean and unit scale based on the mean and standard deviation of the most recent 30-second window. Then, the target vector is subtracted dimension by dimension from each vector in the set, the differences are squared dimension by dimension, summed, and the square root of the sum is taken to obtain the Euclidean distance. A distance sequence is formed according to the recording order, and a similarity score is generated based on this. The scoring rule is as follows: the 10th percentile of the distance distribution within the same 30-second window is used as the high similarity boundary, and the 90th percentile is used as the low similarity boundary. Records with a distance not greater than the high similarity boundary are assigned a score of 1, records with a distance not less than the low similarity boundary are assigned a score of 0, and distances between the two are assigned discretely in nine levels. The four levels closest to the high similarity boundary are assigned scores of 0.9, 0.8, 0.7, and 0.6 respectively, the midpoint is assigned a score of 0.5, and the four levels closest to the low similarity boundary are assigned scores of 0.4, 0.3, 0.2, and 0.1 respectively. This yields a scoring sequence. Then, for each entry in the scoring sequence, a pattern library index retrieval mechanism is executed. The preset index key is fixed and consists of four parts: channel label, frequency band label, spatial grid label, and time slice label. The time slice matching tolerance is fixed at ±2 seconds, the spatial grid matching tolerance is fixed at a radius of 2 centimeters, and the frequency band matching tolerance is fixed at within one adjacent frequency band. After equal or nearest-neighbor matching of the four types of labels in the library, a retrieval accuracy index is calculated. The retrieval accuracy index is obtained by combining three components in a fixed proportion, where the index hit completeness weight is 0.5, the label consistency ratio weight is 0.3, and the label proximity weight is 0.2. Each of the three components is linearly mapped from zero to one and then weighted to obtain a single accuracy score. Next, a fusion weight is assigned to each entry, and the weight allocation value is calculated. The fusion weight is equal to the aforementioned accuracy score, and the weight allocation value is calculated using a fixed method: similarity score multiplied by 0.7 and accuracy score multiplied by 0.The sum of 3, with all entries calculated independently, forms a weighted sequence. This sequence is then sorted using quicksort in descending order of value and compared to a matching threshold. The matching threshold is determined by the 66th percentile of the weighted value distribution within the same 30-second window. Any entry whose weighted value is greater than or equal to this threshold is included in the preliminary probability distribution. If more than one entry exceeds the threshold, its weighted values ​​are summed and normalized to obtain the preliminary probability for each entry. If no entry exceeds the threshold, the top 5 entries are selected and normalized using the same rules to generate low-confidence preliminary probabilities to ensure output stability. Finally, EEG abnormality markers within the same index key range as these entries are read and their distribution adjusted. Each EEG abnormality marker contains three Boolean or binary values: whether the peak position is positively offset from the resting baseline, whether the peak energy is positively offset from the resting baseline, and whether the peak energy is positively offset from the resting baseline. The three indicators—positive increase in baseline information, duration of abnormality not less than 1 second, and other indicators—are returned from a historical EEG signal database and aligned with the time slice and frequency band range of the entries. Distribution adjustment employs a one-time Bayesian update process. First, the frequency of high-risk samples within the most recent 300 seconds is statistically analyzed within the same index key range as the prior probability, and zero counts are smoothed by adding one. Then, the proportions of the above three indicators in the candidate entry set and in non-candidate samples within the same range are statistically analyzed as the strength of evidence in two scenarios. Subsequently, the prior probability is converted into a prior odds in sequence; the ratio of the proportion of candidate scenarios to the proportion of non-candidate scenarios is used as the likelihood ratio and multiplied into the prior odds to obtain the posterior odds; finally, the posterior odds are converted into a probability and combined with the preliminary probability using the arithmetic mean of the two to obtain the final attack risk probability value, thus taking into account both distance-based and historical evidence.

[0039] In the similarity scoring phase, the Euclidean distance distribution within the most recent 30-second window is used to determine the two-level boundaries. The 10th percentile is used as the high similarity boundary, and the 90th percentile as the low similarity boundary. Based on this, the distance between the two boundaries is discretely assigned nine levels of scores: 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, and 0.1. The lower boundary within the boundary is assigned a score of 1, and the upper boundary outside the boundary is assigned a score of 0. The matching tolerance for pattern library index retrieval is fixed at deployment: time slice ±2 seconds, spatial grid radius 2 cm, and frequency band within one adjacent frequency band. These three tolerances remain unchanged during runtime. The three weights of the retrieval accuracy index are fixed at deployment: index hit completeness 0.5, tag consistency ratio 0.3, and tag proximity 0.2, used to generate a single accuracy score and participate in subsequent weighting. The weight fusion ratio is fixed at deployment: similarity score accounts for 0.7 and accuracy score accounts for 0.3. The matching threshold after candidate pattern sorting is determined by the 66th percentile of the weight distribution within the same 30-second window. Any entry greater than or equal to this value enters the preliminary probability distribution. When no entry reaches this threshold, a backup threshold for stable output is activated, and the first 5 descending entries are taken and summed to generate the preliminary probability. The prior statistical window for the distribution adjustment phase is fixed at the most recent 300 seconds to estimate high-risk priors. Zero count processing is fixed by smoothing by adding 1 to the count of each class to avoid zero priors. The EEG abnormality markers used for correction adopt three fixed thresholds, where the peak position must be positively offset relative to the resting baseline, the peak energy must be positively increased relative to the resting baseline, and the abnormal duration threshold is fixed at not less than 1 second. The resting baseline is determined once by the median position and median energy of 60 consecutive seconds of resting data during deployment and remains unchanged during operation.

[0040] S7 includes obtaining a preliminary distribution group from risk probability values, integrating real-time electric field strength using a backtracking fusion data method, determining the fusion sequence by calculating the intensity deviation value (the intensity deviation value is obtained by taking the root of the sum of squared differences between the real-time electric field strength and the corresponding elements in the preliminary distribution group), evaluating the matching results of the fusion sequence to obtain a set of credibility indicators (the matching result evaluation calculates the index value by comparing the similarity of each element in the fusion sequence with a preset matching template; if the credibility index exceeds a preset threshold, a three-dimensional anomaly region coordinate set is generated), extracting mapping relationships from the three-dimensional anomaly region coordinate set to generate parameters, constructing a relationship matrix using a coordinate transformation method (the coordinate transformation method converts the x-axis, y-axis, and z-axis values ​​in the coordinate set into matrix elements), and obtaining anomaly region location maps through linear transformations between elements), constructing elements for the fusion association model based on the anomaly region location maps, integrating risk association update items through matrix overlay (the matrix overlay method adds corresponding elements of the location map matrix and the update item matrix to determine the dynamic risk model framework), obtaining the updated distribution from the dynamic risk model framework, adjusting parameter values ​​through a backtracking verification mechanism (the backtracking verification mechanism compares the differences between the updated distribution and the historical distribution and iteratively corrects them to obtain the dynamic risk association model).

[0041] In this embodiment, the probability values ​​of the risk of attack are first organized into preliminary distribution groups according to channels and time frames, with the time window length fixed at 2 seconds and the sliding step size fixed at 0.5 seconds; Real-time electric field intensity is read channel by channel within each time frame, and subtracted point by point from the probability element of the same channel and time frame in the preliminary distribution group. The difference of all points in each channel is squared, summed, and the square root is taken to obtain the intensity deviation value. The values ​​are arranged in order of channel number to form a fusion sequence. To suppress transient noise, the fusion sequence is subjected to median smoothing and equal-weighted moving average with a length of 5 samples, and the smoothed fusion sequence is output. Then, the matching results are evaluated. The preset matching template used for evaluation is constructed in the high-confidence pre-onset period during the deployment phase and remains unchanged during the operation period. The template construction caliber is to select a continuous 60-second clinically confirmed high-risk segment from historical samples, and generate the benchmark according to the same time window and step size as in this step. The curves are recorded, and the relative morphology between channels is recorded. In this evaluation, the absolute difference between the smoothed fusion sequence and the template is taken point-by-point within the same time window for each channel, and the average is calculated within the channel to form a channel-level difference score. Then, the difference scores of all channels are non-negatively normalized and weighted to obtain a confidence index. The confidence threshold is determined using the 66th percentile of the distribution of similar confidence indices within the most recent 30-second window. When the current confidence index is greater than or equal to this threshold, a three-dimensional anomaly region coordinate set is generated. Each point in the coordinate set contains the channel's spatial location and height or depth value, along with a corresponding confidence score as the point weight. The time index of the point's generation is also recorded for backtracking. After completing the coordinate set, mapping and relationship construction are performed. The calibration transformation method calibrates three parameters at once during the deployment phase and keeps them unchanged during runtime. These three parameters are, in order: translation, scaling factor, and planar rotation angle. The translation is taken from the difference between the geometric center of the electrode array and the reference center of the preset brain region model. The scaling factor is taken from the ratio of the average adjacent distance of the electrode array to the average adjacent distance of the model. The planar rotation angle is taken from the angle between the midline of the forehead and the midline of the model. The values ​​of the first, second, and third axes in the coordinate set are linearly transformed to the model coordinates at once according to the above three parameters and projected onto a regular grid to form a relation matrix. The grid resolution is fixed at 2 mm. Point weights are linearly mapped from zero to one to the strength of matrix elements. The assignment rule is that values ​​within 1 cm of the nearest grid center are assigned full values, and values ​​more than 1 cm but not more than 3 cm away are assigned full values. The distance is linearly reduced to zero to obtain the anomaly area location map. Then, the elements of the fusion correlation model are used to generate a dynamic risk model framework. The elements are limited to two types and both come from data that can be directly obtained in this step. The first type is the probability increment update term of the preliminary distribution group, which is mapped to the same grid in the current time frame and the previous time frame. The second type is the intensity deviation update term after spatial interpolation of the smoothed fusion sequence. The two types of update terms and the location map are added to the corresponding elements on the same grid and normalized according to the number of elements to obtain the dynamic risk model framework. Then, the updated distribution is obtained from the dynamic risk model framework and a backtracking verification mechanism is executed. The historical distribution is cached frame by frame in the most recent 300-second window, and the stability threshold is fixed at 0, which is the median value of the historical distribution at the same grid position.If the absolute difference between the updated distribution and the historical distribution at any grid location exceeds a stability threshold, the two types of parameters are fine-tuned in a fixed order and iteratively verified. The fine-tuning objects are the scaling factor in coordinate transformation and the outer radius of the grid assignment. The scaling factor is adjusted in increments of 1%, with a maximum of 3 consecutive adjustments. The outer radius is adjusted in increments of 1 mm, with a maximum of 3 consecutive adjustments. After each fine-tuning, the relationship matrix and location map are immediately recalculated and re-added with the two types of update items to obtain a new updated distribution. This is then compared with the historical distribution until the difference at all grid locations does not exceed the stability threshold or the maximum number of fine-tuning attempts is reached. Upon termination, the dynamic risk association model is output, and the parameter values ​​are recorded for subsequent traceability.

[0042] The credibility threshold is determined as the 66th percentile based on the credibility index distribution within the most recent 30-second window for the same subject. When the credibility index of the current frame is greater than or equal to this value, it enters the coordinate set of the 3D abnormal region. This threshold is automatically updated with the 30-second sliding window, but the percentile caliber remains unchanged. The spatial adjacency threshold for connectivity expansion is fixed at 2 cm, used to determine whether two points are adjacent within the coordinate set and participate in the generation of connected subsets. This value is written once during the deployment phase and remains unchanged during runtime. The seed point threshold for the coordinate set is fixed at the median credibility within the set. Only points with credibility not lower than this median can be used as expansion starting points to ensure that connectivity expansion starts from a high-credibility region. The relation matrix is ​​assigned... The values ​​adopt a dual-radius threshold: the full-value radius is fixed at 1 cm and the outer radius is fixed at 3 cm. Points with a distance of no more than 1 cm from the center of the grid are assigned the full value. Points with a distance of more than 1 cm but no more than 3 cm are linearly decayed to zero. Points with a distance of more than 3 cm are not assigned a value. The above two radii are determined during deployment and remain unchanged. The stability judgment threshold is fixed at 0.2 times the median value of the historical distribution. It is used to compare the difference between the updated distribution and the historical distribution at the same grid position during backtracking verification. If the difference exceeds this threshold, parameter fine-tuning is triggered. The step size and number thresholds for parameter fine-tuning are fixed as follows: the coordinate transformation scaling factor is adjusted by 1% each time, with a maximum of 3 consecutive adjustments; the outer radius is adjusted by 1 mm each time, with a maximum of 3 consecutive adjustments.

[0043] S8 includes obtaining electric field intensity changes from dynamic risk correlations, integrating real-time data through continuous trend monitoring, and determining the criteria for judging acceleration modes; applying a warning threshold comparison to the criteria for judging acceleration modes, and triggering the generation of a warning signal through probability calculation if the acceleration mode exceeds the threshold. The probability calculation is based on the ratio of the change trend to the threshold difference, resulting in optimized parameters for EEG abnormalities; extracting real-time data integration elements from the optimized parameters for EEG abnormalities, constructing a risk model update matrix using an abnormal region localization method, converting the parameters into coordinate points and calculating the distance between points to generate a matrix, and determining the fusion sequence evaluation index; fusing the risk model update matrix with the fusion sequence evaluation index, obtaining the abnormal region localization coordinates, and obtaining the optimized EEG abnormality early warning system.

[0044] In this implementation, the dynamic risk correlation model output by S7 is first used as input. A fixed time window length of 2 seconds and a sliding step size of 0.5 seconds are used. The electric field intensity change values ​​are read channel by channel and frame by frame and arranged into a sequence in chronological order. Within each time frame, the rate of change for the same channel is calculated. The rate of change is equal to the difference between the current frame value and the previous frame value. Then, the absolute value of the difference between two adjacent rates of change is averaged within the current time window to obtain the acceleration index. To suppress instantaneous noise, a median smoothing with a length of 5 is first applied, followed by an equal-weighted moving average with a length of 5 to obtain a smoothed acceleration index. The warning threshold is determined using the 66th percentile of the smooth acceleration index distribution within the most recent 30-second window for the same subject, and is updated as the window scrolls, but the percentile caliber remains unchanged. If the smooth acceleration index of a channel is not less than the threshold for three consecutive time frames, the channel is judged to be in acceleration mode and enters probability calculation. The difference ratio in the probability calculation is equal to the ratio of the difference between the smooth acceleration index and the warning threshold divided by the warning threshold. A value less than 0 is truncated to 0, and a value greater than 1 is truncated to 1. Then, the dynamic risk value of the channel in the same time frame is linearly mapped from zero to one to a standardized risk value, and finally... The probability difference ratio and the standardized risk value are calculated as an arithmetic mean. The trigger threshold is determined by the 66th percentile of the final attack probability distribution within the most recent 30-second window for the same subject and is updated on a rolling basis. When the final attack probability is not less than the threshold, an early warning signal is generated and the EEG abnormality optimization parameters are output. The EEG abnormality optimization parameters include three terms with fixed calibers: the first term is the temporal consistency weight, which is equal to the average of the smoothing acceleration index of the channel in the most recent three time frames, linearly mapped from zero to one; the second term is the spatial consistency weight, which is equal to the average of the final attack probability of the channel and the channels within a 2-cm radius, linearly mapped from zero to one; and the third term is the amplitude enhancement factor, which is equal to the positive difference between the current smoothing acceleration index and the early warning threshold, linearly mapped from zero to one. Real-time data integration elements are generated from the above three terms, and a risk model update matrix is ​​constructed. The construction steps are as follows: the geometric coordinates of each channel in the current time frame are converted into coordinate points. The planar position of the point is taken from the electrode geometry, and the height or depth is taken from the third axis value of the brain region model. The point weight is the temporal consistency weight, spatial consistency weight, and amplitude enhancement factor in a ratio of 0.4, 0.4, and 0.The weighted sum of 2; calculating the distance between any two points using all coordinate points as nodes and generating an update matrix based on the distance, assigning full values ​​to the corresponding positions for distances less than 1 cm, linearly decreasing to zero for distances greater than 1 cm but not exceeding 3 cm, and assigning zero values ​​for distances exceeding 3 cm; simultaneously, adding the anomaly area location map obtained in S7 element-wise to the update matrix on the same grid and normalizing it according to the number of matrices involved in the addition to obtain the risk model update matrix; then calculating the fusion sequence evaluation index to determine whether to output the location coordinates, the evaluation index is fixed at 3 items and combined with equal weights, the first item is the coverage ratio equal to the proportion of non-zero elements in the update matrix to all elements, the second item is the concentration equal to the update The first term is the result of a zero-to-one inverse mapping of the distance from the centroid of each non-zero element of the matrix to the geometric center of the matrix. The second term is the consistency result, which is the sum of the absolute differences of each element of the updated matrix and the anomaly region localization map, mapped from zero to one. The arithmetic mean of these three terms is taken to obtain the fusion score. The entry threshold is determined by the 66th percentile of the fusion score distribution within the most recent 30-second window for the same subject and is updated on a rolling basis. If the current fusion score is not less than the threshold, the largest connected component with a value greater than zero in the updated matrix is ​​searched according to the four-way adjacency principle, and its value-weighted centroid is taken as the anomaly region localization coordinate output. Otherwise, the localization coordinates of the previous time frame are retained and marked as low-confidence updates.

[0045] The warning threshold for acceleration mode is determined by the 66th percentile of the smooth acceleration index distribution within the most recent 30-second window for the same subject. Entry into acceleration mode is determined when the smooth acceleration index of a channel is not lower than this threshold for three consecutive time frames. The warning trigger threshold is determined by the 66th percentile of the final attack probability distribution within the same 30-second window. A warning signal is triggered when the current final attack probability is greater than or equal to this value. The spatial consistency statistical radius of the EEG abnormality optimization parameters is fixed at 2 cm during deployment and remains unchanged during operation, used to calculate the average probability of the channel and its neighborhood. The distance assignment of the risk model update matrix uses a dual-radius threshold, which is fixed once during deployment. The full-value radius is 1 cm and the outer radius is 3 cm. Any two points with a distance of no more than 1 cm are assigned the full value. Points with a distance greater than 1 cm but not more than 3 cm are assigned the full value, which decreases linearly to zero. Points with a distance greater than 3 cm are assigned the zero value. The fusion evaluation entry threshold is determined by the 66th percentile of the fusion score distribution within the same 30-second window. The current fusion score must be no less than this value to enter the positioning output. The connectivity determination threshold adopts a fixed caliber of four-way adjacency and matrix value greater than zero to ensure consistent judgment of spatial connectivity. The combination ratio of temporal consistency weight, spatial consistency weight and amplitude enhancement factor is fixed at 0.4, 0.4 and 0.2 during deployment and is not used as a discrimination threshold in sliding updates.

[0046] During the startup phase, input electrode spatial coordinates and channel number mapping, 60 seconds of continuous resting EEG data, sampling rate, brain region spatial alignment parameters (reference center, average adjacent spacing, midline direction), and historical database retrieval index; output risk level identifier (1, 2, or 3), seizure risk probability (0 to 1), abnormal region localization results (central 3D coordinates and boundary point set), whether an alert is triggered (yes or no), and simultaneously return a lightweight state cache for the next window calculation (containing necessary statistics for the most recent 30 seconds and 300 seconds, coordinate transformation parameters, and grid intensity of the previous localization map).

[0047] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for epilepsy early warning based on electroencephalogram (EEG) signal analysis, characterized in that, include: S1. Collect EEG signals through a multi-channel electrode array, obtain electric field intensity data from different brain regions, and perform digital conversion on the quantization of spectral amplitude differences and phase offset angle measurement to obtain a time-frequency domain feature matrix. S2. Based on the time-frequency domain feature matrix, the spatial coordinates of the abnormal area are extracted using the frequency band energy distribution comparison method. If the correlation coefficient of the time-domain waveform is lower than the preset threshold, it is judged as a potential abnormal area, and the abnormal area location result is obtained. S3. Obtain the abnormal area location results, calculate the electric field intensity gradient change rate based on the spectral density function matching degree, determine the change rate quantization index through frequency response curve fitting, and obtain the gradient change feature vector. S4. By using the gradient change feature vector, the signal envelope shape comparison method is used to perform feature normalization processing. The risk level classification is determined based on the frequency domain peak position deviation, and the risk level identification code is obtained. S5. Based on the risk level identification code, retrieve similar patterns from the historical EEG signal database through a threshold boundary dynamic adjustment mechanism, calculate the similarity score using pattern matching confidence interval, and obtain a set of candidate matching patterns. S6. Obtain the candidate matching pattern set, filter the matching accuracy weight allocation results through feature vector similarity scoring and pattern library index retrieval mechanism. If the candidate pattern ranking algorithm output exceeds the matching threshold, the attack risk probability value is obtained. S7. By using the probability value of the risk of onset, a pattern verification backtracking mechanism is used to fuse real-time electric field intensity data. Based on the credibility assessment of the matching results, a three-dimensional abnormal region mapping relationship is generated to obtain a dynamic risk association model. S8. Obtain the dynamic risk association model, continuously monitor and analyze the trend of electric field intensity change. If the trend shows an acceleration mode and exceeds the warning threshold, trigger the warning signal output through probability calculation to obtain the optimized EEG abnormality warning system.

2. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S1 includes: EEG signals were acquired using a multi-channel electrode array, and electric field intensity data were obtained from different brain regions to obtain the original electric field intensity sequence. For the original electric field intensity sequence, the spectral amplitude difference is quantized, and the difference is calculated by subtracting the reference spectral amplitude to obtain the amplitude difference sequence; Based on the amplitude difference sequence, the phase offset angle is measured, and the offset angle sequence is determined by obtaining the angle difference through the arctangent function; The offset angle sequence and amplitude difference sequence are processed by digital conversion, and the sequence elements are mapped to a matrix grid to construct a time-frequency domain feature matrix; Brain inter-region synchronization indices are extracted from the time-frequency domain feature matrix, and the distribution of neural connectivity strength is obtained by calculating the inter-row cross-correlation function of the matrix.

3. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S2 includes: Frequency band energy distribution data are obtained from the time-frequency domain feature matrix. The energy difference value is calculated by subtracting the reference energy value using a comparison method to obtain the preliminary coordinates of the abnormal area. For the preliminary coordinates of the abnormal region, the correlation coefficient of the time-domain waveform is calculated. If the correlation coefficient is lower than the preset threshold, it is judged as a potential abnormal brain region, and the boundary sequence of the abnormal region is determined. By mapping the boundary sequence of abnormal regions to a pre-defined brain region spatial model, and using coordinate transformation to fuse energy distribution data, a precise localization coordinate set is obtained; The brain region connectivity strength index is extracted based on the precise location coordinate set, and the coordinate deviation is adjusted by the offset angle correction method to obtain the abnormal region location result.

4. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S3 includes: Electric field intensity data is obtained from the matching degree of the spectral density function. The gradient change rate is calculated for the electric field intensity data. The difference ratio between intensity values ​​is obtained through difference operation to obtain the change rate sequence. By fitting the frequency response curve with the rate of change sequence, and using the least squares method to match the curve parameters, the quantitative index of the rate of change is determined, and a set of quantitative indexes is obtained. Gradient change feature vectors are extracted from the set of quantitative indicators, and the preliminary boundary of the abnormal region obtained from the time-frequency domain feature matrix is ​​fused to obtain the boundary adjustment vector; The boundary adjustment vector is mapped to the preset brain region model, the connection strength offset is calculated, and the fusion offset value is corrected by the angle deviation to obtain the offset correction coordinates; By integrating the energy distribution differences obtained from the frequency band energy distribution data through offset correction coordinates, potential abnormal brain regions are identified, and the abnormal region localization results are obtained.

5. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S4 includes: The signal envelope data is obtained from the gradient change vector. The Hilbert transform is used to calculate the envelope amplitude of the signal envelope data. The shape curve is generated by smoothing the amplitude sequence to obtain the shape curve sequence. By comparing the shape curve sequences, the frequency domain peak positions are fused to calculate the ratio of the differences between positions, determine the deviation value, and obtain the deviation value set; Quantitative indicators are extracted from the deviation value set, and the set is divided into three levels (low, medium, and high) using a preset threshold range to obtain the level classification results. Based on the classification results, the classification code values ​​are integrated, and the abnormal signal features obtained from the frequency domain peak position are fused to determine the potential risk area and obtain the risk level identification code.

6. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S5 includes: Using risk level identification codes, an initial similar pattern group is obtained from a historical EEG signal database. A threshold boundary dynamic adjustment mechanism is used to expand the boundary range of the initial similar pattern group. The threshold boundary dynamic adjustment mechanism dynamically expands the range according to the change of the threshold boundary value of the identification code, thus obtaining an expanded pattern group. Pattern feature vectors are extracted from the extended pattern group, and confidence intervals are calculated using the pattern matching method. The pattern matching method calculates intervals by comparing the distances between vectors, and the confidence intervals are fused to determine the similarity score, thus obtaining a score sequence. The scoring sequence is sorted, high-scoring patterns are filtered based on the sorting results, and abnormal EEG fluctuation features obtained from historical EEG signal database are integrated to determine the potential matching degree and obtain preliminary matching patterns. The temporal relevance index is obtained from the initial matching pattern. The matching weight is adjusted based on the temporal relevance index. The final similarity is calculated by weight fusion to obtain the optimized matching pattern. To optimize the matching pattern integration, frequency domain anomaly identifiers obtained from frequency domain peak positions are integrated. A set construction method is used to generate a candidate matching pattern set. The set construction method constructs a set by integrating the identifiers. The risk similarity pattern distribution is determined by fusing the candidate matching pattern sets to obtain the candidate matching pattern set.

7. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S6 includes: Feature vector groups are obtained from the candidate matching pattern set. The similarity scoring method is used to determine the degree of similarity by calculating the Euclidean distance between the vectors. The Euclidean distance is obtained by taking the square root of the sum of the squares of the differences in each dimension, and a scoring sequence is obtained. For the scoring sequence, matching items are extracted through a pattern library index retrieval mechanism. The pattern library index retrieval mechanism matches similar items according to a preset index key, and the retrieval results are combined to determine the accuracy index. Weight values ​​are assigned to accuracy indicators, and the indicator values ​​are integrated by weighted average calculation to obtain a weight allocation sequence. The candidate pattern sorting algorithm is applied to the weight allocation sequence. The candidate pattern sorting algorithm uses quicksort to sort the sequence values ​​in descending order. If the sorting output exceeds the matching threshold, the preliminary probability distribution is determined. The abnormal EEG markers are integrated from the initial probability distribution. These markers are obtained from a historical EEG signal database. The distribution probability values ​​are updated using a distribution adjustment method and Bayesian formula to obtain the probability value of the attack risk.

8. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S7 includes: A preliminary distribution group is obtained from the risk probability value. The real-time electric field intensity is integrated using a backtracking fusion data method. The fusion sequence is determined by calculating the intensity deviation value, which is obtained by taking the root of the sum of squares of the differences between the real-time electric field intensity and the corresponding elements in the preliminary distribution group. For the evaluation of matching results of the fused sequence, a set of credibility indicators is obtained. The evaluation of matching results is calculated by comparing the similarity between each element in the fused sequence and the preset matching template. If the credibility index exceeds the preset threshold, a set of coordinates of three-dimensional abnormal regions is generated. The mapping relationship is extracted from the coordinate set of the three-dimensional anomaly area to generate parameters. The relationship matrix is ​​constructed by the coordinate transformation method. The coordinate transformation method converts the x-axis, y-axis and z-axis values ​​in the coordinate set into matrix elements. The anomaly area location map is obtained through linear transformation between elements. For the elements of the abnormal area location map fusion association model construction, risk association update items are integrated by matrix overlay. The matrix overlay method adds corresponding elements of the location map matrix and the update item matrix to determine the dynamic risk model framework. The updated distribution is obtained from the dynamic risk model framework. The parameter values ​​are adjusted through a backtracking verification mechanism. The backtracking verification mechanism compares the differences between the updated distribution and the historical distribution and iteratively corrects them to obtain the dynamic risk association model.

9. The epilepsy early warning method based on electroencephalogram (EEG) signal analysis according to claim 1, characterized in that: S8 includes: Changes in electric field intensity are obtained from dynamic risk correlations, and real-time data is integrated through continuous monitoring of trends to determine the criteria for acceleration mode judgment; The acceleration mode is judged based on the application of warning threshold comparison. If the acceleration mode exceeds the threshold, a warning signal is triggered by probability calculation. The probability calculation is based on the ratio of the change trend to the threshold difference, and the optimized parameters of EEG abnormality are obtained.

10. The method for epilepsy early warning based on electroencephalogram (EEG) signal analysis according to claim 9, characterized in that: S8 further includes: Real-time data integration elements are extracted from the abnormal EEG parameters. An abnormal region localization method is used to construct a risk model update matrix. The abnormal region localization method converts the parameters into coordinate points and calculates the distance between points to generate a matrix, thereby determining the evaluation index of the fusion sequence. By updating the fusion risk model matrix based on the fusion sequence evaluation index, the coordinates of abnormal regions are obtained, resulting in an optimized EEG abnormality early warning system.