Abstract

Template matching is an approach for signal pattern recognition, often used for biomedical signals including electroencephalogram (EEG). Since EEG is often severely contaminated by various physiological or pathological artifacts, identification and rejection of these artifacts with improved template matching algorithms would enhance the overall quality of EEG signals. In this paper, we propose a novel approach to improve the accuracy of conventional template matching methods by adopting the dynamic positional warping (DPW) technique, developed recently for handwriting pattern analysis. To validate the feasibility and superiority of the proposed method, eye-blink artifacts in the EEG signals were detected, and the results were then compared to those from conventional methods. DPW was found to outperform the conventional methods in terms of artifact detection accuracy, demonstrating the power of DPW in identifying specific one-dimensional data patterns.

1. Introduction

Template matching has been one of the most popular approaches in pattern recognition over the past few decades [14]. This technique is designed to match parts of a signal (or image) to a predefined template signal (or image) in order to quantify similarity of shapes among test and template signals. Thanks to its applicability in detecting various kinds of patterns, successful applications in a variety of different research fields have been reported. Such fields include eye-region detection [5, 6], human authentication [7], stock change categorization [8], handwriting recognition [9], signature verification [10], and electroencephalogram (EEG) artifact detection [1113].

Pattern-detection studies on EEG signals have been conducted for the purpose of identifying pathologically driven EEG patterns or EEG artifacts [11, 12, 1416]. However, there is still a need for better identification of eye-blink and motion artifacts, so that they can be rejected nearly perfectly in hopes of obtaining more reliable EEG analyses results. Precise automatic identification of artifacts is of great necessity in applications requiring online EEG processing or long-term EEG monitoring. Aside from the need for better artifact detection, there is also a need for better detection of abnormal EEG patterns associated with various brain disorders in order to achieve improved diagnostic decisions or better lesion localization [17, 18].

Dynamic time warping (DTW), a technique for enhanced template matching, has been widely studied in speech recognition [19, 20] and is gradually being applied in other ways, such as shape-boundary matching [21], facial recognition [22], signature verification [23], and EEG pattern detection [12]. DTW is a method that has been applied to achieve more accurate quantification of differences between template and test-signal subpatterns, through optimal matching of corresponding points. Instead of assuming uniform distributions among corresponding points between template and test subpatterns, DTW finds the best corresponding points by warping the template pattern at the time axis. Recent studies have shown higher accuracies for template matching with DTW than for conventional template matching methods that assume uniform distributions among corresponding points [2426].

Dynamic positional warping (DPW) is a modification of DTW that was developed to improve accuracy in distance quantification [27]. It was originally developed for the accurate matching of contour data with two-dimensional shapes and frequently used for signature verification. By allowing for the signal to be warped on the ordinate axis in addition to the time axis, DPW can more accurately identify corresponding points than can conventional DTW.

The main goal of this study was to investigate whether DPW could be extended to one-dimensional pattern recognition problems. To approach this aim, we applied DPW for the detection of eye-blink artifact patterns in frontal EEG data acquired from 24 healthy subjects. The detection accuracy of DPW was then compared to those of the conventional template matching methods.

2. Materials and Methods

2.1. Experimental Data and Preprocessing

In this study, eye-blink artifacts in continuous EEG signals were selected as the target patterns to be detected. The reason for this is that, while eye-blink artifacts were regarded as representative artifacts contaminating EEG signals, it was difficult to accurately identify them due to high variability among events or individuals. EEG data were recorded from 24 healthy participants using a multichannel EEG recording system (ActiveTwo AD-box, BioSemi, The Netherlands) at a sampling rate of 2,048 Hz, while the participants performed spot-the-difference puzzles for 25 seconds. Two slightly different images were presented on the left and right halves of a display, and the participants were asked to find the differences between two images for 15 seconds. The task was repeated five times for each participant. A particular frontal channel Fp2 in the international 10–20 system was used for the eye-blink artifact detection. To verify eye-blink detection accuracy, it was necessary to use a ground-truth dataset indicating the presence of an eye-blink artifact. For this aim, time ranges of eye-blink artifacts were marked by two experienced researchers based on visual inspection of EEG data.

