Anomaly Detection in Electroencephalogram Signals Using Unconstrained Minimum Average Correlation Energy Filter

: Problem statement: Electroencepharogram (EEG) is an extremely complex signal with very low signal to noise ratio and these attributed to difficulty in analyzing the signal. Hence for detecting abnormal segment, a distinctive method is required to train the technologist to distinguish the anomalous in EEG data. The objective of this study was to create a framework to analyze EEG signals recorded from epileptic patients by evaluating the potential of UMACE filter to detect changes in single-channel EEG data during routine epilepsy monitoring. Approach: Normally, the peak to side lobe ratio (PSR) of a UMACE filter was employed as an indicator if a test data is similar to an authentic class or vice versa, however in this study, the consistent changes of the correlation output known as Region Of Interest (ROI) was plotted and monitored. Based on this approach, a novel method to analyze and distinguish variances in scalp EEG as well as comparing both normal and abnormal regions of the patient’s EEG was assessed. The performance of the novelty detection was examined based on the onset and end time of each seizure in the ROI plot. Results: Results showed that using ROI plot of variances one can distinguish irregularities in the EEG data. The advantage of the proposed technique was that it did not require large amount of data for training. Conclusion: As such, it was feasible to perform seizure analysis as well as localizing seizure onsets. In short, the technique can be used as a guideline for faster diagnosis in a lengthy EEG recording.


INTRODUCTION
EEG signals detect the electrical activity of the brain and their use as inputs for epilepsy detection, Brain-Computer Interfacing (BCI) and wake-sleep studies has gained interest from researchers in these fields. In BCI, EEG signals are used as a communication medium to help locked-in syndrome patients to communicate with the outside world. In fact, EEG signals are the only responses that can be monitored and read by clinicians to detect responses of the locked-in syndrome patient. In early days, EEG was employed to detect tumors and epilepsy. Currently, EEG signals recorded by epilepsy monitoring units are most often used to localize the epilepsy. This is achieved by monitoring the EEG patterns and behavior during the occurrence of epilepsy. This procedure requires the EEG to be recorded for a few days and a few series of epilepsy attacks must be scrutinized for confirmation purposes before surgical treatment.
Numerous research studies have been undertaken to enhance the detection, prediction and understanding of epilepsy. Ongoing studies seek to improve existing methods. Earlier study by other researchers developed algorithms based on pattern recognition of spikes and sharp waves. The shape and duration of the events is critical for detection. The difficulty in this method is to identify the spike and sharp waves in real situations, since both waves may be obscured by the background and noise, making it difficult to obtain the defined pattern [1] . Mohseni et al. [2] proved that the variance method performs better than methods using other tools, such as time-frequency distributions and the Lyapunov exponent. However, the threshold value needs to be determined for processing. Maiwald et al. [3] states that the aforementioned detection methods are not comparable since their terms are mostly unstandardized. In essence, most researchers prefer ease of implementation with moderate results over complicated methods with excellent effects.
Epilepsy research frequently uses EEG as an input. Currently, EEG remains in use and has gained attention for further applications such as seizure prediction purposes. EEG is attractive because it is an easy to obtain, non-invasive and inexpensive method to acquire signals from the brain. Some previous EEG processing methods used intracranial EEG (iEEG) [4][5][6][7] , resulting in many problems. iEEG is limited to acute epilepsy cases only. It is invasive and thus only certain infirmaries practice iEEG. Our study thus utilizes scalp EEG rather than iEEG.
This study deals with scalp EEG data from the EEG monitoring lab. Epilepsy patients go through the monitoring session to localize and produce more accurate results before epilepsy surgery. Patients stay for a few days in the monitoring lab and a few episodes of seizure attacks are recorded. This procedure is mandatory before surgery. Hence, the specialists must examine long hours of recording from a series of attacks. There is thus a need for computerized screening to assist in localizing the time of seizure attacks. This may also shorten the time required for diagnosis [1,8,9] . Furthermore, dealing with huge amounts of EEG data requires fast and trouble-free implementation to produce accurate and prompt results. In this study, the UMACE filter is chosen for processing the EEG data, since it can be employed to handle large amounts of data and produce prompt results.

