# Enhanced Template Matching Using Dynamic Positional Warping for Identification of Specific Patterns in Electroencephalogram

Authors: Won-Du Chang; Chang-Hwan Im
Journal: Journal of Applied Mathematics
 (2014)

---

## 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.


---

## Body

## 1. Introduction

Template matching has been one of the most popular approaches in pattern recognition over the past few decades [1–4]. 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 [11–13].Pattern-detection studies on EEG signals have been conducted for the purpose of identifying pathologically driven EEG patterns or EEG artifacts [11, 12, 14–16]. 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 [24–26].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. Figure1 illustrates the schematic diagram of our study protocol.Figure 1
Schematic diagram of our study protocol forn
=
5 templates. After selecting templates from the ground-truth dataset, the average distance among the templates is calculated for normalization (during the “Training” phase). During the “Testing” phase, distances between templates and test patterns within test-signal sliding windows are calculated.The core parts of this process include distance calculation between templates and test patterns (denoted by Step 1 in Figure1) 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 N). 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: (
1
) effects of improper template selection can be minimized by distance-averaging; (
2
) variations in template width and shape do not need to be considered. Normalized distance (denoted by D
j) between the jth test pattern and templates can be calculated by
(1)
D
j
=
(
∑
i
=
1
n
d
i
j
)
n
·
σ
,
where d
i
j is distance between the ith template and the jth test pattern, n is the number of templates, and σ is a normalization factor, given as
(2)
σ
=
(
∑
i
=
1
n
∑
j
=
i
+
1
n
d
i
j
)
{
n
·
(
n
-
1
)
/
2
}
.The test patternT
j is accepted if D
j 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 A and B, with L
A and L
B as the respective signal lengths, distances for each metric are defined as follows.Root-mean-square error:
(3)
d
rmse
=
1
L
·
∑
k
=
1
L
{
A
(
k
)
-
B
(
k
)
}
2
.Correlation:
(4)
d
corr
=
∑
k
=
1
L
{
A
(
k
)
-
A
-
}
·
{
B
(
k
)
-
B
-
}
∑
k
=
1
L
{
A
(
k
)
-
A
-
}
2
·
∑
k
=
1
L
{
B
(
k
)
-
B
}
2
.Kurtosis:
(5)
d
ku
=
|
∑
k
=
1
L
A
{
A
(
k
)
-
A
-
}
4
L
A
·
σ
A
4
-
∑
k
=
1
L
B
{
B
(
k
)
-
B
-
}
4
L
B
·
σ
B
4
|
,
where A
(
k
) and B
(
k
) denote kth data in signals A and B, respectively. Note that RMSE and correlation are calculable only for identical signal lengths. Thus, a common variable L 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
(6)
d
dtw
=
τ
(
L
A
,
L
B
)
,
where L
A and L
B are respective template and test pattern lengths, and τ
(
i
,
j
) is the distance between two subsignals {
A
(
k
)
∣
1
≤
k
≤
i
} and {
B
(
k
)
∣
1
≤
k
≤
j
}, defined as
(7)
τ
(
i
,
j
)
=
|
{
A
(
i
)
-
A
(
1
)
}
-
{
B
(
j
)
-
B
(
1
)
}
|
+
min
⁡
c
⁡
{
τ
(
i
-
C
A
(
c
)
,
j
-
C
B
(
c
)
)
}
,
where τ
(
1,1
) = 0, and C
A
(
c
) and C
B
(
c
) are cth slope constraints on pattern axes, which limit the number of skipping (jumping) data points. C
A
B
(
c
) denotes the cth pair of the slope constraints on template and test pattern axes and can be written as
(8)
C
A
B
=
{
(
1
,
m
)
,
(
m
,
1
)
∣
1
≤
m
≤
M
}
,
where M 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 A and B can be written as follows:
(9)
d
dtw
=
τ
(
L
A
,
L
B
)
,
(10)
τ
(
i
,
j
)
=
|
{
A
(
i
)
-
A
(
i
prev
)
}
-
{
B
(
j
)
-
B
(
j
prev
)
}
|
+
ω
(
i
,
j
)
,
(11)
i
prev
=
i
-
C
A
(
c
min
⁡
(
i
,
j
)
)
,
(12)
j
prev
=
j
-
C
B
(
c
min
⁡
(
i
,
j
)
)
,
(13)
c
min
⁡
(
i
,
j
)
=
arg
min
⁡
c
⁡
{
φ
(
i
-
C
A
(
c
)
,
j
-
C
B
(
c
)
)
}
,
(14)
ω
(
i
,
j
)
=
min
⁡
c
⁡
{
φ
(
i
-
C
A
(
c
)
,
j
-
C
B
(
c
)
)
}
,
where most notations are the same as those used in the original DTW equations ((6) and (7)). In these equations, i
prev and j
prev represent preceding corresponding points that minimize τ
(
i
,
j
). 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 A
(
i
prev
) and B
(
j
prev
) are substituted for A
(
1
) and B
(
1
), respectively, in (10).Figure2 compares the mechanisms of DPW and DTW in one-dimensional data-matching applications. When two signals are compared and points a and b are matched as a corresponding pair (Figure 2(a)), DTW shifts a subsequence that begins with a on the time axis such that the shifted point is moved to the same time index as the subsequence starting with b (Figure 2(b)). This process, denoted as time warping, allows for distance calculation between points c and d by placing them closely on time axis. In the case of DPW, upon matching a and b, the subsequence starting from a is warped so that a is overlapped onto b. Please note this subsequence warping costs the distance (on the axis of ordinate) between the two points a and b, while the warping cost on the time axis is free (refer to [27] for more detailed description on the original DPW method).Schematic illustrations for elucidating dynamic time warping and positional warping for one-dimensional data matching: (a) two signalsα (solid line) and β (dashed line) are compared and considered a pair of corresponding points. (b) Time warping in DTW: a is warped to a
' by time shifting. (c) Positional and time warping in DPW: a is warped to a
′ to be overlapped onto b.
(a)
(b)
(c)


