Accurate electroencephalogram fatigue detection method and device based on self-adaptive time sequence modeling

The EEG fatigue detection method based on adaptive temporal modeling, which utilizes a two-layer Transformer encoder and multi-scale temporal modeling, solves the problems of insufficient accuracy and real-time performance in existing fatigue detection technologies, and achieves accurate prediction and real-time feedback of the fatigue state of power workers.

CN122020503APending Publication Date: 2026-05-12STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
Filing Date
2025-12-11
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing fatigue detection methods cannot accurately predict the fatigue state of power workers, and their detection accuracy is not high under high load and long working hours. They cannot reflect the continuous and gradual process from alertness to fatigue, and their real-time performance is insufficient.

Method used

An EEG fatigue detection method based on adaptive temporal modeling is adopted. Spatial feature modeling and temporal relationship modeling are performed through a two-layer Transformer encoder. Combined with multi-scale temporal modeling, the model is dynamically adjusted using the complexity factor of power operation scenario to capture short-term high-frequency neural oscillations and long-term fatigue accumulation, thereby achieving accurate fatigue state prediction.

Benefits of technology

It improves the predictability and evaluation accuracy of fatigue detection, can stably predict fatigue state in highly complex scenarios, accurately capture the complete evolution process from instantaneous fluctuations to gradual accumulation, and enhances the time granularity adaptability and real-time feedback capability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122020503A_ABST
    Figure CN122020503A_ABST
Patent Text Reader

Abstract

The invention relates to an electroencephalogram fatigue accurate detection method and device based on self-adaptive time sequence modeling. The method comprises the steps that real-time working condition data and electroencephalogram data of a detected person are collected and preprocessed; performing multi-dimensional feature extraction on the electroencephalogram data to obtain a feature matrix; inputting the feature matrix and the real-time working condition data into a pre-established fatigue prediction model to obtain a fatigue degree score; wherein the process of obtaining the fatigue degree score comprises the steps that based on a feature matrix, spatial feature modeling and time relation modeling are conducted through a double-layer Transform encoder, electroencephalogram spatial features and fatigue time features are obtained, and operation scene complexity factors obtained based on real-time working condition data are considered in the spatial feature modeling and the time relation modeling; and based on the fatigue time characteristics, multi-scale time sequence modeling is adopted to output a fatigue degree score. Compared with the prior art, the accuracy and effectiveness of feature extraction and the prediction stability under different working conditions are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fatigue detection technology, and in particular to a method and device for accurate detection of brainwave fatigue based on adaptive temporal modeling. Background Technology

[0002] The safe and stable operation of power systems relies heavily on the sustained focus and precise decision-making of personnel in dispatching, operation, and maintenance positions. However, the high-load, long-duration nature of these tasks easily induces cognitive fatigue, significantly increasing the risk of operational errors and posing a major safety hazard. Utilizing physiological signals such as electroencephalography (EEG) to objectively monitor fatigue has become a research hotspot in this field.

[0003] Traditional fatigue monitoring methods mostly fall under the category of anomaly detection, aiming to identify fatigue states that have already occurred. This approach is essentially a delayed response; by the time the system issues an alarm, the operator's cognitive abilities may have already dropped to a dangerous level, missing the optimal time for intervention.

[0004] The neurophysiological process of fatigue is extremely complex, and its EEG signals exhibit closely coupled dynamic changes in spatial (functional coordination of different brain regions), temporal (dynamic changes in fatigue state), and frequency (changes in different EEG rhythms). Traditional methods often process these dimensions separately, which affects the accuracy of recognition.

[0005] In real-world scenarios, fatigue is a continuous, gradual process from alertness to exhaustion. However, traditional methods simplify fatigue into a binary classification problem of "normal" and "fatigued." This coarse-grained binary judgment fails to reflect the specific stage of fatigue development that the worker is currently in.