EEG signals and correlation filters:
Advanced correlation filters, such as MACE and UMACE, are usually applied in the field of image processing. In those contexts, they are mostly used in authentication and identification processes. The advantage of MACE is that it has the ability to provide good discrimination without the need for impostor training images [10] . In image processing, these correlation filters can be designed to accommodate the intrinsic amplitude variability of images in the training set while being tolerant to noise pervading the images [11,12] . The MACE filter has been improved and can produce quick results, but it involves complex calculations [13] . UMACE is easy to implement, provides first-rate results and does not require large numbers of training images [10,14] .
It is a well known fact that the EEG signal is complex and changes rapidly. For certain cases, such as epilepsy, no specific pattern has been identified as indicative of a specific situation. Inter-subject variability also causes difficulty when dealing with biomedical signals such as EEG data [15] . In epilepsy, the UMACE filter may be able to detect abnormal conditions since the seizures of an individual usually exhibit similar patterns. However, this pattern cannot be compared with those of other patients, since no two patients exhibit similar seizure patterns [4] . The UMACE method is applied to EEG data in this study, since it can tolerate the inter and intra-subject variability for certain degrees of change [10] .
As discussed by Savvides et al. [12] , the MACE filter was developed by Mohalanobis et al. [16] in an effort to reduce the large sidelobes observed in the equal correlation peak synthetic discriminant filter (ECP SDF filter). MACE was developed to aid detection of sharp correlation peaks in one region of the plane. The MACE filter minimizes the average correlation output from the training images while simultaneously satisfying the correlation peak constraint at the origin. In this way, the correlation plane value will be close to 0 in every location except that of the target object, which will produce a strong peak. The closed-form equation of a MACE filter is given by: where, D is a diagonal matrix with the average power spectrum of the training image placed along diagonal elements. X consists of the Fourier transform of the training images lexicographically re-ordered and placed along each column. u is a column vector containing the desired correlation output at the origin for each training image. UMACE minimizes the average correlation output while maximizing the correlation output at the origin. The equation for a UMACE is as in (2): where, m is a column vector containing the means of the Fourier transforms of the training images. UMACE filters are computationally more attractive since the inversion of only a diagonal matrix is required. Noise tolerance can be built in to the filters as [10] . This is done by replacing D with D', where D'= αD + sqrt (1-α 2 ) C and C is a diagonal matrix containing the noise power spectral density. For white noise, C is the identity matrix with α range from 0 to 1 and is chosen based on the trade-off between noise tolerance and discrimination. Note that α = 1 yields a MACE filter.

MATERIALS AND METHODS
The EEG data used in this study were recorded using the Medelec-Profile system by Medelec (Oxford Instruments, United Kingdom). The analysis used EEG data recorded using bipolar montage. The EEG signals were digitally sampled at 256 Hz and bandpass filtered at settings of 0.5-70 Hz. The subjects used in this study were six patients at the Science University of Malaysia Hospital in Kubang Kerian and their ages ranged from 18-24 years. Patients were admitted for video EEG monitoring for evaluation prior to an epilepsy surgery. The results were tested against the time of seizure observed through video observations.
During the video-EEG monitoring process, all 19 channels of data were recorded. For clinical onset analysis, both video and EEG data recordings were synchronized so that the stored video EEG data could be used for offline analysis. This preliminary work used and analyzed EEG data from only one channel, the most prominent channel based on the recording. EEG data from the Medelec system was changed into .txt before being processed using a matlab function. The most affected channel was chosen as an input based on amplitude changes in the EEG data. Three seconds from the normal EEG data was chosen as a training portion for the filter and then the rest of the input from that channel was used to test the UMACE method.
UMACE and MACE usually use two-dimensional data for inputs such as images. In this analysis, the UMACE filter was used on a one-dimensional scalp EEG signal. To create a 2-D signal from a 1-D format, time delayed methods were used to transform the signal to 2-D data. First, the training data were selected from the normal region of the EEG recording. This was done by choosing three consecutive seconds from the normal region as the training data. Next, the selected training data were rearranged into 2-D data. Figure 1 shows the overall system of our method. A specific amount of training data acted as input to the filter and the test data was then correlated with the designed filter to produce the correlation output. In most studies, the indicator for discrimination or classification is the Peak-to-Side lobes Ratio (PSR) measurements from correlation output [11,12,14,17] . However, in this study instead of the PSR value, we monitor the consistent changes in the correlation output. Some small changes found in the correlation output were regarded as different segments or situations of the EEG data were compared.
Consistent changes appeared in the middle row of the plot, called the Region Of Interest (ROI). The changes in the ROI were calculated and used as an input to produce the final plot, labeled the Sum of ROI, shown in Fig. 1. Normal segments usually exist around the origin, whereas the abnormal parts produce very high peak values compared to the normal parts. The second row shows the output with the epilepsy region as the testing data and the bottom row shows the result of the correlation output with the post-epilepsy region as the testing input. As can be seen, the results of the 2-D plot are not obvious for any testing input. However, some distinctions are observed in the 3-D plot between training and testing data due to the occurrence of some clear peaks in the 3-D plot. These peaks indicate certain specific values in the plot. The Epilepsy segment testing input produced mainly sharp peaks, while the post-epilepsy testing data produced less spiky peaks than the epilepsy region. The smallest peaks are observed in the normal region data. The sum of these peaks in the ROI produces the final graphs that are shown Fig. 3 in the next section. The characteristic of the epilepsy region is highlighted in the red box.

