Electroencephalogram signal fatigue detection method, device and computer readable storage medium

By combining multi-scale temporal feature encoding and graph attention network model, and using synchronous and asynchronous partitioning strategies to generate sample data, and performing channel-level and sample-level graph comparison learning, the problem of low accuracy in EEG signal fatigue detection is solved, and high-accuracy fatigue detection is achieved.

CN119700138BActive Publication Date: 2026-06-26ZHANJIANG POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHANJIANG POWER SUPPLY BUREAU OF GUANGDONG POWER GRID CO LTD
Filing Date
2024-12-09
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies for fatigue detection using EEG signals have low accuracy and cannot effectively exploit the spatial consistency of multi-channel signals and the multi-scale representation of time series, resulting in insufficient detection accuracy.

Method used

A multi-scale temporal feature encoding model and a graph attention network model are adopted. Positive and negative sample data are generated through synchronous and asynchronous partitioning strategies. Combined with a multi-head self-attention mechanism and a Transformer encoder, channel-level and sample-level graph comparison learning is performed to extract multi-scale temporal features and channel correlations.

Benefits of technology

It improves the accuracy of fatigue detection using EEG signals and can effectively improve detection accuracy in multi-channel data scenarios, meeting the high accuracy requirements for fatigue detection and early warning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119700138B_ABST
    Figure CN119700138B_ABST
Patent Text Reader

Abstract

The application provides an electroencephalogram fatigue detection method, device and computer readable storage medium. The method comprises the following steps: obtaining original sample data of an electroencephalogram, performing division processing on the original sample data of the electroencephalogram to generate positive sample data and negative sample data; inputting the original sample data, the positive sample data and the negative sample data into a multi-scale time sequence feature coding model to extract corresponding multi-scale time sequence features, performing graph construction processing on the original sample data, the positive sample data and the negative sample data according to the corresponding multi-scale time sequence features to obtain corresponding sample graphs, inputting each sample graph into a graph attention network model, training the graph attention network model, and obtaining a fatigue detection model; obtaining electroencephalogram data of a person to be detected, performing detection processing on the electroencephalogram data by using the fatigue detection model, and outputting a fatigue detection result. The problem of low detection accuracy of electroencephalogram fatigue detection in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of brainwave signal fatigue detection technology, and more specifically, to a brainwave signal fatigue detection method, a brainwave signal fatigue detection device, a computer-readable storage medium, and an electronic device. Background Technology

[0002] Fatigue detection based on electroencephalogram (EEG) signals is an important task in the field of biomedical signal processing. It can be applied to real-time fatigue detection and hazard warning for workers in various work scenarios, such as hazardous jobs, indoor / outdoor maintenance work, and high-altitude work, as well as for large truck drivers and long-distance drivers, thereby protecting the safety of people's lives and property.

[0003] Electroencephalogram (EEG) signals are a type of nonlinear time-series data with multiple channels and variables. Therefore, fatigue detection based on EEG signals is essentially a multivariate time-series classification algorithm. Currently, fatigue detection based on EEG signals mainly relies on Long Short-Term Memory (LSTM) networks to learn the temporal features of EEG signals, which has significantly improved performance in fatigue level classification. For example, deep CNN-LSTM models and GAN-LSTM models both inherit the LSTM architecture design used in general time-series analysis.

[0004] However, general time series analysis, compared to its focus on time-dimensional features, lacks in-depth research into the relationships between channel-dimensional features, which affects the encoder's ability to capture the overall features of multi-channel EEG data. For example, the TS-TCC model introduces a time contrast module to learn robust time representations through cross-view prediction tasks. However, this model directly fuses all channel values ​​from one or more time steps during embedding, failing to effectively mine the spatial consistency of multi-channel signals, i.e., the stability of each channel and the stability of correlations between different channels. Furthermore, for time-dimensional features, existing models only learn fixed-scale temporal feature representations. For instance, the TST model, based on a single Transformer encoder architecture, uses autoregressive methods to denoise the input data and extract dense vector representations of multivariate time series, significantly improving performance on downstream supervised learning tasks. However, it cannot learn hierarchical multi-scale representations from time series data and cannot effectively capture long-distance dependencies and interactions throughout the time series. Existing technologies also suffer from low detection accuracy in EEG signal fatigue detection. Summary of the Invention

[0005] The main objective of this application is to provide a method, device, storage medium, processor, and electronic device for detecting brain electrical signals fatigue, so as to at least solve the problem of low detection accuracy of brain electrical signals fatigue detection in the prior art.

[0006] To achieve the above objectives, according to one aspect of this application, a method for detecting fatigue in electroencephalogram (EEG) signals is provided, comprising: acquiring raw sample data of EEG signals; dividing the raw sample data of the EEG signals into positive sample data and negative sample data; inputting the raw sample data, the positive sample data, and the negative sample data into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features, and performing graph construction processing on the raw sample data, the positive sample data, and the negative sample data according to the corresponding multi-scale temporal features to obtain corresponding sample graphs; inputting each of the sample graphs into a graph attention network model, training the graph attention network model to obtain a fatigue detection model; acquiring EEG signal data of a person to be tested, using the fatigue detection model to detect and process the EEG signal data, and outputting fatigue detection results.

