Pain electroencephalogram data enhancement method based on generative adversarial network and multi-feature fusion

By adopting the method of fusion of generative adversarial networks and multi-features in EEG data enhancement, the problems of low data quality and unstable training process in the prior art are solved, high-quality EEG data enhancement is achieved, and the performance of pain classification model is improved.

CN120180183AInactive Publication Date: 2025-06-20GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510242500.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has problems with low data quality and unstable training process in the enhancement of EEG data, and lacks the means to effectively utilize EEG multi-domain information, resulting in low quality of generated data.

Method used

The pain EEG data enhancement method based on the fusion of generative adversarial network and multi-features is adopted. Through random masking transformation, automatic coding reconstruction based on UNet architecture, channel exchange operation and frequency offset operation, enhanced EEG data is generated, and the data authenticity is judged through the discriminator, and the parameters of the generator and discriminator are optimized until the iteration condition is met.

Benefits of technology

Effectively utilize multi-domain characterization of painful EEG data to ensure the quality and reliability of generated data, and improve the training effect of classification models and the robustness and generalization capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120180183A_ABST
    Figure CN120180183A_ABST
Patent Text Reader

Abstract

The invention provides a pain electroencephalogram data enhancement method based on a generative adversarial network and multi-feature fusion. The method comprises the steps that original electroencephalogram data are acquired and preprocessed; constructing a generative adversarial network, and in a generator, sequentially executing random masking transformation, UNet architecture-based automatic coding reconstruction, channel exchange operation and frequency deviation operation on the preprocessed original electroencephalogram data to generate enhanced electroencephalogram data; in the discriminator, the authenticity of the enhanced electroencephalogram data is discriminated, and a discrimination result is output; after confrontation training is completed, a trained generator is obtained, and the trained generator is used for conducting data enhancement on the new electroencephalogram data; according to the method, the multi-domain representation of the pain electroencephalogram data can be effectively utilized, and the quality and reliability of the generated data are ensured, so that the training effect of the classification model is further improved, and the robustness and generalization ability of the model are also improved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical fields of deep learning and data augmentation, and more particularly, to a pain electroencephalogram data augmentation method based on a generative adversarial network and multi-feature fusion. Background Art

[0002] Pain is one of the oldest and most common physiological experiences of humans. The International Association for the Study of Pain (IASP) defines it as "an unpleasant sensory and emotional experience associated with actual or potential tissue damage". From a physiological perspective, pain is a warning signal that the body perceives noxious stimuli through peripheral nerve endings and transmits them through the spinal cord to the cerebral cortex for integration. Its essence is a survival protection mechanism. However, pain is by no means a simple physiological phenomenon. In patients with chronic pain, about 30% of cases cannot find clear organic lesions but still continuously experience real pain sensations. The adverse pain experience affects the physical and mental state of patients and may lead to more serious health problems.

[0003] Therefore, pain discrimination has practical value in clinical medicine. Timely and accurate pain discrimination will facilitate the subsequent treatment work for medical staff. Especially in special groups (such as infants, dementia patients, coma patients, etc.), patients often cannot report their pain conditions by themselves. At this time, the accuracy of pain discrimination is directly related to the treatment quality. These both create the demand for pain discrimination and pose challenges to it.

[0004] For this reason, modern medicine has developed a multi-modal pain assessment system, forming a discriminant framework that combines subjective and objective methods. Subjective assessment takes the patient's self-report as the core and uses the Visual Analogue Scale (VAS), Numerical Rating Scale (NRS), and McGill Pain Questionnaire (MPQ) as the gold standard tools; although such methods are simple and easy to implement, due to their high dependence on the patient's self-report, it is difficult to avoid subjective influence. The method of using physiological indicators and biomarkers for pain discrimination is more objective. For example, pain is evaluated by monitoring blood pressure, heart rate, and detecting biomarkers in blood, urine, cerebrospinal fluid, etc.; however, such methods have higher requirements for equipment and technology and greater costs, and are not convenient for clinical application. Currently, pain detection based on electroencephalogram (EEG) data is becoming a forefront field for objective pain assessment due to its millisecond-level time resolution, lower cost, and non-invasive characteristics. EEG signals are a direct reflection of brain activities and are not affected by the patient's subjective consciousness and language expression ability, so they have high objectivity. Relevant pathological studies and actual verifications have also confirmed the effectiveness of EEG signals for pain discrimination.

[0005] With the booming development of the deep learning field in recent years, algorithms and models for electroencephalogram (EEG) analysis and pain discrimination have also been developed. The training of deep learning models usually requires a considerable amount of data. However, due to the inherent characteristics of EEG data and the complex process of obtaining EEG data, the publicly available datasets based on EEG data are relatively limited, and it is very difficult to obtain a large amount of data for model training. Therefore, seeking a solution method that can train a robust and effective model through limited samples has practical application significance.