## 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. Figure1 illustrates the schematic diagram of our study protocol.Figure 1
Schematic diagram of our study protocol forn
=
5 templates. After selecting templates from the ground-truth dataset, the average distance among the templates is calculated for normalization (during the “Training” phase). During the “Testing” phase, distances between templates and test patterns within test-signal sliding windows are calculated.The core parts of this process include distance calculation between templates and test patterns (denoted by Step 1 in Figure1) 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 N). 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: (
1
) effects of improper template selection can be minimized by distance-averaging; (
2
) variations in template width and shape do not need to be considered. Normalized distance (denoted by D
j) between the jth test pattern and templates can be calculated by
(1)
D
j
=
(
∑
i
=
1
n
d
i
j
)
n
·
σ
,
where d
i
j is distance between the ith template and the jth test pattern, n is the number of templates, and σ is a normalization factor, given as
(2)
σ
=
(
∑
i
=
1
n
∑
j
=
i
+
1
n
d
i
j
)
{
n
·
(
n
-
1
)
/
2
}
.The test patternT
j is accepted if D
j 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 A and B, with L
A and L
B as the respective signal lengths, distances for each metric are defined as follows.Root-mean-square error:
(3)
d
rmse
=
1
L
·
∑
k
=
1
L
{
A
(
k
)
-
B
(
k
)
}
2
.Correlation:
(4)
d
corr
=
∑
k
=
1
L
{
A
(
k
)
-
A
-
}
·
{
B
(
k
)
-
B
-
}
∑
k
=
1
L
{
A
(
k
)
-
A
-
}
2
·
∑
k
=
1
L
{
B
(
k
)
-
B
}
2
.Kurtosis:
(5)
d
ku
=
|
∑
k
=
1
L
A
{
A
(
k
)
-
A
-
}
4
L
A
·
σ
A
4
-
∑
k
=
1
L
B
{
B
(
k
)
-
B
-
}
4
L
B
·
σ
B
4
|
,
where A
(
k
) and B
(
k
) denote kth data in signals A and B, respectively. Note that RMSE and correlation are calculable only for identical signal lengths. Thus, a common variable L 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
(6)
d
dtw
=
τ
(
L
A
,
L
B
)
,
where L
A and L
B are respective template and test pattern lengths, and τ
(
i
,
j
) is the distance between two subsignals {
A
(
k
)
∣
1
≤
k
≤
i
} and {
B
(
k
)
∣
1
≤
k
≤
j
}, defined as
(7)
τ
(
i
,
j
)
=
|
{
A
(
i
)
-
A
(
1
)
}
-
{
B
(
j
)
-
B
(
1
)
}
|
+
min
⁡
c
⁡
{
τ
(
i
-
C
A
(
c
)
,
j
-
C
B
(
c
)
)
}
,
where τ
(
1,1
) = 0, and C
A
(
c
) and C
B
(
c
) are cth slope constraints on pattern axes, which limit the number of skipping (jumping) data points. C
A
B
(
c
) denotes the cth pair of the slope constraints on template and test pattern axes and can be written as
(8)
C
A
B
=
{
(
1
,
m
)
,
(
m
,
1
)
∣
1
≤
m
≤
M
}
,
where M 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 A and B can be written as follows:
(9)
d
dtw
=
τ
(
L
A
,
L
B
)
,
(10)
τ
(
i
,
j
)
=
|
{
A
(
i
)
-
A
(
i
prev
)
}
-
{
B
(
j
)
-
B
(
j
prev
)
}
|
+
ω
(
i
,
j
)
,
(11)
i
prev
=
i
-
C
A
(
c
min
⁡
(
i
,
j
)
)
,
(12)
j
prev
=
j
-
C
B
(
c
min
⁡
(
i
,
j
)
)
,
(13)
c
min
⁡
(
i
,
j
)
=
arg
min
⁡
c
⁡
{
φ
(
i
-
C
A
(
c
)
,
j
-
C
B
(
c
)
)
}
,
(14)
ω
(
i
,
j
)
=
min
⁡
c
⁡
{
φ
(
i
-
C
A
(
c
)
,
j
-
C
B
(
c
)
)
}
,
where most notations are the same as those used in the original DTW equations ((6) and (7)). In these equations, i
prev and j
prev represent preceding corresponding points that minimize τ
(
i
,
j
). 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 A
(
i
prev
) and B
(
j
prev
) are substituted for A
(
1
) and B
(
1
), respectively, in (10).Figure2 compares the mechanisms of DPW and DTW in one-dimensional data-matching applications. When two signals are compared and points a and b are matched as a corresponding pair (Figure 2(a)), DTW shifts a subsequence that begins with a on the time axis such that the shifted point is moved to the same time index as the subsequence starting with b (Figure 2(b)). This process, denoted as time warping, allows for distance calculation between points c and d by placing them closely on time axis. In the case of DPW, upon matching a and b, the subsequence starting from a is warped so that a is overlapped onto b. Please note this subsequence warping costs the distance (on the axis of ordinate) between the two points a and b, while the warping cost on the time axis is free (refer to [27] for more detailed description on the original DPW method).Schematic illustrations for elucidating dynamic time warping and positional warping for one-dimensional data matching: (a) two signalsα (solid line) and β (dashed line) are compared and considered a pair of corresponding points. (b) Time warping in DTW: a is warped to a
' by time shifting. (c) Positional and time warping in DPW: a is warped to a
′ to be overlapped onto b.
(a)
(b)
(c)