[0007] Optionally, the original sample data of the EEG signal is segmented to generate positive sample data and negative sample data, including: segmenting the original sample data using a synchronous segmentation strategy to generate the positive sample data, wherein the synchronous segmentation strategy involves segmenting the original sample data according to a preset time interval and randomly shuffling the segment order while maintaining consistency of the EEG channels in the segmented data; and segmenting the original sample data using an asynchronous segmentation strategy to generate the negative sample data, wherein the asynchronous segmentation strategy involves segmenting the original sample data according to the preset time interval and randomly shuffling the segment order of each EEG channel in different ways.

[0008] Optionally, during the training of the graph attention network model, the method further includes: calculating the total loss function of the graph attention network model, wherein the total loss function includes channel-level contrast loss, overall sample contrast loss, and cross-entropy loss; and updating the model parameters of the graph attention network model according to the total loss function.

[0009] Optionally, the channel-level contrast loss in the total loss function of the graph attention network model is calculated, including: according to the first formula: Determine the channel-level contrast loss in, The feature representation of the nth channel node of the original sample data after the Lth layer of the network. The feature representation of the nth channel node of the original sample data after the Lth layer of the network. The L-th layer network represents the feature representation of all channel nodes except the nth channel in the original sample data, the positive sample data, and the negative sample data, and τ represents the temperature coefficient.

[0010] Optionally, the overall sample contrast loss in the total loss function of the graph attention network model is calculated, including: according to the second formula: Determine the overall contrast loss of the sample. in, This represents the overall characteristics of sample i. The overall characteristics of the positive sample data representing sample i. τ represents the m-th overall feature in the batch containing sample i after removing sample i and in the data-augmented sample, B represents the size of a batch, and τ represents the temperature coefficient.

[0011] Optionally, the original sample data, the positive sample data, and the negative sample data are input into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features, including: mapping the original sample data, the positive sample data, and the negative sample data respectively through the Time2Vec model to generate corresponding initial time series embeddings; and inputting each of the initial time series embeddings into a Transformer encoding layer based on a multi-head self-attention mechanism to obtain the corresponding multi-scale temporal features.

[0012] Optionally, after processing the EEG signal data to be detected using the fatigue detection model and outputting the fatigue detection result, the method further includes: determining the fatigue level of the person to be detected based on the fatigue detection result, and generating a prompt message based on the fatigue level, wherein the prompt message is used to remind the person to be detected of their current fatigue state.

[0013] According to another aspect of this application, a brainwave signal fatigue detection device is provided, comprising: an acquisition unit, configured to acquire raw sample data of brainwave signals, divide the raw sample data of brainwave signals into positive sample data and negative sample data; a processing unit, configured to input the raw sample data, the positive sample data and the negative sample data into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features, and perform graph construction processing on the raw sample data, the positive sample data and the negative sample data according to the corresponding multi-scale temporal features to obtain corresponding sample graphs, and input each of the sample graphs into a graph attention network model to train the graph attention network model to obtain a fatigue detection model; and a detection unit, configured to acquire brainwave signal data of a person to be detected, use the fatigue detection model to detect and process the brainwave signal data, and output fatigue detection results.

[0014] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform any of the described electroencephalogram (EEG) signal fatigue detection methods.

[0015] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any of the described electroencephalogram (EEG) signal fatigue detection methods.

[0016] This application utilizes the technical solution to acquire raw sample data of electroencephalogram (EEG) signals, divide and process this raw data to generate positive and negative sample data. The raw, positive, and negative sample data are then input into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features. Based on these features, graph construction is performed on the raw, positive, and negative sample data to obtain corresponding sample graphs. These sample graphs are then input into a graph attention network model for training, resulting in a fatigue detection model. Finally, the application acquires the EEG signal data of the person to be tested, uses the fatigue detection model to process the EEG signal data, and outputs the fatigue detection results. In scenarios where multiple channels of EEG signal time series data exist, this approach fully utilizes multi-scale temporal features and channel correlations, effectively improving the low accuracy of existing EEG signal fatigue detection algorithms in long-term, multi-channel data. It possesses strong multi-scale temporal feature and multi-channel feature learning capabilities and robustness, meeting the high accuracy requirements of practical applications such as fatigue detection and early warning. This solves the problem of low detection accuracy in existing EEG signal fatigue detection technologies. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 A hardware structure block diagram of a mobile terminal for performing a brainwave signal fatigue detection method according to an embodiment of this application is shown.

[0019] Figure 2 A flowchart illustrating a method for detecting brainwave signal fatigue according to an embodiment of this application is shown.

[0020] Figure 3A flowchart illustrating a specific brainwave signal fatigue detection method provided according to an embodiment of this application is shown.

[0021] Figure 4 A schematic diagram of EEG signal data enhancement based on synchronous and asynchronous partitioning provided according to an embodiment of this application is shown;

[0022] Figure 5 A schematic diagram illustrating channel-level and sample-level comparisons provided according to embodiments of this application is shown.

[0023] Figure 6 A structural block diagram of an electroencephalogram (EEG) signal fatigue detection device according to an embodiment of this application is shown.

[0024] The above figures include the following reference numerals:

[0025] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation

[0026] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

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

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] As described in the background section, the existing technology has the problem of low detection accuracy in EEG signal fatigue detection. To solve the problem of low detection accuracy in EEG signal fatigue detection in the existing technology, the embodiments of this application provide an EEG signal fatigue detection method, an EEG signal fatigue detection device, a computer-readable storage medium, and an electronic device.

[0030] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

[0031] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a brainwave signal fatigue detection method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0032] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the EEG signal fatigue detection method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] This embodiment provides a method for detecting brainwave signal fatigue that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0034] Figure 2 This is a flowchart of a brainwave signal fatigue detection method according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:

[0035] Step S201: Obtain raw sample data of EEG signals, and divide the raw sample data of the EEG signals to generate positive sample data and negative sample data.

[0036] Specifically, to generate positive samples, first, the original sample X... jThe brainwaves are segmented according to a time interval τ, forming T / τ segments. A synchronous segmentation strategy is employed, which involves randomly shuffling the segment order while maintaining consistency across brainwave channels. From a single-channel perspective, after shuffling the segment order, adjacent segments no longer exhibit temporal dependence; however, data from different channels within the same time segment remain contiguous after the shuffling. For each sample, this synchronous segmentation strategy generates a positive sample.

[0037] For generating negative samples, an asynchronous partitioning strategy was adopted. Similarly, the original sample X was first partitioned... j The data is segmented according to a time interval τ, and the segment order is randomly shuffled. Furthermore, the segmentation order of each channel is also randomly shuffled in different ways. This strategy ensures that data from different channels within the same time segment cannot be grouped together after the segment order is shuffled. For each sample, an asynchronous partitioning strategy is also used to generate a negative sample.

[0038] Step S202: Input the original sample data, positive sample data and negative sample data into the multi-scale temporal feature encoding model to extract the corresponding multi-scale temporal features, and perform graph construction processing on the original sample data, positive sample data and negative sample data according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs. Input each of the above sample graphs into the graph attention network model to train the graph attention network model to obtain the fatigue detection model.

[0039] Specifically, to generate multi-scale temporal feature representations of EEG signal time series data, a multi-stage multi-scale temporal feature encoding module model was adopted, thereby generating feature maps at different time scales. Each stage of the model consists of a time partitioning operation and a Transformer encoder layer, with the time partitioning granularity of each stage being twice that of the previous stage. Relying on this multi-stage structure, local and global representations of the time series at different time scales can be effectively extracted.

[0040] Step S203: Obtain the EEG signal data of the person to be tested, use the above-mentioned fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result.

[0041] This embodiment acquires raw sample data of EEG signals, divides the raw sample data into positive and negative sample data, and inputs the raw, positive, and negative sample data into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features. Based on these features, graph construction is performed on the raw, positive, and negative sample data to obtain corresponding sample graphs. These sample graphs are then input into a graph attention network model for training, resulting in a fatigue detection model. The EEG signal data of the person to be tested is acquired, and the fatigue detection model is used to process the EEG signal data, outputting fatigue detection results. In scenarios where multiple channels of EEG signal time series data exist, this method fully utilizes multi-scale temporal features and channel correlations, effectively improving the low accuracy of existing EEG signal fatigue detection algorithms in long-term, multi-channel data. It possesses strong multi-scale temporal and multi-channel feature learning capabilities and robustness, meeting the high accuracy requirements of practical applications such as fatigue detection and early warning. This solves the problem of low detection accuracy in existing EEG signal fatigue detection technologies.

[0042] In the specific implementation process, the original sample data of the above-mentioned EEG signals are divided and processed to generate positive sample data and negative sample data, including: dividing the original sample data using a synchronous division strategy to generate the above-mentioned positive sample data, wherein the synchronous division strategy is to divide the original sample data into segments according to a preset time interval and randomly shuffle the segment order while keeping the EEG channels of the segmented data consistent; and dividing the original sample data using an asynchronous division strategy to generate the above-mentioned negative sample data, wherein the asynchronous division strategy is to divide the original sample data into segments according to the preset time interval and randomly shuffle the segment order of each of the above-mentioned EEG channels in different ways.

[0043] This method uses synchronous and asynchronous partitioning data augmentation strategies for subsequent comparative learning, making the model pay more attention to the dependencies between channels.

[0044] Specifically, during the training of the graph attention network model, the method further includes: calculating the total loss function of the graph attention network model, wherein the total loss function includes channel-level contrast loss, overall sample contrast loss, and cross-entropy loss; and updating the model parameters of the graph attention network model according to the total loss function.

[0045] This method acquires multi-scale temporal features and then constructs a graph for each sample, using channels as nodes and inter-channel correlations as edges. It introduces two graph comparison learning methods: channel-level comparison and sample-level comparison. Channel-level comparison aims to maintain the spatial consistency of EEG signals, enabling samples to better learn intra-channel and inter-channel correlations, thus addressing the problem of existing models neglecting channel-dimensional features. Sample-level comparison aims to learn global features of samples that simultaneously possess multi-scale temporal and multi-channel characteristics by comparing samples in each training batch. The model parameters are updated by combining channel-level comparison loss, global sample comparison loss, and cross-entropy loss, improving the model's accuracy in fatigue detection tasks.

