Feature extraction method and system based on multi-scale convolution attention

By adopting a feature extraction method of multi-scale convolution combined with attention mechanism in the diagnosis of depression, the problem of insufficient extraction of EEG signal characteristics in the prior art is solved, and high-precision identification of depression-related features and effective modeling of global timing dependencies is achieved.

CN119811641APending Publication Date: 2025-04-11QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411882768.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art has problems such as manual feature extraction methods to capture the insufficient characteristics of complex time and spatial domains of EEG signals, insufficient global timing dependencies and long-term feature extraction in the diagnosis of depression, and insufficient attention to adaptive key channels.

Method used

The multi-scale convolution combined with attention mechanism is adopted to comprehensively extract the multi-scale convolutional and bidirectional timing features in the EEG signal through the multi-scale convolutional attention layer, the Conformer coding layer and the bidirectional gating cyclic unit layer to achieve adaptive attention to key channels.

Benefits of technology

Effectively capture the EEG signal characteristics of different time scales and spatial dimensions, improve the recognition accuracy of depression-related features, avoid the complexity and information loss of traditional manual feature extraction, and enhance the modeling ability of global timing dependencies in EEG signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119811641A_ABST
    Figure CN119811641A_ABST
Patent Text Reader

Abstract

The invention provides a feature extraction method and system based on multi-scale convolution attention, relates to the technical field of computer-aided medical treatment, and aims to solve the problems that a traditional manual feature extraction method is insufficient in capturing complex electroencephalogram signals, local and global feature modeling is limited, and adaptive attention to key channels is insufficient. The method comprises the following steps: acquiring electroencephalogram signal data, and preprocessing the electroencephalogram signal data to obtain preprocessed electroencephalogram signal data; and inputting the preprocessed electroencephalogram signal data into a feature extraction model, and extracting features. According to the method, multi-scale convolution is combined with an ECA attention mechanism, complexity and information loss of traditional manual feature extraction are avoided, the Conformer coding layer is introduced to solve the defects of a convolutional neural network in long-time feature extraction, the model can comprehensively understand time sequence features in electroencephalogram signals, and by combining the BiGRU layer, the time sequence features in the electroencephalogram signals can be comprehensively extracted. And the long-time dependency relationship in the electroencephalogram signal can be better extracted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer-assisted medical technology, and in particular relates to a feature extraction method and system based on multi-scale convolutional attention. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] Depression is a serious mental disorder with emotional and cognitive dysfunction. It can persist for a long time, which may reduce a person's ability to handle daily life affairs normally. According to the World Health Organization (WHO), depression will become the world's number one cause of self-harm by 2030. Therefore, early detection and diagnosis of depression is crucial. However, current clinical diagnostic methods have shortcomings such as easy disguise, subjective denial, and poor sensitivity. Therefore, it is necessary to develop a simple, accurate and operational method to help clinicians identify depression.

[0004] The identification of depression mainly relies on scales and interviews, and the final diagnosis is made by psychiatrists based on subjective judgment based on experience. However, in clinical practice, there is a lack of effective and objective standards to evaluate depression. In recent years, with the improvement of science and technology and medical level, neuroimaging technologies such as electroencephalogram (EEG) have been increasingly used in depression research. Compared with other technologies, EEG can capture the electrical activity of brain neurons with a time resolution of milliseconds, with high reliability and low cost. Therefore, studying depression EEG can more accurately diagnose patients' conditions and help doctors develop correct treatment plans for patients.

[0005] The development of artificial intelligence has provided a solution for the automatic diagnosis of mental illness. In the field of brain-computer interface, the EEG signal feature extraction network has gradually developed to a deeper level and applied to tasks such as motor imagery, sleep staging and emotion recognition, and depression recognition is no exception. In recent years, with the advancement of deep learning in computing, this technology has become more and more popular in the field of depression recognition and has been widely used. Since EEG signals are one-dimensional, expanding them to three or four dimensions to extract features may lead to overfitting and long training time. Therefore, we use the original EEG data to retain more information, so the preprocessed raw data is directly used as the input of the model.

[0006] According to the research proposed so far, firstly, the traditional manual feature extraction method cannot fully capture the complex time and space domain characteristics of EEG signals. Secondly, although convolutional neural networks are good at local feature extraction, they are insufficient in capturing global temporal dependencies and long-term features. In addition, medical research has shown that multi-scale information is crucial to EEG signals, and many physiological components play a role at different time scales. In addition, the existing models cannot effectively distinguish the contributions of different channels and lack adaptive attention to key channels. At the same time, the model has shortcomings in modeling temporal features, making it difficult to fully capture the front-end and back-end dependencies of signals.

