Search

CN-122004901-A - Method for detecting brain electricity abnormal wave based on Mamba optimized attention and related equipment

CN122004901ACN 122004901 ACN122004901 ACN 122004901ACN-122004901-A

Abstract

The embodiment of the application provides an electroencephalogram abnormal wave detection method and related equipment based on Mamba for optimizing attention, and belongs to the technical field of artificial intelligence and biomedical signal processing. The method aims to solve the problems of low long time sequence modeling efficiency, serious feature redundancy and insufficient time sequence positioning precision in the prior art. The method comprises the steps of carrying out multi-scale wavelet convolution decomposition on the preprocessed electroencephalogram signals, inputting extracted features into a Mamba Optimized Attention (MOA) module, fusing a gating mechanism of a nucleated linear attention and a selective state space model, modeling long-time dependency relations with linear complexity, carrying out feature decomposition and cross reconstruction based on channel importance through a space reconstruction (SD) module to inhibit redundancy, and finally predicting and outputting abnormal wave positioning results point by point. The application realizes the high-efficiency and accurate detection of the brain electricity abnormal wave, and is particularly suitable for the clinical real-time monitoring and the embedded equipment deployment.

Inventors

  • XU YANWU
  • WANG LEI
  • Diao Yueqin
  • LUO JINGNAN
  • MENG HANG
  • FANG JIANSHENG

Assignees

  • 华南理工大学

Dates

Publication Date
20260512
Application Date
20251225

Claims (10)

  1. 1. An electroencephalogram abnormal wave detection method based on Mamba for optimizing attention, which is characterized by comprising the following steps: acquiring multichannel electroencephalogram signals and preprocessing; Inputting the preprocessed electroencephalogram signals into a wavelet convolution module for multi-scale feature extraction to obtain multi-scale feature representation; Inputting the multi-scale feature representation to a time-dependent modeling module, wherein the time-dependent modeling module models the long-time dependence of the electroencephalogram signal with linear computation complexity based on Mamba optimized attention mechanisms, and outputs global context embedded features; The global context embedded features are input to a space reconstruction module, and the space reconstruction module outputs refined features by estimating the importance of channels, generating binary masks, decomposing and cross reconstructing the features to inhibit feature redundancy; Based on the refining characteristics, a sequence equal in length to the input electroencephalogram signal is output through point-by-point prediction, wherein the output value of each time point represents the prediction probability of occurrence of electroencephalogram abnormal waves at the moment.
  2. 2. The method of claim 1, wherein the step of the wavelet convolution module performing multi-scale feature extraction comprises: performing primary Haar wavelet decomposition on an input signal to obtain a low-frequency component and a high-frequency component; processing the low-frequency component and the high-frequency component by applying a learnable convolution kernel respectively; Performing inverse wavelet transform reconstruction on the processed low-frequency and high-frequency components; Residual fusion is carried out on the result of convolution processing of the reconstructed signal and the original input signal; And splicing a plurality of groups of features subjected to convolution kernel processing with different sizes in the channel dimension to obtain the multi-scale feature representation.
  3. 3. The method of claim 1, wherein the time dependent modeling module optimizes an attention module for Mamba, the process comprising: carrying out layer normalization on the input characteristics and reserving residual connection; Extracting a first activation feature and a second activation feature respectively through a first linear projection branch and a one-dimensional convolution branch which are arranged in parallel; generating dynamic gating weights based on the input features; After linear projection and convolution pretreatment are carried out on the input features, the kernel function is used for mapping and rearranging the matrix multiplication sequence, and the nucleated linear attention features are calculated, so that the calculation complexity and the sequence length are in a linear relation; Gating and fusing the dynamic gating weight, the nucleated linear attention feature, the second activation feature and the first activation feature; And after the gating fusion result is added with the residual error connection, combining the leachable position coding and the multi-layer perceptron, and outputting the global context embedding characteristic.
  4. 4. A method according to claim 3, wherein the calculation formula of the nucleated linear attention feature is: Wherein, the And For the query matrix and key matrix obtained by mapping the input features by the kernel function, For the features after the convolution pre-processing, Linear attention features for the coring; Is transposed.
  5. 5. The method of claim 1, wherein the processing of the spatial reconstruction module comprises: grouping normalization is carried out on the input features, and importance weights of all channels are calculated according to scaling factors of the normalization layer; generating a binary mask based on the importance weights; Decomposing the input features into an informative subset and a redundant subset by using the binary mask and the complementary mask thereof; The informative subsets and the redundant subsets are further subdivided and combined in a crossing mode, and feature reconstruction is achieved; And splicing the reconstructed features, and outputting the refined features after the reconstructed features pass through a lightweight convolution layer.
  6. 6. The method according to claims 1 to 5, characterized in that in the model training phase, a weighted Dice loss function is used as an optimization target, and the calculation formula of the weighted Dice loss function is: Wherein, the For the model prediction output, As a real tag it is possible to provide a real tag, For a weight matrix set according to class imbalance, Is a smooth constant.
  7. 7. An electroencephalogram abnormal wave detection system based on Mamba for optimizing attention, comprising: The preprocessing module is used for acquiring and preprocessing multichannel electroencephalogram signals; the wavelet convolution module is connected with the preprocessing module and is used for carrying out multi-scale feature extraction on the preprocessed electroencephalogram signals to obtain multi-scale feature representation; The time-dependent modeling module is connected with the wavelet convolution module, is a Mamba optimized attention module and is used for modeling the long-time dependency relationship of the multi-scale feature representation with linear calculation complexity and outputting a global context embedding feature; The spatial reconstruction module is connected with the time-dependent modeling module and is used for suppressing redundancy in the global context embedded feature through channel importance estimation and feature cross reconstruction and outputting refined features; and the output module is connected with the space reconstruction module and used for carrying out point-by-point prediction based on the refining characteristics and outputting abnormal wave detection sequences with equal length as the input electroencephalogram signals.
  8. 8. An electronic device comprising a memory storing a computer program and a processor implementing the method of any of claims 1 to 6 when the computer program is executed by the processor.
  9. 9. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the method of any one of claims 1 to 6.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the method of any one of claims 1 to 6.

