Feature Trajectory Dynamic Time Warping for Clustering of Speech Segments

Dynamic time warping (DTW) can be used to compute the similarity between two sequences of generally differing length. We propose a modification to DTW that performs individual and independent pairwise alignment of feature trajectories. The modified technique, termed feature trajectory dynamic time warping (FTDTW), is applied as a similarity measure in the agglomerative hierarchical clustering of speech segments. Experiments using MFCC and PLP parametrisations extracted from TIMIT and from the Spoken Arabic Digit Dataset (SADD) show consistent and statistically significant improvements in the quality of the resulting clusters in terms of F-measure and normalised mutual information (NMI).


Introduction
Dynamic Time Warping (DTW) is a method of optimally aligning two distinct time series of generally different length. In addition to the alignment, DTW computes a score indicating the similarity of the two sequences. This ability to quantify the similarity between time series has led to the application of DTW in automatic speech recognition (ASR) systems several decades ago [1,2]. It has remained popular in this field, with more recent developments reported in [3] and [4].
DTW has also found application in fields related to ASR. For example, it has been used successfully in keyword spotting and information retrieval (IR) systems [5,6,7]. To accomplish IR, sub-sequences in a speech signal that match a template with certain degree of time warping are detected.
In the related task of acoustic pattern discovery, DTW can be allowed to consider multiple local alignments between speech signals during the overall search [8]. In this way DTW can find similar segment pairs in speech audio, followed by a clustering step [9]. The resulting cluster labels are used to train hidden Markov models (HMMs).
In an effort to improve performance, several variations of DTW have been proposed since its inception. For example, a one-against-all index (OAI) for each time series under consideration is proposed in [4]. The OAI is subsequently used to weight the corresponding DTW alignment score in a speech recognition system. DTW has also been modified to allow the direct matching of points along the best alignment for use in a signature verification system [10]. A stability function is subsequently applied, and the resulting score is used as a similarity measure.
We describe a modification of DTW and demonstrate its improved performance when used as a similarity measure to cluster speech segments. Our DTW modification exploits the asynchronous temporal structure of features extracted from speech. Related work has considered such feature trajectories by training separate hidden Markov models (HMMs) for each MFCC feature dimension [11]. This work reports improvements in both phoneme and word recog-nition. The clustering of speech segments also has several useful applications in ASR [12,13,14]. Recently it has been particularly useful in the automatic discovery of sub-word units [15,16]. Section 2 reviews the standard formulation of DTW and Section 3 describes our proposed modification. Section 4 presents the evaluation tools we employ and Section 5 describes the data we use for experimentation. Section 6 presents an experimental evaluation of the proposed method. Section 7 discusses the results and concludes the paper.

Classical Dynamic Time Warping (DTW)
We consider speech segments as temporal sequences of multidimensional feature vectors in the Euclidean space. Sequences are of arbitrary and generally different length, but all vectors are of equal dimension. The DTW algorithm recursively determines the best alignment between two such vector time series by minimizing a cumulative path cost that is commonly based on Euclidean distances between time aligned vectors [2,17].
Consider N such sequences X i , i = 1, 2, ..., N , each composed of T i feature vectors, as defined in Equation 1.
Each feature vector x it has m dimensions, as indicated in Equation 2.
Two sequences X i and X j are aligned by constructing a T i -by-T j distance matrix D ij (p, q) whose entries contain the distances d(x ip , x jq ). Typical choices for d are the Euclidean distance and the Manhattan distance. A matrix of minimum accumulated distances γ ij (p, q) is then constructed by considering all paths from D ij (1, 1) to D ij (p, q). Using local and global path constraints, γ ij (p, q) is computed recursively according to the principle of dynamic programming, as shown in Equation 3 [2].
The similarity DT W (X i , X j ) between vector sequences X i and X j is then given by Equation 4. Here K is the length of the optimal path from D ij (1, 1) to D ij (T i , T j ) and is used to normalise the similarity value.
This standard formulation of dynamic time warping will in the remainder of the paper be referred to as classical DTW. Figure 1 shows the classical DTW alignment between two different sequences of 21-dimensional spectral feature vectors representing the same sound uttered by different speakers. These spectral features are obtained by straightforward binning of the short-time power spectra. To avoid clutter, the alignment of just four of the feature vectors is shown.