[0006] Data augmentation refers to the process of transforming the original data by certain means to generate new data, which is an effective solution to the above-mentioned scarcity of EEG data. In the field of EEG analysis, traditional data augmentation methods include geometric transformation, window cropping, and noise addition. Although traditional methods are simple and easy to implement, they are limited to single-domain transformation and may affect the consistency of other domains. With the development of the deep learning field, deep learning-based data generation models have gradually been applied to the augmentation of EEG data. Many researchers have conducted experiments using generative adversarial networks (GANs) and relevant features and prior knowledge of EEG pain discrimination, and designed various GAN-based data augmentation models, which have improved the data gap problem to a certain extent and enhanced the recognition accuracy of classification models. Nevertheless, the traditional GANs used in existing research still have the problem of unstable training processes; at the same time, there is a lack of means to effectively utilize multi-domain information of EEG during data augmentation, and multi-domain features of EEG are not fused, resulting in low-quality generated data. Summary of the Invention

[0007] To overcome the defect of low-quality augmented data of EEG signals generated by the above-mentioned existing technologies, the present invention provides a pain EEG data augmentation method based on generative adversarial networks and multi-feature fusion, which can effectively utilize the multi-domain representation of pain EEG data, ensure the quality and reliability of the generated data, thereby further improving the training effect of the classification model and also enhancing the robustness and generalization ability of the model to a certain extent.

[0008] To solve the above technical problems, the technical solution of the present invention is as follows: A pain EEG data augmentation method based on generative adversarial networks and multi-feature fusion, comprising the following steps: S1: Obtain the original EEG data and perform preprocessing; S2: Construct a generative adversarial network, which includes a generator and a discriminator; S3: In the generator, perform random masking transformation, auto-encoding reconstruction based on the UNet architecture, channel swapping operation, and frequency offset operation on the preprocessed original EEG data in sequence to generate augmented EEG data; S4: In the discriminator, determine the authenticity of the enhanced EEG data and output a determination result; S5: Respectively set the loss functions of the generator and the discriminator, repeat steps S3 - S4, calculate the loss function values of the generator and the discriminator, and continuously iterate to optimize the parameters of the generator and the discriminator until the preset stop iteration condition is met, and obtain a trained generator; S6: Obtain new EEG data, input it into the trained generator for data enhancement to obtain an extended dataset, and use the extended dataset to train a preset pain classification model to improve pain classification accuracy.

[0009] Preferably, in step S1, the original EEG data is segmented into data segments with a duration of 1 second, and the EEG data of each channel is mapped to an 11×11 two - dimensional matrix according to the 10 - 20 EEG electrode channel distribution system to complete pre - processing.

[0010] Preferably, in step S3, the random masking transformation includes: Set the data points at random positions in the input EEG data segment to zero, expressed as:

[0011] where, represents the value of the data point after random masking transformation; represents the value of the data point ; represents the zero - setting probability value of the data point ; represents a zero - setting probability threshold randomly sampled from the uniform distribution interval , and are respectively the minimum and maximum values of the zero - setting probability threshold.

[0012] Preferably, in step S3, the UNet architecture includes a contracting path and an expanding path connected in sequence. Among them, the contracting path includes convolutional layer 1, convolutional layer 2, convolutional layer 3, and convolutional layer 4 connected in sequence, and the expanding path includes convolutional layer 5, convolutional layer 6, and convolutional layer 7 connected in sequence; the convolutional kernels of convolutional layer 1 and convolutional layers 4 - 7 are all 3×3, and the convolutional kernels of convolutional layer 2 and convolutional layer 3 are all 5×5; LeakyReLU activation functions are respectively set after convolutional layers 1 - 7; Convolutional layer 1 also forms a skip connection with convolutional layer 7, convolutional layer 2 also forms a skip connection with convolutional layer 6, and convolutional layer 3 also forms a skip connection with convolutional layer 5.

[0013] Preferably, in the step S3, the channel exchange operation includes: according to a 10-20 electroencephalogram electrode channel distribution system, swapping the left-brain electrode channel data with the electrode channel data at the corresponding position in the right brain, and keeping the middle channel data unchanged; For the electroencephalogram data of channels, perform channel exchange, which is expressed as:

[0014] wherein, is the data after channel exchange for the i-th channel; represents the electrodes in the left-brain part, expressed as , represents the total number of electrodes in the left-brain part; represents the electrodes in the right-brain part, expressed as ; is the electrode in the middle part.

[0015] Preferably, in the step S3, the frequency shift operation includes: performing frequency shift on the complex analytic signals of each channel of the electroencephalogram data, and the complex analytic signal is expressed as:

[0016] wherein, is the complex analytic signal; is the input electroencephalogram data; represents the Hilbert transform; is the imaginary unit; Perform a frequency shift operation on the complex analytic signal , which is expressed as:

[0017] wherein, is the electroencephalogram data after the frequency shift operation at time t; represents the real part of the complex analytic signal at time t; represents a frequency shift value randomly sampled from the interval , represents the maximum value of the frequency shift value.

[0018] Preferably, the structure of the discriminator includes, connected in sequence: a convolutional layer 8, a convolutional layer 9, a convolutional layer 10, a separable convolutional module, a multi-scale feature extraction module, and a discriminant module; The convolutional kernel size of the convolutional layer 8 is 3×3, and the convolutional kernel sizes of the convolutional layer 9 and the convolutional layer 10 are both 5×5; SELU activation functions are respectively set after the convolutional layers 8-10; The separable convolution module includes a 3×3 depth convolution layer and a 1×1 pointwise convolution layer connected in sequence. An SELU activation function is provided after the 1×1 pointwise convolution layer; The multi-scale feature extraction module includes convolution layer 11, convolution layer 12, and convolution layer 13 arranged in parallel. The convolution kernel sizes of convolution layer 11, convolution layer 12, and convolution layer 13 are 1×1, 3×3, and 5×5 respectively; SELU activation functions are provided after convolution layer 11 to 13; The discriminant module includes: linear layer 1 and linear layer 2 connected in sequence; an SELU activation function is provided after linear layer 1.

[0019] Preferably, in step S5, the loss function of the generator is specifically:

[0020] where is the loss function value of the generator; represents the distribution of real EEG data; e represents the sampling sample of real EEG data; G is the generator; D is the discriminator; is the EEG data after random masking transformation; E represents the mathematical expectation; The loss function of the discriminator adopts the gradient penalty form of Wasserstein GAN, specifically:

[0021] where is the loss function value of the discriminator; is the gradient penalty coefficient; represents the L2 norm; represents the linear interpolation distribution of real EEG data and the enhanced EEG data generated by the generator; represents the sampling sample of.

[0022] Preferably, in step S5, the preset stopping iteration condition is specifically to reach the preset maximum number of iterations, or, the loss function value of the generator is less than or equal to the preset first threshold and the loss function value of the discriminator is less than or equal to the preset second threshold.

[0023] Preferably, in step S6, the extended dataset includes new EEG data and new enhanced EEG data generated by the trained generator; The preset pain classification model includes at least any one of EEGNet and EEG Conformer classification models.

[0024] Compared with the prior art, the beneficial effects of the technical solution of the present invention are: The present invention provides a method for enhancing pain EEG data based on a generative adversarial network and multi-feature fusion. First, the original EEG data is obtained and preprocessed. Then, a generative adversarial network is constructed. In the generator, the preprocessed original EEG data is sequentially subjected to random masking transformation, auto-encoding reconstruction based on the UNet architecture, channel swapping operation, and frequency shift operation to generate enhanced EEG data. In the discriminator, the authenticity of the enhanced EEG data is discriminated, and a discrimination result is output. After that, the loss functions of the generator and the discriminator are respectively set, and iterative training is repeated. The loss function values of the generator and the discriminator are calculated, and the parameters of the generator and the discriminator are continuously iteratively optimized until a preset stop iteration condition is met, and a trained generator is obtained. Finally, the trained generator is used to enhance new EEG data, and the extended dataset can be used to train the existing pain classification model to improve its pain classification accuracy. Based on the generative adversarial network and multi-feature fusion, the present invention can effectively utilize the multi-domain representation of pain EEG data to ensure the quality and reliability of the generated data. Using the enhancement method proposed by the present invention to expand the dataset for training the pain classification model can effectively improve the scarcity problem of EEG data, thereby improving the training effect of the classification model and also enhancing the robustness and generalization ability of the model to a certain extent. The present invention provides a new data enhancement method for the case of limited EEG data volume, which can effectively improve the training effect of the classification model and has practical significance and application value for pain discrimination research. Description of the Drawings

[0025] Figure 1 It is a flowchart of a method for enhancing pain EEG data based on a generative adversarial network and multi-feature fusion provided in Embodiment 1.

[0026] Figure 2 It is a schematic diagram of data mapping provided in Embodiment 2.

[0027] Figure 3 It is a schematic diagram of the generator structure provided in Embodiment 2.

[0028] Figure 4 It is a schematic diagram of the UNet architecture in the generator provided in Embodiment 2.

[0029] Figure 5 It is a schematic diagram of the discriminator structure provided in Embodiment 2.

[0030] Figure 6 It is a schematic diagram of the training process of the pain classification model after adding the data enhancement method provided in Embodiment 2. Detailed Embodiments

[0031] The drawings are only for illustrative purposes and should not be construed as a limitation of this patent. To better illustrate this embodiment, some components in the accompanying drawings are omitted, enlarged or reduced, which do not represent the dimensions of the actual product; For those skilled in the art, it is understandable that some well-known structures and their descriptions in the accompanying drawings may be omitted.

