A spatiotemporal multimodal spike detection method based on topological graph
Through the spatiotemporal multi-modal spike detection method based on topological graphs, the temporal and topological features of magnetoencephalography data are integrated, and the self-attention mechanism and cross-attention mechanism are used to solve the problem of low spike detection accuracy in the existing technology. Achieved higher detection accuracy.
Patent Information
- Application Number
- CN202410879393.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-02
AI Technical Summary
Existing spike wave detection methods have low detection accuracy in magnetoencephalogram data of epilepsy patients. In particular, deep learning methods are difficult to learn the spatial dipole-like distribution characteristics of spike waves, resulting in low detection accuracy.
A spatio-temporal multi-modal spike detection method based on topological graphs is adopted, and the multi-modal deep network model is used to fuse temporal and topological features, and the self-attention mechanism and cross-attention mechanism are used to generate the final spike prediction probability and improve detection accuracy. .
The accuracy of spike detection is improved, and the multi-modal deep network model not only learns the timing information of spikes, but also fits the spatial location information of focal epilepsy, improving the accuracy of detection.
Smart Images

Figure CN118411366B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spike wave detection, and in particular to a spatiotemporal multimodal spike wave detection method based on a topological graph. Background Art
[0002] Epilepsy is the second most common neurological disease in the world after stroke. It is a chronic brain disease in which abnormal discharges of brain neurons lead to temporary dysfunction of the central nervous system. During an epileptic seizure, a part of the body or the entire body briefly twitches involuntarily, sometimes accompanied by loss of consciousness and incontinence, and may even cause permanent brain damage. Although the pathogenic mechanism of epilepsy is still unclear, the changes in the electromagnetic field caused by abnormal discharges of neurons in the patient's head have become an important pathological observation indicator. Among epilepsy patients, about It is not possible to treat epilepsy with anti-epileptic drugs, and requires neuromodulation to alleviate epileptic seizures, or surgical resection of epileptic focus tissue to eliminate epileptic seizures. It is particularly important to detect the spike wave period of abnormal discharge from massive magnetoencephalogram data.
[0003] Magnetoencephalography (MEG) is a non-invasive brain function detection technology that can more accurately reflect the physiological activities of the cerebral cortex by directly measuring the weak electromagnetic field signals released by tangential pyramidal neurons in the brain. Compared with scalp electroencephalogram (EEG), the magnetic signal of MEG is less interfered by tissue conduction, has more sensors, and is more accurate in locating epileptic foci; compared with intracranial electroencephalography (iEEG), MEG is a non-invasive detection method for whole-brain imaging, which can effectively alleviate the patient's pain and reduce the additional risks brought by invasive methods. Therefore, magnetoencephalography is currently widely used in the postoperative evaluation of epilepsy patients.
[0004] Interictal Epileptic Discharges (IEDs), represented by spikes, are an electrophysiological sign of epilepsy patients during the interictal period. It is generally believed that the signal originates from abnormal discharges of the epileptogenic focus. In the current clinical process, experienced doctors are required to manually mark the spike time points, but the single magnetoencephalogram data collection time of epilepsy patients is about several hours. The manual marking efficiency of doctors is low and it is highly subjective, which is heavily dependent on the subjective experience of doctors. For this reason, the industry has developed a variety of spike detection algorithms, which can be divided into two categories: traditional machine learning and deep learning.
[0005] Traditional machine learning generally performs feature engineering on spikes, and the common idea is to reduce the data dimension and extract effective features. According to the different feature forms, it can be divided into three types: time domain, frequency domain, and time-frequency domain. These features are obtained by performing different transformations based on Fourier transform. This type of method has strong interpretability and supports manual interaction to adjust preferences. However, because the model is simple, it is difficult to summarize complex waveform data, and the detection accuracy of artifacts, atypical spikes, etc. is poor.
[0006] Deep learning is a technology that has emerged in recent years. It mainly uses deep neural networks to extract features of time domain signals and then classify the features to achieve automatic detection of spikes. Existing deep learning methods for spike detection tasks can be divided into three types according to the network structure used: convolutional neural network (CNN), recurrent neural network (RNN), and attention network (Attention). These three methods have their own advantages and disadvantages in different application scenarios. Only independent multi-channel data are used during model training, so only the morphological characteristics of spikes are learned, and the spatial distribution information of sensor channels is not integrated. Therefore, it is difficult to learn the physiological characteristics of the spatial dipole-shaped distribution of spikes, resulting in low detection accuracy of spikes. Summary of the invention
[0007] Based on the technical problems existing in the background technology, the present invention proposes a spatiotemporal multimodal spike wave detection method based on a topological graph, which improves the detection accuracy of spike waves.
[0008] The present invention proposes a spatiotemporal multimodal spike detection method based on a topological map, which processes the acquired magnetoencephalogram data and inputs them into a trained multimodal deep network model to output the corresponding spike prediction results.
[0009] The training process of the multimodal deep network model is as follows:
[0010] Step 1: preprocessing and data segmentation of the magnetoencephalogram data sampled during the interictal period of epileptic patients to obtain segmented magnetoencephalogram data, and performing two-dimensional topological position point embedding and interpolation of the segmented magnetoencephalogram data to obtain topological map data;
[0011] Step 2: Input the segmented magnetoencephalogram data into the temporal modality network, and output the last layer of temporal features and the temporal intermediate layer feature sequence; input the topological map data into the image modality network, and output the last layer of topological features and the topological intermediate layer feature sequence; retain the temporal intermediate layer feature sequence in the order from deep to shallow of the temporal modality network, and retain the topological intermediate layer feature sequence in the order from deep to shallow of the image modality network, and the number of retained temporal intermediate layer feature sequences is consistent with the number of retained topological intermediate layer feature sequences;
[0012] Step three, fuse the retained temporal intermediate layer feature sequence with the retained topological intermediate layer feature sequence to obtain the intermediate fusion feature, fuse the intermediate fusion feature, the last layer of temporal features, and the last layer of topological features based on the self-attention mechanism to obtain the final fusion feature, send the final fusion feature to the classifier to obtain the spike prediction probability, construct a binary cross entropy loss function based on the output spike prediction probability, and update the model parameters through gradient back propagation to train the multimodal deep network model.
[0013] Furthermore, in step 2, specifically:
[0014] (1) Generation of the last layer of temporal features and the feature sequence of the intermediate layer of the temporal sequence:
[0015]
[0016]
[0017] in, represents a temporal modal network, Indicates Segmented MEG data, represents the model parameters of the temporal modal network, Indicates The temporal feature sequence of the segmented magnetoencephalogram data output by the temporal modality network, represents the feature sequence of the intermediate layer of the time series, Indicates The first segmented magnetoencephalogram data was generated by the temporal modality network The temporal intermediate layer features, Indicates The last layer of temporal features of the segmented MEG data output by the temporal modality network;
[0018] (2) Generation of the last layer of topological features and the topological intermediate layer feature sequence:
[0019]
[0020]
[0021] in, represents the image modality network, Indicates Topology data, represents the model parameters of the image modality network, Indicates The topological feature sequence output by the image modality network of the topological map data is represents the topological middle layer feature sequence, Indicates The topological map data is generated by the image modality network. Topological middle layer features, Indicates The topological map data is generated by the segmented magnetoencephalogram data through the last layer of topological features output by the image modality network. An index used to represent segmented magnetoencephalogram data or topological map data;
[0022] (3) The retained temporal intermediate layer feature sequence and the retained topological intermediate layer feature sequence are generated as follows:
[0023] when When , the topological intermediate layer feature sequence retained by the image modality network is , the temporal intermediate layer feature sequence retained by the temporal modal network is ;
[0024] when When , the temporal intermediate layer feature sequence retained by the temporal modal network is , the topological intermediate layer feature sequence retained by the image modality network is ;
[0025] when When , the temporal intermediate layer feature sequence retained by the temporal modal network is , the topological intermediate layer feature sequence retained by the image modality network is .
[0026] Furthermore, in step 3, assume that , the generation process of the intermediate fusion features is as follows:
[0027] right Middle The corresponding topological middle layer features The intermediate features of the image are obtained after being processed by the two-dimensional pooling layer and the flattening layer. , all topological intermediate layer features are processed in this way to obtain the intermediate feature sequence of the image;
[0028] right Middle The corresponding temporal intermediate layer features The intermediate features of the signal are obtained after being processed by the one-dimensional pooling layer and the flattening layer in turn. , all the time series intermediate layer features are processed in this way to obtain a signal intermediate feature sequence; the length of the image intermediate feature sequence is consistent with the length of the signal intermediate feature sequence;
[0029] Pair the image intermediate feature sequences with the signal intermediate feature sequences one by one in order from front to back. Perform cross-attention mechanism processing to obtain a cross-attention feature sequence with the same length as the middle feature sequence of the picture or the middle feature sequence of the signal , Represents the intermediate feature pair The obtained cross attention features, Represents the intermediate feature pair ( ) The cross attention features obtained;
[0030] A Convolutional Pyramid operation is performed on the cross-attention feature sequence according to the information density of the cross-attention feature, and finally an intermediate fusion feature is obtained. The Convolutional Pyramid operation is an inverted pyramid convolution.
[0031] Furthermore, in the process of obtaining the cross-attention features by processing the intermediate features of the image and the intermediate features of the signal through the cross-attention mechanism, the cross-attention mechanism is specifically as follows:
[0032]
[0033]
[0034]
[0035]
[0036] in, Representation based on the intermediate features of the image and signal intermediate features The generated cross-attention features, , , The intermediate feature pairs The three different embedding vectors generated by the mapping are superscript represents the matrix transpose operation, They are three different mapping matrices, for The size of the second dimension.
[0037] Furthermore, in step three, the intermediate fusion features, the last layer of temporal features, and the last layer of topological features are fused based on the self-attention mechanism to obtain the final fusion features. The generation is as follows:
[0038]
[0039]
[0040] in, represents the self-attention mechanism, represents a temporary intermediate feature, represents the intermediate fusion feature, represents the last layer of temporal features, represents the topological features of the last layer, Represents a concatenation operation.
[0041] Furthermore, in step three, the binary cross entropy loss function is constructed as follows:
[0042]
[0043]
[0044] in, represents the mean loss function of all segmented MEG data on the multimodal deep network model, is the zero-dimensional true label for each segmented MEG data, Indicates The zero-dimensional true labels of the segmented MEG data, Indicates that the segmented magnetoencephalogram data does not contain spikes. Indicates that the segmented MEG data contains at least one spike wave, represents the total number of slices of all segmented MEG data, is the spike prediction probability output by the multimodal deep network model, Indicates Prediction probability of spikes corresponding to segmented MEG data.
[0045] The advantage of the spatiotemporal multimodal spike wave detection method based on a topological map provided by the present invention is that the spatiotemporal multimodal spike wave detection method based on a topological map provided in the structure of the present invention fuses the features of segmented magnetoencephalogram data and topological map data through the CrossConvPyramid method, so that the multimodal deep network model not only learns the timing information of the spike wave, but also fits the spatial position information contained in the focal epilepsy, thereby improving the detection accuracy of the spike wave. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic diagram of the process flow of the present invention;
[0047] Figure 2a A schematic diagram of the three-dimensional topological position of the magnetometer in the helmet of the brain magnetic collection device;
[0048] Figure 2b for Figure 2aSchematic diagram of the two-dimensional topological position of the magnetometer in the helmet of the midbrain magnetic field acquisition device;
[0049] Figure 3 This is a partial channel timing waveform diagram of segmented magnetoencephalography data;
[0050] Figure 4 for Figure 3 Schematic diagram of topological map data generated corresponding to the segmented magnetoencephalogram data;
[0051] Figure 5 Schematic diagram of the generation of intermediate fusion features;
[0052] Figure 6 Schematic diagram of the final fusion feature generation based on the self-attention mechanism. DETAILED DESCRIPTION
[0053] Below, the technical solution of the present invention is described in detail through specific embodiments. Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific implementation disclosed below.
[0054] like Figures 1 to 6 As shown, the present invention proposes a spatiotemporal multimodal spike detection method based on a topological map, which processes the acquired magnetoencephalogram data and inputs it into a trained multimodal deep network model to output the corresponding spike prediction results.
[0055] The training process of the multimodal deep network model is as follows:
[0056] Step 1: preprocessing and data segmentation of the magnetoencephalogram data sampled during the interictal period of epileptic patients to obtain segmented magnetoencephalogram data, and performing two-dimensional topological position point embedding and interpolation of the segmented magnetoencephalogram data to obtain topological map data;
[0057] (a1) In the preprocessing of magnetoencephalogram data sampled during the interictal period of epileptic patients, the preprocessing includes bandpass filtering, removing ECG artifacts, resampling, and normalization, specifically:
[0058] The magnetoencephalogram data collected from epileptic patients during the interictal period were The band-pass filter parameters are used for band-pass filtering;
[0059] Based on the reference electrocardiogram (ECG) and electrooculogram (EOG) channels, the data after bandpass filtering are decomposed and the artifact vector removal algorithm is used to remove heartbeat artifacts and eye movement artifacts;
[0060] The artifact-removed data is normalized by a gradiometer and a magnetometer to obtain preprocessed magnetoencephalogram data. The mean and standard deviation used in the normalization operation are related to the data set. In this embodiment, the normalized mean of the gradiometer is , the standard deviation is , the normalized mean value of the magnetometer is , the standard deviation is ;
[0061] The above preprocessing algorithms are all commonly used algorithms and will not be further explained. The parameters used can be changed according to actual conditions.
[0062] The pre-processed MEG data are divided into the following steps: the pre-processed MEG data are sliced 150ms before and after the doctor's marked points, and each marked point will get a 306×300-dimensional data after slicing. , where 306 represents 102 magnetometers and 204 gradiometers.
[0063] Divide the sliced data and select the The difficult case data is used as the test set, and the remaining data is used as the training set. In this embodiment, 12 (10.1%) patients with a total of 4706 (15.0%) data from 31420 data slices of 119 patients are selected as the test set. The rest of the data is used as training set , training set Used to train multimodal deep network models, test sets Used to test and verify the multimodal deep network model after training to determine the training effect of the multimodal deep network model.
[0064] (a2) The two-dimensional topological position points of the brain topological position of the segmented magnetoencephalogram data are embedded and interpolated to obtain topological map data, specifically including (a2-1) and (a2-2):
[0065] (a2-1) Aggregate the segmented MEG data according to spatial position, and embed the aggregated data into a two-dimensional topological position according to the brain topological position;
[0066] The segmented magnetoencephalogram data are aggregated according to the spatial position. Specifically, the magnetoencephalogram helmet is provided with multiple sensor positions, each of which is provided with a magnetometer and two gradiometers with different directions. The spatial position of the same sensor position is consistent, so the signal values of the magnetometer and gradiometer at the same position can be aggregated, specifically:
[0067]
[0068] in, Represents the signal strength at the sensing location after data aggregation; Respectively represent the signal strength displayed on the magnetometer and gradiometer at the sensing position, Indicates a set of parameters. In this embodiment, only one set of parameters is used. , so after data aggregation, the original 306×300 dimensional data Transformed into 102×300 dimensional data .
[0069] The aggregated data are then mapped to the brain topological position corresponding to the two-dimensional plane according to the relative position of the sensor that generates these data on the magnetoencephalography helmet, that is, the three-dimensional brain topological position; the center of a set of magnetometers and gradiometers in the magnetoencephalography helmet, that is, the Cartesian coordinate position of the center of the magnetometer is used as the three-dimensional topological position point, and then mapped to the two-dimensional plane to obtain the two-dimensional topological position point embedded in the aggregated data, such as Figure 2a and Figure 2b As shown in the figure. Among them, the three-dimensional topological position points are mapped to the two-dimensional topological position points of the two-dimensional plane, as follows:
[0070] Use polar coordinate mapping to perform two-dimensional equidistant projection of the three-dimensional position, keeping the position between the magnetometer centers roughly unchanged: that is, the three-dimensional spatial position point Mapping to two-dimensional space , and any two points in three-dimensional space , satisfying that the distance between the two points before and after the mapping remains roughly unchanged, that is . Specifically, the polar coordinate mapping is:
[0071] In the original three-dimensional space, there is the following polar coordinate mapping relationship:
[0072]
[0073]
[0074]
[0075] in, represents the Cartesian coordinate position of the center of the magnetometer in three-dimensional space; represents the polar diameter length, and Represents the tilt and rotation arc of the polar diameter, with the center of the magnetometer at the highest point above the head as the origin. When mapped to a two-dimensional plane, As the polar diameter, As an arc, discard , construct a polar coordinate system for the two-dimensional plane, specifically:
[0076]
[0077]
[0078] in, Represents the Cartesian coordinate position of the center of the magnetometer in the two-dimensional plane. This enables mapping of three-dimensional topological position points to two-dimensional topological position points in the two-dimensional plane.
[0079] like Figure 2a As shown in the figure, it is the three-dimensional spatial position of 102 magnetometers. The Cartesian coordinate position of the center of each magnetometer corresponds to the three-dimensional topological position of 102 sets of sensor positions. By mapping the three-dimensional topological position to the two-dimensional plane, the corresponding two-dimensional topological position can be obtained. The 102×300 data is embedded in the two-dimensional topological position, and the following is obtained: Figure 2b The topological location of brain magnetic channels in the figure.
[0080] Regarding the description of the brain topological position, the brain topological position of this embodiment is actually the topological position corresponding to the sensor position, and the topological map corresponds to a picture of the relative position relationship between each point. Figure 2a Shown is a three-dimensional topological position diagram of the sensor positions in a magnetoencephalogram device from Elekta. In this three-dimensional topological position diagram, each square is a magnetometer, and each magnetometer is surrounded by two gradiometers (not shown in the figure). In general, the magnetometer and gradiometer at the same sensor position are close in spatial distribution.
[0081] (a2) Use the interpolation method to interpolate the two-dimensional topological position map to obtain topological map data.
[0082] Among them, the topological position in the two-dimensional topological position map is interpolated as follows:
[0083] For a millisecond point in 300 milliseconds Magnetoencephalography data ,have represents a set of two-dimensional discrete points in a two-dimensional topological position, Indicates the aggregated data The coordinate position of each channel on the two-dimensional brain topology map, Indicates the aggregated data Channels Data value at a given time point .
[0084] A 102×102 grid map is generated based on these 102 known discrete data points, and each grid point Based on the 19 known data points around it, cubic spline interpolation is performed to obtain the interpolation value. By analogy, the interpolation value of each unknown grid data point in the network diagram is solved, and finally a complete topological map is fitted, which is used as the topological map data corresponding to the segmented magnetoencephalography data.
[0085] For 300 such time points, 300 pieces of topology map data will be generated. In order to reduce the computational overhead, and based on a large amount of experimental data results, the topology map data of the first millisecond of every 5 milliseconds can be used to represent the 5 pieces of topology map data of these 5 milliseconds, and the topology map data of 102x102 size can be downsampled to 64x64.
[0086] In summary, a raw segmented MEG data After step (a2), a sequence of 60 64x64 size topological images can be generated. .
[0087] For the original training set and test set , the segmented MEG data in each data partition are generated with the above topological map, and a multimodal training set containing both MEG data and topological map data can be obtained. and multimodal test sets .
[0088] Step 2: Input the segmented magnetoencephalogram data into the temporal modality network, and output the last layer of temporal features and the temporal intermediate layer feature sequence; input the topological map data into the image modality network, and output the last layer of topological features and the topological intermediate layer feature sequence;
[0089] In this embodiment, the time series modal network performs feature extraction on the time series signal modality based on the SpikeNet network model (Development of Expert-Level Automated Detection of Epileptiform Discharges During Electroencephalogram Interpretation), and the image modal network performs feature extraction on the topological map modality based on the ResNeXt network model (Aggregated Residual Transformations for Deep Neural Networks).
[0090] For the input data space , the embedding feature space of temporal modality network and image modality network , the output data space of the multimodal deep network model , as the temporal modality network and image modality network in the multimodal deep network model deepen the depth of the classifier, the original input data space and low-dimensional embedding feature space Mutual information will decrease, while the output data space and low-dimensional embedding feature space Mutual information This indicates that as the network depth increases, the low-dimensional embedding feature space will contain more features that are related to the output data space. Related information. (Based on the information bottleneck method and the information bottleneck theory of deep learning in the paper "On the information bottleneck theory of deep learning") Information density: In summary, when the feature space is embedded Data Dimensions When it decreases, the unit data dimension contains more information related to the output space, so the information density Increase. Based on this, the information density of the intermediate layer features output by the network layer closer to the classification layer is greater. Therefore, the temporal intermediate layer feature sequence is retained in the order from deep to shallow in the temporal modality network, and the topological intermediate layer feature sequence is retained in the order from deep to shallow in the image modality network. The number of retained temporal intermediate layer feature sequences is consistent with the number of retained topological intermediate layer feature sequences. Specifically:
[0091]
[0092]
[0093]
[0094]
[0095] in, represents a temporal modal network, Indicates Segmented MEG data, represents the model parameters of the temporal modal network, Indicates The temporal feature sequence of the segmented magnetoencephalogram data output by the temporal modality network, represents the feature sequence of the intermediate layer of the time series, Indicates The first segmented magnetoencephalogram data was generated by the temporal modality network The temporal intermediate layer features, Indicates The last layer of temporal features of the segmented magnetoencephalogram data output by the temporal modality network; among them, represents the image modality network, Indicates Topology data, represents the model parameters of the image modality network, Indicates The topological feature sequence output by the image modality network of the topological map data is represents the topological middle layer feature sequence, Indicates The topological map data is generated by the image modality network. Topological middle layer features, Indicates The topological map data is generated by the segmented magnetoencephalogram data through the last layer of topological features output by the image modality network. An index used to represent segmented MEG data or topological map data.
[0096] when When , the topological intermediate layer feature sequence retained by the image modality network is , the temporal intermediate layer feature sequence retained by the temporal modal network is ,in, Indicates The first segmented magnetoencephalogram data was generated by the temporal modality network Temporal intermediate layer features;
[0097] when When , the temporal intermediate layer feature sequence retained by the temporal modal network is , the topological intermediate layer feature sequence retained by the image modality network is , Indicates The topological data is generated by the temporal modal network. Topological middle layer features;
[0098] when When , the temporal intermediate layer feature sequence retained by the temporal modal network is , the topological intermediate layer feature sequence retained by the image modality network is .
[0099] In this embodiment, the segmented magnetoencephalogram data and topological sequence data After passing through the time series modality network (SpikeNet network) and the image modality network (ResNeXt network model), the last layer of time series features will be obtained. And the last layer of topological features , the dimensions of the two last layer features are both 256. Similarly, the temporal intermediate layer feature sequences are obtained respectively and topological intermediate layer feature sequence , where the superscript Indicates the dimension of the feature map.
[0100] Step three, fuse the retained temporal intermediate layer feature sequence with the retained topological intermediate layer feature sequence to obtain the intermediate fusion feature, fuse the intermediate fusion feature, the last layer of temporal features, and the last layer of topological features based on the self-attention mechanism to obtain the final fusion feature, send the final fusion feature to the classifier to obtain the spike prediction probability, construct a binary cross entropy loss function based on the output spike prediction probability, and update the model parameters through gradient back propagation to train the multimodal deep network model.
[0101] (b1) fusing the retained temporal intermediate layer feature sequence with the retained topological intermediate layer feature sequence to obtain an intermediate fusion feature;
[0102] like Figure 5 As shown in the figure, CrossConvPyramid is used to fuse the retained temporal intermediate layer feature sequence with the retained topological intermediate layer feature sequence. , ,as well as The corresponding temporal intermediate layer feature sequences and topological intermediate layer feature sequences retained under the three conditions have the same specific fusion process. For example, the fusion methods corresponding to the other two conditions can be directly referred to The fusion method can be used.
[0103] (b1-1) For , the retained topological intermediate layer feature sequence is , the retained temporal intermediate layer feature sequence is ;
[0104] (b1-2) Yes Middle The corresponding topological middle layer features The intermediate features of the image are obtained by downsampling through the two-dimensional pooling layer and the flattening layer. , all topological intermediate layer features are processed in this way to obtain the intermediate feature sequence of the image;
[0105]
[0106] in, represents a two-dimensional pooling layer, Represents a flattened layer.
[0107] (b1-3) Yes Middle The corresponding temporal intermediate layer features The intermediate features of the signal are obtained after being processed by the one-dimensional pooling layer and the flattening layer in turn. , all the time series intermediate layer features are processed in this way to obtain the signal intermediate feature sequence; the length of the picture intermediate feature sequence is consistent with the length of the signal intermediate feature sequence. It should be noted that the picture intermediate feature sequence is a sequence obtained by sequentially combining all the picture intermediate features, and the signal intermediate feature sequence is a sequence obtained by sequentially combining all the signal intermediate features;
[0108]
[0109] in, Represents a one-dimensional pooling layer.
[0110] (b1-4) Pair the image intermediate feature sequences with the signal intermediate feature sequences one by one in order from front to back. Perform cross-attention mechanism processing to obtain a cross-attention feature sequence with the same length as the middle feature sequence of the picture or the middle feature sequence of the signal , Represents the intermediate feature pair The obtained cross attention features, Represents the intermediate feature pair ( ) to obtain the cross-attention features.
[0111]
[0112] in, Represents the cross-attention feature mechanism. The cross-attention mechanism is specifically:
[0113]
[0114]
[0115]
[0116]
[0117] in, Representation based on the intermediate features of the image and signal intermediate features The generated cross-attention features, , , The intermediate feature pairs The three different embedding vectors generated by the mapping are superscript represents the matrix transpose operation, They are three different mapping matrices, for The size of the second dimension.
[0118] In sequence, you can generate Cross-attention feature sequence .
[0119] (b1-5) Perform ConvolutionalPyramid operation on the cross-attention feature sequence according to the information density of the features. This operation is a kind of inverted pyramid convolution structure, that is, the deeper cross-attention features with higher information density are subjected to fewer layers of convolution block operations, and the shallower cross-attention features with lower information density are subjected to more layers of convolution fast operations. Finally, the CrossConvPyramid operation is completed, and the intermediate fusion feature is obtained. , specifically:
[0120]
[0121] in, Represents the intermediate fusion features generated by the fusion method CrossConvPyramid. represents a linear transformation function; Indicates pressing the feature Perform splicing operations. Indicates passing Different layers To process, The value range is ,1, where Represents a convolutional neural network block, which contains a convolutional neural network layer and a batch normalization layer; and have The convolutional neural network blocks with the same layers, namely After Layer convolutional neural network blocks with All convolutional neural network blocks used are exactly the same.
[0122] In this embodiment, and After downsampling and cross-attention mechanism processing, the attention feature sequence is obtained: , and then the intermediate fusion features can be obtained through the Convolutional Pyramid operation. Specifically:
[0123]
[0124] Among them, the subscript Represents the input model Segmented magnetoencephalogram data or topological map data, superscript or Both represent the dimensions of the feature map. represents the intermediate fusion features output by the CrossConvPyramid fusion method in this implementation, Represents a concatenation operation.
[0125] (b2) Fusion of intermediate features , the last layer of temporal features , the last layer of topological features Based on the fusion of self-attention mechanism, the final fusion features are obtained;
[0126] The fusion features and and Perform fusion based on self-attention mechanism, such as Figure 6 The details are as follows:
[0127]
[0128]
[0129] Among them, the subscript Represents the input model Segmented magnetoencephalogram data or topological map data; Represents the temporary intermediate features produced by splicing; Represents the final fusion feature output by the fusion method CrossConvPyramid. Indicates splicing in the feature channel dimension, Represents the self-attention mechanism, as follows:
[0130]
[0131]
[0132]
[0133]
[0134] in, represents the generated self-attention feature, is an activation function, The final fusion feature The three different embedding vectors generated by the mapping are are the corresponding three different mapping matrices, with superscript represents the matrix transpose operation, for The size of the second dimension.
[0135] In this embodiment, , and Perform fusion based on self-attention mechanism, such as Figure 6 As shown, the details are as follows:
[0136]
[0137]
[0138] (b3) sending the final fusion features into the classifier to obtain the spike prediction results, constructing a binary cross entropy loss function based on the output spike prediction results, and updating the model parameters through gradient back propagation to train the multimodal deep network model;
[0139] The final fusion features output by CrossConvPyramid are sent to the classifier to obtain the spike prediction results output by the multimodal deep network model. Based on the spike prediction results, the binary cross entropy loss function of the model can be constructed for back propagation to update the model parameters to achieve the purpose of training the model. The binary cross entropy loss function is as follows:
[0140]
[0141]
[0142] in, represents the mean loss function of all segmented MEG data on the multimodal deep network model, is the zero-dimensional true label for each segmented MEG data, Indicates The zero-dimensional true labels of the segmented MEG data, Indicates that the segmented magnetoencephalogram data does not contain spikes. Indicates that the segmented MEG data contains at least one spike wave, represents the total number of slices of all segmented MEG data, is the spike prediction probability output by the multimodal deep network model, Indicates Prediction probability of spikes corresponding to segmented MEG data.
[0143] Finally, the multimodal deep network model after training is tested on the multimodal test set. Test verification is performed to verify the training effect of the multimodal deep network model. If the effect does not meet the preset requirements, training will continue through the test set until the training effect is obtained. Specifically:
[0144] Specifically:
[0145]
[0146] in, For the test set In multimodal deep network models The prediction results on is a model parameter, which is the model parameter corresponding to the multimodal deep network model after training.
[0147] Through steps 1 to 3, the features of segmented magnetoencephalogram data and topological map data are fused through the CrossConvPyramid method, so that the multimodal deep network model can learn the timing information of spikes and fit the spatial location information contained in focal epilepsy. Compared with the single-time spike detection model of the existing State-of-the-art (Sota) model, this embodiment has achieved The accuracy and The F1-score is improved.
[0148] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A spatiotemporal multimodal spike detection method based on topological graph, characterized in that: After data processing, the acquired magnetoencephalogram data is input into the trained multimodal deep network model to output the corresponding spike wave prediction results; The training process of the multimodal deep network model is as follows: Step 1: preprocessing and data segmentation of the magnetoencephalogram data sampled during the interictal period of epileptic patients to obtain segmented magnetoencephalogram data, and performing two-dimensional topological position point embedding and interpolation of the segmented magnetoencephalogram data to obtain topological map data; Step 2: Input the segmented magnetoencephalogram data into the temporal modality network, and output the last layer of temporal features and the temporal intermediate layer feature sequence; input the topological map data into the image modality network, and output the last layer of topological features and the topological intermediate layer feature sequence; The temporal intermediate layer feature sequences are retained in the order from deep to shallow layers of the temporal modality network, and the topological intermediate layer feature sequences are retained in the order from deep to shallow layers of the image modality network. The number of retained temporal intermediate layer feature sequences is consistent with the number of retained topological intermediate layer feature sequences. Step three, fuse the retained temporal intermediate layer feature sequence with the retained topological intermediate layer feature sequence to obtain the intermediate fusion feature, fuse the intermediate fusion feature, the last layer of temporal features, and the last layer of topological features based on the self-attention mechanism to obtain the final fusion feature, send the final fusion feature to the classifier to obtain the spike prediction probability, construct a binary cross entropy loss function based on the output spike prediction probability, and update the model parameters through gradient back propagation to train the multimodal deep network model.
2. The spatiotemporal multimodal spike detection method based on topological graph according to claim 1, characterized in that: In step 2, specifically: (1) Generation of the last layer of temporal features and the feature sequence of the intermediate layer of the temporal sequence: in, represents a temporal modal network, Indicates Segmented MEG data, represents the model parameters of the temporal modal network, Indicates The temporal feature sequence of the segmented magnetoencephalogram data output by the temporal modality network, represents the feature sequence of the intermediate layer of the time series, Indicates The first segmented magnetoencephalogram data was generated by the temporal modality network The temporal intermediate layer features, Indicates The last layer of temporal features of the segmented MEG data output by the temporal modality network; (2) Generation of the last layer of topological features and the topological intermediate layer feature sequence: in, represents the image modality network, Indicates Topology data, represents the model parameters of the image modality network, Indicates The topological feature sequence output by the image modality network of the topological map data is represents the topological middle layer feature sequence, Indicates The topological map data is generated by the image modality network. Topological middle layer features, Indicates The topological map data is generated by the segmented magnetoencephalogram data through the last layer of topological features output by the image modality network. An index used to represent segmented magnetoencephalogram data or topological map data; (3) The retained temporal intermediate layer feature sequence and the retained topological intermediate layer feature sequence are generated as follows: when When , the topological intermediate layer feature sequence retained by the image modality network is , the temporal intermediate layer feature sequence retained by the temporal modal network is ,in Indicates Segmented MEG data generated by temporal modality networks Middle Temporal intermediate layer features; when When , the temporal intermediate layer feature sequence retained by the temporal modal network is , the topological intermediate layer feature sequence retained by the image modality network is ,in Indicates The topological data is generated by the temporal modal network Middle Topological middle layer features; when When , the temporal intermediate layer feature sequence retained by the temporal modal network is , the topological intermediate layer feature sequence retained by the image modality network is .
3. The spatiotemporal multimodal spike detection method based on topological graph according to claim 2, characterized in that: In step 3, assume that , the generation process of the intermediate fusion features is as follows: right Middle The corresponding topological middle layer features The intermediate features of the image are obtained after being processed by the two-dimensional pooling layer and the flattening layer. , all topological intermediate layer features are processed in this way to obtain the intermediate feature sequence of the image; right Middle The corresponding temporal intermediate layer features The intermediate features of the signal are obtained after being processed by the one-dimensional pooling layer and the flattening layer in turn. , all the time series intermediate layer features are processed in this way to obtain a signal intermediate feature sequence; the length of the image intermediate feature sequence is consistent with the length of the signal intermediate feature sequence; Pair the image intermediate feature sequences with the signal intermediate feature sequences one by one in order from front to back. Perform cross-attention mechanism processing to obtain a cross-attention feature sequence with the same length as the middle feature sequence of the picture or the middle feature sequence of the signal , Represents the intermediate feature pair The obtained cross attention features, Represents the intermediate feature pair ( ) The cross attention features obtained; A Convolutional Pyramid operation is performed on the cross-attention feature sequence according to the information density of the cross-attention feature, and finally an intermediate fusion feature is obtained. The Convolutional Pyramid operation is an inverted pyramid convolution.
4. The method for detecting spatiotemporal multimodal spikes based on topological graphs according to claim 3, characterized in that: In the process of obtaining cross-attention features by processing the intermediate features of the image and the intermediate features of the signal through the cross-attention mechanism, the cross-attention mechanism is as follows: in, Representation based on the intermediate features of the image and signal intermediate features The generated cross-attention features, , , The intermediate feature pairs The three different embedding vectors generated by the mapping are superscript represents the matrix transpose operation, They are three different mapping matrices, for The size of the second dimension.
5. The method for detecting spatiotemporal multimodal spikes based on topological graphs according to claim 3, characterized in that: In step 3, the intermediate fusion features, the last layer of temporal features, and the last layer of topological features are fused based on the self-attention mechanism to obtain the final fusion features. The generation is as follows: in, represents the self-attention mechanism, represents a temporary intermediate feature, represents the intermediate fusion feature, represents the last layer of temporal features, represents the topological features of the last layer, Represents a concatenation operation.
6. The spatiotemporal multimodal spike detection method based on topological graph according to claim 2, characterized in that: In step three, the binary cross entropy loss function is constructed as follows: in, represents the mean loss function of all segmented MEG data on the multimodal deep network model, is the zero-dimensional true label for each segmented MEG data, Indicates The zero-dimensional true labels of the segmented MEG data, Indicates that the segmented magnetoencephalogram data does not contain spikes. Indicates that the segmented MEG data contains at least one spike wave, represents the total number of slices of all segmented MEG data, is the spike prediction probability output by the multimodal deep network model, Indicates The spike prediction probability corresponding to the segmented MEG data, represents the linear transformation function, Represents the final fusion feature.