Description

Method for detecting brain electricity abnormal wave based on Mamba optimized attention and related equipment Technical Field The application relates to the technical field of artificial intelligence and biomedical signal processing, in particular to an electroencephalogram abnormal wave detection method and related equipment based on Mamba for optimizing attention. Background Electroencephalogram (Electroencephalography, EEG) is a key tool for clinical diagnosis of neurological diseases such as epilepsy. Automatic detection of abnormal brain waves (such as spike waves and sharp waves) is of great significance for early disease identification and treatment. At present, the electroencephalogram abnormal wave detection method is mainly divided into three types, wherein the first type is a method based on traditional machine learning, such as a Support Vector Machine (SVM), a random forest and the like, and depends on manually designed characteristics (such as wave band power and waveform morphology), and the performance is limited by the specificity of the characteristic design and the generalization capability is insufficient. The second category is deep learning-based methods, especially Convolutional Neural Networks (CNNs) and their combinations with long-term memory networks (LSTM) (CNN-LSTM), which are capable of automatically learning features, but are limited by the receptive field of convolution, and are difficult to model long-term dependencies effectively. The third class is a transform-based method, where the self-attention mechanism has global modeling capability, but the computational complexity is proportional to the square of the sequence length (O (N 2)), and when processing long-time, high-sampling-rate EEG signals, there is a problem of excessive computational and memory overhead, and it is difficult to meet the clinical real-time requirements. In recent years, state space models (STATE SPACE Model, SSM) such as Mamba have been proposed, whose selective state space mechanism (SELECTIVE SSM) can theoretically Model long sequences with linear complexity (O (N)). However, the standard Mamba model has problems of difficult parallel computation of a recursive structure, insufficient modeling capability for local detail, lack of effective control over feature redundancy, and the like, which limit the direct application of the model in EEG abnormal wave detection requiring high space-time resolution. Therefore, the prior art has obvious defects in the aspects of long time sequence modeling efficiency, feature redundancy control and millisecond time sequence positioning precision, and a novel solution capable of considering high efficiency, accuracy and practicability is needed. Disclosure of Invention The embodiment of the application mainly aims to provide a method, a system, electronic equipment, a storage medium and a program product for detecting brain wave based on Mamba optimized attention, which can give consideration to detection precision, operation efficiency and time resolution in analysis of long-time-sequence high-sampling-rate EEG, so as to overcome multiple limitations of the traditional method and provide a feasible, stable and efficient technical path for rapid detection and intelligent diagnosis and treatment of brain wave. In order to achieve the above object, an aspect of an embodiment of the present application provides an electroencephalogram abnormal wave detection method based on Mamba for optimizing attention, the method including: acquiring multichannel electroencephalogram signals and preprocessing; Inputting the preprocessed electroencephalogram signals into a wavelet convolution module for multi-scale feature extraction to obtain multi-scale feature representation; Inputting the multi-scale feature representation to a time-dependent modeling module, wherein the time-dependent modeling module models the long-time dependence of the electroencephalogram signal with linear computation complexity based on Mamba optimized attention mechanisms, and outputs global context embedded features; The global context embedded features are input to a space reconstruction module, and the space reconstruction module outputs refined features by estimating the importance of channels, generating binary masks, decomposing and cross reconstructing the features to inhibit feature redundancy; Based on the refining characteristics, a sequence equal in length to the input electroencephalogram signal is output through point-by-point prediction, wherein the output value of each time point represents the prediction probability of occurrence of electroencephalogram abnormal waves at the moment. In some embodiments, the step of the wavelet convolution module performing multi-scale feature extraction comprises: performing primary Haar wavelet decomposition on an input signal to obtain a low-frequency component and a high-frequency component; processing the low-frequency component and the high-frequency