[0032] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0033] Embodiment 1 As Figure 1 shown, this embodiment provides a method for enhancing pain EEG data based on a generative adversarial network and multi-feature fusion, including the following steps: S1: Obtain the original EEG data and perform preprocessing; S2: Construct a generative adversarial network, which includes a generator and a discriminator; S3: In the generator, perform random masking transformation, auto-encoding reconstruction based on the UNet architecture, channel swapping operation, and frequency offset operation on the preprocessed original EEG data in sequence to generate enhanced EEG data; S4: In the discriminator, discriminate the authenticity of the enhanced EEG data and output the discrimination result; S5: Set the loss functions of the generator and the discriminator respectively, repeat steps S3 - S4, calculate the loss function values of the generator and the discriminator, and continuously iterate and optimize the parameters of the generator and the discriminator until the preset stop iteration condition is met, and obtain the trained generator; S6: Obtain new EEG data and input it into the trained generator for data enhancement to obtain an extended dataset, and use the extended dataset to train a preset pain classification model to improve the pain classification accuracy.

[0034] In the specific implementation process, first obtain the original EEG data and perform preprocessing; Then construct a generative adversarial network (GAN). The generative adversarial network consists of two parts: a generator and a discriminator. During the training process of the GAN, the two will perform a minimax game. The discriminator needs to discriminate whether the data generated by the generator is real data, while the generator needs to continuously optimize the generated data to deceive the discriminator; by optimizing the minimax game loss function of the two, the discriminator and the generator can be gradually optimized, and finally generate data similar to the real samples; In the generator, perform random masking transformation, auto-encoding reconstruction based on the UNet architecture, channel swapping operation, and frequency offset operation on the preprocessed original EEG data in sequence to generate enhanced EEG data; in the discriminator, discriminate the authenticity of the enhanced EEG data and output the discrimination result; Afterwards, the loss functions of the generator and the discriminator are set respectively, and the above-mentioned generation and discrimination processes are repeated. The adversarial training is carried out iteratively. After each iteration, the loss function values of the generator and the discriminator are calculated, and the parameters of the generator and the discriminator are optimized until the preset iteration stop condition is met, and the trained generator is obtained; Finally, the trained generator is used to perform data augmentation on the new EEG data. The expanded dataset can be used to train the existing pain classification model. With the help of this method, the limited sample dataset originally used for training can be expanded, and the newly generated data can participate in the training of the pain classification model to improve the classification effect; This method can effectively utilize the multi-domain representation of pain EEG data, ensure the quality and reliability of the generated data, thereby further improving the training effect of the classification model, and also improving the robustness and generalization ability of the model to a certain extent.

[0035] Embodiment 2 This embodiment provides a method for enhancing pain EEG data based on a generative adversarial network and multi-feature fusion, including the following steps: S1: Obtain the original EEG data and perform preprocessing; S2: Construct a generative adversarial network, which includes a generator and a discriminator; S3: In the generator, perform random masking transformation, auto-encoding reconstruction based on the UNet architecture, channel swapping operation, and frequency offset operation on the preprocessed original EEG data in sequence to generate enhanced EEG data; S4: In the discriminator, discriminate the authenticity of the enhanced EEG data and output the discrimination result; S5: Set the loss functions of the generator and the discriminator respectively, repeat steps S3 - S4, calculate the loss function values of the generator and the discriminator, and continuously iterate to optimize the parameters of the generator and the discriminator until the preset iteration stop condition is met, and the trained generator is obtained; S6: Obtain new EEG data and input it into the trained generator for data augmentation to obtain an expanded dataset, and use the expanded dataset to train the preset pain classification model to improve the pain classification accuracy; In the step S1, the original EEG data is segmented into data segments with a duration of 1 second, and the EEG data of each channel is mapped to an 11×11 two-dimensional matrix according to the 10 - 20 EEG electrode channel distribution system to complete the preprocessing; In the step S3, the random masking transformation includes: Setting the data points at random positions in the input EEG data segment to zero, which is expressed as:

[0036] Wherein, Represents a data point Value after random masking transformation; Represents a data point Value; Represents a data point Zeroing probability value; Represents a zeroing probability threshold randomly sampled from the uniform distribution interval And And Are the minimum and maximum values of the zeroing probability threshold respectively; In step S3, the UNet architecture includes a contracting path and an expanding path connected in sequence. Among them, the contracting path includes convolutional layer 1, convolutional layer 2, convolutional layer 3, and convolutional layer 4 connected in sequence, and the expanding path includes convolutional layer 5, convolutional layer 6, and convolutional layer 7 connected in sequence; the convolutional kernels of convolutional layer 1 and convolutional layers 4 - 7 are all 3×3, and the convolutional kernels of convolutional layer 2 and convolutional layer 3 are all 5×5; LeakyReLU activation functions are respectively set after convolutional layers 1 - 7; Convolutional layer 1 also forms a skip connection with convolutional layer 7, convolutional layer 2 also forms a skip connection with convolutional layer 6, and convolutional layer 3 also forms a skip connection with convolutional layer 5; In step S3, the channel swapping operation includes: according to the 10 - 20 electroencephalogram electrode channel distribution system, swapping the data of the left - brain electrode channels with the data of the electrode channels at the corresponding positions in the right - brain, and keeping the data of the middle channels unchanged; For Electroencephalogram data of Channels, the channel swapping is expressed as:

[0037] Wherein, Is the data after the i - th channel swapping; Represents the electrodes in the left - brain part, expressed as , Represents the total number of electrodes in the left - brain part; Represents the electrodes in the right - brain part, expressed as ; Are the electrodes in the middle part; In step S3, the frequency shift operation includes: performing frequency shift on the complex analytic signals of each channel of the electroencephalogram data, and the complex analytic signal is expressed as:

[0038] Wherein, Is the complex analytic signal; Is the input electroencephalogram data; Represents the Hilbert transform; Is the imaginary unit; For the complex analytic signal perform a frequency shift operation, expressed as:

[0039] where is the EEG data after the frequency offset operation at time t; represents the real part of the complex analytic signal at time t; represents a randomly sampled frequency offset value from the interval ; represents the maximum value of the frequency offset value; The structure of the discriminator includes, connected in sequence: a convolutional layer 8, a convolutional layer 9, a convolutional layer 10, a separable convolutional module, a multi-scale feature extraction module, and a discrimination module; The convolutional kernel size of the convolutional layer 8 is 3×3, and the convolutional kernel sizes of the convolutional layer 9 and the convolutional layer 10 are both 5×5; an SELU activation function is provided after the convolutional layers 8-10; The separable convolutional module includes a 3×3 depth convolutional layer and a 1×1 pointwise convolutional layer connected in sequence, and an SELU activation function is provided after the 1×1 pointwise convolutional layer; The multi-scale feature extraction module includes convolutional layers 11, 12, and 13 arranged in parallel, and the convolutional kernel sizes of the convolutional layers 11, 12, and 13 are 1×1, 3×3, and 5×5 respectively; an SELU activation function is provided after the convolutional layers 11-13; The discrimination module includes, connected in sequence: a linear layer 1 and a linear layer 2; an SELU activation function is provided after the linear layer 1; In the step S5, the loss function of the generator is specifically:

[0040] where is the value of the loss function of the generator; represents the real EEG data distribution; e represents the sampling sample of the real EEG data; G is the generator; D is the discriminator; is the EEG data after the random masking transformation; E represents the mathematical expectation; The loss function of the discriminator adopts the gradient penalty form of Wasserstein GAN, specifically:

[0041] where is the value of the loss function of the discriminator; is the gradient penalty coefficient; represents the L2 norm; Represents the linear interpolation distribution of real EEG data and the enhanced EEG data generated by the generator; Represents the sampling samples of; In the step S5, the preset stop iteration condition is specifically to reach the preset maximum number of iterations, or the loss function value of the generator is less than or equal to the preset first threshold and the loss function value of the discriminator is less than or equal to the preset second threshold; In the step S6, the extended dataset includes new EEG data and new enhanced EEG data generated by the trained generator; The preset pain classification model includes at least any one of the EEGNet and EEG Conformer classification models.

[0042] In the specific implementation process, first obtain the original EEG data and perform preprocessing; in this embodiment, the original EEG data needs to be segmented into data segments with a duration of 1 second, and the EEG data of each channel is mapped to an 11×11 two-dimensional matrix according to the 10-20 EEG electrode channel distribution system. The mapping method is as Figure 2 shown; in this embodiment, taking the original EEG data with 32 channels and downsampled to a sampling rate of 128 Hz as an example, the input data shape is 32×128, and according to the mapping rule, it will be mapped to data with a shape of 128×11×11; Then construct a generative adversarial network (GAN). The generative adversarial network consists of two parts: a generator and a discriminator. During the training process of the GAN, the two will perform a minimax game. The discriminator needs to determine whether the data generated by the generator is real data, while the generator needs to continuously optimize the generated data to deceive the discriminator; by optimizing the minimax game loss function of the two, the discriminator and the generator can be gradually optimized, and finally generate data similar to the real samples; As Figure 3 is the structure of the generator. In the generator, the preprocessed original EEG data is successively subjected to a random masking transformation, an auto-encoding reconstruction based on the UNet architecture, a channel swapping operation, and a frequency shift operation to generate enhanced EEG data; the specific data processing steps are as follows: a) The random masking transformation operation will set the data points at random positions in the input EEG data segment to zero. Before performing the random masking, the data will be mapped to data of 128×11×11. Therefore, in this embodiment, is used to represent the position of a certain point. The specific masking transformation operation is expressed as:

[0043] Among them, represents the value of the data point after random masking transformation; Represents the value of a data point ; Represents the zeroing probability value of a data point ; Represents the zeroing probability threshold randomly sampled from the uniform distribution interval ; where and are the minimum and maximum values of the zeroing probability threshold respectively; when is less than the threshold , the corresponding point data of the input EEG data will be set to zero; b) The data obtained through the random masking transformation will then directly reconstruct the EEG data in a downsampling and upsampling manner through an autoencoder; to address the issue of detail loss that may occur when downsampling high-resolution time series using a conventional autoencoder, this method uses an adjusted UNet architecture to reconstruct the EEG data, and its structure is as shown in Figure 4 ; In this embodiment, the UNet architecture includes a contracting path (left side) and an expanding path (right side) connected in sequence. The contracting path follows the typical architecture of an encoder convolutional neural network to extract and downsample the EEG signal and extract the feature map, which is composed of a 3×3 convolutional layer, two 5×5 convolutional layers, and another 3×3 convolutional layer connected in sequence. LeakyReLU is used as the activation function after each convolutional layer, the stride of each convolutional layer is set to 1, and the number of feature channels is halved; The expanding path includes three 3×3 convolutional layers with a stride of 1 connected in sequence, which upsample the feature map output by the contracting path in sequence, doubling the number of feature channels in sequence; similarly, there is a LeakyReLU activation function after each convolutional layer; Between the contracting and expanding paths, the feature map is upsampled to a high spatio-temporal resolution through skip connections to generate new EEG samples based on the extracted features; after processing by the final convolutional layer, a preliminary synthesis result of size 128×11×11 can be obtained; c) The data obtained through preliminary synthesis will be reshaped into data of 32×128 shape according to the original channel information; next, the data will undergo channel swapping, and the channel swapping process follows the following channel swapping operation: according to the 10-20 EEG electrode channel distribution system, the left brain electrode channel data is swapped with the electrode channel data at the corresponding position in the right brain, and the middle channel data remains unchanged; Assume that for channels of EEG data undergoing channel swapping, it can be expressed as:

[0044] where Data after channel exchange for the i-th channel; Electrodes representing the left brain part, denoted as , Total number of electrodes in the left brain part; Electrodes representing the right brain part, denoted as ; Electrodes for the middle part; d) After the channel exchange operation, the data will also undergo a frequency offset operation; the frequency offset will perform the same frequency shift operation on all channels of the EEG data. The frequency offset operation includes frequency shifting the complex analytic signal of each channel of the EEG data, and the complex analytic signal is expressed as:

[0045] where, is the complex analytic signal; is the input EEG data; represents the Hilbert transform; is the imaginary unit; For the complex analytic signal perform a frequency shift operation, expressed as:

[0046] where, is the EEG data after the frequency offset operation at time t; represents the real part of the complex analytic signal at time t; represents a randomly sampled frequency offset value from the interval ; represents the maximum value of the frequency offset value; through experiments, in this method is set to 0.1 Hz; In the discriminator, the authenticity of the enhanced EEG data is discriminated, and the discrimination result is output; The discriminator structure is as Figure 5 shown. To analyze the complex spatio-temporal features of the EEG signal, it consists of three two-dimensional convolutional layers, a separable convolution module, and a multi-scale feature extraction module; First, the input EEG signal passes through three convolutional blocks to extract low-resolution features; the first convolutional block uses a 3×3 convolutional layer, while the second and third convolutional blocks use 5×5 convolutional layers; each convolutional layer halves the number of input feature channels, and the stride of all convolutional layers is set to 1. After each convolutional layer, the scaled exponential linear unit (SELU) is used as the activation function; Then, since the discrimination of pain is related to the local patterns of spatial or temporal features, this method adds a separable convolution module to decouple the modeling of spatio-temporal information; it decomposes the standard 3×3 convolutional layer into a 3×3 depth convolution and a 1×1 pointwise convolution, and divides the calculation into two steps, depth convolution and pointwise convolution; the depth convolution applies a convolutional filter to each input channel, and the pointwise convolution is used to create a linear combination of the depth convolution outputs; the strides of both the depth convolution and the pointwise convolution are set to 1, and SELU is still used after the pointwise convolution output; in this way, the separable convolutional layer can capture the spatial and temporal correlations of the extracted feature maps; The recognition of pain perception needs to consider EEG signals at different spatial scales. Therefore, this method designs a multi-scale feature extraction module containing three different-sized filters to extract multi-scale feature maps; it includes a 1×1 convolutional layer, a 3×3 convolutional layer, and a 5×5 convolutional layer, and connects their output filter banks into a single feature map to form the input for the next stage; the stride of each convolutional layer is 1, and the number of feature channels is halved; After that, the feature maps extracted by the convolutional layers of each EEG signal are reshaped into 1×3872 (32×11×11) feature vectors, and a linear layer is used to map the feature vectors to scalars; the linear layer contains 1024 nodes, followed by a SELU activation function to feedback the discriminant class results; The loss functions of the generator and the discriminator are set respectively, and the above-mentioned generation and discrimination processes are repeated, and adversarial training is carried out iteratively. After each iteration, the loss function values of the generator and the discriminator are calculated and the parameters of the generator and the discriminator are optimized until the preset maximum number of iterations is reached, or the loss function values of the generator and the discriminator are respectively less than or equal to the corresponding thresholds, and the training is completed to obtain the trained generator; In this embodiment, the loss function of the generator is specifically:

[0047] Among them, is the loss function value of the generator; represents the distribution of real EEG data; e represents the sampling samples of real EEG data; G is the generator; D is the discriminator; is the EEG data after random masking transformation; E represents the mathematical expectation; Due to the instability problem in the training process of traditional GAN, this method adopts the gradient penalty version of WassersteinGAN, that is, WGAN-GP, and uses it as the loss function of the discriminator, specifically:

[0048] Among them, is the loss function value of the discriminator; is the gradient penalty coefficient; represents the L2 norm; represents the linear interpolation distribution of the real EEG data and the enhanced EEG data generated by the generator; represents the sampling samples of; such as Figure 6 As shown in, finally, the trained generator is used to perform data augmentation on the new EEG data, and the expanded dataset can be used to train the existing pain classification model. With the help of this method, the limited sample dataset originally used for training can be expanded, allowing the newly generated data to participate in the training of the pain classification model and improving the classification effect; To verify the effectiveness of this method, this embodiment also conducts experimental verification on the public EEG pain dataset The brainfunction in chronic pain (BFCP). The BFCP dataset is collected using a German BrainProducts EEG device and contains 65 EEG channels and 2 additional electrooculogram channels; the dataset has collected the resting-state EEG data of 189 subjects, including 101 chronic pain patients (average age 58.2±13.5 years, 69 females) and 88 healthy subjects (average age 57.8±14.6 years, 55 females), and the pain category and VAS pain score of each patient are recorded at the same time; The pain discrimination task is selected for the experiment, and painless and pain subjects are classified according to the pain score; taking EEGNet and EEG conformer as the benchmark classification models, the comparison of the results before and after data augmentation using this method is shown in Table 1 under the condition of 10-fold cross-validation across subjects: Table 1 Comparison of results before and after data augmentation

[0049] As can be seen from Table 1, the classification models trained after augmentation have all improved in accuracy, indicating that the proposed method is robust and general; In addition, this embodiment also takes EEG conformer as the benchmark classification model, and compares the four situations of no augmentation, using channel swapping augmentation, using frequency shift augmentation, and using this method for augmentation. The results are shown in Table 2: Table 2 Comparison of results of four situations

[0050] As can be seen from Table 2, the accuracy obtained after data augmentation using this method is the highest, indicating that this method can make more effective use of the potential features of EEG data and contribute to the improvement of the model's performance; This method can effectively utilize the multi-domain representation of pain EEG data to ensure the quality and reliability of the generated data, thereby further improving the training effect of the classification model and also enhancing the robustness and generalization ability of the model to a certain extent.

[0051] The same or similar reference numerals correspond to the same or similar components; The terms describing the positional relationship in the drawings are only for illustrative purposes and should not be construed as a limitation of this patent; Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention and are not intended to limit the implementation manners of the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to enumerate all the implementation manners here. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. A pain EEG data enhancement method based on generative adversarial network and multi-feature fusion, characterized in that: The following steps are involved: S1: obtain raw EEG data and preprocess it; S2: construct a generative adversarial network, wherein the generative adversarial network includes a generator and a discriminator; S3: In the generator, random masking transformation, automatic encoding reconstruction based on the UNet architecture, channel exchange operation and frequency shift operation are sequentially performed on the preprocessed raw EEG data to generate enhanced EEG data; S4: in the discriminator, the authenticity of the enhanced EEG data is discriminated and a discrimination result is output; S5: Set the loss functions of the generator and discriminator respectively, repeat steps S3-S4, calculate the loss function values ​​of the generator and discriminator, and continuously iterate and optimize the parameters of the generator and discriminator until the preset stop iteration condition is met to obtain the trained generator; S6: Obtain new EEG data and input it into the trained generator for data enhancement, obtain an extended data set, and use the extended data set to train the preset pain classification model to improve the accuracy of pain classification.