Feature Trajectory DTW (FTDTW)
We define a feature trajectory X (l) i as the time series obtained when considering the l-th element of each feature vector in a sequence X i , as shown in Equation 5.
Hence X (l) i is a 1-dimensional time series for feature l. We now calculate the similarity of two feature vector sequences by applying classical DTW to each corresponding pair of feature trajectories, and subsequently normalise the sum, as shown in Equation 6.
where β = m l=1 K 2 l , K is the path length and DT W (.) is non-normalised classical DTW. As illustration, we repeat the alignment of the two speech segments shown in Figure 1 with FTDTW. Figure 2 Figure 2 illustrates how, in contrast to classical DTW, FTDTW does not require features coincident in time in one segment to align with features in the other segment also coincident in time.

Evaluation
We evaluate the effectiveness of our proposed modification to DTW by using it to compute similarities between speech segments, and then using these similarities to perform agglomerative hierarchical clustering [18,19]. We will cluster speech segments corresponding to triphones extracted from the TIMIT corpus as well as isolated digits extracted from the Spoken Arabic Digit Dataset (SADD). Since the phonetic alignment is provided in the former and the word alignments in the latter, the ground truth is available. Hence we can use the external metrics F-measure and normalised mutual information (NMI) to quantify the quality of the resulting clusters [20,21,22].

Agglomerative Hierarchical Clustering (AHC)
In AHC, the agglomeration of data objects (speech segments in the case of our experimental evaluation) is initialised by the assumption that each object is the sole occupant of its own cluster. A binary tree referred to as a dendrogram is created by successively merging the closest cluster pairs until a single cluster remains [23]. We use the popular Ward method to quantify inter-cluster similarity [24]. The input to the AHC algorithm is a symmetric N × N proximity matrix populated by the values of DT W (·, ·) or F T DT W (·, ·) and the output consists of the R clusters.

F-measure
The F-measure is based on the quantities precision (PR) and recall (RE). Precision indicates the degree to which a cluster is dominated by a particular class, while recall indicates the degree to which a particular class is concentrated in a specific cluster. Precision and recall are defined in Equations 7 and 8 respectively.
Here n rv indicates the number of objects of class v in cluster r; n r and n v the number of objects in cluster r and class v respectively. The F-measure (F ) is given in Equation 9.
When the clusters are perfect, n rv = n r = n v and hence F (r, v) = 1.
NMI is based on the mutual information, I(G, C) between classes and clusters [22,25]. The mutual information is not sensitive to varying number of clusters and therefore it is normalised by a factor based on the cluster entropy H(G) and class entropy H(C). These entropies measure cluster and class cohesiveness respectively. The NMI criterion is given in Equation 10.
The mutual information I(G, C) and the entropies H(G) and H(C) are given in Equations 11, 12 and 13 respectively.
In Equation 11, P (G r ), P (C v ) and P (G r ∩ C v ) are the probabilities of a segment belonging to cluster G r , class C v and the intersection of G r and C v respectively.
It can be shown that I(G, C) is zero when the clustering is random with respect to class membership and that it achieves a maximum of 1.0 for perfect clustering [25].

Data
Our first set of experiments uses speech segments taken from the TIMIT speech corpus [26]. TIMIT has been chosen because it includes accurate time-aligned phonetic transcriptions, meaning that both phonetic labels and their start/end times are known. As our desired clusters we use triphones, which are phones in specific left and right contexts [27]. We consider triphones that occur at least 20 times and at most 25 times in the corpus. This leads to an evenly balanced set of 8772 speech segments, which also corresponds approximately to the number of segments in our second set of experiments.
For comparison and confirmation purposes, we performed a second set of experiments using the Spoken Arabic Digit Dataset (SADD) [28]. SADD consists of 8800 utterances already parametrised as 13-dimensional MFCCs. The utterances were spoken by 44 male and 44 female Arabic speakers. Each utterance in the SADD corresponds to a single Arabic digit, and will therefore be considered to be a single segment in our experiments. Each digit (0 to 9) was uttered ten times by each speaker.
A third set of experiments is based on 10 independent subsets of speech segments drawn from the TIMIT SI and SX utterances, irrespective of occurrence frequency. This better represents the unbalanced distribution of triphones that may be expected in unconstrained speech. Table 1 summarises the datasets used in each of the three sets of experiments. 123182 TIMIT SI and SX triphones divided randomly into 10 subsets (not evenly balanced).
We considered two feature vector parametrisations popular in the field of speech processing, namely mel frequency cepstral coefficients (MFCCs) and perceptual linear prediction (PLP) coefficients [29,30]. For the former, log frame energy was appended to the first 12 MFCCs to produce a 13-dimensional feature vector. First and second differentials (velocity and acceleration) were subsequently added to produce the final 39-dimensional MFCC feature vector. For the latter, 13 PLP coefficients were considered, to which velocity and acceleration were added, again resulting in a 39dimensional feature vector. One such feature vector was extracted for each 10ms frame of speech, where consecutive frames overlapped by 5ms. All TIMIT feature vectors were computed using HTK [31]. SADD provides pre-computed MFCC features, and hence PLP features were not used in the associated experiments.