[0006] Chinese patent CN118177835A discloses a fatigue level prediction method and system based on electroencephalogram (EEG) signals. Addressing the problems of existing EEG-based fatigue monitoring technologies, such as significant individual variability requiring lengthy calibration for new individuals and poor real-time performance, this method collects EEG data from multiple historical subjects, performs spectral analysis and channel selection, establishes a fatigue prediction model, and uses this model to predict the fatigue level of the subject to be tested, reducing calibration time and improving real-time performance. However, the fatigue state assessment does not actually show a continuous, gradual transition from alertness to drowsiness, and the fatigue level prediction method lacks specificity, resulting in low detection accuracy in complex power system operating scenarios with high loads and long durations. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a method and device for accurate detection of brainwave fatigue based on adaptive temporal modeling. This method can accurately predict the fatigue state of power workers based on their brainwave signals and provide real-time feedback. This solves the deficiencies of existing information processing network models in terms of predictability, modeling completeness, and evaluation precision, improves the accuracy and effectiveness of feature extraction, and makes up for the shortcomings of traditional deep learning in fatigue detection.

[0008] The objective of this invention can be achieved through the following technical solutions: A precise method for detecting brain fatigue based on adaptive temporal modeling, the method comprising: Real-time working condition data and EEG data of the test subjects are collected and preprocessed separately. The complexity factor of the work scenario is obtained from the real-time working condition data. Multi-dimensional feature extraction is performed on the preprocessed EEG data to obtain a feature matrix. The feature matrix and the complexity factor of the work scenario are input into a pre-established fatigue prediction model to obtain a fatigue level score. The fatigue prediction model includes a two-layer Transformer encoder. The process of obtaining a fatigue level score includes: based on the feature matrix, performing spatial feature modeling and temporal relationship modeling through the two-layer Transformer encoder to obtain fatigue time features. The spatial feature modeling and temporal relationship modeling take into account the complexity factor of the work scenario obtained based on real-time working condition data. Based on the fatigue time features, multi-scale temporal modeling is used to predict the fatigue state and output a fatigue level score.

[0009] Furthermore, the preprocessing of the EEG data of the tested individuals includes: Bandpass filtering is performed on the raw EEG signal; Independent component analysis was used to remove artifacts from electroencephalogram (EEG) signals, including electrooculogram (EOG) and electromyogram (EMG) signals.

[0010] Furthermore, the real-time operating data includes: Fault-related categories: Number of equipment fault alarms and fault severity within a preset time period; Operation-related categories: frequency of scheduling commands issued within a preset time and operation difficulty level; Environmental factors: Noise level and light intensity at the work site; Equipment-related category: Responsible for the operational status of equipment in the area.

[0011] Furthermore, the preprocessing of the real-time operating data includes: The real-time working condition data is aligned with the collection timestamp of the EEG data of the tested personnel, and outlier cleaning is performed. For missing data, the average value is filled in. Min-Max standardization is used to standardize the numerical data in the real-time operating condition data; By employing ordered encoding and standardization, the categorized data in the real-time operating condition data is encoded into values ​​in the range [0,1]. If the standardized / encoded real-time operating data does not fall within the [0,1] range, the portion exceeding this range will be forcibly truncated. Calculate sub-factors for each type of data in the real-time operating data, and obtain the operation scenario complexity factor by weighted summation and fusion of the sub-factors according to preset weights; wherein, the weights are set based on the risk priority of power operation.

[0012] Furthermore, the process of multi-dimensional feature extraction includes: The preprocessed continuous EEG signal was divided into time windows of fixed length; Calculate the differential entropy characteristics of different frequency bands for each time window; A feature matrix is ​​constructed based on the differential entropy features of different frequency bands.

[0013] Furthermore, the process of spatial feature modeling based on the two-layer Transformer encoder includes: The feature matrix is ​​reconstructed into an input format suitable for spatial modeling; Based on the reconstructed feature matrix, a query matrix, a key matrix, and a value matrix are generated using three preset learnable weight matrices. Calculate the attention weight matrix between different channels, using channels as the sequence unit; The channel adjustment coefficient is calculated based on the task scenario complexity factor, and the attention weight matrix is ​​dynamically scaled based on the channel adjustment coefficient. Substitute the dynamically adjusted weight matrix into the Softmax calculation to output the spatial features; The spatial features are input into a feedforward network, processed by linear transformation and activation function, and then combined with layer normalization to obtain EEG spatial features.