## 3. Results and Discussion

Receiver operating characteristic (ROC) curves were used to compare pattern-detection performances among the various template matching approaches introduced in Section2. 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.Figure 3
ROC curves of five different methods.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.Table1 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%).Table 1
Best accuracies (%) evaluated for each participant among results from 20 iterations. Best accuracy values for each participant are in bold font.
Subject ID
Correlation
RMSE
Kurtosis
DTW
DPW
1
86.96
61.32
22.86
94.97
98.55
2
84.25
90.67
39.46
97.60
98.28
3
49.19
60.83
15.98
77.42
85.27
4
69.02
84.38
15.77
93.65
95.41
5
49.28
73.69
18.45
83.50
92.39
6
26.67
84.44
13.33
90.00
91.55
7
80.72
92.80
30.95
94.64
98.66
8
88.19
92.86
48.00
98.01
100.00
9
62.96
98.77
31.34
98.77
99.38
10
71.83
71.33
17.94
93.57
95.11
11
40.00
86.67
20.71
91.55
100.00
12
61.32
91.74
13.24
93.28
99.26
13
57.48
41.88
15.10
79.21
96.56
14
60.83
78.89
30.19
91.43
97.14
15
63.89
76.07
15.01
94.36
98.65
16
80.63
94.18
34.05
96.84
98.95
17
60.87
54.01
22.79
84.28
80.82
18
40.30
86.38
24.00
97.37
98.72
19
65.01
72.08
18.37
89.81
94.95
20
17.59
76.67
17.69
93.33
94.94
21
79.20
91.67
22.13
92.51
97.94
22
63.11
41.63
25.10
91.88
96.70
23
65.55
90.23
23.08
100.00
98.08
24
40.99
97.53
20.71
99.17
99.17
Average
61.08
78.78
23.18
92.38
96.10In 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 (Table2). 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.Table 2
Artifact detection accuracies (%) with respect to the number of templates, for equal precision and recall.
Number of templates
Correlation
RMSE
Kurtosis
DTW
DPW
1
49.54
±
22.45
61.65
±
28.42
9.65
±
5.63
77.58
±
22.44
83.94
±
23.52
2
34.37
±
27.54
62.55
±
25.51
11.74
±
11.01
68.29
±
29.59
78.23
±
30.35
3
28.42
±
25.93
61.60
±
25.08
10.20
±
7.21
76.38
±
20.47
86.06
±
17.06
4
27.31
±
24.58
60.42
±
25.52
9.88
±
7.49
75.51
±
20.07
85.79
±
16.36
5
23.84
±
22.28
59.77
±
24.72
10.77
±
8.15
74.64
±
19.79
85.92
±
16.24
6
24.89
±
21.47
58.90
±
25.72
10.47
±
8.35
77.49
±
17.44
86.63
±
15.41
7
25.76
±
22.91
58.44
±
25.09
10.37
±
8.14
76.09
±
17.64
86.42
±
15.74
8
25.35
±
22.23
58.59
±
25.25
10.85
±
8.74
76.80
±
17.32
86.87
±
14.60
9
24.56
±
20.88
59.65
±
24.45
11.08
±
8.90
77.92
±
15.12
87.13
±
14.16
10
24.17
±
19.33
59.49
±
25.37
10.69
±
9.17
78.68
±
15.35
86.54
±
15.25


## 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.



---

*Source: 528071-2014-04-27.xml*