Experiments
To evaluate the performance of Feature Trajectory DTW (FTDTW) as an alternative to classical DTW as a similarity measure, we will employ it to perform AHC of the speech segments described in Section 5. The quality of the automatically-determined clusters will be determined using the F-measure and in several cases also NMI.
In a first set of experiments, we cluster Dataset 1 (Table 1). Figure 3 reflects the clustering performance in terms of (a) the F-measure and (b) NMI, when using MFCCs as features. Both the F-measure and NMI are plotted as a function of the number of clusters. Note that the F-measure continues to decline as the number of clusters exceeds 1200.

Figures 3(a) and 3(b)
show that FTDTW improves on the performance of classical DTW in this clustering task in terms of both F-measure and NMI. Especially in terms of F-measure, this improvement is substantial.
A corresponding set of experiments using PLP features was carried out for Dataset 1, and the results are shown in Figure 4. The same trends seen for MFCCs in Figure 3 are observed, with substantial improvements particularly in terms of F-measure.
In a second set of experiments, we clustered Dataset 2 ( Table 1) which consists of isolated Arabic digits. Figure 5 indicates the clustering performance, both in terms of F-measure and NMI for this dataset. Again we observe that FTDTW outperforms classical DTW in terms of both F-measure and NMI in practically all cases.
In a third and final set of experiments, we considered Dataset 3 ( Table 1). The 10 independent subsets of the TIMIT training set each contained between 12034 and 12495 triphone segments. In contrast to the experiments for Dataset 1, all triphone tokens were considered irrespective of occurrence frequency. Furthermore, the number of clusters was chosen to be 2394, a figure which corresponds to the number of triphone types with more than 10 occurrences in the data. A single number of clusters, rather than a range as presented in Figures 3, 4 and 5, has been used here in order to make the required computations practical. Figure 6 presents the clustering performance for each of the 10 subsets in terms of F-measure. We observe that FTDTW achieves an improvement over classical DTW in all cases. A paired t-test indicated p < 0.0001, and hence the improvements are statistically highly significant. Similar improvements were observed in terms of NMI.

Discussion and conclusions
The experiments in Section 6 have applied our modified DTW algorithm (FTDTW) to the clustering of speech segments. Our experiments show consistent and statistically significant improvement over the classical DTW baseline for both MFCC and PLP parametrisations and across three data sets. We conclude that FTDTW is more effective as a similarity measure for speech signals than classical DTW.
Because classical DTW operates on a feature-vector by feature-vector basis, it enforces absolute temporal synchrony between the feature trajectories. In contrast, FTDTW does not impose this synchrony constraint, but aligns feature trajectories independently on a pair-by-pair basis. Since FTDTW is observed to lead to better clusters in our experiments, we conclude that the strict temporal synchrony imposed by classical DTW is counter-productive in the case of speech signals. We further speculate that segments of speech that human listeners would regard as similar also exhibit such differing time-scale warping among the feature trajectories. It remains to be seen whether this decoupling of the feature trajectories is advantageous for signals other than speech.
Finally, and noting that it is not a focus of this paper, we may consider the maxima observed in the F-measure in Figure 3 and 4, and in both the F-measure and NMI in Figure 5. A peak in the quality of the clusters as a function  of the number of clusters may be taken to indicate the best estimate of the 'true' number of clusters in the data. For the experiments using the MFCC parametrisation of Dataset 1 (Figure 4), we see that an optimum in the F-measure in reached at 501 and 421 clusters for FTDTW and classical DTW respectively. The 'true' number of clusters corresponds to the number of triphone types in Dataset 1, which is 404. Hence both DTW formulations over-estimate the number of clusters. A similar tendency is seen for the PLP parametrisations of the same dataset, where the F-measure peaks at 439 and 559 clusters for classical DTW and proposed DTW respectively, and also for Dataset 2 in Figure 5.
Although the ground truth is known, the class definitions (triphones for Datasets 1 and 3, and isolated digits for Dataset 2) may be called into question. In particular, although all triphones correspond to acoustic segments from the same phone within the same left and right contexts, there are many other possible sources of systematic variability, such as the accent of the speaker. Hence it may be reasonable to expect that a larger number of clusters is needed to optimally model the data. To determine whether this is the case, the clusters should be used to determine acoustic models for an ASR system. Then the performance of varying clusterings of the data can be compared by comparing the performance of the resulting ASR systems. We intend to address this question in ongoing work.