[0014] Furthermore, the process of modeling temporal relationships based on the two-layer Transformer encoder includes: The spatial features of the brainwave obtained after modeling the spatial features are reconstructed into an input format for matching time modeling; Calculate the window adjustment coefficient based on the complexity factor of the operation scenario, adjust the coverage of the dynamic window based on the window adjustment coefficient, and dynamically generate the window mask matrix; Based on the reconstructed EEG spatial features and window mask matrix, a sliding window attention mechanism is used to simultaneously capture short-term neural oscillations and long-term fatigue accumulation processes in the EEG. The capture results of the sliding window attention mechanism are input into the feedforward network, processed by linear transformation and activation function, and then combined with layer normalization to obtain fatigue time features.

[0015] Furthermore, the process of predicting fatigue state using multi-scale time series modeling and obtaining the fatigue level score includes: Based on convolutional layers constructed at several different scales, and based on fatigue time characteristics, instantaneous neural oscillations, mid-term fatigue accumulation, and long-term fatigue trends are captured respectively, and short-term, mid-term, and long-term features are obtained. The short-term, medium-term and long-term features are fused using a splicing operation to obtain multi-scale features. The multi-scale features are input into a linear layer for dimension mapping, and the dimension mapping result is normalized to the range [0,1] using the Sigmoid function to obtain the fatigue level score.

[0016] Furthermore, the fatigue prediction model is trained based on a time-series regularized loss function, which includes regression loss and smoothing loss.

[0017] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the brainwave fatigue precision detection method based on adaptive temporal modeling as described above.

[0018] Compared with the prior art, the beneficial effects of the present invention include: 1. This invention performs deep processing of EEG signals through spatial feature modeling, temporal relationship modeling, and multi-scale temporal modeling based on a two-layer Transformer module. It can accurately predict fatigue status based on the EEG signals of power workers and provide real-time feedback, thus overcoming the shortcomings of existing information processing network models in predictability, modeling completeness, and evaluation precision. This improves the accuracy and effectiveness of feature extraction and compensates for the deficiencies of traditional deep learning in fatigue detection. This invention models the spatial correlation between channels using a two-layer Transformer encoder, binding frequency features with spatial features. It also reconstructs the temporal modeling input based on spatial features, allowing temporal features to naturally carry spatial and frequency information. Finally, through multi-scale modeling, it achieves adaptive integration of three-dimensional features, avoiding the limitations of single-dimensional modeling and fully preserving the physiological correlation of EEG signals. Furthermore, this invention considers the complexity factor of the work scenario acquired based on real-time working condition data in spatial feature modeling and temporal relationship modeling, breaking through the limitations of traditional fixed attention structures. This allows the model to actively adapt to the dynamic changes in power work scenarios, improving prediction stability under different working conditions.

[0019] 2. This invention introduces a channel adjustment coefficient in the spatial modeling of a two-layer Transformer and a window adjustment coefficient in the temporal modeling, enabling the model to adaptively match high-complexity scenarios (such as fault repair) and low-complexity scenarios (such as routine inspection), focusing on the dynamic needs of short-term high-frequency neural oscillations and capturing long-term fatigue accumulation, thus solving the problem of poor adaptability of traditional models to scene changes.

[0020] 3. This invention designs a hierarchical convolutional layer to cover the changes in fatigue throughout all stages, and associates EEG signals with work condition data through scene complexity factors to achieve cross-modal information complementarity at the neural and scene levels. Compared with traditional single-scale modeling, it can more accurately capture the complete evolution process of fatigue from instantaneous fluctuations to gradual accumulation and then to periodic repetition, and improve the temporal granularity adaptability of prediction.

[0021] 4. In view of the characteristics of power operation scenarios, this invention has developed a standardization and coding scheme for operating condition data. It adopts ordered coding for classified data such as fault level and operation difficulty, and adopts Min-Max standardization for numerical data such as alarm frequency and noise level, so as to ensure the feasibility of fusion of multi-source heterogeneous data. Attached Figure Description