[0007] It can be seen that the existing technology has certain problems: the traditional manual feature extraction method is insufficient in capturing complex EEG signals, there are limitations in local and global feature modeling, and insufficient attention is paid to the adaptation of key channels. Summary of the invention

[0008] In order to overcome the deficiencies of the above-mentioned prior art, the present invention provides a feature extraction method and system based on multi-scale convolutional attention. The scale convolution combined with the attention mechanism is adopted to effectively capture the EEG information features of different time scales and spatial dimensions. Through the combination of sequence model and bidirectional gated recurrent unit, the bidirectional temporal features in the EEG signal are fully extracted, which solves the problems of insufficient capture of complex EEG signals by traditional manual feature extraction methods, limitations in local and global feature modeling, and insufficient adaptive attention to key channels.

[0009] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:

[0010] The first aspect of the present invention discloses a feature extraction method based on multi-scale convolutional attention, comprising:

[0011] Acquire electroencephalogram signal data, and preprocess the electroencephalogram signal data to obtain preprocessed electroencephalogram signal data;

[0012] Input the preprocessed EEG signal data into the feature extraction model to extract features;

[0013] The feature extraction model includes a multi-scale convolutional attention layer, an encoding layer, and a bidirectional gated recurrent unit layer;

[0014] The preprocessed EEG signal data is input into the multi-scale convolutional attention layer, and the multi-scale convolution and attention mechanism is used to extract the multi-scale EEG attention features;

[0015] Input the multi-scale EEG attention features into the encoding layer to obtain the encoding layer output features;

[0016] A bidirectional gated recurrent unit layer is used to extract contextual information from the output features of the encoding layer.

[0017] As a further technical solution, the EEG signal data is preprocessed, specifically, the EEG signal is filtered to obtain an EEG signal of a preset frequency band:

[0018] Performing window segmentation on the EEG signal of the preset frequency band to obtain the segmented EEG signal;

[0019] Applying artifact suppression algorithm to the segmented EEG signal to obtain the suppressed EEG signal;

[0020] The suppressed EEG signal is normalized to obtain the preprocessed EEG signal.

[0021] As a further technical solution, the multi-scale convolutional attention layer includes three groups of different convolutional layers, a channel attention layer, a concatenation layer, and a second average pooling layer;

[0022] The preprocessed EEG signals are subjected to three different sets of parallel convolutions to extract EEG features, and three sets of EEG features are obtained;

[0023] A channel attention mechanism is used for each group of EEG features to assign weights to different EEG channels and obtain each group of EEG attention features;

[0024] Each group of EEG attention features is fused through the concatenation layer to obtain the fused EEG attention features;

[0025] The fused EEG attention features are downsampled through the second average pooling layer to obtain multi-scale EEG attention features.

[0026] As a further technical solution, three different sets of convolutions in parallel include:

[0027] The 2D convolutional layer along the time axis acts as a frequency filter for temporal convolution;

[0028] Deep convolutional layers, which process signals in the spatial domain;

[0029] The first average pooling layer reduces the dimension of temporal features and obtains EEG features.

[0030] As a further technical solution, the encoding layer includes a first half-step feedforward neural network, a second half-step feedforward neural network, a multi-head self-attention module and a convolution module;

[0031] After the multi-scale EEG attention features are input into the first half-step feedforward neural network, they are fused with the multi-scale EEG attention features to obtain the first fusion features;

[0032] After the first fusion feature is input into the multi-head attention module, it is fused with the first fusion feature to obtain the second fusion feature;

[0033] Input the second fusion features into the convolution module to obtain the convolution output features;

[0034] The convolution output features are fused with the second fusion features to obtain the third fusion features;

[0035] After the third fusion feature is input into the second feedforward neural network, it is fused with the third fusion feature to obtain the fourth fusion feature;

[0036] The fourth fusion feature is processed by layer normalization to obtain the encoding layer output feature.

[0037] As a further technical solution, the convolution module includes layer normalization, a first point-by-point convolution layer, a second point-by-point convolution layer, a gated linear unit, a depth convolution layer and a dropout layer;

[0038] The second fusion is subjected to layer normalization to obtain the second fusion features after layer normalization;

