Introduction

Migraine is painful and persistent brain disorder. Between 23% and 29% in women and between 15% and 20% in men suffer from migraine in the world [1]. There are not satisfactory researches to determine the characterization of migraine completely yet. But recent researches show that diagnosis of migraine patient can be realized by using electroencephalograph (EEG) signals [211]. EEG signals are used to diagnose the migraine under repetitive flash stimulation which is the most preferred method for revealing the characteristics of migraine patients [4]. Since clinical and physiological frequency of interest in EEG is between the 0.5 and 30 Hz, the former researches are about the basic frequency bands of EEG signals (1–30 Hz) [7, 12]. Different kind of diagnosing methods has been proposed for revealing the existence of magnitude increase and phase synchronization changes of alpha rhythm in migraine patients under flash stimulation [5, 6]. In our previous study [5], it was seen that when flash stimulation is applied to migraine patients, there is a magnitude increase at beta band in T5-T3 channels of EEG while there is no magnitude change for healthy subjects [5]. But in this study [5], flash stimulation was applied such that, first 10 s duration was 2 Hz, second 10 s was 4 Hz and last 10 s was 6 Hz frequency. This means, stimulated time period has been constituted 30 s of time period which starts from 2 Hz frequency and increasing 2 Hz per 10 s. But which of these flash stimulation frequencies gives better results and which flash stimulation frequency is more effective than others to diagnose migraine? Also, how much flash stimulation duration is necessary to detect the characteristics of migraine? Therefore, in this study we tried to clarify these questions. According to result of this previous study we decided T5-T3 channel of EEG signals can be important to detect the migraine and we selected this channel to analyze the flash stimulation frequencies and time duration. Artificial neural network (ANN) classifier has been used to determine which flash stimulation frequency is most effective. After the determination of most effective flash stimulation frequency, we have analyzed the stimulation periods to determine how much time duration is necessary to detect magnitude increase of migraine patient. In order to determine the necessary time duration, we analyzed the power spectrums and then verify them by using ANN classifier. In this study power spectral densities (PSDs) of EEG signals were obtained by using Burg Autoregressive (AR) method, since Burg method ensures a stable AR model and is computationally efficient [13].

Materials and methods

Data recording

EEG data obtained from Kahramanmaras Sutcu Imam University Neurology Department. Migraine headache was diagnosed according to the diagnostic criteria proposed by the International Headache Society. In all patients, EEG recordings were obtained with an 18-Channel Nicolet One Machine. Electrodes were positioned according to the international 10–20 system, at Fp1, Fp2, F7, F3, Fz, F4, F8, T3, C3, C4, T4, T5, P3, Pz, P4, T6, O1 and O2. The EEG signals were sampled at a rate of 256 Hz. Time periods of each 2, 4 and 6 Hz stimulus frequency was taken 10 s. For each stimulus frequency, a 10 s stimulus interval was followed by another 10 s rest period. The migraine group consisted of fifteen patients (2 males, 13 females) and control group consisted of fifteen healthy subjects (5 males, 10 females). The age range of both migraine group and healthy subjects is between 20–35 years. Healthy subjects did not have any neurological or psychiatric disease; migraine group was in the interictal state and did not have any neurological or psychiatric disease except migraine.

Spectral analysis of EEG signals

In this study, AR parametric modelling was used to analyze the EEG signals. Since in order to identify EEG signal changes, the AR methods gives better performance compared to the other methods [13]. In this model, the amplitude of a signal at a given period is obtained by summing up the different amplitudes of previous samples, and adding estimation error such as white noise. The power spectral density (PSD) estimate is computed from these estimates. AR process of order p is expressed as the following equation:

$$ x(n) = - \sum\limits_{k = 1}^p {a(k)x(n - k) + w(n)} $$
(1)

Where a(k) are the AR coefficients and w(n) is white noise of variance equal to σ 2.

The Burg method is based on minimizing forward and backward prediction errors and estimates the reflection coefficient. From the estimates of the AR parameters, PSD estimation is formed as [1417]:

$$ {\hat{P}_{BURG}}(f) = \frac{{{{\hat{e}}_p}}}{{{{\left| {1 + \sum\limits_{k = 1}^p {{{\hat{a}}_p}(k){e^{ - j2\pi fk}}} } \right|}^2}}}, $$
(2)

Where \( {\hat{e}_p} = {\hat{e}_{f.p}} + {\hat{e}_{b.p}} \) is the total least squares error.