[0022] Figure 1 This is a flowchart of the method of the present invention; Figure 2 A multi-band signal feature map showing the distribution of EEG electrodes; Figure 3 This is a schematic diagram of a two-layer Transformer encoder structure. Detailed Implementation

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

[0024] Example 1 This embodiment discloses a precise method for detecting EEG fatigue based on adaptive temporal modeling. The method of this embodiment is as follows: Figure 1 As shown, steps S1-S3 are included, and the specific steps are described below: Step S1: Collect real-time working condition data and EEG data of the test subjects and preprocess them respectively, and obtain the work scenario complexity factor from the real-time working condition data.

[0025] Real-time operating data includes: Fault-related categories: Number of equipment fault alarms and fault severity within a preset time period; Operation-related categories: frequency of scheduling commands issued within a preset time and operation difficulty level; Environmental factors: Noise level and light intensity at the work site; Equipment-related category: Responsible for the operational status of equipment in the area.

[0026] The EEG data of the test subjects was specifically obtained by collecting multi-channel EEG signals. Obtain, where C is the number of channels, refer to Figure 2 T represents the number of time points; the EEG signal sampling rate is 1000Hz, and data is continuously collected for 8 hours of work.

[0027] Preprocessing of the EEG data of the test subjects includes: Bandpass filtering is performed on the raw EEG signal; Independent component analysis was used to remove artifacts from EEG signals, including electrooculography (EOG) and electromyography (EMG).

[0028] The specific process of preprocessing the EEG data of the test subjects in this embodiment is as follows: Multichannel EEG signals were subjected to common-average reference rereference processing. The signal is filtered using a 4th-order Butterworth filter with a frequency range of 0-50Hz. Independent component analysis algorithm is applied to remove artifacts such as eye movements and blinking, while retaining neural oscillations related to fatigue; Preprocessing of real-time operating data includes: Align the real-time operating data with the collection timestamps of the EEG data of the test subjects, perform outlier cleaning, and fill in missing data with average values; Min-Max standardization is used to standardize the numerical data in real-time operating condition data; By employing ordered coding and standardization, the categorized data in real-time operating condition data is encoded into values ​​in the range [0,1]. If the standardized / encoded real-time operating data does not fall within the [0,1] range, the portion exceeding this range will be forcibly truncated. Calculate the sub-factors of each type of data in the real-time operating data, and obtain the operation scenario complexity factor by weighted summation of the sub-factors according to the preset weights; where the weights are set based on the priority of power operation risks.

[0029] Each EEG time window corresponds to a scene complexity factor S, where the closer S is to 1, the more complex the scene and the higher the cognitive load on the operator; the closer S is to 0, the simpler the scene and the lower the load.

[0030] In this embodiment, the specific process of outlier cleaning after aligning the real-time working condition data with the EEG data of the tested personnel is as follows: Fault-related data cleaning: Anomaly detection: If the number of fault alarms is greater than 10 times / 5 minutes, under normal operating conditions of the power system, major faults rarely exceed 3 times within 5 minutes. If it exceeds this, it is considered a false alarm. The fault level code is abnormal, including non-major / general / minor.

[0031] Processing logic: Abnormal alarm frequency: Replace with the average alarm frequency over the past 10 minutes (e.g., 8 alarms in the past 10 minutes, with a 5-minute average of 4 alarms). Level coding error: Treat as a general fault by default; Deduplication: Duplicate alarms from the same device are retained only once.

[0032] Operation-related data cleaning: Anomaly detection: Dispatch command frequency > 15 times / 5 minutes, regular dispatch commands ≤ 8 times within 5 minutes, excessive commands are system errors; operation difficulty coefficient is empty, no difficulty is marked.

[0033] Processing logic: Abnormal command frequency: Threshold of 15 times is set, meaning that if the number of commands exceeds 15 times, it will be counted as 15 times to avoid extreme values ​​dominating. Difficulty level is empty: Match the default value according to the operation type, such as equipment inspection with a default difficulty of 1 and fault repair with a default difficulty of 3.

[0034] Environmental data cleaning: Abnormal value judgment: Noise level > 100dB, light intensity > 10000 lux or < 50 lux; data jump > 50%, such as noise 60dB in the previous minute and suddenly 100dB in the current minute, is considered a sensor failure.