[0046] More specifically, the channel-level contrast loss in the total loss function of the above graph attention network model is calculated, including: according to the first formula: Determine the above channel-level contrast loss in, The feature representation of the nth channel node of the above original sample data after the Lth layer of the network. The feature representation of the nth channel node of the above original sample data after the Lth layer of the network. The L-th layer network represents the feature representation of all channel nodes except the nth channel in the original sample data, the positive sample data, and the negative sample data mentioned above, and τ represents the temperature coefficient.

[0047] This method, which uses channel-level comparison, aims to maintain the spatial consistency of EEG signals, enabling samples to better learn the correlations within and between channels, thus overcoming the problem of existing models neglecting channel-dimensional features.

[0048] Further, the overall sample contrast loss in the total loss function of the above graph attention network model is calculated, including: according to the second formula: Determine the overall contrast loss of the above samples in, This represents the overall characteristics of sample i. The overall characteristics of the above positive sample data representing sample i, τ represents the m-th overall feature in the batch containing sample i after removing sample i and in the data-augmented sample, B represents the size of a batch, and τ represents the temperature coefficient.

[0049] This method, which uses sample-level comparison, aims to learn global features of samples that simultaneously possess multi-scale temporal features and multi-channel features by comparing samples in each training batch.

[0050] Furthermore, the original sample data, positive sample data, and negative sample data are input into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features. This includes: mapping the original sample data, positive sample data, and negative sample data respectively using the Time2Vec model to generate corresponding initial time series embeddings; and inputting each of the initial time series embeddings into a Transformer encoding layer based on a multi-head self-attention mechanism to obtain the corresponding multi-scale temporal features.

[0051] This method employs a multi-stage, multi-scale temporal feature encoding module model to generate feature maps at different time scales. Each stage of the model consists of a time partitioning operation and a Transformer encoder layer, with the time partitioning granularity of each stage being twice that of the previous stage. This multi-stage structure effectively extracts both local and global representations of the time series at different time scales.

[0052] Specifically, after processing the EEG signal data to be detected using the fatigue detection model and outputting the fatigue detection result, the method further includes: determining the fatigue level of the person to be tested based on the fatigue detection result, and generating a prompt message based on the fatigue level, wherein the prompt message is used to remind the person to be tested of their current fatigue state.

[0053] This method can be applied to real-time fatigue detection and hazard warning tasks for workers, large truck drivers, and long-distance drivers in different work scenarios such as hazardous work, indoor / outdoor maintenance work, and high-altitude work, thereby protecting the safety of people's lives and property.

[0054] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the EEG signal fatigue detection method of this application will be described in detail below with reference to specific embodiments.

[0055] This embodiment relates to a specific method for detecting fatigue using electroencephalogram (EEG) signals, such as... Figure 3As shown, a data augmentation mechanism based on synchronous and asynchronous partitioning is introduced to enable the model to better learn the temporal consistency of EEG signal features. A multi-scale temporal feature encoding module is employed to effectively integrate EEG signal features at different time scales. Channel-level comparison is introduced to fully explore the intrinsic correlation between different channels of the EEG signal at the channel variable level. Simultaneously, sample-level comparison is introduced to enhance the independence between samples. The EEG signal fatigue detection algorithm based on multi-scale temporal feature extraction and graph comparison learning can be mainly divided into four parts: data augmentation module, multi-scale temporal feature encoding module, graph construction module, and graph comparison learning module. Graph comparison includes both channel-level comparison and sample-level comparison. The specific content of each part in the overall structure of the EEG signal fatigue detection algorithm based on multi-scale temporal feature extraction and graph comparison learning is as follows:

[0056] 1. Data augmentation strategy:

[0057] Given a time series dataset of EEG signals Y represents an N-channel EEG data sample corresponding to a time period consisting of T timestamps. j This is the label corresponding to the sample, representing the level of human fatigue.

[0058] A data augmentation strategy was employed to generate positive and negative samples for each sample, such as... Figure 4 As shown.

[0059] To generate positive samples, first, the original sample X... j The brainwaves are segmented according to a time interval τ, forming T / τ segments. A synchronous segmentation strategy is employed, which involves randomly shuffling the segment order while maintaining consistency across brainwave channels. From a single-channel perspective, after shuffling the segment order, adjacent segments no longer exhibit temporal dependence; however, data from different channels within the same time segment remain contiguous after the shuffling. For each sample, this synchronous segmentation strategy generates a positive sample.

[0060] For generating negative samples, an asynchronous partitioning strategy was adopted. Similarly, the original sample X was first partitioned... j The data is segmented according to a time interval τ, and the segment order is randomly shuffled. Furthermore, the segmentation order of each channel is also randomly shuffled in different ways. This strategy ensures that data from different channels within the same time segment cannot be grouped together after the segment order is shuffled. For each sample, an asynchronous partitioning strategy is also used to generate a negative sample.

[0061] 2. Multi-scale temporal feature encoding module:

[0062] To generate multi-scale temporal feature representations of EEG signal time series data, this invention employs a multi-stage multi-scale temporal feature encoding module model, thereby generating feature maps at different time scales. Each stage of the model consists of a time partitioning operation and a Transformer encoder layer, with the time partitioning granularity of each stage being twice that of the previous stage. This multi-stage structure effectively extracts local and global representations of the time series at different time scales.