[0039] The second fusion feature after layer normalization is convolved layer by layer to obtain the first convolution output feature;

[0040] Activate the first convolution output feature through a gated linear unit to obtain a gated linear unit output;

[0041] Pass the gated linear unit output to the deep convolution layer with activation function to obtain the deep convolution output features;

[0042] Pass the depth convolution output feature through the second point-by-point convolution layer to obtain the second convolution output feature;

[0043] The dropout layer is used to regularize the second convolution output features to obtain the convolution module output features.

[0044] As a further technical solution, the bidirectional gated recurrent unit layer includes two gated recurrent units, one for forward propagation to obtain forward propagation features, and the other for backward propagation to obtain reverse propagation features. According to the forward propagation features and the reverse propagation features, the hidden state update features are obtained.

[0045] The second aspect discloses a feature extraction system based on multi-scale convolutional attention, comprising:

[0046] A data acquisition and preprocessing module, used to acquire EEG signal data, preprocess the EEG signal data, and obtain preprocessed EEG signal data;

[0047] A feature extraction module is used to input the preprocessed EEG signal data into the feature extraction model to extract features;

[0048] The feature extraction model includes a multi-scale convolutional attention layer, an encoding layer, and a bidirectional gated recurrent unit layer;

[0049] The preprocessed EEG signal data is input into the multi-scale convolutional attention layer, and the multi-scale convolution and attention mechanism is used to extract the multi-scale EEG attention features;

[0050] Input the multi-scale EEG attention features into the encoding layer to obtain the encoding layer output features;

[0051] A bidirectional gated recurrent unit layer is used to extract contextual information from the output features of the encoding layer.

[0052] The third aspect of the present invention discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the program.

[0053] A fourth aspect of the present invention discloses a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method described in the first aspect.

[0054] One or more of the above technical solutions have the following beneficial effects:

[0055] (1) The feature extraction model in this embodiment adopts multi-scale convolution combined with ECA attention mechanism. The model can effectively capture the EEG signal features of different time scales and spatial dimensions, and adaptively weight each channel, focusing on key channels, and improving the recognition accuracy of depression-related features. This automated feature extraction method avoids the complexity and information loss of traditional manual feature extraction. Secondly, by introducing the Conformer model, the convolutional network's ability to extract local features is fully utilized, and the modeling ability of global temporal dependencies in EEG signals is enhanced, solving the shortcomings of convolutional neural networks in long-term feature extraction, so that the model can fully understand the temporal features in EEG signals. Finally, combined with BiGRU (bidirectional gated recurrent unit), the model further strengthens the ability to capture bidirectional dependencies in the time dimension, and can better extract long-term dependencies in EEG signals. The acquisition of this bidirectional temporal information improves the performance of the model in depression detection, especially in complex temporal data.

[0056] (2) The feature extraction method in this embodiment has good scalability and flexibility. It can not only process EEG signals at different time scales, but also be combined with other types of feature extraction methods or different EEG data processing methods to further enhance the performance of the model. This method can be applied to clinical screening as an auxiliary diagnostic tool for depression, providing an efficient and reliable means of EEG signal analysis.

[0057] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0059] Figure 1 Schematic diagram of the structure of a feature extraction model based on multi-scale convolutional attention according to the first embodiment of the present invention;

[0060] Figure 2 This is a schematic diagram of the multi-scale convolutional attention layer structure of the first embodiment of the present invention;

[0061] Figure 3 Schematic diagram of the coding layer structure of the first embodiment of the present invention;

[0062] Figure 4 This is a flow chart of a feature extraction method based on multi-scale convolutional attention according to the first embodiment of the present invention. DETAILED DESCRIPTION

[0063] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0064] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.

[0065] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0066] The overall idea proposed in this invention is: first, through a multi-scale convolutional attention mechanism, the multi-scale time-frequency information of EEG signals is captured from the spatial domain and frequency domain; then, the Conformer encoder extracts local features through convolution operations, and captures the global dependencies of EEG signals through a self-attention mechanism, and further uses a multi-head attention mechanism to enhance the expression ability of related EEG signal features; the BiGRU layer is used to extract the time-dependent features of EEG signals, and these abstract features are input into the classification module for the final classification decision.

[0067] Embodiment 1

[0068] This embodiment discloses a feature extraction method based on multi-scale convolutional attention.