[0035] Processing logic: Exceeding the tolerance range: Replace according to the tolerance threshold, that is, noise > 100dB replaces 100dB, light > 10000lux replaces 10000lux; Data jump anomalies: Use a weighted average of the previous minute's data and the current data, with the previous minute accounting for 70% and the current data accounting for 30%, and smooth it out.

[0036] Equipment-related data cleaning: Anomaly detection: If the number of overloaded / abnormal devices exceeds 50% of the total number of devices under responsibility, it is considered a system data synchronization error.

[0037] Processing logic: Replace 30% of the total number of responsible devices. The proportion of devices under overload / abnormal at the same time in the power system rarely exceeds 30%.

[0038] Step S2: Perform multi-dimensional feature extraction on the preprocessed EEG data to obtain the feature matrix.

[0039] The process of multi-dimensional feature extraction includes: The preprocessed continuous EEG signal was divided into time windows of fixed length; For each time window, the differential entropy characteristics of different frequency bands are calculated, including δ (0.5-4Hz), θ (4-8Hz), α (8-13Hz), β (13-30Hz), and γ (30-48Hz). A feature matrix is ​​constructed based on the differential entropy features of different frequency bands.

[0040] In this embodiment, the formula for calculating differential entropy is: ,in It is the signal variance within a specific frequency band, with the EEG frequency band as a reference. Figure 2 .

[0041] Step S3: Input the feature matrix and the complexity factor of the work scenario into the pre-established fatigue prediction model to obtain the fatigue level score.

[0042] The fatigue prediction model consists of a two-layer Transformer encoder, a multi-scale fusion layer, and an output layer.

[0043] The process of obtaining a fatigue level score includes: based on the feature matrix, spatial feature modeling and temporal relationship modeling are performed through a two-layer Transformer encoder to obtain EEG spatial features and fatigue temporal features. The complexity factor of the work scenario obtained based on real-time working condition data is considered in the spatial feature modeling and temporal relationship modeling. Based on the fatigue temporal features, multi-scale temporal modeling is used to predict the fatigue state and output a fatigue level score.

[0044] The two-layer Transformer encoder is as follows: Figure 3 As shown, it includes spatial and temporal layers. The first layer, the Transformer encoder, is used for spatial feature modeling. The specific parameters are: 8 attention heads; 512 hidden layer dimensions; 2048 feedforward network dimensions; 0.1 dropout rate; and 2 layers.

[0045] The second Transformer encoder is used for temporal relationship modeling. Its specific parameters are: window size of 16 time steps; number of attention heads of 8; hidden layer dimension of 256; position encoding is sine-cosine position encoding; number of layers of 2.

[0046] Before modeling using the task scenario complexity factor, the global EEG activity entropy value F is calculated based on the features extracted in step S2.

[0047] The specific calculation expression is as follows: in, For the number of time windows, The number of frequency bands in the characteristic matrix. Let F be the differential entropy of the i-th time window and the j-th frequency band. A larger F indicates a more active EEG signal. The process of spatial feature modeling based on a two-layer Transformer encoder includes: Reconstruct the feature matrix into an input format suitable for spatial modeling; Based on the reconstructed feature matrix, a query matrix, a key matrix, and a value matrix are generated using three preset learnable weight matrices, as shown in the following expressions: in, , and These are query, key, and value matrices, respectively. To reconstruct the feature matrix into an input format suitable for spatial modeling, , and Here is the learnable weight matrix for spatial attention; Calculate the attention weight matrix between different channels, using channels as the sequence unit; The expression for the channel adjustment coefficient, calculated based on the complexity factor of the work scenario, is as follows: in, and This is the attention weight matrix between different channels. For bias terms, For the Sigmoid function; Constructing a functional mask matrix of brain regions The mask value is set to 1 for cognitively relevant brain regions such as the prefrontal cortex (F3, F4, Fz channels, etc.), parietal cortex (C3, C4, Cz channels, etc.), and occipital cortex (O1, O2, Oz channels, etc.), while the mask value for irrelevant brain regions (such as some channels in the temporal lobe) is 0.8, thereby enhancing the regulatory sensitivity of core brain regions. The attention weight matrix is ​​dynamically scaled based on the channel adjustment coefficient. The original attention matrix expression is: ,in The scaling factor is used, and after applying dynamic adjustment and brain region masking scaling, the result is: , This is element-wise multiplication, ensuring that the weight of each channel is dynamically adjusted according to the scenario.

