A brain consciousness recognition method, system, electronic device and storage medium
By combining temporal and spatial feature extraction with multi-level interactive fusion, the problem of capturing temporal dynamic information in EEG signal recognition of consciousness disorders was solved, and high-precision assessment of brain consciousness level was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU RAINJET MEDICAL EQUIP CO LTD
- Filing Date
- 2026-04-23
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies struggle to effectively capture the temporal dynamics of EEG signals in disorders of consciousness, facing challenges such as strong signal non-stationarity, significant inter-individual variability, and difficulty in extracting key discriminative features, resulting in low classification accuracy.
A method combining temporal and spatial feature extraction with multi-level interactive fusion is adopted. EEG signals are processed through a hierarchical fusion network, and post-processing technology of target mismatch negative wave trough is combined to generate brain consciousness recognition results.
It significantly improves the accuracy and reliability of brain consciousness level classification, overcomes the problem of insufficient joint modeling ability of single models in temporal dynamics and spatial distribution, and enhances the clinical objectivity of the assessment system.
Smart Images

Figure CN122432769A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of EEG data processing, and more particularly to a method, system, electronic device, and storage medium for recognizing brain consciousness. Background Technology
[0002] Brain consciousness level refers to an individual's comprehensive ability to perceive, cognize, and react to their own state and surrounding environment, encompassing a continuous spectrum from fully awake to deep coma. In clinical practice, accurate assessment of consciousness level is crucial in various scenarios: for critically ill patients, dynamic changes in consciousness level are a core indicator for judging disease progression; for patients with impaired consciousness, precise stratification of consciousness directly relates to treatment selection, prognosis, and the rational allocation of medical resources; even in the general population, fluctuations in consciousness level are closely related to factors such as fatigue levels, depth of anesthesia, and drug effects. Therefore, establishing objective and accurate methods for assessing brain consciousness level is an important research direction in neuroscience, clinical medicine, and biomedical engineering.
[0003] Due to challenges such as strong signal non-stationarity, large inter-individual differences, and difficulty in extracting key discriminative features in the identification of EEG signals in disorders of consciousness, existing methods are unable to fully capture temporal dynamic information. Summary of the Invention
[0004] This application provides a method, system, electronic device, and storage medium for recognizing brain consciousness, in order to solve the problems existing in related technologies. The technical solution is as follows: In a first aspect, embodiments of this application provide a method for recognizing brain consciousness, including: The EEG signal feature matrix of the subject to be tested is obtained. The EEG signal feature matrix includes the original EEG signal of the subject to be tested and the frequency features of multiple physiological frequency bands. Temporal features are extracted from the EEG signal feature matrix to obtain a temporal feature sequence, which is used to characterize the global temporal dependency of the EEG signal feature matrix. Spatial dimension features are extracted from the EEG signal feature matrix to obtain a spatial feature sequence, which is used to characterize the spatial distribution pattern of the EEG signal feature matrix in different channels. The temporal and spatial feature sequences are input into a pre-defined hierarchical fusion network. The temporal and spatial features are interactively fused through a multi-level attention mechanism to obtain a joint spatiotemporal feature representation. Based on joint spatiotemporal feature representation, the initial brain consciousness level category of the test subject is determined; Within a preset time window, the preset voltage amplitude range corresponding to the initial brain consciousness level category is extracted to obtain the minimum point and the minimum point is determined as the target mismatch negative wave trough; Based on the initial brain consciousness level category and the negative wave trough of target mismatch, the brain consciousness recognition results of the test subject are generated.
[0005] Secondly, embodiments of this application provide a brain consciousness recognition system, including: The first acquisition module is used to acquire the EEG signal feature matrix of the test subject. The EEG signal feature matrix includes the original EEG signal of the test subject and the frequency features of multiple physiological frequency bands. The first module is used to extract time dimension features from the EEG signal feature matrix to obtain a time feature sequence, which is used to characterize the global time dependency of the EEG signal feature matrix. The second module is used to extract spatial dimension features from the EEG signal feature matrix to obtain a spatial feature sequence. The spatial feature sequence is used to characterize the spatial distribution pattern of the EEG signal feature matrix in different channels. The third module is used to input the temporal feature sequence and the spatial feature sequence into a preset hierarchical fusion network, and to perform interactive fusion of the temporal and spatial features through a multi-level attention mechanism to obtain a joint spatiotemporal feature representation. The first determining module is used to determine the initial brain consciousness level category of the test subject based on the joint spatiotemporal feature representation; The fourth module is used to extract the preset voltage amplitude range corresponding to the initial brain consciousness level category within a preset time window, obtain the minimum point, and determine the minimum point as the target mismatch negative wave trough. The first generation module is used to generate the brain consciousness recognition results of the test subject based on the initial brain consciousness level category and the target mismatch negative wave trough.
[0006] Thirdly, embodiments of this application provide an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described brain consciousness recognition method.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium that stores computer instructions, wherein when the computer instructions are executed on a computer, the methods in any of the above-described embodiments are performed.
[0008] The advantages or beneficial effects of the above technical solutions include at least the following: In this embodiment, the brain consciousness recognition method employs temporal and spatial feature extraction, as well as multi-level interactive fusion techniques. This overcomes the technical problem of low classification accuracy caused by the insufficient ability of a single model to jointly model the temporal dynamics and spatial distribution of EEG signals, thus achieving the technical effect of fully mining spatiotemporal complementary information and significantly improving the accuracy and reliability of brain consciousness level classification. Simultaneously, it employs a technique of finding target mismatch negative wave troughs within a preset amplitude range based on the classification category for post-processing. This overcomes the problem of a lack of waveform feature support in a single classification result, achieving the technical effect of verifying with physiological electrical waveforms and improving the clinical objectivity of the assessment system. It effectively solves the problem that existing methods struggle to fully capture temporal dynamic information due to challenges such as strong signal non-stationarity, large inter-individual differences, and difficulty in extracting key discriminant features in EEG signal recognition of consciousness disorders.
[0009] The above overview is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of this application will become readily apparent from the accompanying drawings and the following detailed description. Attached Figure Description
[0010] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the various drawings denote the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings depict only some embodiments disclosed in this application and should not be construed as limiting the scope of this application.
[0011] Figure 1 This is a schematic diagram of a brain consciousness recognition method according to an embodiment of this application; Figure 2 This is a block diagram of an electronic device according to an embodiment of this application.
[0012] Figure 3 This is a schematic diagram of a brain consciousness recognition model according to an embodiment of the brain consciousness recognition method of this application.
[0013] Figure 4 This is a schematic diagram of the time encoding module of a brain consciousness recognition model according to an embodiment of the present application.
[0014] Figure 5 This is a schematic diagram of the residual block of a brain consciousness recognition model according to an embodiment of the present application.
[0015] Figure 6 This is a schematic diagram of the spatial attention mechanism of a brain consciousness recognition model according to an embodiment of the present application.
[0016] Figure 7 This is a schematic diagram of the top-level fusion layer of a brain consciousness recognition model according to an embodiment of the present application.
[0017] Figure 8 This is a schematic diagram of the intermediate fusion layer of the brain consciousness recognition model according to an embodiment of the present application.
[0018] Figure 9 This is a schematic diagram of the bottom fusion layer of a brain consciousness recognition model according to an embodiment of the present application. Detailed Implementation
[0019] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.
[0020] like Figure 1 As shown, in a first aspect, embodiments of this application provide a method for recognizing brain consciousness, including: S110: Obtain the EEG signal feature matrix of the subject under test. The EEG signal feature matrix includes the raw EEG signal of the subject under test and the frequency features of multiple physiological frequency bands. S120: Extract time dimension features from the EEG signal feature matrix to obtain a time feature sequence, which is used to characterize the global time dependency of the EEG signal feature matrix. S130: Spatial dimension features are extracted from the EEG signal feature matrix to obtain a spatial feature sequence. The spatial feature sequence is used to characterize the spatial distribution pattern of the EEG signal feature matrix in different channels. S140: Input the temporal feature sequence and spatial feature sequence into the preset hierarchical fusion network, and use a multi-level attention mechanism to interactively fuse the temporal and spatial features to obtain a joint spatiotemporal feature representation; S150: Based on joint spatiotemporal feature representation, determine the initial brain consciousness level category of the test subject; S160: Extract the preset voltage amplitude range corresponding to the initial brain consciousness level category within the preset time window, obtain the minimum point, and determine the minimum point as the target mismatch negative wave trough; S170: Based on the initial brain consciousness level category and the target mismatch negative wave trough, generate the brain consciousness recognition result of the test subject.
[0021] In this embodiment, the brain consciousness recognition method employs temporal and spatial feature extraction, as well as multi-level interactive fusion techniques. This overcomes the technical problem of low classification accuracy caused by the insufficient ability of a single model to jointly model the temporal dynamics and spatial distribution of EEG signals, thus achieving the technical effect of fully mining spatiotemporal complementary information and significantly improving the accuracy and reliability of brain consciousness level classification. Simultaneously, it employs a technique of finding target mismatch negative wave troughs within a preset amplitude range based on the classification category for post-processing. This overcomes the problem of a lack of waveform feature support in a single classification result, achieving the technical effect of verifying with physiological electrical waveforms and improving the clinical objectivity of the assessment system. It effectively solves the problem that existing methods struggle to fully capture temporal dynamic information due to challenges such as strong signal non-stationarity, large inter-individual differences, and difficulty in extracting key discriminant features in EEG signal recognition of consciousness disorders.
[0022] Brain consciousness recognition model such as Figure 3 As shown, the model mainly consists of a temporal feature extraction branch, a spatial feature extraction branch, and a hierarchical fusion module. Through parallel extraction and deep fusion across multiple branches, the classification module ultimately outputs the consciousness level category. The proposed model is named Spatio-Temporal Fusion Network (STF-Net), and its core is a dedicated spatio-temporal representation learning and fusion mechanism designed for EEG signals. The temporal feature extraction branch employs a temporal encoder module, capturing long-range dependencies in EEG sequences through a self-attention mechanism to enhance temporal context modeling capabilities. The spatial feature extraction branch includes improved residual blocks and a spatial attention mechanism, with multi-scale convolutional layers added to the residual blocks. These multi-scale convolutional layers utilize kernels of different sizes to extract multi-granularity spatial features. Residual connections deepen the network to learn higher-order representations, and the spatial attention mechanism strengthens key information from both spatial and channel dimensions, improving the discriminative power of spatial features. To effectively integrate features from temporal and spatial branches, a hierarchical fusion module was designed. This module includes a three-layer attention mechanism (top-level cross-attention, middle-level cross-attention, and bottom-level self-attention). Through layer-by-layer interaction and fusion, a joint representation that combines temporal dynamics and spatial structure is obtained. Finally, a classification module performs dimensionality reduction and classification on the fused features using a multi-layer fully connected network. The entire network is trained end-to-end, resulting in a compact and efficient structure that enables accurate assessment of consciousness levels with limited computational resources.
[0023] In step S110, the EEG signal feature matrix of the subject to be tested is obtained. The EEG signal feature matrix includes the original EEG signal of the subject to be tested and the frequency features of multiple physiological frequency bands. In this embodiment, the frequency characteristics of multiple physiological frequency bands are obtained by dividing the original EEG signal into six physiological frequency bands with different frequency ranges; calculating the relative power characteristics and differential entropy characteristics of each physiological frequency band, and using the relative power characteristics and differential entropy characteristics as the frequency characteristics of the physiological frequency band.
[0024] The process of obtaining the EEG signal feature matrix of the subject to be tested involves: concatenating the original EEG signal, the relative power features of six physiological frequency bands, and the differential entropy features of six physiological frequency bands to construct an EEG signal feature matrix with thirteen data channels.
[0025] Specifically, the electronic device acquires the raw electroencephalogram (EEG) signal of the subject through an EEG acquisition device. To eliminate environmental noise and physiological artifacts (such as interference from electrooculography and electromyography), the electronic device pre-processes the raw EEG signal with band-pass filtering and independent component analysis (ICA) denoising. For all experiments, the training and test sets are divided at the individual (patient) level; that is, a particular individual's data is assigned to either the training or test set and will not appear in both sets simultaneously. This design avoids data leakage that could affect the reliability of the results. Subsequently, the electronic device divides the denoised raw EEG signal into six different frequency bands according to clinical EEG physiology standards. Specifically, the six physiological frequency bands include: (1) Delta Band: The frequency range is from 0.5 Hz to 4 Hz; (2) Theta Band: The frequency range is 4 Hz to 8 Hz; (3) Alpha Band: The frequency range is 8 Hz to 13 Hz; (4) Sigma / Spindle Band: Frequency range from 13 Hz to 16 Hz; (5) Beta Band: The frequency range is from 16 Hz to 30 Hz; (6) Gamma Band: The frequency range is from 30 Hz to 45 Hz.
[0026] The brain's electrophysiological activity typically corresponds to different states of consciousness or pathology within different frequency ranges. By decomposing the broadband raw EEG signal into six independent physiological frequency bands with specific frequency ranges, electronic devices can achieve multi-scale analysis of EEG signals, thereby breaking down the superimposed EEG signals into mutually independent frequency components.
[0027] The relative power and differential entropy characteristics of each frequency band were calculated, resulting in 12 features. These features were then combined with the original signal features to form a 13-channel feature matrix with a scale of (13, 512). All data were not normalized to preserve the original distribution characteristics.
[0028] During training, the optimizer AdamW was used with an initial learning rate of 5e-4, weight decay of 1e-4, and cosine annealing. The loss function was adaptive Focal Loss, where gamma = 2.0, and alpha was dynamically calculated based on the training set classes (log-weighted to alleviate class imbalance and make the model focus more on the minority class). The training batch size was set to 16, with a total of 150 epochs, and an early stopping strategy (patience = 30) was employed to prevent overfitting. No data augmentation was used during training. During the validation phase, the best-loaded model weights were used for re-prediction, and accuracy was calculated. All experiments were run in the same environment: NVIDIA 4060 GPU hardware and Python 3.8 + PyTorch 2.1.0 + CUDA 12.0 software.
[0029] The electronic device calculates the relative power (RP) feature for each physiological frequency band. The relative power feature characterizes the proportion of signal power (i.e., energy) contained within a specific physiological frequency band in the total power of all six physiological frequency bands. In practice, the electronic device first calculates the absolute power of each individual physiological frequency band, then calculates the sum of the absolute powers of all six physiological frequency bands (i.e., the total power), and finally divides the absolute power of a single physiological frequency band by the total power to obtain the relative power feature corresponding to that frequency band. In real clinical settings, due to physiological differences such as scalp impedance and skull thickness, different subjects exhibit significant individual baseline differences in the absolute amplitude and absolute energy of their EEG signals. By calculating and using relative power features instead of absolute power, the subsequent network model can effectively shield against interference from individual baseline physiological differences, accurately identifying the subject's level of consciousness purely based on the changing trends of energy distribution ratios between different frequency bands.
[0030] The electronic device further calculates the differential entropy (DE) feature for each physiological frequency band. Differential entropy is a measure of the complexity and randomness of information in a continuous signal sequence. In this step, the electronic device generates a value that quantifies the degree of chaos within the continuous EEG signal sequence by statistically analyzing the data dispersion (e.g., calculating variance) within each specific physiological frequency band; this value is the differential entropy feature. While relative power features primarily characterize the macroscopic energy distribution profile, cerebral cortical activity possesses extremely strong nonlinear dynamic properties. In certain microconscious states, the energy changes in EEG signals may be extremely subtle, but their inherent randomness and complexity can change significantly. By calculating the differential entropy feature, the electronic device achieves a high degree of condensation of high-frequency, complex, and nonlinear microscopic dynamic information in EEG signals, effectively filling the blind spots of purely linear feature extraction.
[0031] After successfully acquiring the above multi-dimensional data, the electronic device performs a channel concatenation operation. Specifically, for the EEG signal of the subject to be tested, the electronic device extracts and corresponds to the following three sets of data: (1) the original EEG signal with one data dimension; (2) the relative power features with a total of six data dimensions calculated based on six physiological frequency bands; and (3) the differential entropy features with a total of six data dimensions calculated based on six physiological frequency bands.
[0032] Subsequently, the electronic device performs a splicing and merging operation on the feature depth dimension of these three types of features. That is, it stacks the 1-dimensional original signal, the 6-dimensional relative power feature, and the 6-dimensional differential entropy feature (1+6+6=13) to finally construct an EEG signal feature matrix with thirteen data channels.
[0033] In this embodiment, the electronic device systematically transforms the originally single-dimensional time-domain EEG waveform into a high-dimensional composite feature tensor that takes into account the original time-domain information, frequency-domain energy ratio information (relative power), and nonlinear chaotic dynamic information (differential entropy). This matrix design with thirteen data channels completely eliminates the technical problems of underfitting models and low accuracy in recognizing complex states caused by the single dimension of input features in deep learning.
[0034] In step S120, time dimension features are extracted from the EEG signal feature matrix to obtain a time feature sequence, which is used to characterize the global time dependency of the EEG signal feature matrix.
[0035] In this embodiment, the EEG signal feature matrix is structurally composed of multiple consecutive time steps, and each time step contains the multi-channel EEG features of the subject at that specific moment (i.e., raw signal, relative power, and differential entropy features). The electronic device analyzes the EEG signal feature matrix along the time axis, treating it as a time series composed of multiple feature vectors arranged in chronological order. The electronic device uses this EEG signal feature matrix as the underlying input data and determines the time dimension of the matrix as the main direction for feature extraction, while not changing the depth dimension information of the features in this step.
[0036] The electronic device performs correlation calculations across time steps. To capture the evolution of EEG signals over long time spans, it does not process the features of a single time step in isolation. Instead, it calculates the intrinsic correlation between any two time steps in the sequence using the temporal feature network of the brain consciousness recognition model. Specifically, for any target time step in the sequence, the electronic device extracts its feature vector through the temporal feature network of the brain consciousness recognition model and performs similarity matching or correlation calculations with the feature vectors of all other time steps in the sequence (including historical moments before the target time step and future moments after it). Through this traversal calculation process, the electronic device obtains the correlation weights (AttentionWeights / Correlation Weights) between the target time step and all other time steps within the entire time observation window.
[0037] Feature aggregation is performed based on association weights. After calculating the aforementioned association weights, the electronic device uses these weights to perform weighted aggregation on the original features of all time steps in the sequence. Specifically, features from other time steps that are highly correlated with the target time step and exhibit similar brainwave activity rhythms will be assigned larger weight values in the aggregation calculation; conversely, features that are less correlated will be assigned smaller weight values. Through this global weighted fusion mechanism, the electronic device injects contextual information from the entire time window into the target time step, thereby updating and generating a new feature representation for the target time step.
[0038] Finally, a temporal feature sequence is generated and global dependencies are established. The electronic device performs the above correlation calculation and feature aggregation operations in parallel or serially for each time step in the EEG signal feature matrix. Subsequently, the electronic device recombines all the aggregated and updated feature vectors according to their original chronological order, and finally outputs the temporal feature sequence.
[0039] Through the rigorous data processing described above, each data node in the generated temporal feature sequence no longer represents merely local EEG information at a single moment, but rather deeply integrates the dynamic changes from all other moments within the entire observation window. Therefore, the temporal feature sequence accurately characterizes the global temporal dependency of the EEG signal feature matrix. This processing method enables electronic devices to overcome transient noise and local abrupt changes in EEG signals, precisely extracting the long-term gradual changes and global evolutionary trends of the brain's state of consciousness along the time axis, providing an indispensable temporal dimension data foundation for subsequent high-precision classification of consciousness levels.
[0040] In step S130, spatial dimension features are extracted from the EEG signal feature matrix to obtain a spatial feature sequence. The spatial feature sequence is used to characterize the spatial distribution pattern of the EEG signal feature matrix in different channels.
[0041] In this embodiment, the EEG signal feature matrix is acquired based on multiple sensor electrodes distributed at different physical locations on the subject's head. Different channels refer to physical channels representing different spatial anatomical regions of the brain (such as the left frontal lobe, right parietal lobe, occipital lobe, etc.). The electronic device uses the EEG signal feature matrix as input and focuses its processing on the spatial dimension of the matrix, treating each physical channel as an independent spatial node, thus forming the basis of the spatial topological network of the cerebral cortex.
[0042] After identifying the spatial nodes, the electronic device uses a pre-defined spatial feature extraction algorithm to perform cross-channel correlation calculations along the aforementioned spatial dimensions. Conscious activity in the brain often requires the coordinated work of multiple brain regions. Therefore, the electronic device does not analyze the local features of a single electrode in isolation, but rather calculates the intrinsic connections between different spatial nodes. Specifically, at a given time point or within a time window, the electronic device extracts the feature vector corresponding to a target physical channel through the spatial feature network of the brain's consciousness recognition model, and performs similarity matching, covariance calculation, or spatial attention weights calculation with the feature vectors of all other physical channels. Through this traversal calculation process, the electronic device quantifies the degree of coordination and interaction between different brain regions in terms of electrophysiological energy and complexity characteristics.
[0043] After calculating the cross-channel correlation weights, the electronic device uses these weights to perform weighted aggregation and spatial filtering on the original features of each physical channel. Specifically, it enhances and fuses features from channels with high co-correlation, while suppressing features from channels with irrelevant noise or artifacts. The electronic device then reassembles the multi-channel features after the spatial fusion operation, ultimately outputting a spatial feature sequence.
[0044] This spatial feature sequence is specifically configured to characterize the spatial distribution pattern of the EEG signal feature matrix across different channels. Spatial distribution patterns are the specific activation or inhibition states of brain regions in the brain network at particular levels of consciousness (e.g., wakefulness versus coma). (For example, the functional connectivity between the frontal and parietal lobes is significantly reduced in a certain state of consciousness.) Electronic devices extracting this spatial distribution pattern essentially capture the functional connectivity and topological network features between multiple brain regions.
[0045] The electronic device performs deep decoding and spatial aggregation of EEG data isolated on various physical electrodes, generating a highly condensed spatial feature sequence. This overcomes the technical limitations of traditional EEG analysis methods that rely solely on single-channel analysis, thus failing to capture abnormalities in the coordination of the entire brain network. By capturing spatial distribution patterns across different channels, the system can accurately identify deep-seated pathological features such as cross-brain region communication disruptions caused by brain injury. Simultaneously, the spatial feature sequence output from this step is converged with the temporal feature sequence obtained in the preceding step in subsequent processing modules. Together, they provide complete and lossless data support for multi-dimensional deep fusion networks from two orthogonal dimensions: temporal evolution patterns and spatial network topology.
[0046] In step S140, the temporal feature sequence and the spatial feature sequence are input into a preset hierarchical fusion network. The temporal features and spatial features are interactively fused through a multi-level attention mechanism to obtain a joint spatiotemporal feature representation.
[0047] In this embodiment, after completing the parallel processing steps, the electronic device obtains the temporal feature sequence for representing the global temporal dependency and the spatial feature sequence for representing the spatial distribution pattern between different channels. In order to deeply explore the nonlinear correlation between these two dimensions, the electronic device then performs the step of inputting the temporal feature sequence and the spatial feature sequence into a preset hierarchical fusion network, and using a multi-level attention mechanism to interactively fuse the temporal and spatial features to obtain a joint spatiotemporal feature representation.
[0048] Specifically, the electronic device synchronously inputs the generated temporal and spatial feature sequences into a pre-deployed hierarchical fusion network. Since the temporal feature sequence focuses on one-dimensional dynamic evolution, while the spatial feature sequence focuses on two-dimensional or multi-dimensional topological network structures, they represent feature representations of different dimensions. The hierarchical fusion network is configured to contain multiple cascaded processing layers (i.e., "hierarchical"), aiming to map these two heterogeneous feature data into a unified feature space and gradually extract the correlation information between them from shallow to deep. After entering the hierarchical fusion network, the electronic device does not simply perform a linear concatenation of the temporal and spatial features, but instead activates a multi-level attention mechanism to perform deep interactive fusion.
[0049] Interactive fusion refers to the calculation of cross-correlation weights between temporal and spatial features by electronic devices at different levels of the algorithm network. In specific implementation, at a certain processing layer of the network, the electronic device can use spatial feature sequences as query conditions to match each time step (key and value) in the temporal feature sequence, thereby calculating which time periods of EEG evolution are most critical under a specific brain region topology; conversely, the electronic device can also use temporal feature sequences as query conditions to evaluate which spatial channels have the most intense coordinated responses under a specific temporal rhythm.
[0050] Through this cross-dimensional weight allocation and feature weighted summation, the network can accurately locate abnormal electrophysiological activities occurring in specific brain regions within specific time periods (e.g., sudden abnormal slow-wave activity in the parietal lobe within a few seconds). The above interactive computation is repeated and progressively performed in multiple layers (multi-levels) of the network. Shallow networks may focus on local spatiotemporal co-occurrence features, while deep networks aggregate global, highly abstract spatiotemporal co-occurrence features.
[0051] After multiple rounds of cross-weight calculation and feature updates in the hierarchical fusion network, the originally independent temporal and spatial feature sequences are completely reconstructed and intertwined. Finally, the network aggregates and generates a unified high-dimensional data structure at the output, namely the Joint Spatio-Temporal Feature Representation.
[0052] The joint spatiotemporal feature representation is a comprehensive feature vector or matrix that combines temporal dynamics and spatial topology. The generation and maintenance of consciousness in the brain depend on the highly dynamic coordination of the whole-brain network in time and space. This joint spatiotemporal feature representation not only includes when the brain state changes (temporal dimension), but also where the changes occur and how different brain regions interact (spatial dimension), and more importantly, it captures the complex relationship resulting from the superposition of these two dimensions.
[0053] This approach addresses the problem of information fragmentation and loss of key clinical information caused by traditional isolated processing of temporal or spatial features. Through interactive fusion enabled by a multi-level attention mechanism, the model can adaptively focus on the most valuable spatiotemporal cross-features for assessing consciousness levels within complex and variable EEG signals, much like an experienced clinical EEG physiologist. This provides high-quality data support for the subsequent classification network to output the final EEG diagnostic results.
[0054] In step S150, the initial brain consciousness level category of the test subject is determined based on the joint spatiotemporal feature representation.
[0055] In this embodiment, the joint spatiotemporal feature representation is typically represented in data structure as a high-dimensional feature vector or feature matrix containing rich information. The electronic device inputs it into the classification network or classification layer (such as a fully connected layer) of the preset brain consciousness recognition model.
[0056] In this classification network, the electronic device performs nonlinear transformation and dimensionality reduction on the joint spatiotemporal feature representation through an internally configured weight matrix. The core purpose of this action is to accurately map the data, which was originally distributed in an abstract, high-dimensional spatiotemporal feature space, to a lower-dimensional classification probability space that is directly related to specific clinical diagnostic categories.
[0057] After completing the feature space mapping, the electronic device uses activation functions (such as the Softmax function and the equiprobability normalization function) to calculate the multi-class probability distribution for the mapped feature data.
[0058] The electronic device calculates the specific probability values of the subject belonging to various preset brain consciousness states (e.g., Coma, Vegetative State / Unresponsive Awakening Syndrome VS / UWS, Minimal Consciousness State (MCS), Exit from Minimal Consciousness State (EMCS), and Consciousness). Each probability value intuitively quantifies the degree of fit between the currently captured spatiotemporal EEG features and the corresponding baseline features of the consciousness state.
[0059] After the above probability calculations, the electronic device obtains a set of probability distribution vectors corresponding to different states of consciousness. Subsequently, the comparison logic unit inside the electronic device extracts the classification label with the highest probability value (or meets a specific confidence threshold) and directly outputs it as the initial brain consciousness level category of the test subject.
[0060] In complex clinical diagnostic environments (especially intensive care units), relying solely on patients' spontaneous or resting EEG activity (i.e., the aforementioned extracted spatiotemporal features) can provide baseline data reflecting the state of the basic network of the cerebral cortex. However, for patients on the verge of confusion (such as between the VS and MCS), it is often necessary to combine the brain's induced response to specific external stimuli to make a final diagnosis.
[0061] Therefore, the initial brain consciousness level category output by the electronic device represents the baseline assessment made by the algorithm based on the spatiotemporal characteristics of the subject's spontaneous EEG. The abstract features extracted by the deep learning network front-end are then decoded into specific medical classification results.
[0062] More importantly, this initial category of brain consciousness level is not directly output as the system's final judgment result, but is stored in the memory unit of the electronic device. It serves as a priori category reference or basic weight, and is strongly combined with the evoked EEG characteristics of the test subject under specific auditory stimuli extracted in subsequent steps (such as target mismatch negative wave characteristics) in the subsequent comprehensive judgment logic. This lays a solid logical and data foundation for eliminating the limitations of single-modality EEG diagnosis and achieving a high-precision determination of brain consciousness level.
[0063] In step S160, within a preset time window, a preset voltage amplitude range corresponding to the initial brain consciousness level category is extracted to obtain the minimum point and the minimum point is determined as the target mismatch negative wave trough.
[0064] In this embodiment, an adaptive search space configuration is performed based on an initial category. The electronic device does not blindly search the global EEG data; instead, it first calls the initial brain consciousness level category generated in the preceding steps as a priori trigger condition for configuring subsequent search parameters. Because the response delay and neural discharge intensity of different degrees of cortical damage to external stimuli such as hearing vary significantly, the electronic device pre-stores a mapping table. Based on the currently acquired initial brain consciousness level category (e.g., the object is initially determined to be in a minimally conscious state or a vegetative state), the electronic device automatically matches and retrieves two key boundary parameters strictly corresponding to that category from the mapping table: one is a preset time window, used to define a specific millisecond-level time interval after the external stimulus occurs; the other is a preset voltage amplitude range, used to define a reasonable microvolt (μV) level threshold range for negative EEG deflection. The electronic device can tailor a two-dimensional (time-voltage) safe search area that is most likely to produce a real induced response based on the current baseline brain network state of the subject, thereby fundamentally eliminating the interference of false positive troughs caused by electromyography, electrooculography or environmental noise outside the area.
[0065] Minimum point extraction is performed within a constrained multidimensional data space. After successfully defining the adaptive search space, the electronic device begins extracting evoked EEG waveform data acquired synchronously (or based on stimulus events). The data processing unit of the electronic device strictly limits the search cursor to a preset time window and simultaneously activates a voltage amplitude filter. The electronic device traverses each discrete time sampling point within this time window, reads its corresponding voltage amplitude, and discards all data points falling outside the preset voltage amplitude range. For the remaining valid data points, the electronic device uses an extreme value search algorithm (e.g., by comparing the voltage slope changes of adjacent time points to find the inflection point where the derivative turns from negative to positive) to calculate and extract the absolute lowest voltage value point under the specific time window and voltage constraints, thus obtaining the local minimum point.
[0066] Establishment and locking of target physiological characteristics. After obtaining the minimum point that meets the above multiple constraints, the electronic device performs a marking operation in the logic control unit to formally determine the minimum point as the target mismatch negative wave trough (MMN trough). Mismatch negative wave (MMN), as a classic event-related potential (ERP) component, is physically a kind of automatic, unconscious negative brainwave deflection phenomenon produced by the brain when receiving a rare deviation stimulus compared to a standard stimulus; and the trough represents the moment when this negative deflection reaches its maximum energy extreme value.
[0067] In this embodiment, the electronic device completely solves the problem that traditional fixed-window extraction methods are prone to feature extraction deviation or loss when dealing with brain-injured patients. The target mismatch negative wave trough determined by the method in this embodiment not only accurately eliminates baseline drift and artifacts, but also deeply quantifies the residual higher cognitive and auditory discrimination abilities of the test subject. Thus, the electronic device successfully acquires the target mismatch negative wave trough reflecting passively induced cognitive abilities. This high-quality induced feature node will complement and corroborate the initial brain consciousness level category based on spontaneous EEG, and be jointly input into the subsequent comprehensive decision-making logic, providing the most critical physiological marker support for the final output of a highly robust and high-confidence comprehensive brain consciousness state assessment result of the test subject.
[0068] In step S170, the brain consciousness recognition result of the test subject is generated based on the initial brain consciousness level category and the target mismatch negative wave trough.
[0069] In this embodiment, after obtaining the initial brain consciousness level category representing the spontaneous EEG baseline state of the test subject, and the target mismatch negative wave trough representing the cognitive response induced by the test subject, in order to eliminate the limitations of single-modality assessment and output the final diagnosis, the electronic device then generates the brain consciousness recognition result of the test subject based on the initial brain consciousness level category and the target mismatch negative wave trough.
[0070] Quantitative extraction of induced physiological characteristic parameters. Electronic devices do not merely stop at finding the trough; they first perform quantitative parameterization analysis on the target mismatch negative wave trough identified in previous steps. The data processing unit of the electronic device extracts specific quantitative physiological indicators from the target mismatch negative wave trough, mainly including: the absolute voltage amplitude of the trough (characterizing the intensity of the brain's neural response to abnormal stimuli) and the latency time of the trough's appearance (the time difference between the occurrence of the external stimulus and the appearance of the trough's minimum value, characterizing the speed of neural conduction and information processing). These quantitative indicators are input into the system's joint decision-making module as independent objective physiological evidence.
[0071] The system executes joint decision-making and calibration logic based on multi-source evidence. After acquiring the quantified trough parameters, the electronic device performs joint logical operations or comprehensive weighted evaluations with the initial brain consciousness level categories stored in memory. The electronic device is internally configured with a preset comprehensive decision matrix or fusion classifier. The electronic device cross-validates the baseline probability distribution provided by the initial brain consciousness level categories with the quantified parameters of the target mismatch negative wave trough.
[0072] In practice, the electronic device uses preset calibration rules to correct the initial judgment. For example, if the initial brain consciousness level category indicates that the subject is in a severe "unresponsive wakefulness syndrome / vegetative state (UWS / VS)," but the voltage amplitude of the target mismatch negative wave trough extracted by the electronic device exceeds the preset effective response threshold, and the latency is within a reasonable cognitive response time period, this constitutes strong evidence of concealed cognitive function retention. In this case, the decision logic unit of the electronic device will increase the classification weight representing a higher level of consciousness (such as microconsciousness state (MCS)), thereby using this evoked feature to perform an upgrade calibration of the initial baseline; conversely, if no effective trough is extracted or the trough parameter is extremely weak / delayed, the electronic device will further confirm and consolidate the initial judgment of a lower level of consciousness.
[0073] The final brain consciousness recognition result is generated and output. After the rigorous cross-validation and calibration calculations described above, the electronic device integrates the spatiotemporal characteristics of spontaneous networks and the characteristics of passively induced cognition for dual judgment, and finally converges to output a diagnostic classification label with the highest confidence. The electronic device formally defines and outputs this final classification label (such as a specific state level such as coma, UWS / VS, MCS, or awakeness) as the brain consciousness recognition result of the test subject.
[0074] This approach addresses the technical problem of misdiagnosis that often arises from relying solely on subjective behavioral scales or a single EEG feature in traditional clinical practice. The generated brain consciousness recognition result (final output) is based on the combination of macroscopic brain network spatiotemporal states (initial categories) extracted through deep learning and microscopic evoked cognitive markers (target MMN troughs) with clearly defined physiological mechanisms. This dual interlocking mechanism of "baseline + evoked" enables the system to penetrate appearances and identify the patient's true level of residual brain consciousness with remarkable sensitivity and accuracy, even when faced with complex critically ill patients in the intensive care unit who are unable to make any behavioral responses due to severe motor dysfunction. This provides solid and objective intelligent technical support for subsequent clinical awakening treatment, prognostic assessment, and life support decisions.
[0075] Traditional recurrent neural networks (RNNs) or convolutional neural networks (CNNs) often struggle with global temporal modeling due to the strong non-stationarity of EEG signals in patients with clinical consciousness disorders, limiting their application to local time windows. This application's embodiments introduce a self-attention mechanism and positional encoding borrowed from the Transformer architecture, preserving the strict temporal order of signals at the underlying logic level and utilizing multi-layered networks to capture the long-range dependencies of EEG signals over time. This mechanism enables the model to penetrate local data fluctuations and accurately pinpoint global temporal dynamic patterns highly correlated with the evolution of the brain's state of consciousness, thus overcoming the technical limitations of existing methods in capturing global temporal dynamic information.
[0076] To address the technical challenges of significant individual differences in skull structure and strong interference from environmental artifacts (such as electromyography and electrooculography) in clinical EEG data, the embodiments of this application do not employ single-scale spatial mapping. Instead, they utilize a network topology that integrates multi-scale convolution and residual connections to adaptively extract the spatial distribution features of multi-channel EEG data across different receptive fields. Simultaneously, by incorporating dynamic weight allocation based on spatial attention mechanisms, the network can proactively enhance the feature representation of core brain regions and key pathways that play a decisive role in identifying consciousness disorders within the complex whole-brain topology, while strongly suppressing the weights of irrelevant artifact regions. This allows the model to remain highly focused on authentic consciousness-related activity patterns even with highly individualized multi-center clinical data, significantly improving the robustness of spatial feature extraction.
[0077] Temporal evolution and spatial topology are highly orthogonal and complementary heterogeneous information in the brain's consciousness network. Traditional methods often employ a coarse strategy of simple splicing at the end, which easily leads to dimensional collapse of deep semantic information. This application innovatively adopts a hierarchical (top-level, middle-level, and bottom-level) fusion strategy and performs cross-modal feature alignment based on a bidirectional cross-attention mechanism. Its physical essence lies in using spatial features to guide keyframes of temporal dynamics, while simultaneously using temporal rhythms to anchor core nodes of spatial topology. This multi-level interactive fusion completely breaks down the barriers between spatiotemporal features, ensuring that the complementary information of temporal dynamics and spatial patterns is seamlessly and fully integrated in the deep layers of the network. This provides subsequent networks with highly discriminative joint feature representations, ultimately improving the absolute accuracy and generalization boundary of brain consciousness level classification.
[0078] In one implementation, time-dimensional feature extraction is performed on the EEG signal feature matrix to obtain a time feature sequence including: The EEG signal feature matrix is transposed by swapping the time dimension and the channel dimension to obtain the feature matrix after dimension swapping. A linear transformation is used to map the feature matrix after dimension swapping to a preset first feature dimension, resulting in dimension-reduced aligned features. A location coding matrix corresponding to the absolute location index of the EEG data sequence is generated based on sine and cosine trigonometric functions. The position encoding matrix is added element by element to the dimension-reduced alignment feature to obtain a temporal feature with position information, so that the dimension-reduced alignment feature can perceive the sequential relationship of time points; Temporal features with location information are input into a multi-layer self-attention encoding network for global context modeling, and the features after global context modeling are mapped back to the initial channel dimension to obtain a temporal feature sequence.
[0079] In this embodiment, as Figure 4As shown, after acquiring the EEG signal feature matrix to be processed, the electronic device, in order to accurately capture the dynamic evolution of clinical EEG signals over a long period of time and overcome the limitations of traditional recurrent neural networks (RNNs) or convolutional neural networks (CNNs) in modeling long-range dependencies, utilizes a pre-configured temporal feature extraction branch (i.e., a temporal feature network) in its Brain Consciousness Recognition Model to extract temporal features from the EEG signal feature matrix, obtaining a temporal feature sequence. The electronic device first acquires the input EEG signal feature matrix. In this embodiment, the input feature is specifically presented as a tensor of shape (batch, 13, 512), where 13 represents 13 channel features (specifically composed of the original EEG signal, six frequency band power, and six frequency band differential entropy), and 512 represents the time series length. Initially, the data structure of this feature matrix is typically presented as a two-dimensional or multi-dimensional tensor in the form of "number of spatial channels × number of temporal sampling points". To adapt it to subsequent serialized input formats similar to the Transformer architecture, the electronic device performs a dimension transposition operation on the EEG signal feature matrix, exchanging the time and channel dimensions to obtain a feature matrix with swapped dimensions. This action transforms the original channel-first structure into a time-step-first sequence, allowing the network to perform feature parsing along the time axis.
[0080] Through the aforementioned dimensional exchange, the electronic device reconstructs the original spatial channel-dominated matrix into a sequence of data with time steps as the main axis, resulting in a feature matrix after the dimensional exchange. The voltage values collected from all EEG channels at the same time point are packaged into an independent feature slice (Token), enabling subsequent networks to examine the dynamic evolution trajectory of the brain's state of consciousness frame by frame along the timeline.
[0081] After obtaining the feature matrix with the swapped dimensions, the data processing unit of the electronic device uses an input projection layer (such as an nn.Linear(13, 64) network structure) to map the number of channels in the feature matrix with the swapped dimensions to a preset first feature dimension using a linear transformation. In this embodiment, the first feature dimension is specifically set to 64 dimensions, resulting in dimensionality-reduced aligned features. In practice, the electronic device performs weighted multiplication and addition operations on the channel data at each time step through a fully connected layer or point-wise convolution. Since the original EEG channels are often numerous and contain redundant information, this linear transformation not only removes useless background noise, but more importantly, it compresses and aligns the channel dimensions, which may differ between different subjects and different acquisition devices, into a standardized mathematical hidden space (i.e., the first feature dimension), thereby providing a standardized input benchmark for efficient matrix operations in subsequent networks.
[0082] After obtaining the dimensionality-reduced alignment features, the self-attention mechanism to be used subsequently essentially performs global parallel computation across all time points, and therefore lacks the ability to perceive temporal order. To address this technical deficiency, the electronic device generates a positional encoding matrix corresponding to the absolute position indices of the EEG data sequence, based on sine and cosine trigonometric functions. For each absolute position index on the timeline (i.e., the specific time and location of the EEG signal), the electronic device calculates its unique positional code using alternating sine and cosine functions. The specific calculation logic is as follows: Where PE represents the generated position encoding matrix, with a shape of (512, 64); pos represents the absolute position index of the EEG data sequence on the time axis, with a value range of 0 to 511; and i represents the dimension index, with a value range of 0 to 31.
[0083] The pos-th row of the matrix generated by the above formula is PE(pos), which is a 64-dimensional vector that precisely encodes the location information at that specific time point. After generating this location encoding matrix, the electronic device performs element-wise addition on the location encoding matrix and the aforementioned 64-dimensional dimensionality-reduced aligned features to obtain temporal features with location information, thereby enabling the dimensionality-reduced aligned features to perceive the sequential relationship between EEG time points.
[0084] Finally, the electronic device inputs the temporal features with location information into a multi-layer self-attention encoding network for global context modeling. In this embodiment, the multi-layer self-attention encoding network is specifically composed of two cascaded Transformer encoder layers (nn.TransformerEncoder). Each layer includes a multi-head self-attention mechanism (specifically configured with 8 attention heads) and a feed-forward network (with a hidden layer dimension of 256), followed by layer normalization operations (such as nn.LayerNorm(64)). This self-attention mechanism allows the model to directly calculate the dependency weights between any two EEG time points, thereby overcoming the limitations of local time windows and accurately capturing global temporal contextual relationships.
[0085] In this self-attention encoding network, the electronic device calculates the correlation weights between the EEG features at the current time point and features at all other time points in the entire time series by generating a query matrix, a key matrix, and a value matrix. This global computation mechanism enables the network to transcend the limitations of time windows and accurately capture the wavelength dependencies of EEG waves separated by several seconds or even tens of seconds (e.g., the association between early sleep spindle waves and later slow waves). After completing the global context extraction at the above depth, in order to ensure that the features in this time dimension can perfectly match the features in the subsequent spatial dimension in terms of data structure, the electronic device uses an output projection layer (such as nn.Linear(64, 13)) to linearly map the features after global context modeling back to the initial channel dimension (i.e., remap back to 13 channels), thereby outputting and obtaining the temporal feature sequence.
[0086] Through the aforementioned dimensional reconstruction, location information injection, and self-attention modeling, the method in this embodiment overcomes the technical difficulties of gradient vanishing or limited local field of view that traditional recurrent neural networks (RNNs) or convolutional neural networks (CNNs) easily encounter when processing long-sequence EEG data. The temporal feature sequence output by the electronic device not only purifies the effective physiological characteristics of the EEG signal but also preserves the global dynamic trajectory of the brain's consciousness evolution. This temporal feature sequence will serve as the core temporal dimension input basis for the subsequent hierarchical feature fusion network, laying an irreplaceable data foundation for the final realization of spatiotemporal joint diagnosis.
[0087] In one implementation, spatial dimension feature extraction is performed on the EEG signal feature matrix to obtain a spatial feature sequence including: The initial convolutional layer is used to perform channel expansion and local spatial pattern capture on the EEG signal feature matrix to obtain expanded spatial features; The extended spatial features are input into a residual network module containing multi-scale convolutional layers to obtain deep spatial features of multiple granularities. Two different pooling operations are performed in parallel on deep spatial features to obtain the results of the two pooling operations; The results of the two pooling operations are concatenated to obtain the concatenated result. Convolutional layers are used to extract features from the concatenated result, and a sigmoid activation function is used to generate weight allocation coefficients. The channel response is recalibrated using weight allocation coefficients to obtain enhanced features, which are represented by the features of enhanced key channels and target local regions. The enhanced features are reduced to a preset second feature dimension by a fully connected network to obtain a spatial feature sequence, wherein the second feature dimension is consistent with the time dimension of the temporal feature sequence.
[0088] In this embodiment, when the electronic device processes EEG data in parallel, in order to fully explore the spatial structural information contained in the multi-channel EEG features (i.e., the distribution patterns and interrelationships of different frequency bands and differential entropy features in different physical channels / brain regions), the electronic device uses the pre-configured spatial feature network (i.e., the spatial feature extraction branch) in its Brain Consciousness Recognition Model to extract spatial dimension features from the EEG signal feature matrix to obtain a spatial feature sequence.
[0089] This spatial feature network adopts an architecture that combines deep convolution and attention mechanisms to gradually abstract high-level semantic features. The specific data flow and implementation process is as follows: Step 1: Initial channel expansion and local spatial pattern capture.
[0090] The electronic device receives the input EEG signal feature matrix and uses an initial convolutional layer to expand the channels and capture local spatial patterns, obtaining expanded spatial features. This initial convolutional layer is specifically configured as a one-dimensional convolutional layer with a kernel size of 7 and a padding parameter of 3. This convolutional operation with a large receptive field effectively spans adjacent data channels, accurately capturing cross-channel local spatial patterns. After expanding the number of feature channels to a preset dimension (e.g., 64 dimensions) through convolution, the electronic device sequentially performs batch normalization (BN) to accelerate network convergence, Rectified Luminous Interval (ReLU) activation to introduce non-linear expression, and max pooling with a stride of 2 for downsampling. Through this series of actions, preliminary spatial features are extracted while significantly reducing the computational complexity of subsequent network layers.
[0091] Step 2: Multi-scale deep feature extraction based on residual networks.
[0092] Next, the electronic device inputs the extended spatial features into a residual network module containing multi-scale convolutional layers to obtain multi-granularity deep spatial features.
[0093] according to Figure 5 The network topology shown depicts a residual block that constructs a parallel structure of backbone paths and skip connections. In the backbone path, the electronic device utilizes three cascaded convolutional layers for multi-scale feature extraction: first, the first convolutional layer expands the feature channels from 64 dimensions to 128 dimensions (using Batch Normalization and ReLU); then, the second convolutional layer expands it from 128 dimensions to 256 dimensions (using Batch Normalization and ReLU); and finally, the third convolutional layer expands it from 256 dimensions to 512 dimensions (using Batch Normalization). Simultaneously, in the skip connection path, the electronic device uses a 1×1 1×1 convolutional layer to perform dimensionality matching on the expanded spatial features of the input. Subsequently, the electronic device performs element-wise addition between the 512-dimensional features output from the backbone path and the features output from the skip connections, and then applies the ReLU activation function again to finally output the deep spatial features. This residual structure greatly deepens the network to extract multi-scale, high-order EEG spatial distribution features, while completely alleviating the gradient vanishing problem that is very easy to occur in deep network training, and effectively promoting the reuse of low-level features and high-level features.
[0094] Step 3: Fusion of Dual-Path Parallel Pooling and Spatial Attention Features. After obtaining the aforementioned high-dimensional deep spatial features, in order to enable the network to adaptively focus on the brain regions most valuable for discriminating the level of consciousness, the electronic device introduces a spatial attention mechanism. First, the electronic device performs two different pooling operations in parallel on the deep spatial features, obtaining the results of the two pooling operations; then, the results of the two pooling operations are concatenated to obtain the concatenated result.
[0095] according to Figure 6 The illustrated process involves the electronic device inputting deep spatial features into a max-pooling layer and an average-pooling layer (AvgPool) in the spatial dimension. Max-pooling extracts the most salient EEG response extremes from each local receptive field (highlighting salient features); average-pooling calculates global statistical background information within the receptive field (preserving overall trends). Subsequently, the electronic device concatenates these two distinct but complementary pooling results in the channel dimension. Figure 6 The 'C' operation in the text aggregates rich and comprehensive spatial context information.
[0096] Step 4: Weight Allocation and Channel Response Recalibration. After splicing, the electronic device uses convolutional layers to extract features from the spliced result and generates weight allocation coefficients using a sigmoid activation function. Subsequently, the channel responses are recalibrated using these weight allocation coefficients to obtain enhanced features. The electronic device uses a standard convolutional layer to reduce the dimensionality of the spliced features and fuse cross-channel information. The output values are then mapped to the (0,1) interval using a sigmoid activation function, generating a weight allocation coefficient matrix representing the importance of each spatial channel. Finally, the electronic device multiplies this weight matrix element-wise with the original deep spatial features (i.e., recalibrating the channel responses). After calibration, the enhanced features primarily represent key channels and target local regions. The network actively suppresses irrelevant channel weights containing environmental artifacts such as electrooculography (EOG) and electromyography (EMG), and significantly highlights the spatial features of key brain regions directly related to consciousness disorders (such as the frontoparietal network), significantly improving the discriminative power of the features.
[0097] Step 5: Cross-branch dimensionality alignment and output. The electronic device uses a fully connected network to reduce the dimensionality of the enhanced features to a preset second feature dimension, obtaining the final spatial feature sequence. After extraction by the residual network, the channel dimension of the enhanced features is relatively high (e.g., 512 dimensions as mentioned above). To further ensure strict alignment with the output format of the temporal feature network (temporal branch), the electronic device uses a fully connected layer to compress and reduce the dimensionality of this feature to 128 dimensions (i.e., the second feature dimension). The feature tensor output by this spatial feature extraction branch maintains absolute consistency between the second feature dimension and the temporal dimension of the temporal feature sequence. This dimensional alignment completely eliminates the dimensionality barrier between heterogeneous networks, providing perfect data preparation for the subsequent lossless spatiotemporal cross-fusion of the two types of features into the hierarchical fusion module.
[0098] Through the synergistic effect of the initial convolution, residual multi-scale extraction, and spatial attention mechanism described above, the brain consciousness recognition model of this application successfully overcomes the technical challenges of large individual skull differences and complex spatial structures in clinical EEG signals. This spatial feature network not only stably extracts pure EEG spatial topological information but also achieves intelligent focusing on key conscious brain regions, thus providing solid spatial dimension data support for the subsequent comprehensive generation of high-precision brain consciousness diagnostic results.
[0099] In one implementation, a temporal feature sequence and a spatial feature sequence are input into a preset hierarchical fusion network. A multi-level attention mechanism is used to interactively fuse the temporal and spatial features to obtain a joint spatiotemporal feature representation, including: The first attention distribution is calculated and feature aggregation is performed using the time feature sequence as the query feature matrix and the spatial feature sequence as the key feature matrix and value feature matrix, respectively, to obtain the first enhanced time feature. The second attention distribution is calculated and features are aggregated using the spatial feature sequence as the query feature matrix and the temporal feature sequence as the key feature matrix and value feature matrix, respectively, to obtain the first enhanced spatial feature. In the intermediate fusion layer of the hierarchical fusion network, the first enhanced temporal features and the first enhanced spatial features are further fused and added together through the cross attention module to obtain hybrid spatiotemporal features; In the bottom fusion layer of the hierarchical fusion network, a self-attention network is used to extract features from the internal relationships of the mixed spatiotemporal features, generating a joint spatiotemporal feature representation.
[0100] In this embodiment, after obtaining pure temporal and spatial feature sequences through preceding temporal and spatial feature extraction branches, respectively, the electronic device faces the challenge of effectively integrating these two heterogeneous pieces of information: temporal dynamics (long-range evolution in the temporal dimension) and spatial patterns (brain region topology in the spatial dimension). To fully integrate these two orthogonal and complementary feature information and overcome the deep semantic loss problem caused by traditional direct concatenation methods, the electronic device utilizes a pre-configured hierarchical fusion network in its brain consciousness recognition model. Through multi-level interactions of bidirectional cross-attention and self-attention, it performs deep coupling of spatiotemporal features.
[0101] Before entering the hierarchical fusion layer, the electronic device first maps the temporal and spatial feature sequences to the same feature dimension (in this embodiment, the feature dimension is specifically configured as 128-dimensional) through linear projection, and then transposes the data tensors of both into a (batch, 512, 128) format to meet the matrix operation requirements of the attention mechanism. The specific data flow and implementation process is as follows: Step 1: Initial bidirectional information interaction based on the top-level fusion layer (generating the first enhanced feature).
[0102] In the top fusion layer of the hierarchical fusion network, the electronic device employs two parallel cross-attention modules to achieve cross-modal feature alignment.
[0103] Work Process 1 (Time-Dominated Spatial Retrieval): The electronic device uses the temporal feature sequence as the query feature matrix (Query, Q=T) and the spatial feature sequence as the key feature matrix (Key, K=S) and value feature matrix (Value, V=S), and inputs them into a multi-head attention network (nn.MultiheadAttention). By calculating the dot product similarity between the query matrix and the key matrix, the first attention distribution is calculated, and the value matrix is aggregated based on this distribution. Subsequently, after layer normalization (nn.LayerNorm(128)) and a feedforward network containing nonlinear activation (specifically, a structure that is linearly expanded to 512 dimensions and then activated by ReLU and reduced to 128 dimensions), the first enhanced temporal features (i.e., First Enhanced Temporal Features) are finally obtained. Figure 7 T(128) in the middle).
[0104] This embodiment uses time cues to retrieve spatial networks, that is, it utilizes the dynamic characteristics of brain waves at a specific point in time to automatically search for and highlight the most active brain region spatial topology patterns at that moment.
[0105] Process Two (Spatial-Dominated Temporal Retrieval): Similarly, in the parallel branch, the electronic device uses the spatial feature sequence as the query feature matrix (Q=S) and the temporal feature sequence as the key feature matrix (K=T) and value feature matrix (V=T). It calculates the second attention distribution and performs feature aggregation. After the same normalization and feedforward network processing, it obtains the first enhanced spatial features (i.e., First Enhanced Spatial Features). Figure 7 S(128) in the middle.
[0106] This embodiment uses spatial structure to anchor temporal rhythms, that is, it uses the spatial characteristics of specific brain regions (such as the frontal lobe) to trace and reinforce the time points of abnormal brain electrical bursts that are highly correlated with them on the time axis.
[0107] Step 2: Deepening fusion and residual aggregation based on the intermediate fusion layer (generating hybrid features).
[0108] Next, the electronic device sends the enhanced features output from the top layer to the intermediate fusion layer for secondary interaction.
[0109] In the intermediate fusion layer of the hierarchical fusion network, the electronic device further fuses the first enhanced temporal features and the first enhanced spatial features through a cross-attention module. Specifically, the electronic device performs bidirectional cross-attention calculation again (i.e., using the enhanced T as Q to retrieve the enhanced S, and vice versa). Unlike the top layer, to prevent the loss of original features in the deep network and accelerate gradient backpropagation, after obtaining the two secondary enhanced outputs, the electronic device introduces a residual connection (Add mechanism) to add the two outputs element-wise, thereby completely breaking down the temporal and spatial modal barriers and obtaining mixed spatiotemporal features. Figure 8 H(128) in the middle.
[0110] Step 3: Self-attention enhancement and final dimension output based on the bottom fusion layer. The electronic device sends the hybrid spatiotemporal features into the bottom fusion layer for ultimate purification of the internal logic.
[0111] like Figure 9As shown, in the bottom fusion layer of the hierarchical fusion network, since the input hybrid spatiotemporal features (e.g., a feature tensor with a feature dimension of 128, denoted as H(128)) already possess both temporal and spatial information, the electronic device no longer uses cross-attention but instead utilizes a multi-head self-attention network (i.e., setting Q=K=V=H) to extract features from the internal relationships of the hybrid spatiotemporal features. By calculating the correlation of the hybrid features themselves at different sequence nodes, the network can capture the deepest joint diagnostic-level features.
[0112] Subsequently, the electronic device enhances the representation by sequentially passing it through layer normalization (nn.LayerNorm(128)) and a feedforward network with random dropout. Finally, the fused features are passed through an output projection layer to maintain the 128-dimensional feature dimension, and their data tensor format is transposed back to (batch, 128, 512), thereby generating a joint spatiotemporal feature representation.
[0113] Through the aforementioned hierarchical interaction mechanism of "top-middle-bottom", the brain consciousness recognition model of this application solves the technical difficulty of aligning spatiotemporal heterogeneous features in complex EEG signals.
[0114] Electronic devices not only achieve lossless deep coupling between temporal dynamic sequences and spatial network topology, but also extract the most decisive spatiotemporal cross-biomarkers for clinical consciousness disorders (such as coma and minimally conscious states) through residual summation in the intermediate layer and internal sorting of self-attention in the underlying layer. The joint spatiotemporal feature representation will directly serve as the final input of the subsequent classification network, providing the core algorithmic foundation and data support for outputting high-confidence brain consciousness level assessment results.
[0115] In one implementation, the initial brain consciousness level category includes at least one of the following state types: detached from minimal consciousness, coma, vegetative state, minimal consciousness, and conscious state. A preset time window is defined as a time range between 100 milliseconds and 350 milliseconds. Within the preset time window, a preset voltage amplitude range corresponding to the initial brain consciousness level category is extracted to obtain minimum points, including: If the initial level of brain consciousness is determined to be out of microconsciousness, then the minimum value point with the smallest amplitude is extracted within the voltage amplitude range of -2.9 microvolts to -2.1 microvolts. If the initial level of brain consciousness is determined to be a coma, then the minimum value point with the smallest amplitude is extracted within a voltage amplitude range greater than or equal to -0.5 microvolts. If the initial level of brain consciousness is determined to be a vegetative state, then the minimum value point with the smallest amplitude is extracted within the voltage amplitude range of greater than -1.0 microvolts and less than or equal to -0.6 microvolts. If the initial level of brain consciousness is determined to be a microconsciousness state, then the minimum value point with the smallest amplitude is extracted within the voltage amplitude range of -2.0 microvolts to -1.0 microvolts. If the initial level of brain consciousness is determined to be a conscious state, then the minimum value point with the smallest amplitude is extracted within a voltage amplitude range of less than -3 microvolts.
[0116] In this embodiment, after the electronic device completes the extraction and cross-fusion of deep features, it needs to transform the abstract high-dimensional tensor into a clinically significant diagnostic result. Specifically, the electronic device first uses the classification network in its brain consciousness recognition model to receive a joint spatiotemporal feature representation as input. The joint spatiotemporal feature representation is a perfect fusion of local brain region spatial topological information accurately extracted by the spatial feature network and long-range dynamic rhythm information captured by the temporal feature network, which undergoes multi-level cross-attention calculations in the hierarchical fusion module. After performing a linear transformation on the joint spatiotemporal feature representation, the classification network outputs the initial brain consciousness level category.
[0117] To further verify the physiological reliability of the initial classification result and accurately anchor the key event-related potentials (ERPs) in the electroencephalogram (EEG) signal, the data processing unit of the electronic device performs a post-processing step based on clinical prior rules on the initial classification result. The specific data flow and implementation process is as follows: In this embodiment, the initial level of brain consciousness is specifically categorized into five clinical consciousness levels, including at least one of the following: Emergence from Minimally Conscious State (EMCS), Coma, Vegetative State (VS), Minimally Conscious State (MCS), and Awake / Conscious. Simultaneously, the electronic device locks a preset time window on the EEG signal timeline. The preset time window is strictly set between 100 and 350 milliseconds after the stimulus occurs (the 100–350 ms time window has strong clinical electrophysiological significance. This time period is precisely the core latency window during which the human brain generates mismatch negative waves (MMN) when processing external stimuli such as hearing. Locking this window effectively filters out early sensory potential interference and late cognitive potential artifacts.
[0118] Because patients with varying degrees of impaired consciousness exhibit significantly different cortical responses to external stimuli (generally, the higher the level of consciousness, the greater the negative amplitude of the MMN), electronic devices abandon the traditional fixed threshold method and instead employ a dynamic matching strategy. Within a preset time window, a preset voltage amplitude range corresponding to the initial level of consciousness is extracted to find the local minimum point (i.e., the MMN trough). Specifically, the following five parallel or mutually exclusive judgment logics are executed: Logic 1: If the electronic device determines that the initial level of brain consciousness is a state of detachment from microconsciousness, then the classification network in the brain consciousness recognition model triggers the corresponding first-level voltage rule, ranging from -2.9 microvolts to -2.1 microvolts. 2.9, 2.1] Search within the voltage amplitude range of μV, and extract the minimum point of the smallest amplitude in this range as the target MMN trough.
[0119] Logic 2: If the initial level of brain consciousness is determined to be a coma (with the most severe brain function impairment and extremely weak response), then the classification network in the brain consciousness recognition model triggers the corresponding second-level voltage rule, at a voltage greater than or equal to -0.5 microvolts. The minimum amplitude point is extracted within the voltage amplitude range of 0.5 to +∞ μV. Comatose patients typically cannot elicit significant negative waves, so the upper threshold is relaxed to positive infinity.
[0120] Logic 3: If the initial level of brain consciousness is determined to be a vegetative state, then the classification network in the brain consciousness recognition model triggers the corresponding third-level voltage rule, which is greater than -1.0 microvolts and less than or equal to -0.6 microvolts. 1.0, Extract the minimum value point with the smallest amplitude within the voltage amplitude range of 0.6 μV.
[0121] Logic 4: If the initial level of brain consciousness is determined to be a micro-consciousness state, then the classification network in the brain consciousness recognition model triggers the corresponding fourth-level voltage rule, ranging from -2.0 microvolts to -1.0 microvolts ([... 2.0, Extract the minimum value point with the smallest amplitude within the voltage amplitude range of 1.0 μV.
[0122] Logic 5: If the initial level of brain consciousness is determined to be a conscious state (normal brain function, strongest response), then the classification network in the brain consciousness recognition model triggers the corresponding fifth-level voltage rule, which is less than -3 microvolts. ∞, 3) Extract the minimum value point with the smallest amplitude within the voltage amplitude range of μV.
[0123] In this embodiment, the minimum value point with the smallest amplitude is extracted because MMN is essentially a negatively deflected EEG wave; the smaller the voltage value (the larger the absolute negative value), the stronger the cortical response. In this embodiment, the post-processing scheme of "personalized approach, state-based thresholding" avoids the problem of misdiagnosis and missed diagnoses caused by using a single fixed voltage threshold, where patients with weak consciousness are misjudged as comatose or artifact noise is mistaken for a conscious response. This fundamentally ensures the high reliability and confidence of the final output EEG characteristics and diagnostic results in complex clinical critical care environments.
[0124] In one implementation, the brain consciousness recognition results of the test subject are generated based on the initial brain consciousness level category and the negative wave trough of target mismatch, including: Determine whether the target mismatch negative wave trough was successfully extracted within the preset voltage amplitude range corresponding to the initial brain consciousness level category; If so, the initial brain consciousness level category is confirmed to have the support of EEG waveform physiological characteristics, and the initial brain consciousness level category is determined as the final brain consciousness recognition result output; If not, the credibility of the initial brain consciousness level category is determined to be lower than the preset requirement, and the corresponding brain consciousness level category is recalibrated based on the interval where the global minimum voltage amplitude is located within the preset time window, or a prompt message that triggers manual verification is generated as the brain consciousness recognition result.
[0125] In this embodiment, after the electronic device completes the preceding dynamic voltage threshold matching and attempts to extract the minimum point, it needs to perform a final logical verification on the extraction result to ensure that the diagnostic conclusions output to the clinician are safe and reliable.
[0126] First, the electronic device's data processing unit executes a conditional branch judgment logic, namely, determining whether the target mismatch negative wave trough has been successfully extracted within a preset voltage amplitude range corresponding to the initial brain consciousness level category. In the underlying data processing, "successful extraction" means that within the preset time window (100ms-350ms) of the EEG signal sequence, there is indeed at least one data point whose voltage value falls within the strictly defined numerical range of the previous step (e.g., [-2.9, -2.1] microvolts corresponding to the departure from the microconscious state), and that this point is its local minimum. From a clinical physics perspective, this judgment action is to verify whether the objective cortical evoked response intensity corresponding to the consciousness state predicted by the deep learning network actually exists in the patient's EEG waveform.
[0127] If the result is "yes" (i.e., the target MMN trough has been successfully extracted), the electronic device confirms that the initial brain consciousness level category is supported by the physiological characteristics of the EEG waveform and determines the initial brain consciousness level category as the final brain consciousness recognition result output. When this condition is met, it indicates that the abstract high-dimensional feature classification result output by the brain consciousness recognition model (such as the aforementioned hierarchical fusion network and classifier) perfectly corroborates the macroscopic physiological voltage markers (MMN troughs) actually collected from the patient's scalp. At this point, the possibility of hallucinations caused by overfitting or occasional noise in the brain consciousness recognition model is ruled out. Therefore, the electronic device assigns the highest level of confidence to this result and presents it as the final diagnostic conclusion to medical personnel through a display or medical interface, providing a direct basis for subsequent awakening treatment.
[0128] If not (i.e., the judgment result is "no," and a minimum point cannot be found within the strictly corresponding interval), the electronic device determines that the credibility of the initial brain consciousness level category is lower than the preset requirement and immediately triggers the abnormality handling mechanism. A "no" result usually means that the brain consciousness recognition model has given a prediction of "awake," but the EEG does not show the expected strong negative deflection (e.g., not reaching the standard of less than -3 microvolts). This indicates that strong electromyography artifacts may have been mixed into the input signal, causing the neural network to make a misjudgment. To strictly adhere to medical safety standards, the electronic device will refuse to directly output this unreliable prediction result and instead adopt one of the following two parallel or alternative fallback strategies: The first fallback strategy (automated recalibration): The electronic device recalibrates the corresponding brain consciousness level category based on the interval containing the global minimum voltage amplitude within a preset time window. Specifically, the electronic device abandons the initial category given by the model and instead searches for the global minimum point with the smallest absolute amplitude within the entire 100ms-350ms time window. After finding this true trough, its voltage value is substituted back into the aforementioned five voltage rule intervals. For example, if the global trough voltage is -0.8 microvolts, falling within the interval (-1.0, -0.6], the system uses the traditional physiological gold standard to "force downgrade" the final brain consciousness recognition result and recalibrate it as "vegetative state." This action gives the system a powerful self-correction capability.
[0129] The second fallback strategy (human-machine collaborative intervention) involves the electronic device generating a prompt message that triggers manual verification as the result of brain consciousness recognition. In practice, the electronic device highlights conflicting brainwave segments and displays an alert pop-up on the system interface stating, "Model prediction does not match waveform characteristics; please have an expert review." This mechanism ensures that, in the face of extremely complex and difficult cases, the final decision-making power rests with the clinician.
[0130] It effectively utilizes the powerful nonlinear feature capture capabilities of preceding networks (such as temporal / spatial feature networks and hierarchical fusion networks), and fundamentally solves the technical challenge of pure AI models being prone to fatal misdiagnosis due to data shift in complex intensive care unit (ICU) environments. Both automated recalibration and manual alerts ensure that every final brain consciousness assessment result has high medical interpretability and a high clinical error tolerance.
[0131] In one implementation, determining the initial level of consciousness of the test subject based on joint spatiotemporal feature representation includes: The joint spatiotemporal feature representation is input into a pre-defined classification network to generate the initial brain consciousness level category of the test subject. The temporal feature network used to perform temporal dimension feature extraction, the spatial feature network used to perform spatial dimension feature extraction, the hierarchical fusion network, and the classification network together constitute the brain consciousness recognition model. The brain consciousness recognition model is obtained through joint training using the following steps: Obtain the training dataset, which contains multiple sets of sample EEG signal feature matrices and the real state labels corresponding to each set of sample EEG signal feature matrices. The EEG signal feature matrices of each group of samples are input into the brain consciousness recognition model to be trained for forward propagation, and the corresponding predicted state category is output. The adaptive focus loss function is used to calculate the overall classification loss between the predicted state category and the true state label; where the class weighting coefficient in the adaptive focus loss function is dynamically allocated based on the proportion of the total number of samples of each true state label in the training dataset. Based on the overall classification loss value, the parameters of each network in the brain consciousness recognition model to be trained are updated synchronously through the backpropagation algorithm, so as to enhance the brain consciousness recognition model's feature attention to minority class data.
[0132] In this embodiment, after the fused joint spatiotemporal feature representation, the present application embodiment further performs classification and recognition steps. Specifically, the joint spatiotemporal feature representation is input into a preset classification network to generate the initial brain consciousness level category of the test subject.
[0133] Specifically, the aforementioned joint spatiotemporal feature representation incorporates the dynamic dependence of EEG signals over time and the topological correlation in spatial electrode distribution. The classification network typically consists of one or more fully connected layers and normalized exponential function layers. The fully connected layer performs a nonlinear mapping on the high-dimensional joint spatiotemporal feature representation, reducing its dimensionality and transforming it into a target feature space corresponding to the number of brain consciousness level categories. Subsequently, the normalized exponential function layers transform the mapped feature vector into a probability distribution, where each probability value represents the likelihood that the test subject belongs to a specific brain consciousness level (e.g., conscious state, minimally conscious state, vegetative state, or coma). The classification network ultimately outputs the category with the highest probability value, i.e., the initial brain consciousness level category. Through these steps, an effective mapping from abstract high-dimensional physiological features to intuitive clinical medical states is achieved.
[0134] In this embodiment, the temporal feature network for performing temporal feature extraction, the spatial feature network for performing spatial feature extraction, the hierarchical fusion network, and the aforementioned classification network together constitute an end-to-end brain consciousness recognition model. This end-to-end overall architecture design ensures that the various network modules within the model no longer operate in isolation but form a unified whole, thereby enabling joint optimization of feature extraction and classification tasks during subsequent training.
[0135] To ensure the brain consciousness recognition model achieves high accuracy and robustness in practical applications, especially when processing clinical EEG signals with highly nonlinear and class-imbalanced characteristics, the model is obtained through the following joint training steps: First, a training dataset is obtained. This dataset contains multiple sets of sample EEG signal feature matrices and corresponding ground truth status labels. The sample EEG signal feature matrices serve as the model's historical input data, while the ground truth status labels are pre-labeled categories of brain consciousness levels corresponding to each sample, as determined by expert physicians or clinical gold standards. Obtaining a sufficient and accurately labeled training dataset is a fundamental prerequisite for the model to learn the inherent underlying patterns of EEG signals under different states of consciousness.
[0136] Next, the EEG signal feature matrices of each group of samples are input into the brain consciousness recognition model to be trained for forward propagation, outputting the corresponding predicted state category. Forward propagation refers to the process of data flowing unidirectionally from the input layer to the output layer in the neural network and being calculated. The sample EEG signal feature matrices are processed sequentially through a temporal feature network, a spatial feature network, and a hierarchical fusion network to extract and fuse the joint spatiotemporal feature representation of the sample. Finally, the classification network outputs the predicted state category of the sample. At this point, because the model is in a state of untraining (its internal network parameters such as weights and biases are usually randomly initialized), the predicted state category often deviates from the true state label.
[0137] Subsequently, the overall classification loss value between the predicted state category and the true state label is calculated using the adaptive focal loss function. In clinical medical scenarios, collected EEG data often exhibits a severe "long-tail effect" (class imbalance), for example, the amount of data in conscious states may be far greater than that in deeply comatose or minimally conscious states. Traditional cross-entropy loss functions tend to lead to the model being dominated by majority class samples, thus neglecting the learning of minority class samples. To address this technical problem, this application introduces an adaptive focal loss function. The adaptive focal loss function not only reduces the loss contribution of easily classified samples (usually majority class samples) by dynamically adjusting the weights of predicted probabilities, but also specifically introduces a dynamic class weighting mechanism. Specifically, the class weighting coefficient in the adaptive focal loss function is dynamically allocated based on the proportion of the total number of samples with each true state label in the training dataset.
[0138] As a preferred embodiment, the formula for calculating the adaptive focus loss function L is as follows: in, : Represents the total number of categories of brain consciousness levels; i: Represents the index of the i-th specific category; : Represents the predicted probability value (range from 0 to 1) that the model predicts the current sample belongs to the i-th category in the predicted state category output by the classification network. This represents the focusing parameter, used to adjust the decay rate of the weights on easily classified samples. When the model is very confident in classifying a sample (i.e., ...), it is used to adjust the decay rate of the weights. When it is close to 1), ( The value will tend to 0, thereby significantly reducing the contribution of the easily classified sample to the overall classification loss value, forcing the model to shift its attention (i.e. the focus of gradient optimization) to those difficult samples that are hard to classify. : Represents the dynamic category weighting coefficient for the i-th category. In this embodiment, this coefficient is not a fixed constant, but is dynamically calculated based on the proportion of the total number of samples. Specifically, ,in This represents the total number of samples in the training dataset. This represents the total number of samples in the training dataset whose true state labels belong to the i-th category.
[0139] Through the aforementioned dynamic allocation mechanism, if the total number of samples for a certain category (such as a rare state of unconsciousness) is... Smaller, then the corresponding The weighting will increase adaptively, thus assigning a greater penalty to the minority class samples during loss calculation. This effectively offsets the negative impact of data imbalance, allowing the calculated overall classification loss value to more objectively and evenly reflect the model's true error across all classes.
[0140] Finally, based on the overall classification loss value, the parameters of each network in the brain consciousness recognition model being trained are synchronously updated using the backpropagation algorithm to enhance the model's focus on features of minority-class data. Using the chain rule, the partial derivative (i.e., gradient) of the overall classification loss value with respect to each network parameter in the model (including the weight matrix and bias terms in the temporal feature network, spatial feature network, hierarchical fusion network, and the classification network) is calculated. Subsequently, an optimizer (e.g., the adaptive moment estimation optimizer, Adam) is used to synchronously update the parameters of all the aforementioned network modules along the negative direction of the gradient. This process of forward propagation to calculate the loss and backpropagation to update the parameters is iterated multiple times (Epochs) until the overall classification loss value converges to a preset threshold or reaches the maximum number of iterations.
[0141] By employing an adaptive focus loss function incorporating dynamic category weighting coefficients for joint training, this application achieves a significant technological breakthrough: enhancing the brain consciousness recognition model's focus on minority class features. This mechanism effectively avoids the model getting stuck in local optima during training, where predictions always tend to favor the majority class. It significantly improves the model's sensitivity to feature extraction from the minority class (typically more critical and critical states of severe consciousness impairment) and the accuracy of the final classification. Simultaneously, the synchronous joint training of the four network modules ensures that the entire data chain, from low-level spatiotemporal feature extraction to high-level semantic classification, works collaboratively under the same optimization objective, maximizing the model's overall feature representation capability. This provides a solid technical guarantee for the accurate identification of the brain consciousness level of the test subject.
[0142] Secondly, embodiments of this application provide a system, including: The first acquisition module is used to acquire the EEG signal feature matrix of the test subject. The EEG signal feature matrix includes the original EEG signal of the test subject and the frequency features of multiple physiological frequency bands. The first module is used to extract time dimension features from the EEG signal feature matrix to obtain a time feature sequence, which is used to characterize the global time dependency of the EEG signal feature matrix. The second module is used to extract spatial dimension features from the EEG signal feature matrix to obtain a spatial feature sequence. The spatial feature sequence is used to characterize the spatial distribution pattern of the EEG signal feature matrix in different channels. The third module is used to input the temporal feature sequence and the spatial feature sequence into a preset hierarchical fusion network, and to perform interactive fusion of temporal and spatial features through a multi-level attention mechanism to obtain a joint spatiotemporal feature representation. The first determining module is used to determine the initial brain consciousness level category of the test subject based on the joint spatiotemporal feature representation; The fourth module is used to extract the preset voltage amplitude range corresponding to the initial brain consciousness level category within a preset time window, obtain the minimum point, and determine the minimum point as the target mismatch negative wave trough. The first generation module is used to generate the brain consciousness recognition results of the test subject based on the initial brain consciousness level category and the target mismatch negative wave trough.
[0143] In this embodiment, the brain consciousness recognition system employs temporal and spatial feature extraction, along with multi-level interactive fusion techniques. This overcomes the limitations of existing technologies where single models lack the ability to jointly model the temporal dynamics and spatial distribution of EEG signals, leading to low classification accuracy. Consequently, it achieves the technical effect of fully mining spatiotemporal complementary information and significantly improving the accuracy and reliability of brain consciousness level classification. Simultaneously, it utilizes a technique of finding target mismatch negative wave troughs within a preset amplitude range based on the classification category for post-processing. This overcomes the problem of a lack of waveform feature support in single classification results, achieving the technical effect of verifying physiological electrical waveforms and improving the clinical objectivity of the assessment system. It effectively solves the challenges faced in recognizing EEG signals related to consciousness disorders, such as strong signal non-stationarity, large inter-individual differences, and difficulties in extracting key discriminant features, which make it difficult for existing methods to fully capture temporal dynamic information.
[0144] The functions of each module in each device in the embodiments of this application can be found in the corresponding descriptions in the above methods, and will not be repeated here.
[0145] Figure 2 A structural block diagram of an electronic device according to an embodiment of this application is shown. Figure 2As shown, the electronic device includes a memory 410 and a processor 420, wherein the memory 410 stores instructions executable on the processor 420. When the processor 420 executes these instructions, it implements the brain consciousness recognition method described in the above embodiments. The number of memories 410 and processors 420 can be one or more. This electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0146] The electronic device may also include a communication interface 430 for communicating with external devices and exchanging data. The devices are interconnected using different buses and can be mounted on a common motherboard or otherwise as needed. The processor 420 can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). The bus can be divided into address buses, data buses, control buses, etc. For ease of illustration, Figure 2 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0147] Optionally, in a specific implementation, if the memory 410, processor 420 and communication interface 430 are integrated on a single chip, the memory 410, processor 420 and communication interface 430 can communicate with each other through an internal interface.
[0148] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting Advanced Reduced Instruction Set Machines (ARM) architecture.
[0149] This application provides a computer-readable storage medium (such as the memory 410 described above) that stores computer instructions, which, when executed by a processor, implement the method provided in this application.
[0150] Optionally, memory 410 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device, etc. Furthermore, memory 410 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 410 may optionally include memory remotely located relative to processor 420, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0151] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0152] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0153] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more (two or more) executable instructions for implementing a particular logical function or process. Furthermore, the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functionality involved.
[0154] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0155] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. All or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware, the program being stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiments.
[0156] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0157] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for recognizing brain consciousness, characterized in that, include: The brainwave signal feature matrix of the subject to be tested is obtained. The brainwave signal feature matrix includes the original brainwave signal of the subject to be tested and the frequency features of multiple physiological frequency bands. Temporal features are extracted from the EEG signal feature matrix to obtain a temporal feature sequence, which is used to characterize the global temporal dependency of the EEG signal feature matrix. Spatial dimension features are extracted from the EEG signal feature matrix to obtain a spatial feature sequence, which is used to characterize the spatial distribution pattern of the EEG signal feature matrix in different channels. The temporal feature sequence and the spatial feature sequence are input into a preset hierarchical fusion network. The temporal and spatial features are interactively fused through a multi-level attention mechanism to obtain a joint spatiotemporal feature representation. Based on the joint spatiotemporal feature representation, the initial brain consciousness level category of the test subject is determined; Within a preset time window, a preset voltage amplitude range corresponding to the initial brain consciousness level category is extracted to obtain the minimum point, and the minimum point is determined as the target mismatch negative wave trough. Based on the initial brain consciousness level category and the target mismatch negative wave trough, the brain consciousness recognition result of the test subject is generated.
2. The method according to claim 1, characterized in that, The extraction of time-dimensional features from the EEG signal feature matrix to obtain the time feature sequence includes: The EEG signal feature matrix is transposed by swapping the time dimension and the channel dimension to obtain the feature matrix after dimension swapping. A linear transformation is used to map the feature matrix after the dimension exchange to a preset first feature dimension to obtain dimension-reduced aligned features. A location coding matrix corresponding to the absolute location index of the EEG data sequence is generated based on sine and cosine trigonometric functions. The position encoding matrix is added element by element to the dimension reduction alignment feature to obtain a temporal feature with position information, so that the dimension reduction alignment feature can perceive the sequential relationship of time points; The temporal features with location information are input into a multi-layer self-attention coding network for global context modeling, and the features after global context modeling are mapped back to the initial channel dimension to obtain a temporal feature sequence.
3. The method according to claim 2, characterized in that, The spatial dimension feature extraction of the EEG signal feature matrix to obtain the spatial feature sequence includes: The EEG signal feature matrix is expanded by channel expansion and local spatial pattern capture using the initial convolutional layer to obtain expanded spatial features; The extended spatial features are input into a residual network module containing multi-scale convolutional layers to obtain multi-granularity deep spatial features; Two different pooling operations are performed in parallel on the deep spatial features to obtain the results of the two pooling operations; The results of the two pooling operations are concatenated to obtain the concatenated result. The convolutional layer is used to extract features from the concatenated result, and the sigmoid activation function is used to generate weight allocation coefficients. The channel response is recalibrated using the weight allocation coefficients to obtain enhanced features, which are represented by enhanced key channels and target local regions. The enhanced features are reduced to a preset second feature dimension by a fully connected network to obtain a spatial feature sequence, wherein the second feature dimension is consistent with the time dimension of the temporal feature sequence.
4. The method according to claim 3, characterized in that, The step of inputting the temporal feature sequence and the spatial feature sequence into a preset hierarchical fusion network, and interactively fusing the temporal and spatial features through a multi-level attention mechanism to obtain a joint spatiotemporal feature representation includes: The first attention distribution is calculated and feature aggregation is performed using the time feature sequence as the query feature matrix and the spatial feature sequence as the key feature matrix and value feature matrix, respectively, to obtain the first enhanced time feature. The second attention distribution is calculated and feature aggregation is performed using the spatial feature sequence as the query feature matrix and the temporal feature sequence as the key feature matrix and value feature matrix, respectively, to obtain the first enhanced spatial feature. In the intermediate fusion layer of the hierarchical fusion network, the first enhanced temporal feature and the first enhanced spatial feature are further fused and added together by the cross attention module to obtain the hybrid spatiotemporal feature; In the bottom fusion layer of the hierarchical fusion network, a self-attention network is used to extract features from the internal relationships of the hybrid spatiotemporal features to generate a joint spatiotemporal feature representation.
5. The method according to claim 4, characterized in that, The initial brain consciousness level category includes at least one of the following state types: out of minimal consciousness, coma, vegetative state, minimal consciousness, and conscious state. The preset time window ranges from 100 milliseconds to 350 milliseconds. Extracting the preset voltage amplitude range corresponding to the initial brain consciousness level category within the preset time window to obtain the minimum point includes: If the initial level of brain consciousness is determined to be out of microconsciousness, then the minimum value point with the smallest amplitude is extracted within the voltage amplitude range of -2.9 microvolts to -2.1 microvolts. If the initial level of brain consciousness is determined to be a coma, then the minimum value point with the smallest amplitude is extracted within a voltage amplitude range greater than or equal to -0.5 microvolts. If the initial level of brain consciousness is determined to be a vegetative state, then the minimum value point with the smallest amplitude is extracted within the voltage amplitude range of greater than -1.0 microvolts and less than or equal to -0.6 microvolts. If the initial level of brain consciousness is determined to be a microconsciousness state, then the minimum value point with the smallest amplitude is extracted within the voltage amplitude range of -2.0 microvolts to -1.0 microvolts. If the initial level of brain consciousness is determined to be a conscious state, then the minimum value point with the smallest amplitude is extracted within a voltage amplitude range of less than -3 microvolts.
6. The method according to claim 5, characterized in that, The brain consciousness recognition result of the test subject, generated based on the initial brain consciousness level category and the target mismatch negative wave trough, includes: Determine whether the target mismatch negative wave trough has been successfully extracted within a preset voltage amplitude range corresponding to the initial brain consciousness level category; If so, the initial brain consciousness level category is confirmed to have support from the physiological characteristics of electroencephalogram waveforms, and the initial brain consciousness level category is determined as the final brain consciousness recognition result. If not, the credibility of the initial brain consciousness level category is determined to be lower than the preset requirement, and the corresponding brain consciousness level category is recalibrated based on the interval where the global minimum voltage amplitude is located within the preset time window, or a prompt message triggering manual verification is generated as the brain consciousness recognition result.
7. The method according to claim 6, characterized in that, The determination of the initial brain consciousness level category of the test subject based on the joint spatiotemporal feature representation includes: The joint spatiotemporal feature representation is input into a preset classification network to generate the initial brain consciousness level category of the test object. The temporal feature network used to perform the temporal dimension feature extraction, the spatial feature network used to perform the spatial dimension feature extraction, the hierarchical fusion network, and the classification network together constitute the brain consciousness recognition model. The brain consciousness recognition model was obtained through joint training using the following steps: Obtain a training dataset, which contains multiple sets of sample EEG signal feature matrices and the real state labels corresponding to each set of sample EEG signal feature matrices. The EEG signal feature matrices of each group of samples are input into the brain consciousness recognition model to be trained for forward propagation, and the corresponding predicted state category is output. An adaptive focus loss function is used to calculate the overall classification loss value between the predicted state category and the true state label; wherein, the class weighting coefficient in the adaptive focus loss function is dynamically allocated based on the proportion of the total number of samples of each true state label in the training dataset; Based on the overall classification loss value, the parameters of each network in the brain consciousness recognition model to be trained are updated synchronously through the backpropagation algorithm, so as to enhance the feature attention of the brain consciousness recognition model to minority category data.
8. A brain consciousness recognition system, characterized in that, include: The first acquisition module is used to acquire the EEG signal feature matrix of the test subject, the EEG signal feature matrix including the original EEG signal of the test subject and the frequency features of multiple physiological frequency bands; The first obtaining module is used to extract time dimension features from the EEG signal feature matrix to obtain a time feature sequence, which is used to characterize the global time dependency of the EEG signal feature matrix. The second obtaining module is used to extract spatial dimension features from the EEG signal feature matrix to obtain a spatial feature sequence, which is used to characterize the spatial distribution pattern of the EEG signal feature matrix in different channels. The third module is used to input the temporal feature sequence and the spatial feature sequence into a preset hierarchical fusion network, and to perform interactive fusion of temporal and spatial features through a multi-level attention mechanism to obtain a joint spatiotemporal feature representation. The first determining module is used to determine the initial brain consciousness level category of the test subject based on the joint spatiotemporal feature representation; The fourth module is used to extract a preset voltage amplitude range corresponding to the initial brain consciousness level category within a preset time window, obtain the minimum point, and determine the minimum point as the target mismatch negative wave trough. The first generation module is used to generate the brain consciousness recognition result of the test subject based on the initial brain consciousness level category and the target mismatch negative wave trough.
9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method as described in any one of claims 1-7.