[0069] In order to more clearly illustrate this embodiment, the feature extraction implementation process based on multi-scale convolutional attention can be specifically described as follows:

[0070] A multi-scale convolutional attention-based feature extraction method is provided, including:

[0071] S1, acquiring EEG signal data, and preprocessing the EEG signal data to obtain preprocessed EEG signal data;

[0072] S2, inputting the preprocessed EEG signal data into the feature extraction model to extract features;

[0073] The feature extraction model includes a multi-scale convolutional attention layer, an encoding layer, and a bidirectional gated recurrent unit layer;

[0074] The preprocessed EEG signal data is input into the multi-scale convolutional attention layer, and the multi-scale convolution and attention mechanism is used to extract the multi-scale EEG attention features;

[0075] Input the multi-scale EEG attention features into the encoding layer to obtain the encoding layer output features;

[0076] A bidirectional gated recurrent unit layer is used to extract contextual information from the output features of the encoding layer.

[0077] like Figure 1 , Figure 4 As shown, in step S1, EEG signal data is acquired, and the EEG signal data is preprocessed to obtain preprocessed EEG signal data.

[0078] S1-1. Obtaining EEG signal data.

[0079] In this example, the EEG data used is a 128-channel resting-state EEG signal from the MODMA dataset.

[0080] Since EEG signals are highly sensitive to the external environment and other physiological signals in the body, their raw data are often subject to multiple interferences before processing. Inspired by previous work and taking into account time performance and computational cost, 16 electrodes (Fp1 / 2, F3 / 4, C3 / 4, P3 / 4, O1 / 2, F7 / 8, T3 / 4, T5 / 6) were selected from 128 electrodes. These electrodes can identify the feasibility of depressive states.

[0081] S1-2, preprocessing the EEG signal data to obtain preprocessed EEG signal data.

[0082] Specifically, S1-2-1, filter the EEG signal to obtain an EEG signal of a preset frequency band.

[0083] In this embodiment, a notch filter is used to eliminate power line interference at 50 Hz, and a bandpass FIR filter is used to retain the information frequency band between 1 Hz and 40 Hz.

[0084] S1-2-2, performing window segmentation on the EEG signal of the preset frequency band to obtain segmented EEG signals;

[0085] In this embodiment, the EEG signal data is segmented using a 4 s window and there is a 75% overlap between adjacent windows.

[0086] S1-2-3. Apply an artifact suppression algorithm to the segmented EEG signal to obtain a suppressed EEG signal.

[0087] In this embodiment, an automatic artifact suppression algorithm Autoreject is used to generate cleaner EEG data.

[0088] S1-2-4. Normalize the suppressed EEG signal to obtain a preprocessed EEG signal.

[0089] In this embodiment, the data needs to be processed by function specification and normalized before entering the network structure. The formula is:

[0090]

[0091] Among them, X i,j represents the eigenvector, μ represents the mean of the eigenvector, and σ represents the standard deviation of the eigenvector.

[0092] like Figure 1-4 As shown, in step S2, the preprocessed EEG signal data is input into a feature extraction model to extract features.

[0093] S2-1. Model construction.

[0094] like Figure 1As shown, in this embodiment, the feature extraction model based on multi-scale convolutional attention includes a multi-scale convolutional attention layer, a coding layer and a bidirectional gated recurrent unit layer.

[0095] S2-2. Extract features.

[0096] like Figure 1 , Figure 2 As shown, S2-2-1, the preprocessed EEG signal data is input into the multi-scale convolutional attention layer, and the multi-scale convolution and attention mechanism is used to extract the multi-scale EEG attention features.

[0097] Based on the neurophysiological characteristics of EEG signals, a parallel multi-scale convolution network module is designed to extract multi-level frequency features. This module sets the size of the temporal convolution kernel (H) in the first layer of the network to a specific ratio of the EEG sampling frequency (fs). These ratios are defined as α. Therefore, S T Represents the size of H, the formula is:

[0098] S T =(1,α·fs) (2)

[0099] In this embodiment, considering that too many convolution operations will increase a large number of parameters and thus affect the operating efficiency, without affecting the classification efficiency, if the temporal convolution layer has L branches, let L=3, the ratio coefficient of the level of the parallel convolution layer from 1 to 3 will become [1, 0.248, 0.124], that is, the size of H corresponds to [(1,250), (1,125), (1,62)]. From the perspective of frequency, when the length of H is set to different ratios of fs, the temporal convolution layer can capture frequency information of 1 Hz, 4 Hz, 8 Hz and above, respectively. From the perspective of time, these convolution kernel sizes correspond to time steps of 1000 ms, 248 ms and 124 ms in duration.