[0048] Substituting the dynamically adjusted weight matrix into the Softmax calculation, the spatial features are output, and their calculation expression is as follows: Spatial features are input into a feedforward network, processed by linear transformation and activation function, and then combined with layer normalization to obtain EEG spatial features. .

[0049] The specific steps for calculating the channel adjustment coefficient based on the task scenario complexity factor and dynamically scaling the attention weight matrix based on the channel adjustment coefficient are as follows: The process of modeling temporal relationships based on a two-layer Transformer encoder includes: The spatial features of EEG obtained after spatial feature modeling are reconstructed into an input format for time-matching modeling; The window adjustment coefficient is calculated based on the complexity factor of the task scenario, and its calculation expression is as follows: in, and For learnable weights, For bias terms; Adjusting the coverage of a dynamic window based on a window adjustment coefficient. (16 means the preset window size is 16), dynamically generate the window mask matrix. ; Based on the reconstructed EEG spatial features and window mask matrix, a sliding window attention mechanism is employed to simultaneously capture short-term neural oscillations and long-term fatigue accumulation processes in the EEG. Its expression is as follows: in, , , and Here is the learnable weight matrix for temporal attention. For time-based attention, the hidden layer dimension is used. The capture results of the sliding window attention mechanism are input into the feedforward network, processed by linear transformation and activation function, and then combined with layer normalization to obtain fatigue time features.

[0050] The process of predicting fatigue state and obtaining fatigue level scores using multi-scale time series modeling includes: Based on convolutional layers constructed at several different scales, and based on fatigue time characteristics, instantaneous neural oscillations, mid-term fatigue accumulation, and long-term fatigue trends are captured respectively, and short-term, mid-term, and long-term features are obtained. By splicing short-term, medium-term and long-term features, multi-scale features are fused to obtain multi-scale features. Multi-scale features are input into a linear layer for dimension mapping. The dimension mapping result is normalized to the range [0,1] using the Sigmoid function to obtain the fatigue level score.

[0051] The fatigue prediction model is trained based on a time-regularized loss function, which includes regression loss and smoothing loss. The expression for the time-regularized loss function is as follows: in, These are the model's predicted values. This represents the actual fatigue value. To regress the loss, To smooth out the loss, For time-order regularization loss, The weights are used to smooth the time series, ensuring the continuity of predicted values ​​in adjacent time periods.

[0052] Fatigue level output: The output range is [0, 1], where 0 represents being fully awake and 1 represents being extremely tired.

[0053] Example 2 Based on Embodiment 1, this embodiment provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, the one or more programs including instructions for executing the aforementioned method for accurate detection of brainwave fatigue based on adaptive temporal modeling.

[0054] At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the aforementioned method for accurate detection of brainwave fatigue based on adaptive temporal modeling. Of course, in addition to software implementation, this invention does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.

[0055] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0056] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0057] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A precise method for detecting brain fatigue based on adaptive temporal modeling, characterized in that, The method includes: Real-time working condition data and EEG data of the test subjects are collected and preprocessed separately. The complexity factor of the work scenario is obtained from the real-time working condition data. Multi-dimensional feature extraction is performed on the preprocessed EEG data to obtain a feature matrix. The feature matrix and the complexity factor of the work scenario are input into a pre-established fatigue prediction model to obtain a fatigue level score. The fatigue prediction model includes a two-layer Transformer encoder. The process of obtaining a fatigue level score includes: based on the feature matrix, performing spatial feature modeling and temporal relationship modeling through the two-layer Transformer encoder to obtain fatigue time features. The spatial feature modeling and temporal relationship modeling take into account the complexity factor of the work scenario obtained based on real-time working condition data. Based on the fatigue time features, multi-scale temporal modeling is used to predict the fatigue state and output a fatigue level score.

2. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 1, characterized in that, Preprocessing of the EEG data of the subjects includes: Bandpass filtering is performed on the raw EEG signal; Independent component analysis was used to remove artifacts from electroencephalogram (EEG) signals, including electrooculogram (EOG) and electromyogram (EMG) signals.

3. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 1, characterized in that, The real-time operating data includes: Fault-related categories: Number of equipment fault alarms and fault severity within a preset time period; Operation-related categories: frequency of scheduling commands issued within a preset time and operation difficulty level; Environmental factors: Noise level and light intensity at the work site; Equipment-related category: Responsible for the operational status of equipment in the area.

4. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 3, characterized in that, Preprocessing of the real-time operating data includes: The real-time working condition data is aligned with the collection timestamp of the EEG data of the tested personnel, and outlier cleaning is performed. For missing data, the average value is filled in. Min-Max standardization is used to standardize the numerical data in the real-time operating condition data; By employing ordered encoding and standardization, the categorized data in the real-time operating condition data is encoded into values ​​in the range [0,1]. If the standardized / encoded real-time operating data does not fall within the [0,1] range, the portion exceeding this range will be forcibly truncated. Calculate sub-factors for each type of data in the real-time operating data, and obtain the operation scenario complexity factor by weighted summation and fusion of the sub-factors according to preset weights; wherein, the weights are set based on the risk priority of power operation.

5. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 1, characterized in that, The process of multi-dimensional feature extraction includes: The preprocessed continuous EEG signal was divided into time windows of fixed length; Calculate the differential entropy characteristics of different frequency bands for each time window; A feature matrix is ​​constructed based on the differential entropy features of different frequency bands.

6. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 1, characterized in that, The process of spatial feature modeling based on the dual-layer Transformer encoder includes: The feature matrix is ​​reconstructed into an input format suitable for spatial modeling; Based on the reconstructed feature matrix, a query matrix, a key matrix, and a value matrix are generated using three preset learnable weight matrices. Calculate the attention weight matrix between different channels, using channels as the sequence unit; The channel adjustment coefficient is calculated based on the task scenario complexity factor, and the attention weight matrix is ​​dynamically scaled based on the channel adjustment coefficient. Substitute the dynamically adjusted weight matrix into the Softmax calculation to output the spatial features; The spatial features are input into a feedforward network, processed by linear transformation and activation function, and then combined with layer normalization to obtain EEG spatial features.

7. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 6, characterized in that, The process of modeling temporal relationships based on the two-layer Transformer encoder includes: The spatial features of the brainwave obtained after modeling the spatial features are reconstructed into an input format for matching time modeling; Calculate the window adjustment coefficient based on the complexity factor of the operation scenario, adjust the coverage of the dynamic window based on the window adjustment coefficient, and dynamically generate the window mask matrix; Based on the reconstructed EEG spatial features and window mask matrix, a sliding window attention mechanism is used to simultaneously capture short-term neural oscillations and long-term fatigue accumulation processes in the EEG. The capture results of the sliding window attention mechanism are input into the feedforward network, processed by linear transformation and activation function, and then combined with layer normalization to obtain fatigue time features.

8. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 1, characterized in that, The process of predicting fatigue state and obtaining the fatigue level score using multi-scale time series modeling includes: Based on convolutional layers constructed at several different scales, and based on fatigue time characteristics, instantaneous neural oscillations, mid-term fatigue accumulation, and long-term fatigue trends are captured respectively, and short-term, mid-term, and long-term features are obtained. The short-term, medium-term and long-term features are fused using a splicing operation to obtain multi-scale features. The multi-scale features are input into a linear layer for dimension mapping, and the dimension mapping result is normalized to the range [0,1] using the Sigmoid function to obtain the fatigue level score.

9. The method for accurate detection of EEG fatigue based on adaptive temporal modeling according to claim 1, characterized in that, The fatigue prediction model is trained based on a time-regularized loss function, which includes regression loss and smoothing loss.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method for accurate detection of brainwave fatigue based on adaptive temporal modeling as described in any one of claims 1-9.