Background
The magnetoencephalogram can detect weak magnetic signals emitted by the human brain by using an extremely sensitive magnetic detector, such as an atomic optical pump magnetometer, a superconducting quantum interferometer and the like, extract corresponding information from the signals and analyze the brain state of a tested person. The current application of magnetoencephalography is mainly two-fold: one aspect is the partitioning and study of different functional areas of the brain network. On the other hand, the compound has important clinical application in the diagnosis and treatment of some brain functional diseases, such as psychosis, brain injury and autism. In particular, in epileptic conditions, the magnetoencephalogram can approximate the location of an epileptic focus, thereby allowing noninvasive and non-invasive diagnosis of the patient.
In the study of human brain function using magnetoencephalogram, the main study object is the signals emitted by the brain when the subject is subjected to different stimuli, and these signals are called event-induced signals. For example, when the testee is stimulated by different visual, auditory, sensory and olfactory senses, different functional areas of the brain will send out corresponding event inducing signals. However, since brain magnetic signals are very weak, and various noises exist. If the time-induced signal is observed, the testee needs to be stimulated for multiple times, the event-induced signal is measured for multiple times, then the event-induced signal obtained through multiple measurement is stored for signal averaging, so that the noise signal which randomly appears in the event-induced signal is suppressed, and the regular signal pattern is strengthened. On the one hand, however, the method of averaging signals yields results that depend on the common trends and "components" present in the observed waveforms. For each stimulation, the waveform, the appearance time, the appearance position, the frequency and other characteristics of each corresponding evoked signal are changed due to the differences of the attention, the tension state and the excitation state of the testee. Thus, part of the information of the event-induced signal in a single measurement is lost in averaging the signal. In addition, in a single evoked signal, there are a number of other brain region-emanating signals as well as ocular and electrocardiographic artifact signals, which also occur randomly, playing a role as noise in the detection of event-evoked signals. Averaging also results in loss of information for these signals. On the other hand, if there is significant noise in a single measurement, the averaging operation also introduces noise into the averaged observed signal. The averaged signal from the averaging operation can only provide a pattern of event-induced signals that is not representative of any single event-induced signal.
Currently, methods for detecting single-event evoked signals are mainly proposed based on electroencephalography, such as separating feature quantities from single-event evoked signals by using independent component analysis, signal space projection, and the like. But the characteristics of such isolation are not obvious due to the particularity and diversity of the brain signal sources. With the improvement of the detection technology, the waveform of the signal naturally becomes the entry point of the next single event induced signal detection technology, and people construct statistics by using the frequency characteristics, the amplitude characteristics and the phase characteristics of the single event induced signal appearing in the electroencephalogram and detect the single event induced signal by using a statistical method. However, there is a difference between the magnetoencephalogram and the event-induced signal features detected in the electroencephalogram, and the useful information about the signal is not the same. Especially, the magnetoencephalogram generally has more sensors due to the positioning requirement of a signal source, and the spatial distribution of detection signals can be obtained. While the electroencephalogram measures the potential difference between the two sensors. Therefore, based on the above reasons, we propose a new algorithm for detecting single event evoked signals in magnetoencephalogram, especially single auditory evoked signals.
Disclosure of Invention
Aiming at the defects of the traditional single event evoked signal detection method in the magnetoencephalogram, the invention provides a magnetoencephalogram single auditory evoked signal detection method and an electronic device.
The technical scheme of the invention is as follows:
a method for detecting a single auditory evoked signal of a magnetoencephalogram comprises the following steps:
1) converting the brain magnetic signals to be detected into two-dimensional matrix data of M x N, wherein M is the number of the brain magnetic sensors, and N is a set time length;
2) sequentially taking each brain magnetic sensor as a selected sensor, calculating the correlation coefficient of the selected sensor and each sensor in a set neighborhood, and calculating an increasing signal of each selected sensor according to the two-dimensional matrix data of the selected sensor, the two-dimensional matrix data of each brain magnetic sensor in the set neighborhood and the correlation coefficient;
3) obtaining a brain magnetic signal view according to the added signals and the positions of the brain magnetic sensors;
4) and extracting the signal space distribution characteristics of the brain magnetic signal view, classifying the signal space distribution characteristics, and judging a single auditory evoked signal or a noise signal contained in the signal to be detected.
Further, the increase signal for each selected sensor is calculated by the following strategy:
1) selecting the sensor X in the corresponding set neighborhood with the correlation coefficient larger than the threshold c
jSignal G
jAnd correspondingly setting the sensor X in the neighborhood
jSignal G of
jBy a correlation coefficient T
jFor weighting, superimposed on the selected sensor X
iSignal G of
iThe obtained signal
As selected sensor X
iNew detection signals, wherein I is more than or equal to 1 and less than or equal to I, I is the number of the selected sensors, J is more than or equal to 1 and less than or equal to J, and J is the number of the sensors in the set neighborhood with the correlation coefficient larger than the threshold value c;
2) if none of the correlation coefficients is greater than the threshold c, the increase signal G for the selected sensor is selectedi'=Gi。
Further, the brain magnetic signal view is a 2D view; obtaining the brain magnetic signal view by the following steps:
1) calculating the average power of each brain magnetic sensor strengthening signal;
2) and coding the average power by using colors, and drawing the average power to a spatial position corresponding to the brain magnetic sensor to obtain a brain magnetic signal view.
Further, extracting signal space distribution characteristics of the brain magnetic signal view through a trained two-dimensional deep convolution neural network, and classifying the signal space distribution characteristics; wherein a two-dimensional deep convolutional neural network is trained by:
a) respectively converting a plurality of single auditory evoked sample signals and sample noise signals into sample data with labels;
b) sequentially taking each magnetoencephalography sensor as a selected sensor, calculating sample correlation coefficients of the selected sensor and each magnetoencephalography sensor in a set sample neighborhood, and calculating a sample increase signal of each selected sensor according to the sample data of the selected sensor, the sample data of each magnetoencephalography sensor in the set sample neighborhood and the sample correlation coefficients;
c) adding signals and the positions of the brain magnetic sensors according to the samples to obtain a plurality of single auditory evoked sample brain magnetic signal views or sample noise views;
d) and training the two-dimensional deep convolutional neural network through an auditory evoked sample brain magnetic signal view and a sample noise view to obtain the trained two-dimensional deep convolutional neural network.
Further, the two-dimensional deep convolutional neural network comprises a google lenet network, an AlexNet network or a two-dimensional deep convolutional neural network with the node number and the weight meeting the requirements.
Further, preprocessing the single auditory evoked sample signal before converting the single auditory evoked sample signal into sample data with a label; the pretreatment comprises the following steps: removing ambient noise signals from the single auditory evoked sample signal, removing eye movement and cardiac artifact noise signals, and removing other signals emanating from the brain.
Further, the ambient noise signal includes: power frequency noise; the method for removing power frequency noise comprises the following steps: filtering removal at 50Hz or 60Hz is used.
Further, the method for removing the eye movement and the cardiac artifact noise signal comprises the following steps: a signal space projection algorithm or an independent component analysis algorithm is used.
Further, other signals emitted by the brain include: an alpha signal and a beta signal; the method for removing the alpha signal and the beta signal comprises the following steps: filtering removal at 10Hz and 20Hz was used.
A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the above-mentioned method when executed.
An electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer to perform the method as described above.
The invention has the beneficial effects that:
a new algorithm for single auditory evoked signal detection in magnetoencephalography based on artificial neural networks is proposed;
compared with the traditional signal averaging method, the single auditory evoked signal detection does not need to store data, and can be realized synchronously with data detection, namely in real time;
a single auditory evoked signal detection is able to preserve the information of the original signal to the maximum extent possible, without affecting the rest of the information contained in the signal, compared to traditional methods of signal averaging;
compared with the traditional algorithm for inducing signals by single events in electroencephalogram, the algorithm utilizes the signal space distribution information contained in the electroencephalogram signals, so that the detection is more accurate, and the calculation is simpler and more convenient.
Detailed Description
In order to better explain the technical scheme of the invention, the invention is further described in detail with reference to the accompanying drawings and specific embodiments. In order to solve the existing technical problems, the invention provides a single auditory evoked signal detection method in a magnetoencephalogram based on an artificial neural network, which specifically comprises the following steps:
the invention relates to a method for automatically detecting single auditory evoked signals in a magnetoencephalogram, which comprises the following steps as shown in figure 1:
1) the known single auditory evoked signals are signal pre-processed in order to remove noise therefrom. Wherein each single auditory evoked signal is a data set in the form of a two-dimensional matrix with a size of M N, M being the number of magnetoencephalography sensors; and N is a set time length.
2) Calculating a correlation coefficient for the signal preprocessed in step 1). The neighborhood radius size is defined as r. For each sensor, a neighborhood is defined, and for ease of description, the sensor is referred to as the selected sensor, and the sensors within its neighborhood are referred to as neighborhood sensors. And respectively calculating a correlation coefficient between each neighborhood sensor detection signal and the selected sensor detection signal, namely a neighborhood correlation coefficient.
3) As shown in fig. 2, the signal preprocessed in step 1) is subjected to linear superposition enhancement. When the correlation coefficient between the neighborhood signal and the selected signal calculated in the step 2) is larger than the threshold c, weighted linear superposition is carried out on the signals of the neighborhood signal and the selected signal, then the superposed signal is divided by the number of the superposed neighborhood signals to serve as a new selected signal, and the weight is the correlation coefficient between the neighborhood signal and the selected signal. But if the number of the superimposed domain signals is 0, no operation is performed on the selected signal.
4) And drawing a 2D view by using the enhanced signal obtained in the step 3). The average power of the enhancement signal is calculated, color coded, and combined with the sensor position information, a 2D view can be rendered.
5) The spatial distribution enhancement operation described above is performed on a known single auditory evoked signal. A 2D view of a single auditory evoked signal is obtained as training set 1. Wherein each single auditory evoked signal is a data set in the form of a two-dimensional matrix with a size of M N, M being the number of magnetoencephalography sensors; and N is a set time length.
6) The spatial distribution enhancement operation described above is performed on a known noise signal. A 2D view of the noise signal is obtained as training set 2. Each noise signal is a data set in a two-dimensional matrix form with the size of M x N, and M is the number of the brain magnetic sensors; and N is a set time length. The measurement environment of the noise signal is the same as the single auditory evoked signal measurement environment.
7) Training a single auditory evoked signal detection model by using the training set 1 and the training set 2 obtained in the steps 5) and 6) to form a training set total; the single auditory evoked signal detection model comprises a feature learning module and a classification output module; the feature learning module comprises a two-dimensional deep convolutional neural network and is used for learning the spatial distribution features of signals presented in a training set, namely a 2D view, extracting the spatial distribution features of the signals and constructing a corresponding deep convolutional neural network model; and then, the classification output module divides the training set data into auditory evoked signals and noise signals according to the spatial distribution characteristics of the single auditory evoked signals extracted from the characteristic learning module.
8) The above-described spatial distribution enhancement operation is performed on the unknown signal to obtain a 2D view thereof. Each unknown signal is a data set in a two-dimensional matrix form with the size of M x N, and M is the number of the brain magnetic sensors; and N is a set time length.
9) And respectively inputting the 2D views of the unknown signals into the trained single auditory evoked signal detection model to obtain corresponding auditory evoked signal detection results.
10) And determining which data are auditory evoked signals and which data are noise signals in the unknown magnetoencephalogram signals according to the auditory evoked signals detection result obtained in the step 9).
Further, the noise includes some environmental noise signals, eye movement and cardiac artifact noise signals, and other signals emitted by the brain.
Further, the environmental noise signal, such as power frequency noise, can be removed by filtering at 50Hz or 60 Hz.
Further, the eye movement and the cardiac artifact signals can be removed by a signal space projection algorithm or an independent component analysis method.
Further, other signals emitted from the brain, such as the alpha signal and the beta signal, can be removed by filtering at 10Hz and 20 Hz.
Further, the neighborhood radius r should be dependent on the device that measures the magnetoencephalogram.
Further, the correlation coefficient threshold c should be determined according to the apparatus for measuring the magnetoencephalogram.
Further, the spatial resolution of the 2D view is related to the number of sensors that the apparatus for measuring the magnetoencephalogram has.
The following is an application example of the present invention:
first there is a known single measurement of the auditory evoked signal. The example signals used in this embodiment are brain magnetic signals measured by SQUID-MEG equipment of CTF, canada, which has 274 sensors, so 274 sets of signals are measured. The measurement of a single auditory evoked signal lasts approximately 0.3 seconds, with a sampling rate of 600Hz, and thus a data length of 0.3 x 600. The single auditory evoked signal fragment is a data matrix of 274 x 180. A single measurement of the auditory evoked signal is employed. There are 197 such single auditory evoked signals in total.
There is also a known noise signal, which should be the same duration as the auditory evoked signal, and a data matrix with data size of 274 x 180. And measured in the same environment as the single auditory evoked signal. There are 200 random noise signals.
The known auditory evoked signals and the noise signals are subjected to signal preprocessing. Including 60Hz, 120Hz, 180Hz, 10Hz, 20Hz filtering operations. Filtering at 60Hz and multiples thereof is intended to remove power frequency noise (the segment of data is measured in europe), filtering at 10Hz is intended to remove the alpha signal, and filtering at 20Hz is intended to remove the beta signal. Meanwhile, signal space projection operation is carried out on the eye movement artifact and the heartbeat artifact signals so as to eliminate the influence of the eye movement artifact and the heartbeat artifact on the magnetoencephalogram signals.
The known single auditory evoked signal and the noise signal are subjected to a signal enhancement processing operation. Each of the 274 sensors is first treated as a selected sensor in turn. The neighborhood of the selected sensor is defined by centering on the location of the selected sensor and by 0.022 x 1.7 meters as radius, and the sensors within the neighborhood of the selected sensor may be referred to as neighborhood sensors. The correlation coefficient between the signal detected by the selected sensor and the signal detected by each of the neighboring sensors is calculated separately. If the correlation coefficient is greater than or equal to 0.8, the signals detected by the adjacent sensors are superposed on the signals detected by the selected sensors by the weight of the correlation coefficient. If the correlation coefficient of the two is less than 0.8, no action is taken. And (4) taking the number of the final superposed signals as the number of the field signals, and taking the obtained signals as the signals detected by the final selected sensor. But if the number of the superimposed domain signals is 0, no operation is performed on the selected signal. Fig. 3 is a 2D view rendered with a single acoustic evoked signal from a raw acquisition and a single acoustic evoked signal after enhancement.
The radius of the above-mentioned field is selected to be 0.022 × 1.7 meters, and according to the distribution of the sensors, it can be known that there are 7-10 field sensors in the radius of the neighborhood, and it can be known through statistics that this parameter is relatively in accordance with this algorithm in this embodiment. In addition, the correlation coefficient threshold is also statistically selected to be 0.8 in the present embodiment.
The 2D view is rendered using the single auditory evoked signal and the noise signal subjected to the signal enhancement operation described above. Since the spatial distribution of the sensors is known. The enhancement signal can be color coded according to its spatial distribution, mapped to the corresponding locations, resulting in a 2D view describing the spatial distribution of the signal with a resolution of 224 x 224 pixels. Finally, 197 2D views of the single auditory evoked signal and 200 2D views of the noise signal can be obtained. There are 397 2D views as our training set.
And training the pre-training network GoogLeNet by using the obtained training set. The structure of the pre-training network GoogLeNet is adjusted correspondingly, so that the recognition of single auditory evoked signals can be completed. The main adjustment is as follows: the number of filters of the last fully connected layer is modified to be equal to the number of classifications (i.e., single auditory evoked signal versus noise signal). Meanwhile, the learning rate factor of the full connection layer is increased, so that the data can be converged more quickly; the number of output classes of the designated network in the classification layer is modified to 2. The classification layer is replaced with a new classification layer without class labels. When training the network, it will automatically set the output class of the layer; and modifying the last dropout layer, wherein the dropout layer is mainly used for randomly setting the parameter transmitted from the previous layer to be 0 so as to prevent the network from being overfitted. Here the probability of setting the layer setting element to 0 is adjusted from 0.5 to 0.6. The network is then trained using a training set.
The trained network can be used for detecting single auditory evoked signals of original training data and also can be used for detecting single auditory evoked signals existing in unknown brain magnetic signals. In an embodiment, the trained network is used to detect the original training data, i.e. the single auditory evoked signals in 397 2D views, with a detection success rate of 100%. A single auditory evoked signal in the unknown data is also detected. The unknown data contains 199 single auditory evoked signals and 200 noise signals. The final detection success rate was also 100%. As shown in fig. 4, is a confusion matrix representing the detection results.
The above embodiments are only intended to illustrate the technical solution of the present invention and not to limit the same, and a person skilled in the art can modify the technical solution of the present invention or substitute the same without departing from the spirit and scope of the present invention, and the scope of the present invention should be determined by the claims.