{'fraction_non_alphanumeric': 0.021804077781854395, 'fraction_numerical': 0.007966874574139107, 'mean_word_length': 5.2783810463968415, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Study on nonlinear analysis of MEG in patients with brain diseases

Magnetoencephalography (MEG) is a kind of brain function detection technology without trauma, which detects the electromagnetic physiological signal in the brain. It is widely used in depression research. We used permutation entropy, improved permutation entropy, conditional entropy to study the difference of MEG between depressed patients and healthy people, respectively. We implement three different entropy algorithms and compare the relative differences of entropy values in different brain regions of healthy people and depression patients under positive, neutral and negative emotional stimuli. The experimental results show that the relative difference of conditional entropy > the relative difference of improved permutation entropy > the relative difference of permutation entropy, and the difference of entropy value in the frontal region of human brain is the most obvious, which may provide the basis for the diagnosis of depression.


Introduction
Depression is a kind of mental illness, clinical manifestation is long-term depression, trapped in the emotional state of depression cannot extricate themselves, to the past like things obviously lost interest, and even more self-injury, suicide behavior. In recent years, with the development of social economy, the pace of life is accelerated, the pressure of work is increased, and the emotional impact is increased, resulting in the incidence of depression increasing year by year. According to statistics, by 2020, depression will become one of the second largest diseases in the world leading to the global burden of disease [1]. There are now more than 26 million patients with depression in China, and the number is still rising, but less than 10% of them are treated [2].
MEG is an important member of the family of brain imaging devices, it is an irreplaceable advanced technology in brain science research and diagnosis of major brain diseases, which can non-invasively detect brain function and record electromagnetic signal information in the brain in real time. MEG detection has effectively prevented and treated many functional diseases, such as psychosis, epilepsy, Parkinson's disease and so on. In the field of brain magnetic measurement, the optical pump atomic magnetometer is expected to be a quantum magnetic sensor to replace the superconducting quantum interferometer type magnetometer in the next generation of magnetoencephalography equipment [3]. (1) Resting state MEG depression [4]. Resting state refers to the analysis of low-frequency electromagnetic signals caused by brain activity, abnormal brain nerve electromagnetic changes will produce slow wave activity in the relative brain function area. Nugent [5] et al. performed static MEG before and after taking ketamine in 35 untreated patients with severe depression and 25 healthy controls. Both groups of data showed increased power spectrum after taking ketamine gamma. Also, in the group of patients with severe depression, gamma power was found to be independent of the magnitude of antidepressant effects. Figure 1 shows part of the MEG waveform in different frequencies. (2) The study of event-related magnetic fields applied to MEG for depression is mainly on the low-frequency characteristic spectrum in the stimulus state. The stimulation modes can be generally divided into memory task stimulation [6], somatosensory stimulation [7], auditory stimulation [8] and emotional picture stimulation [9]. As for the stimulation of emotional pictures, Veronica et al. [10] showed that the activity of the anterior cingulate gyrus of normal people and depressed people gradually decreased after they viewed a large number of negative emotional stimulation pictures, while the anterior cingulate gyrus activity of depressed people increased on the contrary.
Our work is mainly divided into three stages around the study of the differences of MEG between depressed patients and healthy people. In the first stage, we use permutation entropy and conditional entropy algorithm to analyze the MEG. In the second stage, we improve the permutation entropy algorithm and analyze the MEG again with the improved permutation entropy calculation. Finally, we compare the relative differences of several methods.

Brain structure
The human brain is the main nervous system of the human body. The sensory organs of the human body, such as eyes, ears and nose, receive external stimuli and then pass them into the nervous system of the brain, and the nervous system of the brain gives corresponding information feedback. The human brain can be divided into cerebellum, brainstem, diencephalon, and telencephalon. The terminal brain is mainly divided into the left hemisphere of the brain and the right hemisphere of the brain, which is the most advanced part of the human central nervous system. The surface of the hemispheres is uneven and the inside is full of grooves and cracks. We can divide the hemisphere into five lobes, the frontal, occipital, parietal, temporal, and insula, based on these sulci, as shown in Figure 2.

Permutation entropy and conditional entropy
Permutation Entropy has extraordinary advantages in the analysis of nonlinear time series, and can better the mutation of dynamics. Its main advantages are: No complex calculation but with good noise resistance; Its arithmetic is sensitive to the change of time, thus have high discrimination to time; It has strong recognition to the mutational information, thus more effective and conventional when dealing with that information. In addition, it could be used to show the characteristics of nonlinear dynamics and the degree of irregularity of time series. Different with permutation entropy, conditional entropy represents the probability of information produced in time series of nonlinear dynamics system. Greater the entropy number is, which stands for more possible the information is produced, more irregular the time series is.

Arithmetic of permutation entropy
Permutation entropy proposed by Bandt [11], the basic principle of permutation entropy is as follows: Assume a time series: { ( ), = 1,2 ⋯ , }, The phase space reconstruction of the sequence results in the following matrix

Arithmetic of conditional entropy
The algorithm definition of conditional entropy is described as follows [12] [13]: Assume the original time series is (1), (2), ⋯ , ( ), There are a total of N points, and parameters are used to represent the value of the embedded dimension and the threshold value.
(1) The original time series is reconstructed into a set of m-dimensional sequences: (2) Calculate the distance between the vectors defined in (1), use d[ ( ), ( )] represents the distance between X( )and X( ), that is: Take the logarithm of ( ), and then averaging it, donating as ∅ ( ), which is :

Improved permutation entropy
The improved permutation entropy is based on the original permutation entropy algorithm by adding the treatment of equivalent case in time series [14], so as to have a better response the characteristics of the nonlinear system. In addition, the length of the data processing requirements are lower and have better noise resistance. The improved permutation entropy is simple to calculate and can better reflect the subtle changes in time series. The improved permutation entropy algorithm has better advantages in the study of the mixture and deterministic process.

Data processing and analysis
In this experiment, we studied the data of brain Magnetoencephalography of emotional picture stimulation in depression patients and healthy subjects. By studying the difference of brain magnetic entropy between healthy people and depression patients under different conditions, the purpose of distinguishing depression patients is better. In this study, 17 groups of different magnetoencephalographic signals were obtained from the brain center of the affiliated brain hospital of Nanjing Medical University. Each topic is stimulated by three different types of images, positive, neutral, and negative images from the international emotional gallery. MEG signals were collected after stimulation, including 275 channels. The collected signals can be divided into 161 data fragments because each set of keys is 160, each type of a total of 3 pictures.

Nonlinear study of magnetoencephalography using permutation entropy
In the process of spatial reconstruction, it is very important to select appropriate embedding dimensions and arrangement factors [15], because both of them have important influence on nonlinear dynamic characteristics. In order to differentiate healthy people and depression patients, it is generally believed that the larger the difference between the two is, the more obvious the effect is. After many experimental comparisons, we found that the best option is when the embedding dimension is 4 and the scale factor is 8. Figure 3 shows the positive image stimulation experiment with these parameters which is the most obvious one among others. Figure 4 shows the permutation entropy under negative stimulation with these parameters.  On the basis of selecting the best embedding dimension and scale factor, we studied depression patients and healthy subjects under positive, neutral and negative picture stimulation, respectively.
Since the region that regulates human emotion is the frontal lobe front of the cerebral cortex, we mainly studied the broken line diagram of the permutation entropy value of 25 channels each of the left and right frontal lobes. Where 1-25 of the abscissa corresponds to 31 to 55 channels of the left frontal lobe and 26-50 is 160 to 184 channels of the right frontal lobe.   Figure 5(a) we can see that for healthy subjects, the entropy values of 25 channels in the left frontal lobe were not significantly distinguished under receiving different stimuli. The basic trend of 25 channels in the right frontal lobe under different stimuli was that the permutation entropy value under positive picture stimulation was slightly larger than that under negative picture stimulation. From Figure  5(b) we can see that for depression patients, whether the channel of left frontal lobe or right frontal lobe, the permutation entropy value of positive picture stimulation is always greater than that of negative picture stimulation. In general, the average permutation entropy value of ordinary patients was significantly larger than that of depression patients. These differences lay the foundation for a better distinction between depression patients.
To verify that we can distinguish between healthy people and depressed patients from the channels mentioned above (channel 31 to 55 channel), in addition to making conclusions from the graphs, similar results can be also concluded from T tests through SPSS software. Each set of data in different stimuli will, of course, have its own T test, but here will only show one of them because of the limitation of space. According to the T test results from Table 1, the significance (2 tails) was less than 0.05, which means there is a significant difference in the value permutation entropy between the healthy subjects and depressed patients. This conclusion is consistent with that from the graphs.

Nonlinear study of magnetoencephalography using conditional entropy
In the calculation of conditional entropy, the selection of embedding dimension and threshold is also quite important. According to the related research and the introduction of literature [16][17][18][19], in order to make the difference of conditional entropy between the two groups more obvious, this paper takes 2  m and 2 . 0  r . After the parameters are selected, we performed conditional entropy calculations for depression patients with positive, neutral, and negative picture stimuli in healthy subjects.  According to the value of conditional entropy calculated from Figure 6 we can see that the conditional entropy of healthy people under negative picture stimulation is generally higher than that of depression patients. Different from the permutation entropy algorithm, the difference between the channel 58-76(left occipital region) and 190-208(right occipital region) is not obvious. The law of the conditional entropy of both under positive and neutral picture stimulation is similar to that of negative picture stimulation. From Figure 7 we can see that the conditional entropy values of depression patients and healthy subjects under different stimuli are different. The general trend is that the conditional entropy value under neutral stimulation is greater than that of positive stimulus. Differentiation in the left occipital region (58-76 channels) depression patients are more differentiated, different stimuli produced by the obtained conditional entropy value gap is obvious. However, the conditional entropy of healthy subjects in the left occipital region is difficult to distinguish between positive and negative stimuli, and the gap between neutral stimuli and the other two is small, and the identification is difficult. In the right occipital region (190-208 channels), it is difficult for both healthy subjects and depression patients to distinguish the conditional entropy values produced under positive and negative stimuli. Therefore, we think that if we use conditional entropy algorithm, it is better to distinguish the brain region of depression patients from healthy people as left occipital region. From the value of mean conditional entropy, the average entropy of healthy subjects was larger in all brain regions than in depression patients, and the difference was the largest in occipital region.
Again, in order to verify the validity of the experimental results from statistical analysis perspective, T test is applied here.  T test results from Table 2, the significance (2 tails) was less than 0.05, which means there is a significant difference in the value conditional entropy between the healthy subjects and depressed patients. This conclusion is consistent with that from the graphs.

Nonlinear study of magnetoencephalography using improved conditional entropy
The improved permutation entropy is further optimized on the basis of permutation entropy algorithm, which obtains that the permutation entropy values of depression patients and healthy subjects are more different and have better anti-noise ability. According to the above, the optimal effect can be achieved when embedding dimension We mainly studied on the left frontal channel. In Figure 8, the abscissa 1-25 corresponds to the 31 to 55 channels of the left frontal lobe. Based on the calculated entropy, we can get that in almost every channel in the left frontal lobe, the improved permutation entropy of healthy subjects is larger than that of depression patients. By calculating healthy subjects and depression patients, we found that the improved permutation entropy of healthy subjects under positive, neutral and negative emotional stimulation was higher than that of depression patients, and the difference between left and right frontal regions was most obvious, which was consistent with the previous conclusion with permutation entropy algorithm, which also indicated that the brain complexity of healthy subjects was higher than that of depression patients. Where p E represents the entropy of depressed patient and h E represents the entropy of healthy subjects.
The results of average differences of the three algorithms are shown in the Table 3. By comparing the mean difference of entropy between healthy subjects and depression patients under the most significant channel of three algorithms, we can obtain the advantages and disadvantages of the three algorithms in the comparison of difference degree.
By comparing the average difference in Table 1, we can get the relative difference of conditional entropy > the relative difference of improved permutation entropy > the relative difference of permutation entropy. This difference also reflects the "improvement" of the improved permutation entropy.

Discussions
The essay offers permutation entropy, conditional entropy and improved permutation entropy algorithm, as effective tools for nonlinear study of MEG. The aim of this paper is to study the difference of entropy values of MEG in healthy people and depressed patients under different conditions: (1) Overall, the permutation entropy values, conditional entropy values and improved permutation entropy values of healthy subjects under positive, neutral and negative emotional stimuli are higher than that of depressed patients. (2) Using permutation entropy and improved permutation entropy algorithm, it is best to distinguish between healthy people and depressed patients&apos; brain regions is the left frontal lobe; using conditional entropy algorithm, it is best to distinguish between healthy people and depressed patients&apos; brain regions is the left occipital region. (3) Compare the the average difference of entropy values in Table 1, we can get the relative difference of conditional entropy > the relative difference of improved permutation entropy > the relative difference of permutation entropy. The general conditional entropy should also be different in the frontal region, but the image frontal region we get is not different, only the occipital region has a difference, which may be related to the small number of samples we selected, resulting in a larger error, and the later stage needs further improvement.

Conclusions
By this experiment, we know that, no matter the healthy people the permutation entropy and conditional entropy are all greater than patients with depressed to some extend. Among which, When using permutation entropy to study the MEG of depressed patients and healthy people, the permutation entropy of 25 channels in the right frontal lobe stimulated by positive images of depressed patients showed a more significant difference from that of healthy people. The permutation entropy of healthy people was slightly greater than that of depressed patients in this area. When the conditional entropy was used to study the samples, the difference in permutation entropy between depressed patients and healthy subjects in the left occipital region (58-76) channel of the brain was the most obvious when the subjects were stimulated by neutral images. Finally, the results of the improved permutation entropy show that the entropy values obtained by the improved permutation entropy has a better distinction between healthy subjects and depressed patients than that obtained by the regular permutation entropy because the average difference. Moreover, the permutation entropy value of the brain in almost every channel in the left frontal area of the brain of depressed patients and healthy subjects has a large difference. The entropy value of healthy people's brains is higher than that of depressed people's brains, indicating that the complexity of healthy people's brains is higher than that of depressed people's brains.