[0100] The multi-scale convolutional attention layer includes three groups of different convolutional layers, channel attention layer, splicing layer and pooling layer.

[0101] Extract multi-scale EEG attention features. The specific process is as follows:

[0102] S2-2-1-1. Use three sets of parallel convolutions to extract EEG features from the preprocessed EEG signal to obtain three sets of EEG features.

[0103] In this embodiment, the multi-scale convolution module extracts EEG features by applying three groups of different convolution operations in parallel on the input EEG signal samples.

[0104] In this embodiment, each group first includes a two-dimensional convolution layer along the time axis, which performs time convolution as a frequency filter; secondly, the signal in the spatial domain is processed by a deep convolution of size (C, 1), where C is the number of all electrode channels, and then an average pooling layer of size (1, 4) is used to reduce the dimension of the temporal features, and the dropout technology is added to prevent overfitting to obtain the EEG features.

[0105] S2-2-1-2. A channel attention mechanism is used for each group of EEG features to assign weights to different EEG channels and obtain each group of EEG attention features.

[0106] In this embodiment, an ECA attention mechanism is introduced on each branch. In the present invention, the ECA attention mechanism improves the model's attention to key channels by adaptively assigning weights to different EEG channels, thereby better capturing depression-related features. In time series data, higher weights are usually assigned to important features, while lower weights are assigned to less relevant features. Therefore, the ECA attention mechanism is responsible for prioritizing relevant information, thereby enhancing the network's ability to identify and respond to key features.

[0107] S2-2-1-3. Each group of EEG attention features is fused through the concatenation layer to obtain the fused EEG attention features.

[0108] The concatenation layer fuses the EEG attention features output by the first average pooling layer into the fused EEG attention features.

[0109] S2-2-1-4. Downsample the fused EEG attention features through the second average pooling layer to obtain multi-scale EEG attention features.

[0110] In this embodiment, an average pooling layer of size (1,8) is applied at the end to further downsample the feature map and reduce the computation time. Therefore, the tensor obtained after the multi-scale convolution module represents the signal sources of different frequencies and different electrode channels.

[0111] After the steps, multi-scale convolution combined with ECA attention mechanism can effectively capture the EEG signal characteristics of different time scales and spatial dimensions, while adaptively weighting each channel and focusing on key channels, thereby improving the recognition accuracy of depression-related features. This automated feature extraction method avoids the complexity and information loss of traditional manual feature extraction.

[0112] S2-2-2. Input the multi-scale EEG attention features into the encoding layer to obtain the encoding layer output features.

[0113] In this embodiment, the Conformer encoder, i.e., the encoding layer, is introduced because the Transformer model is good at capturing content-based global interactions, while the CNN can effectively utilize local features. Therefore, the local and global dependencies of the sequence are modeled in a parameter-efficient manner, thereby achieving the advantages of both.

[0114] The encoding layer includes the first half-step feedforward neural network, the second half-step feedforward neural network, a multi-head self-attention module and a convolution module.

[0115] like Figure 3 As shown, in this embodiment, the Conformer encoding layer utilizes two half-step feedforward neural networks (FFNNs). Between the two FFNNs, a multi-head self-attention (MHSA) with four heads is used, followed by a convolution module. The feature tensor from the multi-scale convolution module represents the signal source of different frequencies and electrode channels, and has a shape of (batch_size, sequence_length, dim). After being processed by the Conformer, the output tensor shape is still (batch_size, sequence_length, dim), but each element contains higher-level timing and frequency features, reflecting the complex patterns and dependencies of the signal.

[0116] After the multi-scale EEG attention feature is input into the first half-step feedforward neural network, it is fused with the multi-scale EEG attention feature to obtain the first fusion feature. The formula is:

[0117]

[0118] Among them, FFN refers to the feed-forward module, x i It is the input of the Conformer encoding layer.

[0119] After the first fusion feature is input into the multi-head attention module, it is fused with the first fusion feature to obtain the second fusion feature. The formula is:

[0120]

[0121] Among them, x i ' represents the second fusion feature, MHSA refers to the multi-head attention module, Indicates the first fusion feature.