RESULTS AND DISCUSSION
As shown in Fig. 3, UMACE filter is able to discriminate the percentage changes in the ROI when the normal segment is compared to the epilepsy portion; these changes can be calculated and depicted in graph form. The training data is chosen using an empirical method based on recorded data. Consistent results are achieved when this technique is used to select the training data.
Results also showed that low values are achieved for normal regions used as training and testing data, reflected in small changes in the plot. The variations in the epilepsy plot are distinguished by high values, in contrast to the plots during normal regions. The most obvious feature in the seizure region is the high lofty correlation value. This pattern continues for a certain period of time without decreasing towards zero (without fluctuating to 0), as highlighted by the red boxes in Fig. 3-8.  1  22  145  21  135  Patient 2  199  337  214  350  Patient 3  180  240  180  240  Patient 4  64  95  66  892  764  892  Patient 5  256  319  245  350  Patient 6  242  335  242  305 other patients may exhibit the EEG data changes before the epilepsy attack, as shown in Fig. 8. It is observed here that the changed value occurred 50 seconds before the actual epilepsy attack. Table 1 shows the comparison of UMACE and video observations. For patients 1, 2 and 6, the UMACE method is unable to perfectly detect the duration as compared to the video. For patients 3, 4 and 5, the UMACE detection is accurate and better than the video observation. For patient 4, the UMACE categorized all the EEG data as seizure at 66 seconds, though from the video observation, the medical practitioner identified some unknown responses from the patient during 95-764 sec. Although the UMACE filters produced late detection in several cases, the strength of evaluating and comparing the changes without requiring a large amount of training data makes it a suitable technique to aid in diagnosis and it can also serve as a guideline to assess whether a patient has recovered from an attack.

CONCLUSION
The results of this study show that the UMACE filter is able to detect changes in scalp EEG data recorded using bipolar montage. In EEG data, changes between the normal and abnormal state of a particular individual must be highlighted to distinguish between normal and epilepsy portions of the data. UMACE can be used to detect these changes in a group of data from the same source. Constant conditions in the EEG signal produced minimal changes in the UMACE output, while different states produced immense changes observable in the plot. Since this method is suitable for bipolar montage, the database from hospitals can be directly applied without any conversion of the original database.
Furthermore, the proposed method only utilizes three consecutive seconds of normal data as the training input, making implementation practically effortless. The results allow normal and epilepsy states to be distinguished on the basis of EEG data. The accuracy of our method is also adequate, since seizure detection usually suffered only small limitations. For instance, accurate prediction required careful patient-specific tuning and usefulness for poorly localized epilepsies is limited. The UMACE filter can be used to aid diagnosis in reading the EEG, assisting specialists to produce faster results and accurate diagnoses.