Electroencephalogram signal fatigue detection method and device and computer readable storage medium
Through multi-scale timing feature coding model and graph attention network, the problem of low accuracy of EEG signal fatigue detection in the prior art is solved, and more effective feature extraction and learning of multi-channel EEG data is achieved, and detection accuracy is improved.
Patent Information
- Application Number
- CN202411802554.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In the prior art, the detection accuracy of EEG signal fatigue detection is low, making it difficult to effectively capture the spatial consistency of multi-channel EEG data and the long-distance dependence of time series.
Multi-scale timing feature encoding model and graph attention network are used to extract multi-scale timing features through multi-stage time series division and Transformer encoder, and through graph construction and graph comparison learning, the spatial consistency of multi-channel signals and the long-distance dependence of time series are fully explored.
It improves the detection accuracy of fatigue detection of EEG signals, can learn multi-scale timing characteristics and multi-channel characteristics more effectively, and meets the high accuracy requirements for practical applications such as fatigue detection and early warning.
Smart Images

Figure CN119700138A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of EEG signal fatigue detection, and in particular to an EEG signal fatigue detection method, an EEG signal fatigue detection device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Fatigue detection based on EEG signals is an important task in the field of biomedical signal processing. It can be applied to real-time fatigue detection and danger warning tasks for workers, large truck drivers, long-distance drivers, etc. in different working scenarios such as dangerous work, indoor / outdoor maintenance work, and high-altitude work, thereby protecting the safety of people's lives and property.
[0003] EEG signals are nonlinear time series data with multiple channel variables, so the essence of fatigue detection based on EEG signals is a multivariate time series classification algorithm. At present, fatigue detection based on EEG signals is mainly based on learning the time series characteristics of EEG signals through long short-term memory networks, which has a significant improvement in the performance of fatigue level classification. For example, deep CNN-LSTM models and GAN-LSTM models have inherited the LSTM architecture design used for general time series analysis.
[0004] However, compared with general time series analysis, which usually only focuses on the characteristics of the time dimension, there is a lack of in-depth research on the relationship between channel dimension features, which affects the encoder's ability to capture the overall characteristics of multi-channel EEG data. For example, the TS-TCC model introduces a time contrast module to learn a robust time representation through a cross-view prediction task. However, the model directly fuses all channel values of one or more time steps during the embedding process, and cannot effectively mine the spatial consistency of multi-channel signals, that is, the stability of each channel and the stability of the correlation between different channels. At the same time, for the characteristics of the time dimension, the existing models only learn fixed-scale time series feature representations. For example, the TST model based on a single Transformer encoder architecture uses an autoregressive method to denoise the input data and extract a dense vector representation of the multivariate time series, which significantly improves the performance of downstream supervised learning tasks. However, it cannot learn hierarchical multi-scale representations from time series data and cannot capture the long-distance dependencies and interactions of the entire time series well. The existing technology has the problem of low detection accuracy of EEG signal fatigue detection. Summary of the invention
[0005] The main purpose of the present application is to provide an EEG signal fatigue detection method, an EEG signal fatigue detection device, a storage medium, a processor and an electronic device, so as to at least solve the problem of low detection accuracy of EEG signal fatigue detection in the prior art.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for detecting fatigue of an EEG signal is provided, including: obtaining original sample data of an EEG signal, dividing and processing the original sample data of the EEG signal 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 temporal feature encoding model to extract corresponding multi-scale temporal features, and performing graph construction processing on the original sample data, the positive sample data and the negative sample according to the corresponding multi-scale temporal features to obtain corresponding sample graphs, and inputting each of the sample graphs into a graph attention network model, training the graph attention network model to obtain a fatigue detection model; obtaining the EEG signal data of the person to be detected, using the fatigue detection model to detect and process the EEG signal data, and outputting the fatigue detection result.
[0007] Optionally, the original sample data of the EEG signal is divided and processed to generate positive sample data and negative sample data, including: using a synchronous division strategy to divide the original sample data to generate the positive sample data, wherein the synchronous division strategy is to segment the original sample data according to preset time intervals, and randomly disrupt the segmentation order while keeping the EEG channels of the segmented data consistent; using an asynchronous division strategy to divide the original sample data to generate the negative sample data, wherein the asynchronous division strategy is to segment the original sample data according to the preset time intervals, and randomly disrupt the segmentation order of each EEG channel in different ways.
[0008] Optionally, during the process of training the graph attention network model, the method also includes: calculating the total loss function of the graph attention network model, wherein the total loss function includes channel-level contrast loss, sample overall 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, 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, Represents the feature representation of the nth channel node of the original sample data after the Lth layer network, Represents the feature representation of the nth channel node of the original sample data after the Lth layer network, It represents the characteristic representation of all channel nodes except the nth channel in the original sample data, the positive sample data, and the negative sample data after passing through the Lth layer network, and τ represents the temperature coefficient.
[0010] Optionally, calculating the sample overall 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, represents the overall characteristics of sample i, Represents the overall characteristics of the positive sample data of sample i, represents the mth overall feature of the sample after removing sample i from the batch where sample i is located and the sample after data enhancement, 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 time series feature encoding model to extract corresponding multi-scale time series features, including: mapping the original sample data, the positive sample data and the negative sample data respectively through a Time2Vec model to generate corresponding time series initial embeddings; and inputting each of the time series initial embeddings into a Transformer encoding layer based on a multi-head self-attention mechanism to obtain the corresponding multi-scale time series features.
[0012] Optionally, after using the fatigue detection model to detect and process the EEG signal data to be detected and outputting the fatigue detection result, the method also includes: determining the fatigue level of the person to be detected based on the fatigue detection result, and generating prompt information based on the fatigue level, wherein the prompt information is used to remind the person to be detected of the current fatigue state.
[0013] According to another aspect of the present application, a device for detecting fatigue of an electroencephalogram signal is provided, comprising: an acquisition unit, for acquiring original sample data of an electroencephalogram signal, dividing and processing the original sample data of the electroencephalogram signal, and generating positive sample data and negative sample data; a processing unit, for inputting 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 performing graph construction processing on the original sample data, the positive sample data and the negative sample according to the corresponding multi-scale temporal features to obtain corresponding sample graphs, and inputting each of the sample graphs into a graph attention network model, training the graph attention network model, and obtaining a fatigue detection model; a detection unit, for acquiring the electroencephalogram signal data of a person to be detected, performing detection processing on the electroencephalogram signal data using the fatigue detection model, and outputting a fatigue detection result.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the EEG signal fatigue detection methods.
[0015] According to another aspect of the present 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 are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of the EEG signal fatigue detection methods.
[0016] Apply the technical solution of the present application, obtain the original sample data of the EEG signal, divide and process the original sample data of the EEG signal, and generate positive sample data and negative sample data; 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 construct the graphs of the original sample data, positive sample data and negative samples according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs, and input each sample graph into the graph attention network model, train the graph attention network model, and obtain the fatigue detection model; obtain the EEG signal data of the person to be detected, use the fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result. In the scenario where there are multiple channel data in the EEG signal time series, the multi-scale temporal features and channel correlation can be fully utilized, and the defects of low detection accuracy of the existing EEG signal fatigue detection algorithm in long-term and multi-detection channel data can be effectively improved. It has strong multi-scale temporal features and multi-channel features learning ability and robustness, and can meet the high accuracy requirements of practical applications such as fatigue detection and early warning. It solves the problem of low detection accuracy of EEG signal fatigue detection in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 A hardware structure block diagram of a mobile terminal for executing an EEG signal fatigue detection method provided in an embodiment of the present application is shown;
[0019] Figure 2 A schematic diagram of a process of detecting fatigue of an EEG signal provided according to an embodiment of the present application is shown;
[0020] Figure 3A schematic diagram of a specific EEG signal fatigue detection method provided according to an embodiment of the present application is shown;
[0021] Figure 4 A schematic diagram of EEG signal data enhancement based on synchronous division and asynchronous division provided according to an embodiment of the present application is shown;
[0022] Figure 5 A schematic diagram of channel-level comparison and sample-level comparison provided according to an embodiment of the present application is shown;
[0023] Figure 6 A structural block diagram of an EEG signal fatigue detection device provided according to an embodiment of the present application is shown.
[0024] The above drawings include the following reference numerals:
[0025] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0026] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work 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 and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] As introduced in the background technology, the prior art has the problem of low detection accuracy of EEG signal fatigue detection. In order to solve the problem of low detection accuracy of EEG signal fatigue detection in the prior art, the embodiments of the present 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 in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0031] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of an EEG signal fatigue detection method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0032] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the EEG signal fatigue detection method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network 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. The above-mentioned specific network examples may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as 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] In this embodiment, a method for detecting fatigue of EEG signals running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] Figure 2 FIG. 1 is a flow chart of a method for detecting fatigue of an EEG signal according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0035] Step S201, obtaining original sample data of the EEG signal, dividing the original sample data of the EEG signal to generate positive sample data and negative sample data;
[0036] Specifically, to generate positive samples, first convert the original sample X jThe data is segmented according to the time interval τ, and divided into T / τ segments. A synchronous segmentation strategy is adopted, that is, the segmentation order is randomly disrupted while keeping the EEG channels consistent. That is, from the perspective of a single channel, after the segmentation order is disrupted, there is no time dependency between adjacent segments, but the data of each channel in the same time segment can still be guaranteed to be in the same time segment after the segmentation order is disrupted. For each sample, a positive sample is generated using this synchronous segmentation strategy.
[0037] For generating negative samples, an asynchronous partitioning strategy is adopted. First, the original sample X j The data is segmented according to the time interval τ, and then the segmentation order is randomly disrupted. At the same time, the segmentation order of each channel needs to be randomly disrupted in different ways. This strategy makes it impossible for the data of each channel in the same time segment to be in the same time segment after the segmentation order is disrupted. For each sample, the asynchronous segmentation strategy is also used to generate a negative sample.
[0038] Step S202, inputting 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 performing graph construction processing on the original 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 inputting each of the sample graphs into a graph attention network model, training the graph attention network model, and obtaining a fatigue detection model;
[0039] Specifically, in order to generate multi-scale temporal feature representations of EEG signal time series data, a multi-stage multi-scale temporal feature encoding module model is used to generate feature maps at different time scales. Each stage of the model consists of a time division processing operation and a Transformer encoder layer. The time division granularity of each stage is twice that of the previous stage. Relying on this multi-stage structure, local and global representations of time series at different time scales can be effectively extracted.
[0040] Step S203, obtaining the EEG signal data of the person to be detected, using the fatigue detection model to detect and process the EEG signal data, and outputting the fatigue detection result.
[0041] Through this embodiment, the original sample data of the EEG signal is obtained, the original sample data of the EEG signal is divided and processed to generate positive sample data and negative sample data; the original sample data, positive sample data and negative sample data are input into the multi-scale temporal feature encoding model to extract the corresponding multi-scale temporal features, and the original sample data, positive sample data and negative samples are processed by graph construction according to the corresponding multi-scale temporal features to obtain the corresponding sample graph, and each sample graph is input into the graph attention network model, and the graph attention network model is trained to obtain the fatigue detection model; the EEG signal data of the person to be detected is obtained, and the EEG signal data is detected and processed using the fatigue detection model, and the fatigue detection result is output. In the scenario where there are multiple channel data in the EEG signal time series, the multi-scale temporal features and channel correlation can be fully utilized, and the defect of low detection accuracy of the existing EEG signal fatigue detection algorithm in long-term and multi-detection channel data can be effectively improved. It has strong multi-scale temporal features and multi-channel features learning ability and robustness, and can meet the high accuracy requirements of practical applications such as fatigue detection and early warning. The problem of low detection accuracy of EEG signal fatigue detection in the prior art is solved.
[0042] In the specific implementation process, the above-mentioned original sample data of the above-mentioned EEG signal is divided and processed to generate positive sample data and negative sample data, including: using a synchronous division strategy to divide the above-mentioned original sample data to generate the above-mentioned positive sample data, wherein the above-mentioned synchronous division strategy is to segment the above-mentioned original sample data according to preset time intervals, and randomly disrupt the segmentation order while keeping the EEG channels of the segmented data consistent; using an asynchronous division strategy to divide the above-mentioned original sample data to generate the above-mentioned negative sample data, wherein the above-mentioned asynchronous division strategy is to segment the above-mentioned original sample data according to the above-mentioned preset time intervals, and randomly disrupt the above-mentioned segmentation order of each of the above-mentioned EEG channels in different ways.
[0043] This method uses a data enhancement strategy based on synchronous and asynchronous partitioning in subsequent contrastive learning, which enables the model to pay more attention to the dependencies between channels.
[0044] Specifically, in the process of training the above-mentioned graph attention network model, the above-mentioned method also includes: calculating the total loss function of the above-mentioned graph attention network model, wherein the above-mentioned total loss function includes channel-level contrast loss, sample overall contrast loss, and cross entropy loss; updating the model parameters of the above-mentioned graph attention network model according to the above-mentioned total loss function.
[0045] After obtaining the multi-scale time series features, this method constructs each sample into a graph with channels as nodes and inter-channel correlations as edges, and 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, so that samples can better learn the correlations within and between channels, making up for the problem that existing models ignore channel dimension features. Sample-level comparison aims to learn the global-level features of samples that have both multi-scale time series features and multi-channel features by comparing samples in each training batch. The model parameters are updated by combining channel-level comparison loss, sample overall comparison loss, and cross-entropy loss to improve the accuracy of the model in fatigue detection tasks.
[0046] More specifically, calculating the channel-level contrast loss in the total loss function of the above-mentioned graph attention network model includes: according to the first formula: Determine the above channel-level contrast loss in, Represents the feature representation of the nth channel node of the above original sample data after the Lth layer network, Represents the feature representation of the nth channel node of the above original sample data after the Lth layer network, It represents the characteristic representation of all channel nodes except the nth channel in the original sample data, the positive sample data, and the negative sample data after passing through the Lth layer network, and τ represents the temperature coefficient.
[0047] The channel-level comparison of this method aims to maintain the spatial consistency of EEG signals, so that samples can better learn the correlations within and between channels, making up for the problem that existing models ignore channel dimension characteristics.
[0048] Further, calculating the overall contrast loss of the samples in the total loss function of the above graph attention network model includes: according to the second formula: Determine the overall contrast loss of the above samples in, represents the overall characteristics of sample i, Represents the overall characteristics of the above positive sample data of sample i, represents the mth overall feature of the sample after removing sample i from the batch where sample i is located and the sample after data enhancement, B represents the size of a batch, and τ represents the temperature coefficient.
[0049] The sample-level comparison of this method aims to learn the global-level features of samples that have both multi-scale temporal features and multi-channel features by comparing the samples in each training batch.
[0050] Furthermore, the original sample data, the positive sample data and the negative sample data are input into a multi-scale time series feature encoding model to extract corresponding multi-scale time series features, including: mapping the original sample data, the positive sample data and the negative sample data respectively through the Time2Vec model to generate corresponding time series initial embeddings; inputting each of the above time series initial embeddings into the Transformer encoding layer based on the multi-head self-attention mechanism to obtain the corresponding multi-scale time series features.
[0051] This method adopts 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 division processing operation and a Transformer encoder layer, and the time division granularity of each stage is twice that of the previous stage. Relying on this multi-stage structure, local and global representations of time series at different time scales can be effectively extracted.
[0052] Specifically, after using the above-mentioned fatigue detection model to detect and process the above-mentioned EEG signal data to be detected and outputting the fatigue detection result, the above-mentioned method also includes: determining the fatigue level of the above-mentioned person to be detected according to the above-mentioned fatigue detection result, and generating prompt information according to the above-mentioned fatigue level, wherein the above-mentioned prompt information is used to remind the above-mentioned person to be detected of the current fatigue state.
[0053] This method can be applied to real-time fatigue detection and danger warning tasks for workers, large truck drivers, long-distance drivers, etc. in different working scenarios such as dangerous work, indoor / outdoor maintenance work, and high-altitude work, thereby protecting the safety of life and property.
[0054] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the EEG signal fatigue detection method of the present application will be described in detail below in combination with specific embodiments.
[0055] This embodiment relates to a specific method for detecting fatigue of EEG signals. Figure 3As shown in the figure, a data enhancement mechanism based on synchronous division and asynchronous division is introduced to enable the model to better learn the temporal consistency of EEG signal features; a multi-scale temporal feature encoding module is adopted to effectively integrate EEG signal features of different time scales; by introducing channel-level contrast, the intrinsic correlation between EEG signal channels is fully explored at the channel variable level; at the same time, sample-level contrast is introduced to enhance the independence between samples. The EEG signal fatigue detection algorithm based on multi-scale temporal feature extraction and graph contrast learning can be mainly divided into four parts, namely: data enhancement module, multi-scale temporal feature encoding module, graph construction module, and graph contrast learning module. Among them, graph contrast includes two parts: channel-level contrast and sample-level contrast. The specific contents of each part in the overall structure of the EEG signal fatigue detection algorithm based on multi-scale temporal feature extraction and graph contrast learning are as follows:
[0056] 1. Data enhancement strategy:
[0057] Given an EEG signal time series dataset represents an EEG data sample with N channels corresponding to a time period consisting of T timestamps, Y j is the label corresponding to the sample, representing the fatigue level of the human body.
[0058] A data augmentation strategy is used to generate positive and negative samples for each sample, such as Figure 4 shown.
[0059] To generate positive samples, first convert the original sample X j The data is segmented according to the time interval τ, and divided into T / τ segments. A synchronous segmentation strategy is adopted, that is, the segmentation order is randomly disrupted while keeping the EEG channels consistent. That is, from the perspective of a single channel, after the segmentation order is disrupted, there is no time dependency between adjacent segments, but the data of each channel in the same time segment can still be guaranteed to be in the same time segment after the segmentation order is disrupted. For each sample, a positive sample is generated using this synchronous segmentation strategy.
[0060] For generating negative samples, an asynchronous partitioning strategy is adopted. First, the original sample X j The data is segmented according to the time interval τ, and then the segmentation order is randomly disrupted. At the same time, the segmentation order of each channel needs to be randomly disrupted in different ways. This strategy makes it impossible for the data of each channel in the same time segment to be in the same time segment after the segmentation order is disrupted. For each sample, the asynchronous segmentation strategy is also used to generate a negative sample.
[0061] 2. Multi-scale temporal feature encoding module:
[0062] In order to generate multi-scale temporal feature representations of EEG signal time series data, a multi-stage multi-scale temporal feature encoding module model is used in the present invention to generate feature maps at different time scales. Each stage of the model consists of a time division processing operation and a Transformer encoder layer, and the time division granularity of each stage is twice that of the previous stage. Relying on this multi-stage structure, local and global representations of time series at different time scales can be effectively extracted.
[0063] In the first stage, for sample X i Channel c data Split it into T / τ time intervals, and the sequence data X of each time interval τ icj Get an initial time series embedding through Time2Vec model mapping The formula is:
[0064] Time series differ from text sequences in that the patterns extracted from them change over time and are highly dependent on the points around them. pos The present invention does not use the sinusoidal position encoding in the original Transformer, but instead uses a one-dimensional convolution kernel with a size of k and a padding of k / 2 to extract the local context information corresponding to the current time interval data as the position encoding e pos .
[0065] Then, time series embedding It is sent to a Transformer encoding layer based on a multi-head self-attention mechanism to encode the time series features of the first stage The formula is as follows:
[0066]
[0067]
[0068] In the second stage, the sample X i Channel c data X ic Re-split into time intervals, merging the two adjacent time intervals divided in the first stage, and embedding the time series of adjacent time intervals in the first stage on the first dimension. and Thus, the initial embedding of the kth time interval is obtained The formula is as follows:
[0069]
[0070] A Transformer encoder-based encoding layer is also used to obtain the temporal features of the second stage Then the number of divided intervals is halved and divided again, and this is repeated until the divided time interval is the total time interval of the sample, and the sample X is obtained. i The feature vector z of channel c data i,c .
[0071] 3. Graph construction module:
[0072] After obtaining the sample X i The feature vector z of channel c data i,c , perform graph construction operations on the original samples and positive samples, each graph Represents a sample X i ,picture Each node in Representative sample X i A single channel data c, edge embedding Represents single channel data z i,c With z i,d After the graph is constructed, an L-layer graph attention network is used to update the node embedding. In the lth 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, the edge is embedded in the following formula Abbreviated as e cd , the 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 as follows:
[0075]
[0076] Aggregate domain node features and update the current node features. The formula is as follows:
[0077]
[0078] 4. Picture comparison learning module:
[0079] After updating the node features at the Lth layer, in order to enable the model to learn more robust channel-level features, the present invention introduces a channel-level contrastive learning to maximize the similarity between the original sample and the corresponding channel in the positive sample, while minimizing the similarity between different channels. Channel-level contrastive learning can encourage the model to learn the perturbation features of each channel data and enhance the similarity of the features of the same channel data. The channel-level contrast loss is defined as follows:
[0080]
[0081] In the formula, Represents the feature representation of the nth channel node of the original sample after the Lth layer of the network, Represents the feature representation of the nth channel node of the original sample after the Lth layer of the network, It represents the characteristic representation of all channel nodes except the nth channel in the original sample, positive sample, and negative sample after passing through the Lth layer network. τ represents the temperature coefficient.
[0082] After L layers of graph neural network, the present invention concatenates the embedded representations of each single-channel node to obtain the sample representation g, which is calculated as follows:
[0083] In order to learn the independence between different samples, the present invention further introduces a sample overall contrast loss The calculation formula is:
[0084] In the formula, represents the overall characteristics of sample i, Represents the overall characteristics of the positive sample of sample i, It represents the mth sample after removing sample i from the batch where sample i is located and the sample after data enhancement. B represents the size of a batch.
[0085] Finally, the sample features are fed into a linear layer and processed by Softmax to obtain the fatigue level classification probability. The calculation formula is:
[0086] The total loss function consists of three parts: channel-level contrast loss, sample overall contrast loss, and cross entropy loss. The calculation formula is:
[0087] This embodiment first designs a data enhancement strategy based on synchronous division and asynchronous division for subsequent contrastive learning, so that the model pays more attention to the dependencies between channels. The multi-scale time series feature encoding module designs multi-stage time series division and Transformer encoder. This hierarchical structure can better learn multi-scale time series representations and capture the long-distance dependencies and interactions of the entire time series, thereby making up for the limitations of existing time series classification models that only extract fixed-scale features; after obtaining the multi-scale time series features, each sample is constructed into a graph with the channel as the node and the correlation between channels as the edge. Two types of graph contrast learning, channel-level contrast and sample-level contrast, are introduced to promote the learning of more robust channel-level features and sample global features. The schematic diagrams of channel-level contrast and sample-level contrast are shown in the figure. 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 the channel and the stability of correlations between different channels, so that samples can better learn the relationship between their internal channels, thereby making up for the problem that existing EEG signal fatigue detection algorithms ignore the channel dimensional characteristics of EEG signals. Sample-level comparison aims to learn robust global-level features of samples by comparing samples in each training batch at the granularity of the entire image. In scenarios where there are multiple channel data in the EEG signal time series, the present invention can make full use of multi-scale time series features and channel correlations, and can effectively improve the defects of low detection accuracy of existing EEG signal fatigue detection algorithms in long-term, multi-detection channel data. It has strong multi-scale time series features and multi-channel features learning capabilities and robustness, and can meet the high accuracy requirements of practical applications such as fatigue detection and early warning.
[0088] The embodiment of the present application also provides an EEG signal fatigue detection device. It should be noted that the EEG signal fatigue detection device of the embodiment of the present application can be used to execute the EEG signal fatigue detection method provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0089] The following is an introduction to the EEG signal fatigue detection device provided in an embodiment of the present application.
[0090] Figure 6 Schematic diagram of an EEG signal fatigue detection device according to an embodiment of the present application. Figure 6 As shown, the device comprises:
[0091] An acquisition unit 61 is used to acquire original sample data of the EEG signal, and to divide the original sample data of the EEG signal to generate positive sample data and negative sample data;
[0092] The processing unit 62 is used 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 sample 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;
[0093] The detection unit 63 is used to obtain the EEG signal data of the person to be detected, use the fatigue detection model to detect and process the EEG signal data, and output a fatigue detection result.
[0094] In this embodiment, the acquisition unit is used to acquire the original sample data of the EEG signal, divide and process the original sample data of the EEG signal, and generate positive sample data and negative sample data; the processing unit is used to 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 samples according to the corresponding multi-scale temporal features to obtain the corresponding sample graph, and input each sample graph into the graph attention network model, train the graph attention network model, and obtain the fatigue detection model; the detection unit is used to acquire the EEG signal data of the person to be detected, use the fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result. In the scenario where there are multiple channel data in the EEG signal time series, the multi-scale temporal features and channel correlation can be fully utilized, and the defects of low detection accuracy of the existing EEG signal fatigue detection algorithm in long-term and multi-detection channel data can be effectively improved. It has strong multi-scale temporal features and multi-channel features learning ability and robustness, and can meet the high accuracy requirements of practical applications such as fatigue detection and early warning. The problem of low detection accuracy of EEG signal fatigue detection in the prior art is solved.
[0095] As an optional scheme, the acquisition unit includes a first division processing module and a second division processing module, the first division processing module is used to adopt a synchronous division strategy to divide and process the above-mentioned original sample data to generate the above-mentioned positive sample data, wherein the above-mentioned synchronous division strategy is to segment the above-mentioned original sample data according to a preset time interval, and randomly disrupt the segmentation order while keeping the brain wave channels of the segmented data consistent; the second division processing module is used to adopt an asynchronous division strategy to divide and process the above-mentioned original sample data to generate the above-mentioned negative sample data, wherein the above-mentioned asynchronous division strategy is to segment the above-mentioned original sample data according to the above-mentioned preset time interval, and randomly disrupt the above-mentioned segmentation order of each of the above-mentioned brain wave channels in different ways.
[0096] An optional solution, the device also includes a computing unit and an updating unit; the computing unit is used to calculate the total loss function of the graph attention network model during the training of the graph attention network model, wherein the total loss function includes channel-level contrast loss, sample overall contrast loss, and cross entropy loss; the updating unit is used to update the model parameters of the graph attention network model according to the total loss function.
[0097] In an optional solution, the calculation unit further includes a first determination module, configured to determine, according to a first formula: Determine the above channel-level contrast loss in, Represents the feature representation of the nth channel node of the above original sample data after the Lth layer network, Represents the feature representation of the nth channel node of the above original sample data after the Lth layer network, It represents the characteristic representation of all channel nodes except the nth channel in the original sample data, the positive sample data, and the negative sample data after passing through the Lth layer network, and τ represents the temperature coefficient.
[0098] In an optional solution, the calculation unit further includes a second determination module, configured to determine the value of the second determination module according to a second formula: Determine the overall contrast loss of the above samples in, represents the overall characteristics of sample i, Represents the overall characteristics of the above positive sample data of sample i, represents the mth overall feature of the sample after removing sample i from the batch where sample i is located and the sample after data enhancement, B represents the size of a batch, and τ represents the temperature coefficient.
[0099] An optional solution, the processing unit includes a mapping processing module and an input module; the mapping processing module is used to map 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 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 multi-scale time series features.
[0100] In an optional scheme, the device also includes a generating unit, which is used to detect and process the above-mentioned EEG signal data to be detected by using the above-mentioned fatigue detection model, and after outputting the fatigue detection result, determine the fatigue level of the above-mentioned person to be detected according to the above-mentioned fatigue detection result, and generate prompt information according to the above-mentioned fatigue level, wherein the above-mentioned prompt information is used to remind the above-mentioned person to be detected of the current fatigue state.
[0101] The EEG signal fatigue detection device includes a processor and a memory. The acquisition unit, processing unit, detection unit, etc. are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0102] The processor includes a kernel, and the kernel retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of low detection accuracy of EEG signal fatigue detection in the prior art is solved by adjusting kernel parameters.
[0103] The memory may include non-permanent memory in a computer-readable medium, 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] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the EEG signal fatigue detection method.
[0105] Specifically, the EEG signal fatigue detection method includes:
[0106] Step S201, obtaining original sample data of the EEG signal, dividing the original sample data of the EEG signal to generate positive sample data and negative sample data;
[0107] Step S202, inputting 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 performing graph construction processing on the original 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 inputting each of the sample graphs into a graph attention network model, training the graph attention network model, and obtaining a fatigue detection model;
[0108] Step S203, obtaining the EEG signal data of the person to be detected, using the fatigue detection model to detect and process the EEG signal data, and outputting the fatigue detection result.
[0109] An embodiment of the present invention provides a processor, which is used to run a program, wherein the EEG signal fatigue detection method is executed when the program is running.
[0110] Specifically, the EEG signal fatigue detection method includes:
[0111] Step S201, obtaining original sample data of the EEG signal, dividing the original sample data of the EEG signal to generate positive sample data and negative sample data;
[0112] Step S202, inputting 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 performing graph construction processing on the original 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 inputting each of the sample graphs into a graph attention network model, training the graph attention network model, and obtaining a fatigue detection model;
[0113] Step S203, obtaining the EEG signal data of the person to be detected, using the fatigue detection model to detect and process the EEG signal data, and outputting the fatigue detection result.
[0114] An embodiment of the present invention provides an electronic device, the device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0115] Step S201, obtaining original sample data of the EEG signal, dividing the original sample data of the EEG signal to generate positive sample data and negative sample data;
[0116] Step S202, inputting 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 performing graph construction processing on the original 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 inputting each of the sample graphs into a graph attention network model, training the graph attention network model, and obtaining a fatigue detection model;
[0117] Step S203, obtaining the EEG signal data of the person to be detected, using the fatigue detection model to detect and process the EEG signal data, and outputting the fatigue detection result.
[0118] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0119] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0120] Step S201, obtaining original sample data of the EEG signal, dividing the original sample data of the EEG signal to generate positive sample data and negative sample data;
[0121] Step S202, inputting 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 performing graph construction processing on the original 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 inputting each of the sample graphs into a graph attention network model, training the graph attention network model, and obtaining a fatigue detection model;
[0122] Step S203, obtaining the EEG signal data of the person to be detected, using the fatigue detection model to detect and process the EEG signal data, and outputting the fatigue detection result.
[0123] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0124] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0125] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0126] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions 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] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0130] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0131] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0132] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0133] 1) A method for detecting fatigue of an EEG signal of the present application includes: obtaining the original sample data of the EEG signal, dividing and processing the original sample data of the EEG signal to generate positive sample data and negative sample data; inputting 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 performing graph construction processing on the original sample data, positive sample data and negative samples according to the corresponding multi-scale temporal features to obtain the corresponding sample graphs, and inputting each sample graph into a graph attention network model, training the graph attention network model to obtain a fatigue detection model; obtaining the EEG signal data of the person to be detected, using the fatigue detection model to detect and process the EEG signal data, and outputting the fatigue detection result. In the scenario where there are multiple channel data in the EEG signal time series, the multi-scale temporal features and channel correlation can be fully utilized, and the defect of low detection accuracy of the existing EEG signal fatigue detection algorithm in long-term and multi-detection channel data can be effectively improved. It has strong multi-scale temporal features and multi-channel features learning ability and robustness, and can meet the high accuracy requirements of practical applications such as fatigue detection and early warning. The problem of low detection accuracy of EEG signal fatigue detection in the prior art is solved.
[0134] 2) An EEG signal fatigue detection device of the present application includes: an acquisition unit, used to acquire original sample data of EEG signals, divide and process the original sample data of EEG signals, and generate positive sample data and negative sample data; a processing unit, used to input the original 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 original sample data, positive sample data and 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, train the graph attention network model, and obtain a fatigue detection model; a detection unit, used to acquire EEG signal data of a person to be detected, use a fatigue detection model to detect and process the EEG signal data, and output a fatigue detection result. In the scenario where there are multiple channel data in the EEG signal time series, it can make full use of multi-scale time series features and channel correlation, and can effectively improve the existing EEG signal fatigue detection algorithm's low detection accuracy in long-term, multi-detection channel data. It has strong multi-scale time series features 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. It solves the problem of low detection accuracy of EEG signal fatigue detection in the existing technology.
[0135] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting fatigue of electroencephalogram signals, characterized in that: include: Acquire original sample data of the EEG signal, and perform division processing on the original sample data of the EEG signal to generate positive sample data and negative sample data; 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 sample 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, train the graph attention network model, and obtain a fatigue detection model; The electroencephalogram (EEG) signal data of the person to be detected is obtained, the fatigue detection model is used to detect and process the electroencephalogram (EEG) signal data, and a fatigue detection result is output.
2. The method according to claim 1, characterized in that The original sample data of the electroencephalogram signal is divided and processed to generate positive sample data and negative sample data, including: The original sample data is segmented by adopting a synchronous segmentation strategy to generate the positive sample data, wherein the synchronous segmentation strategy is to segment the original sample data according to a preset time interval and randomly disrupt the segmentation order while keeping the brain wave channels of the segmented data consistent; The original sample data is segmented and processed using an asynchronous segmentation strategy to generate the negative sample data, wherein the asynchronous segmentation strategy is to segment the original sample data according to the preset time interval and randomly disrupt the segmentation order of each brain wave channel in different ways.
3. The method according to claim 1, characterized in that In the process of training 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, sample overall contrast loss, and cross entropy loss; The model parameters of the graph attention network model are updated according to the total loss function.
4. The method according to claim 3, characterized in that Calculate the channel-level contrastive loss in the total loss function of the graph attention network model, including: According to the first formula: Determine the channel-level contrast loss e channel ,in, Represents the feature representation of the nth channel node of the original sample data after the Lth layer network, Represents the feature representation of the nth channel node of the original sample data after the Lth layer network, It represents the characteristic representation of all channel nodes except the nth channel in the original sample data, the positive sample data, and the negative sample data after passing through the Lth layer network, and τ represents the temperature coefficient.
5. The method according to claim 3, characterized in that: Calculate the sample overall contrast loss in the total loss function of the graph attention network model, including: According to the second formula: Determine the overall contrast loss l of the sample G ,in, represents the overall characteristics of sample i, Represents the overall characteristics of the positive sample data of sample i, represents the mth overall feature of the sample after removing sample i from the batch where sample i is located and the sample after data enhancement, B represents the size of a batch, and τ represents the temperature coefficient.
6. The method according to claim 1, characterized in that Inputting 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 includes: Mapping the original sample data, the positive sample data and the negative sample data respectively through the Time2Vec model to generate corresponding time series initial embedding; Each of the time series is initially embedded into a Transformer encoding layer based on a multi-head self-attention mechanism to obtain the corresponding multi-scale time series features.
7. The method according to claim 1, characterized in that After the fatigue detection model is used to detect and process the to-be-detected electroencephalogram signal data and the fatigue detection result is output, the method further includes: The fatigue level of the person to be detected is determined according to the fatigue detection result, and prompt information is generated according to the fatigue level, wherein the prompt information is used to remind the person to be detected of the current fatigue state.
8. An electroencephalogram signal fatigue detection device, characterized in that: include: An acquisition unit, used for acquiring original sample data of the EEG signal, dividing the original sample data of the EEG signal to generate positive sample data and negative sample data; A processing unit, 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 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, train the graph attention network model, and obtain a fatigue detection model; The detection unit is used to obtain the EEG signal data of the person to be detected, use the fatigue detection model to detect and process the EEG signal data, and output the fatigue detection result.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for detecting fatigue of electroencephalogram signals according to any one of claims 1 to 7.
10. 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 are configured to be executed by the one or more processors, and the one or more programs include a method for executing the EEG signal fatigue detection method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Emotion recognition method based on twin network architecture and graph convolution
CN114330436A
Cross-subject electroencephalogram signal emotion recognition method
CN118633938A
EEG emotion recognition system and method based on multi-scale space-time diagram convolution and comparative learning
CN119970033A