[0063] In the first stage, for sample X i Channel C data It is divided into T / τ time intervals, and the sequence data X for each time interval τ is... icj An initial embedding of the time series is obtained through mapping using the Time2Vec model. The formula is:

[0064] Unlike text sequences, the patterns extracted from time series change over time and are highly dependent on their surrounding points. Therefore, location encoding e pos This invention does not use the sinusoidal positional encoding in the original Transformer. Instead, it employs a one-dimensional convolutional kernel of size k and padding of k / 2 to extract the local context information corresponding to the current time interval data as the positional encoding e. pos .

[0065] Then, time series embedding The data is fed into a Transformer encoding layer based on a multi-head self-attention mechanism to encode the temporal features of the first stage. The formula is shown below:

[0066]

[0067]

[0068] In the second phase, for sample X i Channel c data X ic Re-segmented into Each time interval is used to merge two adjacent time intervals from the first stage, and the time series of adjacent time intervals from the first stage are embedded by splicing them together along the first dimension. and Thus, the initial embedding for the k-th time interval is obtained. The formula is shown below:

[0069]

[0070] Similarly, a Transformer-based encoder layer is used to obtain the temporal features of the second stage. Then the number of intervals is halved, and the data is re-divided. This process is repeated until the interval between divisions equals the total interval of the samples. This yields sample X. i The feature vector z of channel c data i,c .

[0071] 3. Graph Construction Module:

[0072] After obtaining sample X i The feature vector z of channel c data i,c Perform graph construction operations on the original samples and positive samples, for each graph Represents a sample X i ,picture Each node in Representative sample X i A single-channel data c, edge embedded Represents single-channel data z i,c With z i,d The similarity between nodes is calculated. After graph construction, an L-layer graph attention network is used to update node embeddings. In the l-th layer, for vertex c, the similarity coefficient e between vertex c and its neighboring nodes is first calculated. cd As edge embedding. (In a graph, edge embedding is performed in the following formula.) Abbreviated as e cd , to transfer single-channel data z i,c Abbreviated as z c The formula is as follows:

[0073]

[0074] Calculate the attention coefficient α based on the correlation coefficient. cd The formula is shown below:

[0075]

[0076] Aggregate the features of the surrounding nodes and update the features of the current node, as shown in the following formula:

[0077]

[0078] 4. Graph Comparison Learning Module:

[0079] After updating the node features at layer L, to enable the model to learn more robust channel-level features, this invention introduces a channel-level contrastive learning approach to maximize the similarity between corresponding channels in the original samples and positive samples, while minimizing the similarity between different channels. Channel-level contrastive learning encourages the model to learn the perturbation features of each channel's data and enhances the similarity of features within the same channel. The channel-level contrastive loss is defined as follows:

[0080]

[0081] In the formula, The feature representation of the nth channel node of the original sample after the Lth layer of the network. The feature representation of the nth channel node of the original sample after the Lth layer of the network. This represents the feature representation of all channel nodes (excluding the nth channel) in the original sample, positive sample, and negative sample after passing through the Lth layer of the network. τ represents the temperature coefficient.

[0082] After passing through an L-layer graph neural network, this invention concatenates the embedded representations of each single-channel node to obtain the sample representation g, calculated using the following formula:

[0083] To learn the independence between different samples, this invention further introduces a sample-wide contrast loss. The calculation formula is:

[0084] In the formula, This represents the overall characteristics of sample i. The overall characteristics of positive samples representing sample i. This represents the m-th sample in the batch containing sample i after removing sample i and its data-enhanced sample, where B represents the size of a batch.

[0085] Finally, the sample features are fed into a linear layer and processed using Softmax to obtain the fatigue level classification probability. Cross-entropy loss is applied. The calculation formula is:

[0086] The total loss function consists of three parts: channel-level contrast loss, overall sample contrast loss, and cross-entropy loss. The calculation formula is as follows:

[0087] This embodiment first designs a data augmentation strategy based on synchronous and asynchronous partitioning for subsequent comparative learning, making the model pay more attention to the dependencies between channels. The multi-scale temporal feature encoding module designs a multi-stage time series partitioning and Transformer encoder. This hierarchical structure can better learn multi-scale time series representations, capturing the long-distance dependencies and interactions of the entire time series, thus overcoming the limitations of existing time series classification models that only extract fixed-scale features. After obtaining the multi-scale temporal features, each sample is constructed as a graph, with channels as nodes and inter-channel correlations as edges. Channel-level and sample-level comparative graph learning are introduced to promote more robust learning of channel-level features and global sample features. The diagrams for channel-level and sample-level comparative are shown below. Figure 5 As shown. Channel-level comparison aims to maintain the spatial consistency of EEG signals, that is, to maintain the stability of data within a channel and the stability of correlations between different channels, enabling samples to better learn the relationships between their internal channels, thereby compensating for the problem of existing EEG signal fatigue detection algorithms neglecting the channel-dimensional features of EEG signals. Sample-level comparison aims to learn robust global features of samples by comparing samples in each training batch at the granularity of the entire image. In scenarios where there is multiple channel data in EEG signal time series, this invention can fully utilize multi-scale temporal features and channel correlations, effectively improving the shortcomings of existing EEG signal fatigue detection algorithms in terms of low detection accuracy in long-term, multi-channel data. It has strong multi-scale temporal feature and multi-channel feature learning capabilities and robustness, and can meet the high accuracy requirements of practical applications such as fatigue detection and early warning.