2. According to claim 1, a pain EEG data enhancement method based on generative adversarial network and multi-feature fusion is characterized in that: In the step S1, the original EEG data is segmented into data segments of 1 second in length, and the EEG data of each channel is mapped to a 11×11 two-dimensional matrix according to a 10-20 EEG electrode channel distribution system to complete preprocessing.

3. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: In step S3, the random masking transformation includes: The data points at random positions in the input EEG data segment are set to zero, expressed as: in, Represents data points Randomly mask the transformed value; Represents data points The value of Represents data points The zero probability value of ; Represents a uniform distribution interval The zero probability threshold obtained by random sampling in and are the minimum and maximum values ​​of the zero probability threshold respectively.

4. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: In the step S3, the UNet architecture includes a contraction path and an expansion path connected in sequence, wherein the contraction path includes convolutional layer 1, convolutional layer 2, convolutional layer 3 and convolutional layer 4 connected in sequence, and the expansion path includes convolutional layer 5, convolutional layer 6 and convolutional layer 7 connected in sequence; the convolutional kernel sizes of the convolutional layer 1 and convolutional layers 4 to 7 are all 3×3, and the convolutional kernel sizes of the convolutional layer 2 and convolutional layer 3 are all 5×5; LeakyReLU activation functions are respectively set after convolutional layers 1 to 7; The convolution layer 1 also forms a skip connection with the convolution layer 7, the convolution layer 2 also forms a skip connection with the convolution layer 6, and the convolution layer 3 also forms a skip connection with the convolution layer 5.

5. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: In step S3, the channel exchange operation includes: according to the 10-20 EEG electrode channel distribution system, exchanging the left brain electrode channel data with the electrode channel data of the corresponding position of the right brain, and the middle channel data remains unchanged; right EEG data of channels Channel exchange is performed, which is expressed as: in, The data after exchange of the i-th channel; The electrodes representing the left brain are represented by , The total number of electrodes representing the left brain segment; The electrodes representing the right brain are represented by ; The electrode in the middle.

6. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: In step S3, the frequency shift operation includes: performing frequency shift on the complex analysis signal of each channel of the EEG data, and the complex analysis signal is expressed as: in, is the complex analytical signal; is the input EEG data; represents the Hilbert transform; is an imaginary unit; Complex analysis signal Perform frequency shift operation, expressed as: in, is the EEG data after the frequency shift operation at time t; Represents the complex analysis signal at time t The real part of Indicates that from the interval The frequency offset value randomly sampled in, Indicates the maximum value of the frequency offset.

7. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: The structure of the discriminator includes: a convolution layer 8, a convolution layer 9, a convolution layer 10, a separable convolution module, a multi-scale feature extraction module and a discriminant module connected in sequence; The convolution kernel size of the convolution layer 8 is 3×3, and the convolution kernel sizes of the convolution layers 9 and 10 are both 5×5; SELU activation functions are respectively set after the convolution layers 8 to 10; The separable convolution module includes a 3×3 depth convolution layer and a 1×1 point-by-point convolution layer connected in sequence, and a SELU activation function is set after the 1×1 point-by-point convolution layer; The multi-scale feature extraction module includes a convolution layer 11, a convolution layer 12 and a convolution layer 13 arranged in parallel, and the convolution kernel sizes of the convolution layer 11, the convolution layer 12 and the convolution layer 13 are 1×1, 3×3 and 5×5 respectively; SELU activation functions are respectively arranged after the convolution layers 11 to 13; The discrimination module includes: a linear layer 1 and a linear layer 2 connected in sequence; The linear layer 1 is followed by a SELU activation function.

8. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: In step S5, the loss function of the generator is specifically: in, is the loss function value of the generator; represents the distribution of real EEG data; e represents the sample of real EEG data; G is the generator; D is the discriminator; is the EEG data after random masking transformation; E represents the mathematical expectation; The loss function of the discriminator adopts the gradient penalty form of Wasserstein GAN, specifically: in, is the loss function value of the discriminator; is the gradient penalty coefficient; represents the L2 norm; Represents the linear interpolation distribution of real EEG data and enhanced EEG data generated by the generator; express of sampling samples.

9. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: In step S5, the preset condition for stopping iteration is specifically that a preset maximum number of iterations is reached, or the loss function value of the generator is less than or equal to a preset first threshold and the loss function value of the discriminator is less than or equal to a preset second threshold.

10. The method for enhancing pain EEG data based on generative adversarial network and multi-feature fusion according to claim 1, characterized in that: In step S6, the extended data set includes new EEG data and new enhanced EEG data generated by the trained generator; The preset pain classification model includes at least: any one of EEGNet and EEG Conformer classification models.

Citation Information

Patent Citations

  • Multi-scale space-time perception electroencephalogram data amplification method and system based on diffusion enhancement

    CN118940031A

  • Development and implementation of psychological state model

    US20230148923A1