[0122] like Figure 3As shown, the convolution module starts with layer normalization, point-wise convolutional layers, and gated linear unit (GLU) activation to reduce the gradient vanishing problem. The output of the GLU is then passed to an ID deep convolutional layer with a swish activation function, followed by another point-wise convolutional layer. Finally, a dropout layer is used to regularize the network. In addition, there is a residual path connecting the input to the output.

[0123] The convolution module includes layer normalization, the first point-by-point convolution layer, the second point-by-point convolution layer, the gated linear unit, the depth-wise convolution layer, and the dropout layer;

[0124] The second fusion feature is subjected to layer normalization to obtain the second fusion feature after layer normalization;

[0125] In this embodiment, the second fusion is processed by layer normalization to obtain the second fusion feature after layer normalization: x=self.norm(inputs).

[0126] The second fusion feature after layer normalization is convolved layer by layer to obtain the first convolution output feature;

[0127] In this embodiment, after the first point-by-point convolution, the first convolution output feature is obtained: x=self.conv1(x).

[0128] The first convolution output feature is activated by a gated linear unit to obtain a gated linear unit output;

[0129] In this embodiment, the gated linear unit is activated to obtain the gated linear unit output: x=self.glu(x).

[0130] Pass the gated linear unit output to the deep convolution layer with activation function to obtain the deep convolution output features;

[0131] In this embodiment, it is passed to the deep convolution layer with an activation function to obtain the deep convolution output feature: x=self.depthwise_conv(x).

[0132] Pass the depth convolution output feature through the second point-by-point convolution layer to obtain the second convolution output feature;

[0133] In this embodiment, after the second point-by-point convolution layer, the second convolution output feature is obtained: x=self.conv2(x).

[0134] The dropout layer is used to regularize the second convolution output features to obtain the convolution module output features.

[0135] In this embodiment, after the Dropout layer regularization processing, the convolution module output feature is obtained: x=self.dropout_layer(x).

[0136] The second fusion feature is input into the convolution module to obtain the output feature of the convolution module. The output feature of the convolution module is fused with the second fusion feature to obtain the third fusion feature. The formula is:

[0137] x″ i =x i ′+Conv(x i ′) (5)

[0138] Among them, x i '' indicates the third fusion feature, Conv refers to the convolution module, x i ' represents the second fusion feature.

[0139] After the third fusion feature is input into the second feedforward neural network, it is fused with the third fusion feature to obtain the fourth fusion feature. The fourth fusion feature is processed by layer normalization to obtain the encoding layer output feature. The formula is:

[0140]

[0141] Among them, y i Represents the output features of the encoding layer, and Layernorm refers to layer normalization processing.

[0142] After the above steps, the convolutional network's ability to extract local features is fully utilized, and the ability to model the global temporal dependencies in EEG signals is enhanced, which solves the shortcomings of convolutional neural networks in long-term feature extraction, and enables the model to fully understand the temporal characteristics in EEG signals.

[0143] S2-2-3. Use the bidirectional gated recurrent unit layer to extract contextual information from the output features of the encoding layer.

[0144] Since EEG signals contain dynamic content, the changes between time slices may hide additional information that may help to make more accurate depression classification. Therefore, the BiGRU bidirectional gated recurrent unit layer is used to extract contextual information from the output of the Conformer encoding layer. The output features of the Conformer encoding layer include multi-scale temporal features, frequency features, etc. The contextual information extracted by BiGRU mainly refers to the dependencies between different time steps in the time series data of depression EEG signals, especially the temporal features captured from both the forward and backward directions.

[0145] In this embodiment, if Figure 1As shown, the basic unit of BiGRU consists of two GRU units: one for forward propagation and the other for backward propagation.

[0146] Compared with LSTM, GRU has the ability to process small amounts of data, has faster calculation speed, and can better solve the problem of gradient disappearance. GRU resets the gate r t and update gate z t To process sequence information, the parameter update equation formula is:

[0147]

[0148] Among them, w r 、w z 、w h , U r , U z and U h is the weight parameter of the BiGRU module, r t is the reset gate, z t It is the update gate. is a candidate activation unit, h t is the hidden unit at time t, h r-1 is the hidden unit at time t-1, x t is the GRU input at time t, σ represents the σ-shaped function, Represents elementary addition operation, Represents the basic multiplication operation.

[0149] The BiGRU module combines the forward and backward GRUs, capturing contextual information from both past and future time steps. Its rules mainly include forward propagation, back propagation, and hidden state update, and the formula is:

[0150]

[0151] After the above steps, the ability to capture bidirectional dependencies in the time dimension is further enhanced, and the long-term dependencies in EEG signals can be better extracted. The acquisition of this bidirectional time series information improves the performance of the model in depression detection, especially in complex time series data.

[0152] The multi-scale convolutional attention based feature extraction model is trained through step S2-2.

[0153] Based on the extracted contextual information, doctors are assisted in diagnosing depression and formulating the correct treatment plan.

[0154] The output of BiGRU is used as the input of the fully connected layer, and the final classification result is output through the softmax function. The main function of the softmax function in the deep learning model is to convert the output of the network into a probability distribution, so that each element of the output is between 0 and 1, and the sum of these probabilities is 1. The softmax calculation formula is:

[0155] y=softmax(W o h f +b o ) (9)

[0156] Among them, h f is the output of BiGRU, W o is the weight term of the fully connected layer, b o is the bias term of the fully connected layer.

[0157] The contextual information extracted by BiGRU mainly refers to the dependencies between different time steps in the time series data of depressive EEG signals, especially the temporal features captured from both the forward and backward directions.

[0158] The feature extraction model of multi-scale convolutional attention in this embodiment first captures the multi-scale time-frequency information of EEG signals from the spatial domain and frequency domain through the multi-scale convolutional attention mechanism. Subsequently, the Conformer encoder extracts local features through convolution operations, and captures the global dependencies of EEG signals through the self-attention mechanism, and further uses the multi-head attention mechanism to enhance the expression ability of related EEG signal features. This structure can effectively learn short-term and long-term temporal relationships, thereby improving the model's ability to recognize depression. Next, the BiGRU layer is used to extract the time-dependent features of the EEG signal, and these abstract features are input into the classification module for the final classification decision.

[0159] Embodiment 2

[0160] The purpose of this embodiment is to provide a feature extraction system based on multi-scale convolutional attention, including:

[0161] A data acquisition and preprocessing module, used to acquire EEG signal data, preprocess the EEG signal data, and obtain preprocessed EEG signal data;

[0162] The feature extraction module is used to input the preprocessed EEG signal data into the feature extraction model to extract features.

[0163] The feature extraction model includes a multi-scale convolutional attention layer, an encoding layer, and a bidirectional gated recurrent unit layer;

[0164] The preprocessed EEG signal data is input into the multi-scale convolutional attention layer, and the multi-scale convolution and attention mechanism is used to extract the multi-scale EEG attention features;

[0165] Input the multi-scale EEG attention features into the encoding layer to obtain the encoding layer output features;

[0166] A bidirectional gated recurrent unit layer is used to extract contextual information from the output features of the encoding layer.

[0167] Based on providing a feature extraction system based on multi-scale convolutional attention, the method steps in Example 1 are implemented.

[0168] Embodiment 3

[0169] The purpose of this embodiment is to provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.

[0170] Embodiment 4

[0171] The purpose of this embodiment is to provide a computer-readable storage medium.

[0172] A computer-readable storage medium stores a computer program, which executes the steps of the above method when executed by a processor.

[0173] The steps involved in the apparatus of the above embodiment correspond to the method embodiment 1, and the specific implementation method can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.

[0174] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, 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, 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. The present invention is not limited to any specific combination of hardware and software.

[0175] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A feature extraction method based on multi-scale convolutional attention, characterized in that: include: Acquiring EEG signal data, and preprocessing the EEG signal data to obtain preprocessed EEG signal data; Input the preprocessed EEG signal data into the feature extraction model to extract features; The feature extraction model includes a multi-scale convolutional attention layer, an encoding layer, and a bidirectional gated recurrent unit layer; The preprocessed EEG signal data is input into the multi-scale convolutional attention layer, and the multi-scale convolution and attention mechanism is used to extract the multi-scale EEG attention features; Input the multi-scale EEG attention features into the encoding layer to obtain the encoding layer output features; A bidirectional gated recurrent unit layer is used to extract contextual information from the output features of the encoding layer.

2. A feature extraction method based on multi-scale convolutional attention as claimed in claim 1, characterized in that: Preprocessing the EEG signal data, specifically, filtering the EEG signal to obtain an EEG signal of a preset frequency band: Performing window segmentation on the EEG signal of the preset frequency band to obtain the segmented EEG signal; Applying artifact suppression algorithm to the segmented EEG signal to obtain the suppressed EEG signal; The suppressed EEG signal is normalized to obtain the preprocessed EEG signal.