[0088] This application also provides a brainwave signal fatigue detection device. It should be noted that the brainwave signal fatigue detection device of this application can be used to execute the brainwave signal fatigue detection method provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0089] The following describes the brainwave signal fatigue detection device provided in the embodiments of this application.

[0090] Figure 6 This is a schematic diagram of a brainwave signal fatigue detection device according to an embodiment of this application. Figure 6 As shown, the device includes:

[0091] The acquisition unit 61 is used to acquire raw sample data of the EEG signal, divide the raw sample data of the EEG signal, and generate positive sample data and negative sample data.

[0092] Processing unit 62 is used to input the original sample data, positive sample data and negative sample data into a multi-scale temporal feature encoding model to extract the corresponding multi-scale temporal features, and to perform graph construction processing on the original sample data, positive sample data and negative sample data according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs, and to input each of the sample graphs into a graph attention network model to train the graph attention network model to obtain a fatigue detection model;

[0093] The detection unit 63 is used to acquire the electroencephalogram (EEG) signal data of the person to be tested, and to process the EEG signal data using the fatigue detection model described above, and output the fatigue detection result.

[0094] In this embodiment, the acquisition unit acquires raw sample data of EEG signals, divides the raw sample data into positive and negative sample data, and processes it. The processing unit inputs the raw sample data, positive sample data, and negative sample data into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features. Based on these features, it performs graph construction processing on the raw sample data, positive sample data, and negative sample data to obtain corresponding sample graphs. Each sample graph is then input into a graph attention network model for training, resulting in a fatigue detection model. The detection unit acquires the EEG signal data of the person to be detected, processes the EEG signal data using the fatigue detection model, and outputs the fatigue detection result. In scenarios where multiple channels of EEG signal time series data exist, this method fully utilizes multi-scale temporal features and channel correlations, effectively improving the low accuracy of existing EEG signal fatigue detection algorithms in long-term, multi-channel data. It possesses strong multi-scale temporal feature and multi-channel feature learning capabilities and robustness, meeting the high accuracy requirements of practical applications such as fatigue detection and early warning. This solves the problem of low detection accuracy in existing technologies for detecting fatigue using electroencephalogram (EEG) signals.

[0095] As an optional solution, the acquisition unit includes a first partitioning processing module and a second partitioning processing module. The first partitioning processing module is used to partition the original sample data using a synchronous partitioning strategy to generate the positive sample data. The synchronous partitioning strategy involves segmenting the original sample data according to a preset time interval and randomly shuffling the segment order while maintaining consistency in the EEG channels of the segmented data. The second partitioning processing module is used to partition the original sample data using an asynchronous partitioning strategy to generate the negative sample data. The asynchronous partitioning strategy involves segmenting the original sample data according to the preset time interval and randomly shuffling the segment order of each EEG channel in different ways.

[0096] In one optional embodiment, the apparatus further includes a computation unit and an update unit; the computation unit is used to calculate the total loss function of the graph attention network model during the training process, wherein the total loss function includes channel-level contrast loss, overall sample contrast loss, and cross-entropy loss; the update unit is used to update the model parameters of the graph attention network model according to the total loss function.

[0097] In an alternative embodiment, the calculation unit further includes a first determining module, used to determine the calculation based on a first formula: Determine the above channel-level contrast loss in, The feature representation of the nth channel node of the above original sample data after the Lth layer of the network. The feature representation of the nth channel node of the above original sample data after the Lth layer of the network. The L-th layer network represents the feature representation of all channel nodes except the nth channel in the original sample data, the positive sample data, and the negative sample data mentioned above, and τ represents the temperature coefficient.

[0098] In an alternative embodiment, the calculation unit further includes a second determining module for determining the second formula: Determine the overall contrast loss of the above samples in, This represents the overall characteristics of sample i. The overall characteristics of the above positive sample data representing sample i, τ represents the m-th overall feature in the batch containing sample i after removing sample i and in the data-augmented sample, B represents the size of a batch, and τ represents the temperature coefficient.

[0099] An optional scheme is that the processing unit includes a mapping processing module and an input module; the mapping processing module is used to perform mapping processing on the above-mentioned original sample data, the above-mentioned positive sample data and the above-mentioned negative sample data respectively through the Time2Vec model to generate the corresponding time series initial embeddings; the input module is used to input each of the above-mentioned time series initial embeddings into the Transformer encoding layer based on the multi-head self-attention mechanism to obtain the corresponding above-mentioned multi-scale temporal features.

[0100] In an optional embodiment, the device further includes a generation unit, which, after processing the EEG signal data to be detected using the fatigue detection model described above and outputting fatigue detection results, determines the fatigue level of the person to be detected based on the fatigue detection results and generates a prompt message based on the fatigue level, wherein the prompt message is used to remind the person to be detected of their current fatigue state.

[0101] The aforementioned brainwave signal fatigue detection device includes a processor and a memory. The acquisition unit, processing unit, and detection unit are all stored as program units in the memory, and the processor executes these program units to achieve the corresponding functions. All of the above modules are located in the same processor; alternatively, the modules may be located in different processors in any combination.