Before the primary analyses, EEG data were high-pass filtered with a 0.1 Hz cutoff frequency, downsampled to a 64 Hz sampling rate in order to reduce the computation cost, and median-filtered with a five-point width in order to smooth the data. The width of the median filter was determined empirically.

2.2. Procedure for Template Matching

In order to evaluate and compare different distance metrics, a typical template matching protocol was implemented. The template matching protocol was designed to be as simple as possible so as to exclude any potential influence from any confounding factors. Figure 1 illustrates the schematic diagram of our study protocol.

The core parts of this process include distance calculation between templates and test patterns (denoted by Step 1 in Figure 1) and an overall similarity decision based on a predetermined threshold (denoted by Step 3 in Figure 1). Both of these steps are common among studies using template matching approaches [11, 12, 28]. In the current study, test patterns were extracted from the continuous test EEG data using a fixed-size sliding window, and the distances between the template and test EEG signals were evaluated at every time point (the number of sliding windows was denoted by ). The size of the sliding window was set to be the same as the length of the template as this was an assumption indispensable for applying linear template matching such as correlation and root-mean-square error. The decision step was only applied for the local minima of the distance array, and equal widths were assumed for the detected pattern and template. When ranges of adjacent detected patterns overlapped with one another, the detected pattern ranges were merged into a single range in order to avoid duplicate detection.

Template signals were randomly selected by a computer as in [4], so as to eliminate any possible bias toward the use of a specific method. When used by experts, manual template selection has the potential for achievement of higher performance outcomes [11, 12] compared to random selection; however, manual selection processes are highly dependent on experts’ subjective decisions and can lead to biased results.

Approaches for better use of training data involve construction of a single template by averaging patterns in a single cluster or selection of best-fit templates for each cluster. Unfortunately, however, these methods do not generally show high performance when template widths and shapes have large variances. In this study, we adopted a normalization method [29], considering large variances of template widths and shapes due to random selection of templates. There are two advantages for normalization approach compared to the conventional approaches: effects of improper template selection can be minimized by distance-averaging; variations in template width and shape do not need to be considered. Normalized distance (denoted by ) between the th test pattern and templates can be calculated by where is distance between the th template and the th test pattern, is the number of templates, and is a normalization factor, given as

The test pattern is accepted if is a local minimum and if this local minimum is lower than a predefined threshold. This overall process was repeated 20 times in order to achieve an unbiased comparison.

2.3. Traditional Distance Metrics

Because it is generally assumed that target-pattern shapes are unchanging, Euclidean distance and correlation-coefficients have been most commonly used for template matching applications [4, 30]. Three traditional distance metrics are investigated in this study, which are root-mean-square error (RMSE) based on Euclidean distances (with linear matching), correlation coefficient, and Kurtosis. Kurtosis was considered in this study because it is widely used in biomedical data analysis [31, 32]. Between two signals and , with and as the respective signal lengths, distances for each metric are defined as follows.

Root-mean-square error:

Correlation:

Kurtosis: where and denote th data in signals and , respectively. Note that RMSE and correlation are calculable only for identical signal lengths. Thus, a common variable was used to represent the signal length in (3) and (4).

2.4. Dynamic Time Warping

In spite of various modifications of DTW in previous decades, original kernel models for calculating distance are still being widely used in many applications. In this study, we adopted a common implementation of DTW [19] and empirically determined parameters for slope constraints. The DTW distance between two signals is defined as where and are respective template and test pattern lengths, and is the distance between two subsignals and , defined as where = 0, and and are th slope constraints on pattern axes, which limit the number of skipping (jumping) data points. denotes the th pair of the slope constraints on template and test pattern axes and can be written as where is the maximum branch length of slope constraints. Note that the values at the starting points of the two patterns are adjusted to be overlapped.

2.5. Dynamic Positional Warping (DPW)

DPW was originally proposed for accurate quantification of differences between two-dimensional data such as an object’s contour or handwritten characters, by searching similar subsequences recursively [27]. When employed for one-dimensional data, the DPW distance between time series signals and can be written as follows: where most notations are the same as those used in the original DTW equations ((6) and (7)). In these equations, and represent preceding corresponding points that minimize . As shown in (9) and (10), the forms of the equations are the same as those of conventional DTW equations, except with regard to distance calculation between two points. Note that and are substituted for and , respectively, in (10).