The selection of the model order is crucial factor of the model-based methods. Since definite peaks do not exist when the chosen degree is low and when the order of a model is very high, misleading and wrong peaks occur and spectra deteriorate. In the literature, several criteria are suggested to find the model order [18]. But one of the better known criteria for selecting the model order has been proposed by Akaike [19], called the Akaike information criterion (AIC). In this study, model order of the AR method was taken as 10 by using AIC. In this study we used MATLAB software to compute AR PSDs of EEG signals. Sampling frequency is 256 and window length is selected as 256.

Neural network classifier

In this study we used multi layer perceptron neural network (MLPNN) for the classification. Because MLPNN has a rapid execution of the trained network, which is particularly advantageous in signal processing applications [20, 21]. MLPNN used in this study consists of an input layer with neurons representing input variables to the problem, an output layer with neurons representing the dependent variables, and one hidden layers containing neurons to help capture the non-linearity in the data. The number of output neuron is chosen as two, and the number of hidden unit neuron is chosen as 50. Inputs are power spectral density of EEG signals. In our MLPNN gradient descent with momentum and adaptive learning rate backpropagation training function is used. This ANN training function updates weight and bias values according to gradient descent momentum and an adaptive learning rate. Backpropagation algorithm is used to calculate derivatives of performance with respect to the weight and bias variables. Each variable is adjusted according to gradient descent with momentum.

We applied the PSD values obtained under flash stimulation for both migraine and healthy subjects as MLPNN inputs. In this study, 24 of the 30 subjects (80% of overall data) were used for training and the rest (20% of overall data) were used for testing. In classification, the aim is to assign the input patterns to one of the two classes, usually represented by outputs restricted to lie in the range from 0 to 1, so that they represent the probability of class membership. The outputs are represented by unit basis vectors:

  • [0 1] = Normal

  • [1 0] = Migraineur

Evaluation of performance

After utilizing the data obtained from ANN, we evaluated the performance of flash stimulation frequencies and time periods by using sensitivity, specifity and accuracy. In order to analyze the output data obtained from the application, sensitivity (true positive ratio) and specifity (true negative ratio) are calculated by using confusion matrix. The sensitivity value (true positive, same positive result as the diagnosis of expert neurologists) was calculated by dividing the total of diagnosis numbers to total diagnosis numbers that are stated by the expert neurologists. Sensitivity, also called the true positive ratio, is calculated by the formula:

$$ {\hbox{Sensitivity}} = {\hbox{TPR}} = \frac{\text{TP}}{{{\hbox{TP}} + {\hbox{FN}}}} \times {\hbox{100\% }} $$
(3)

On the other hand, specifity value (true negative, same diagnosis as the expert neurologists) is calculated by dividing the total of diagnosis numbers to total diagnosis numbers that are stated by the expert neurologists. Specifity, also called the true negative ratio, is calculated by the formula:

$$ {\hbox{Specifity}} = {\hbox{TNR}} = \frac{\text{TN}}{{{\hbox{TN}} + {\hbox{FP}}}} \times {\hbox{100\% }} $$
(4)

Term of accuracy is formulated below:

$$ {\hbox{Accuracy}} = \frac{{{\text{Sensitivity}} + {\text{Specifity}}}}{{2}} \times {\hbox{100\% }} $$
(5)

Results and discussion

In order to determine which frequency is the most effective for the detection of migraine we used a method based on magnitude increase in the migraine patients under flash stimulation at the beta band of T5-T3 channel of EEG. We can see that there is a magnitude increase at the beta band in the migraine patients under flash stimulation; on the contrary, healthy subjects do not have any magnitude increase mentioned in former research [5]. Besides as it can be seen from Fig. 1 that, the magnitude increase at the beta band for migraine patients under flash stimulation is synchronously increased with stimulation frequency. On the other hand, there isn’t any magnitude change at the beta band for healthy subject under flash stimulation (see Fig. 2). Hence, in order to detect migraine in a better way, stimulation frequency must be increased.

Fig. 1
figure 1

PSD plots of migraine patient both stimulated at different frequency and non-stimulated

Fig. 2
figure 2

PSD plots of healthy subject both stimulated at different frequency and non-stimulated