[0102] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the low detection accuracy of current EEG signal fatigue detection technologies.

[0103] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0104] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the electroencephalogram (EEG) signal fatigue detection method.

[0105] Specifically, methods for detecting fatigue using electroencephalogram (EEG) signals include:

[0106] Step S201: Obtain raw sample data of EEG signals, and divide the raw sample data of the EEG signals to generate positive sample data and negative sample data.

[0107] Step S202: Input the original sample data, positive sample data and negative sample data into the multi-scale temporal feature encoding model to extract the corresponding multi-scale temporal features, and perform graph construction processing on the original sample data, positive sample data and negative sample data according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs. Input each of the above sample graphs into the graph attention network model to train the graph attention network model to obtain the fatigue detection model.

[0108] Step S203: Obtain the EEG signal data of the person to be tested, use the above-mentioned fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result.

[0109] This invention provides a processor for running a program, wherein the program executes the electroencephalogram (EEG) signal fatigue detection method.

[0110] Specifically, methods for detecting fatigue using electroencephalogram (EEG) signals include:

[0111] Step S201: Obtain raw sample data of EEG signals, and divide the raw sample data of the EEG signals to generate positive sample data and negative sample data.

[0112] Step S202: Input the original sample data, positive sample data and negative sample data into the multi-scale temporal feature encoding model to extract the corresponding multi-scale temporal features, and perform graph construction processing on the original sample data, positive sample data and negative sample data according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs. Input each of the above sample graphs into the graph attention network model to train the graph attention network model to obtain the fatigue detection model.

[0113] Step S203: Obtain the EEG signal data of the person to be tested, use the above-mentioned fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result.

[0114] This invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:

[0115] Step S201: Obtain raw sample data of EEG signals, and divide the raw sample data of the EEG signals to generate positive sample data and negative sample data.

[0116] Step S202: Input the original sample data, positive sample data and negative sample data into the multi-scale temporal feature encoding model to extract the corresponding multi-scale temporal features, and perform graph construction processing on the original sample data, positive sample data and negative sample data according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs. Input each of the above sample graphs into the graph attention network model to train the graph attention network model to obtain the fatigue detection model.

[0117] Step S203: Obtain the EEG signal data of the person to be tested, use the above-mentioned fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result.

[0118] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0119] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:

[0120] Step S201: Obtain raw sample data of EEG signals, and divide the raw sample data of the EEG signals to generate positive sample data and negative sample data.

[0121] Step S202: Input the original sample data, positive sample data and negative sample data into the multi-scale temporal feature encoding model to extract the corresponding multi-scale temporal features, and perform graph construction processing on the original sample data, positive sample data and negative sample data according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs. Input each of the above sample graphs into the graph attention network model to train the graph attention network model to obtain the fatigue detection model.

[0122] Step S203: Obtain the EEG signal data of the person to be tested, use the above-mentioned fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result.

[0123] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0124] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0125] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0126] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0127] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0128] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0129] Memory may include non-persistent memory 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.

[0130] Computer-readable media includes 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, magnetic 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.

[0131] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0132] As can be seen from the above description, the embodiments of this application achieve the following technical effects:

[0133] 1) This application discloses a method for fatigue detection of electroencephalogram (EEG) signals, comprising: acquiring raw sample data of EEG signals; dividing the raw sample data of EEG signals into positive sample data and negative sample data; inputting the raw sample data, positive sample data, and negative sample data into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features; performing graph construction processing on the raw sample data, positive sample data, and negative sample data according to the corresponding multi-scale temporal features to obtain corresponding sample graphs; inputting each sample graph into a graph attention network model; training the graph attention network model to obtain a fatigue detection model; acquiring EEG signal data of the person to be tested; using the fatigue detection model to detect and process the EEG signal data; and outputting fatigue detection results. In scenarios where there are multiple channels of data in the EEG signal time series, this method can fully utilize multi-scale temporal features and channel correlations, effectively improving the shortcomings of existing EEG signal fatigue detection algorithms in terms of low detection accuracy in long-term, multi-channel data. It has strong multi-scale temporal feature and multi-channel feature learning capabilities and robustness, and can meet the high accuracy requirements of practical applications such as fatigue detection and early warning. This solves the problem of low detection accuracy in existing technologies for detecting fatigue using electroencephalogram (EEG) signals.

[0134] 2) A brainwave signal fatigue detection device according to this application includes: an acquisition unit, used to acquire raw sample data of brainwave signals, divide the raw sample data of brainwave signals into positive sample data and negative sample data; a processing unit, used to input the raw sample data, positive sample data and negative sample data into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features, and perform graph construction processing on the raw sample data, positive sample data and negative sample data according to the corresponding multi-scale temporal features to obtain corresponding sample graphs, and input each sample graph into a graph attention network model to train the graph attention network model to obtain a fatigue detection model; and a detection unit, used to acquire brainwave signal data of the person to be detected, use the fatigue detection model to detect and process the brainwave signal data, and output fatigue detection results. In scenarios involving multiple channels of EEG signal time-series data, this method can fully utilize multi-scale temporal features and channel correlations, effectively improving the low detection accuracy of existing EEG fatigue detection algorithms in long-term, multi-channel data. It possesses strong multi-scale temporal and multi-channel feature learning capabilities and robustness, meeting the high accuracy requirements of practical applications such as fatigue detection and early warning. This solves the problem of low detection accuracy in existing EEG fatigue detection technologies.