3. A feature extraction method based on multi-scale convolutional attention as claimed in claim 1, characterized in that: The scale convolutional attention layer includes three different groups of convolutional layers, channel attention layer, concatenation layer and pooling layer; The preprocessed EEG signals are subjected to three different sets of parallel convolutions to extract EEG features, and three sets of EEG features are obtained; A channel attention mechanism is used for each group of EEG features to assign weights to different EEG channels and obtain each group of EEG attention features; Each group of EEG attention features is fused through the concatenation layer to obtain the fused EEG attention features; The fused EEG attention features are downsampled through the average pooling layer to obtain multi-scale EEG attention features.

4. A feature extraction method based on multi-scale convolutional attention as claimed in claim 3, characterized in that: The three different sets of convolutions in parallel include: The 2D convolutional layer along the time axis acts as a frequency filter for temporal convolution; Deep convolutional layers, processing signals in the spatial domain; The average pooling layer reduces the dimension of the temporal features and obtains EEG features.

5. A feature extraction method based on multi-scale convolutional attention as claimed in claim 1, characterized in that: The encoding layer includes the first half-step feedforward neural network, the second half-step feedforward neural network, the multi-head self-attention module and the convolution module; After the multi-scale EEG attention features are input into the first half-step feedforward neural network, they are fused with the multi-scale EEG attention features to obtain the first fusion features; After the first fusion feature is input into the multi-head attention module, it is fused with the first fusion feature to obtain the second fusion feature; Input the second fusion features into the convolution module to obtain the convolution output features; The convolution output features are fused with the second fusion features to obtain the third fusion features; After the third fusion feature is input into the second feedforward neural network, it is fused with the third fusion feature to obtain the fourth fusion feature; The fourth fusion feature is processed by layer normalization to obtain the encoding layer output feature.

6. A feature extraction method based on multi-scale convolutional attention as claimed in claim 5, characterized in that: The convolution module includes layer normalization, the first point-by-point convolution layer, the second point-by-point convolution layer, the gated linear unit, the depth-wise convolution layer, and the dropout layer; The second fusion is subjected to layer normalization to obtain the second fusion features after layer normalization; The second fusion feature after layer normalization is convolved layer by layer to obtain the first convolution output feature; Activate the first convolution output feature through a gated linear unit to obtain a gated linear unit output; Pass the gated linear unit output to the deep convolution layer with activation function to obtain the deep convolution output features; Pass the depth convolution output feature through the second point-by-point convolution layer to obtain the second convolution output feature; The dropout layer is used to regularize the second convolution output features to obtain the convolution module output features.

7. A feature extraction method based on multi-scale convolutional attention as claimed in claim 1, characterized in that: The bidirectional gated recurrent unit layer includes two gated recurrent units, one for forward propagation to obtain forward propagation features, and the other for backward propagation to obtain reverse propagation features. According to the forward propagation features and the reverse propagation features, the hidden state update features are obtained.

8. A feature extraction system based on multi-scale convolutional attention, characterized in that: include: A data acquisition and preprocessing module, used to acquire EEG signal data, preprocess the EEG signal data, and obtain preprocessed EEG signal data; A feature extraction module is used to input the preprocessed EEG signal data into the feature extraction model to extract features; The feature extraction model includes a multi-scale convolutional attention layer, an encoding layer, and a bidirectional gated recurrent unit layer; The preprocessed EEG signal data is input into the multi-scale convolutional attention layer, and the multi-scale convolution and attention mechanism is used to extract the multi-scale EEG attention features; Input the multi-scale EEG attention features into the encoding layer to obtain the encoding layer output features; A bidirectional gated recurrent unit layer is used to extract contextual information from the output features of the encoding layer.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are performed.

Citation Information

Patent Citations

  • Motor imagery electroencephalogram signal classification method based on channel attention and multi-scale time domain convolution

    CN114266276A

  • Motor imagery recognition method and system based on multi-scale convolution and Transform

    CN117113269A

  • Conformer-based multi-scale fusion convolution system in streaming speech recognition

    CN118070851A

  • Epilepsy prediction method and system in combination with spatial-temporal characteristics

    CN118072947A

  • Motor imagery electroencephalogram signal classification method based on multi-scale convolution and self-attention

    CN118349906A