Another observation is that, healthy subject with stimulation at 4 Hz has lower magnitude increase at the beta band than healthy subject with stimulation at 2 and 6 Hz at the beta band. This magnitude increase emerged by 4 Hz of flash stimulation is too low as compared to magnitude increase of migraine patient under flash stimulation at the beta band. As a result we can use the 4 Hz of flash stimulation frequency is the most effective frequency to detect migraine. 2 Hz flash stimulation is not enough to detect migraine, but, 4 Hz of flash stimulation is adequate for detecting migraine. The results are also verified by using MLPNN and shown in Table 1. MLPNN gives 93.3% accuracy for 4 Hz of flash stimulation. The magnitude increase in migraine patient at the beta band, with 2 Hz and 6 Hz flash stimulation is similar to the magnitude increase of healthy subject. Therefore this similarity decreases the performance of MLPNN. Also we used different classification methods such as radial basis function networks (RBF), learning vector quantization (LVQ) and self organizing map (SOM) networks for comparison purposes. The comparison results are shown in Table 2. As it can be seen easily from the Table 2 that, MLPNN is the best for migraine detection as compared to other network models (RBF, LVQ and SOM).

Table 1 Neural network classification results of flash stimulation frequencies
Table 2 Classification results of different models for each flash stimulation frequencies

After determining the effective stimulation frequency as 4 Hz to detect the migraine, we tried to determine the necessary time duration of flash stimulation by observing the PSD plots and neural network results. Hence, EEG records we used for determining the flash stimulation period are consisted of 2, 4, 6, 8 and 10 s of record periods. Therefore we obtained the PSDs of these records to determine which one is the minimum time period for detecting migraine. As it can be seen from these PSDs, the magnitude increase at the beta band in migraine patients related to flash stimulation is synchronously increased up to 8 s time duration. After 8 s this magnitude increase in migraine patients does not change as seen in Figs. 3b, 4b, 5b, 6b and 7b. On the other hand, magnitude increase at the beta band in healthy subjects related to flash stimulation is decreased up to 6 s. After 6 s this magnitude decrease does not change as seen in Figs. 3a, 4a, 5a, 6a and 7a. Hence, 8 s of record period under flash stimulation is the least time period for determining the migraine effectively. As seen in Figs. 3a, b, 4a and b, the magnitude increase at the beta band in migraine patients with 2 s and 4 s of flash stimulation periods are similar to magnitude increase in healthy subjects. At 6 s of flash stimulation period magnitude increase at the beta band in healthy subject is small, but magnitude increase in migraine patient is not enough to distinguish it from healthy subject as seen in Fig. 5a and b. On the contrary, in 8 s of record period, flash stimulated healthy subjects have almost no magnitude change at the beta band and magnitude increase in migraine patients under flash stimulation is enough to distinguish it from healthy subjects as shown in Fig. 6a and b. The record period longer than 8 s does not change anything and stay at the same level as 8 s of record period as seen in Fig. 7a and b. We also verified the PSD observation results by using MLPNN, and results are shown as Table 3. According to results of ANN, 8 s of record period is the least flash stimulation period. MLPNN gives 93.3% accuracy for 8 s of record period.

Fig. 3
figure 3

PSD plots of healthy subject and migraine patient stimulated data for 2 s of record period a) for healthy subject b) for migraine patient

Fig. 4
figure 4

PSD plots of healthy subject and migraine patient stimulated data for 4 s of record period a) for healthy subject b) for migraine patient

Fig. 5
figure 5

PSD plots of healthy subject and migraine patient stimulated data for 6 s of record period a) for healthy subject b) for migraine patient

Fig. 6
figure 6

PSD plots of healthy subject and migraine patient stimulated data for 8 s of record period a) for healthy subject b) for migraine patient

Fig. 7
figure 7

PSD plots of healthy subject and migraine patient stimulated data for 10 s of record period a) for healthy subject b) for migraine patient

Table 3 Neural network classification results of flash stimulation time periods

As a result, we can say that both migraine and healthy subjects have a different reaction to magnitude increase at the beta band under flash stimulation. In the first 2 s period of flash stimulation both migraine patients and healthy subjects have almost the same magnitude increase at the beta band. But this magnitude decreases at the beta band for healthy subjects while magnitude increases for migraine patients in flash stimulation periods. Afterwards, this magnitude change at the beta band is over to an end in 8 s and longer period.

Conclusions

In this study, we have tried to determine the most effective flash stimulation frequency and the least time period to diagnose the migraine. First aim of this study was to determine the best flash stimulation frequency to detect the migraine. Hence we have determined the most effective flash stimulation frequency as 4 Hz to detect the migraine. Second aim is the determination of the least time period to detect the migraine. We have found the minimum time period as 8 s to diagnose the migraine. According to this result, we determined the best flash stimulation frequency and least time period in EEG recordings for migraine detection based on magnitude increase at the beta band of EEG signal in T5-T3 channel. Also we have studied magnitude change for both migraine and healthy subjects related to flash stimulation frequencies and record period of flash stimulation. Therefore we can conclude that these results can be used effectively to determine the characteristics of migraine patient against flash stimulation.