Figure 2 compares the mechanisms of DPW and DTW in one-dimensional data-matching applications. When two signals are compared and points and are matched as a corresponding pair (Figure 2(a)), DTW shifts a subsequence that begins with on the time axis such that the shifted point is moved to the same time index as the subsequence starting with (Figure 2(b)). This process, denoted as time warping, allows for distance calculation between points and by placing them closely on time axis. In the case of DPW, upon matching and , the subsequence starting from is warped so that is overlapped onto . Please note this subsequence warping costs the distance (on the axis of ordinate) between the two points and , while the warping cost on the time axis is free (refer to [27] for more detailed description on the original DPW method).

3. Results and Discussion

Receiver operating characteristic (ROC) curves were used to compare pattern-detection performances among the various template matching approaches introduced in Section 2. To evaluate ROC curves, recall rates were evaluated with respect to fixed precision rates for each iteration of each participant. Then, for each precision rate, recall rates were averaged across all the iterations and participants. Figure 3 shows ROC curves illustrating detection accuracies for five different methods. DPW showed the highest accuracy among all methods investigated, with an accuracy of 82% for equal precision and recall rates. DPW accuracy was 10% higher than that for conventional DTW (where accuracy rating was 72%) and even higher than those for conventional distance metrics (RMSE: 49%, correlation: 34%, and Kurtosis: 11%). These results demonstrate that positional warping, as has been used for two-dimensional pattern recognition problems, might be also effective in one-dimensional pattern recognition problems.

The extremely low accuracies of RMSE and correlation may be surprising, considering that both distance metrics are so commonly used for template matching applications. The poor performances found for both metrics are thought to partly originate from high target-pattern shape variations. It is also possible that these poor performances were the result of the chosen task being more difficult than typical tasks. Since the templates in the current task were selected randomly from ground-truth datasets, there may have been many templates with irregular shapes. Despite these difficult conditions, the proposed DPW approach showed much higher detection accuracy than the DTW approach, suggesting that DPW might be used as a new and powerful method for extracting specific signal patterns for EEG applications.

Table 1 summarizes the best detection accuracies among 20 iterations, evaluated for each participant. Accuracy was calculated as the percentage of precision or recall for equal precision and recall values in ROC curves. When ROC curves were evaluated for each participant and best accuracies were selected among the 20 iteration results, the conventional methods based on correlation coefficients or RMSEs yielded better accuracies than the results shown in Figure 3. Nevertheless, DPW still outperformed the other metrics, ranking the highest for 22 of 24 participants. The averaged detection accuracy for DPW (96.10%) was 3.62% higher than that for DTW (92.38%).

In addition, the influence of the number of templates on detection accuracy was investigated. The detection accuracy was evaluated by increasing the number of templates and then averaging across all iterations and participants (Table 2). The results show a weak influence of the number of templates on detection accuracy. Except for correlation, accuracy did not change significantly as the number of templates increased. Instead, the standard deviations of DTW and DPW decreased significantly, demonstrating the possibility for more stable pattern detection by the use of sufficient numbers of templates in DTW and DPW.

4. Conclusion

In this paper, we investigated whether DPW, originally developed for two-dimensional pattern recognition, could be successfully employed for one-dimensional pattern recognition. To validate our alternative hypothesis that DPW is effective for one-dimensional data analysis, DPW was applied to the problem of EEG eye-blink artifact detection. DPW outperformed conventional template matching methods including DTW, demonstrating that this positional warping method, which warps signals on both ordinate and abscissa axes, is also effective in one-dimensional pattern recognition. This study suggests the possibility of applying DPW to many other types of signal patterns and applications. We are also planning to combine DPW with other methodologies in our future studies.

Conflict of Interests

The authors declare that there is no conflict of interests regarding the publication of this paper.

Acknowledgments

This work was supported in part by the IT R&D program of MSIP/KEIT (KI10045461, Development of Cultural Contents Evaluation Technology Based on Real-Time Biosignal of Multiple Subjects), in part by the IT R&D program of MOTIE/MISP/KEIT (10045452, Development of Multimodal Brain-Machine Interface System Based on User Intent Recognition), and in part by the National Research Foundation of Korea (NRF) funded by the Ministry of Science, ICT and Future Planning (NRF-2012R1A2A2A03045395).