[0135] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for detecting fatigue using electroencephalogram (EEG) signals, characterized in that, include: The raw sample data of the electroencephalogram (EEG) signal is acquired, and the raw sample data of the EEG signal is divided into positive sample data and negative sample data. The original sample data, the positive sample data, and the negative sample data are input into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features. Based on the corresponding multi-scale temporal features, graph construction processing is performed on the original sample data, the positive sample data, and the negative samples to obtain corresponding sample graphs. Each sample graph is then input into a graph attention network model to train the graph attention network model and obtain a fatigue detection model. The brainwave signal data of the person to be tested is acquired, and the fatigue detection model is used to detect and process the brainwave signal data to output the fatigue detection result. The original sample data of the EEG signal is divided into positive and negative sample data, including: The original sample data is divided using a synchronous partitioning strategy to generate the positive sample data. The synchronous partitioning strategy involves dividing the original sample data into segments according to a preset time interval and randomly shuffling the segment order while maintaining the consistency of the EEG channels of the segmented data. The original sample data is divided using an asynchronous partitioning strategy to generate the negative sample data. The asynchronous partitioning strategy involves dividing the original sample data into segments according to the preset time interval and randomly shuffling the segment order of each EEG channel in different ways.

2. The method according to claim 1, characterized in that, The method further includes the following steps during the training of the graph attention network model: Calculate the total loss function of the graph attention network model, wherein the total loss function includes channel-level contrast loss, overall sample contrast loss, and cross-entropy loss; The model parameters of the graph attention network model are updated based on the total loss function.

3. The method according to claim 2, characterized in that, Calculating the channel-level contrast loss in the total loss function of the graph attention network model includes: According to the first formula: Determine the channel-level contrast loss ,in, The nth channel node of the original sample data is in the nth channel. Feature representation after layer network The nth channel node of the original sample data is in the nth channel. Feature representation after layer network This represents all channel nodes in the original sample data, the positive sample data, and the negative sample data except for the nth channel, after passing through the nth channel. Feature representation after layer network Indicates the temperature coefficient. For a single sample, the sample image is shown. Let N be the set of sample images corresponding to all training samples, and N be the total number of channels of the EEG signal. 1 is the feature mapping function, and m takes the values ​​1, 2, and 3, which correspond to the original sample data, the positive sample data, and the negative sample data, respectively.

4. The method according to claim 2, characterized in that, Calculating the overall sample contrast loss in the total loss function of the graph attention network model includes: According to the second formula: Determine the overall contrast loss of the sample. ,in, Representative sample Overall characteristics Representative sample The overall characteristics of the positive sample data, Representative in the sample Remove samples from the batch The m-th global feature in the sample after data augmentation and the sample after data augmentation. This represents the size of a batch. This represents the temperature coefficient, and M is the total number of samples participating in the overall comparison in a training batch. This is the function for calculating feature similarity.

5. The method according to claim 1, characterized in that, The original sample data, the positive sample data, and the negative sample data are input into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features, including: The original sample data, the positive sample data, and the negative sample data are mapped using the Time2Vec model to generate corresponding initial time series embeddings. Each of the aforementioned time series is initially embedded into a Transformer encoding layer based on a multi-head self-attention mechanism to obtain the corresponding multi-scale temporal features.

6. The method according to claim 1, characterized in that, After processing the EEG signal data to be detected using the fatigue detection model and outputting the fatigue detection result, the method further includes: The fatigue level of the person being tested is determined based on the fatigue detection results, and a prompt message is generated based on the fatigue level, wherein the prompt message is used to remind the person being tested of their current fatigue state.

7. A brainwave signal fatigue detection device, characterized in that, include: The acquisition unit is used to acquire raw sample data of EEG signals, divide the raw sample data of EEG signals, and generate positive sample data and negative sample data. The processing unit is configured to input the original sample data, the positive sample data, and the negative sample data into a multi-scale temporal feature encoding model to extract corresponding multi-scale temporal features, and perform graph construction processing on the original sample data, the positive sample data, and the negative samples according to the corresponding multi-scale temporal features to obtain corresponding sample graphs, and input each sample graph into a graph attention network model to train the graph attention network model to obtain a fatigue detection model; The detection unit is used to acquire the electroencephalogram (EEG) signal data of the person to be tested, and to process the EEG signal data using the fatigue detection model to output the fatigue detection result. The acquisition unit includes: The first segmentation processing module is used to segment the original sample data using a synchronous segmentation strategy to generate the positive sample data. The synchronous segmentation strategy is to segment the original sample data according to a preset time interval and randomly shuffle the segment order while keeping the EEG channels of the segmented data consistent. The second partitioning processing module is used to partition the original sample data using an asynchronous partitioning strategy to generate the negative sample data. The asynchronous partitioning strategy involves dividing the original sample data into segments according to the preset time interval and randomly shuffling the segment order of each EEG channel in different ways.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the electroencephalogram (EEG) signal fatigue detection method according to any one of claims 1 to 6.

9. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing the EEG signal fatigue detection method according to any one of claims 1 to 6.