Fuzzy Logic

Fuzzy Logic Enhanced Symmetric Dynamic Programming for Speech Recognition

Patrick Mills
University of South Carolina
Electrical and Computer Engineering
Columbia, SC 29208
  John Bowles
University of South Carolina
Electrical and Computer Engineering
Columbia, SC 29208

A PDF version is also available. (238K)
For more information, download the Thesis this work is based upon.

Publiction Information:
Patrick Mills and John Bowles. "Fuzzy Logic Enhanced Symmetric Dynamic Programming for Speech Recognition." Proceedings of the 5th IEEE International Conference on Fuzzy Systems. (New Orleans, LA. September 1996).

Abstract - Fuzzy logic allows effective decision making in the presence of uncertainty. Identifying spoken words, even in an ideal environment by a trained speaker, is a complex task filled with uncertainty. The speech waveform is nonlinear and variant, removing the possibility of simple analysis. Dynamic programming is a time normalization technique that allows static templates to be used to identify spoken words. Fuzzy logic enhancements enable the technique to handle noise and quantization errors better and improves classification accuracy. An important consequence of using a fuzzy based system is that the system's confidence in its identification can be used to accept the identification or to request further information.

1. Introduction

Speech is a human's most efficient communication modality. Beyond efficiency, humans are comfortable and familiar with speech. Other modalities require more concentration, restrict movement, and cause body strain due to unnatural positions. [LEA80]

The main problem in speech recognition, as with other complex tasks that require some form of intelligence, is the amount of information that must be examined before making a classification or decision. Speech recognition is an extremely complex pattern matching problem. The complexity arises from the variability in speech rate, pitch, volume, and emotion. Together with the natural differences in individual human voice production systems, these factors produce a variable and nonlinear waveform. As if these challenges were not enough, a speech recognition system must also deal with non-speech sounds and environmental noise.

Given two representations of the same spoken word by the same speaker under similar conditions, it is highly probable that they will be of different lengths. The main problem is that variations in speaking rate cause nonlinear changes on the time axis. Dynamic Programming (DP) is one technique that attempts to optimally eliminate timing differences between two waveforms.

2. Dynamic Programming

The DP algorithm works by warping one waveform onto the axis of the other. However, rather than merely stretching or compressing the waveform, the algorithm attempts to match the waveforms so that similarities are maintained and time aligned. In the classic algorithm, one of the waveforms is warped onto the time axis of the other. However, recent research has shown that mapping both waveforms onto a new common axis performs much better. This technique is called symmetric dynamic programming (SDP). The flowchart for SDP is shown in Figure 1 for two waveforms, A and B, having I and J samples respectively. [WAIB90, pp. 159 - 163]

Flow Chart
Figure 1. SDP Flowchart
SDP creates a common time axis for two waveforms with differing time axes.

The performance of the DP-equation for SDP depends on the chosen slope restriction. The slope restriction ensures that the warping function has an even gradient. It also ensures that the algorithm does not focus on similarities that are outside a window of usefulness. Experimental results show a slope restriction of one to be optimal. Therefore, the DP-equation is: [WAIB90, p. 163]

Gradient Equation

where the distance between any two samples is given by:

Absolute Value Equation

The DP-equation g(i, j) involves picking the path with the lowest distance and can therefore be viewed as a gradient. With a slope restriction of one, three paths must be examined as shown in Figure 2. The slope restriction requires that the function step at most once in the horizontal or vertical direction before stepping orthogonally or diagonally.

Graident Grid
Figure 2. Gradient Paths
When the slope restriction is set to one, three paths must be examined to find the minimum gradient.

The total distance between the waveforms is given at the end of the algorithm as D(A, B). This distance can be used directly as a comparison between the input waveform and a stored template. Alternatively, the common axis representation of the waveform after warping can be used for further processing.

While finding the best time alignment between a template and an unknown, dynamic programming also isolates and matches features. The implementation employed for this paper used dynamic programming on time-amplitude values only; no spectral analysis was performed. While neglecting spectral information limits the overall accuracy of the recognition process, dynamic programming without specialized hardware is too time consuming to perform additional complex analysis such as Fourier analysis or Linear Predictive Coding.

Dynamic programming has a complexity of O(n²), which can cause unreasonable demands on both processing time and system memory. Fortunately, several constraints can be employed to reduce the complexity. By providing a slope constraint, the search area can be limited. Based on work by Sakoe and Chiba, an optimal slope constraint of one was chosen. [WAIB90, pp. 159-65] Dynamic programming can be viewed graphically as a plot of the template waveform (a) vs. the unknown waveform (b). The warping function defines the optimal path from the starting point, which is always (0, 0), to the ending point, (A-1, B-1) where A and B are the lengths of the template and the unknown waveforms respectively. When the two waveforms are exactly the same, the warping function becomes the diagonal line b = a.

Since the starting and ending points are fixed and the slope is constrained, it is possible to define the area of all possible solutions.

The top and left sides are bounded by:
Top-Left Boundary Equation
  The bottom and right sides are bounded by:
Bottom-Right Boundary Equation

Figure 3 shows the possible paths that may be taken by the warping function. However, due to the recursive nature of the dynamic programming algorithm (equation 1), the left and bottom boundaries cannot be utilized since values outside their boundaries may be needed for calculating values within the area of possible solutions. Notice that the top and right boundaries correspond to starting at the end point and following the lines of maximum and minimum slope towards the starting point. Similarly, the bottom and left boundaries correspond to following the lines of maximum and minimum slope from the starting point and moving towards the end point.

Figure 3. Area Searched by DP Algorithm
The four lines bound the region of all possible solutions. The gray region shows the area that must be searched for possible solutions.

Example Graph
Figure 4. SDP Example
The two waveforms A and B used in the example are shown.

The DP-algorithm is perhaps best explained with an example. Figure 4 shows the two waveforms to be compared; waveform A has a length of 10, and waveform B has a length of 15. The first step is to calculate the distance from each point in waveform A to each point in waveform B. To illustrate the calculations at time 0, B is 1 and A is 0; hence, (0, 0) is 1-0 = 1 in Table 1. At time 1, A is 1; hence, (0, 1) is 1-1 = 0. Table 1 shows the results of these distance calculations. The next step is to apply equation 1 and calculate the recursive gradients as shown in Table 2. The final step is to normalize the gradient at (A-1, B-1) = (9, 14) by dividing by A+B = 25. The final result, 0.36, is the best distance between the two waveforms.

B \ A 0123 4567 89
14 4 21
13 1 2310
12 2021 201
1103 1130 11
10014 0241 02
9103 1130 1
8430 4203 4
7212 2021
6014 0241
5103 113
4212 202
3430 42
2321 31
1212 2
Table 1. Waveform Distance Matrix
Each cell contains the distance from a point on waveform A to a point on waveform B.

B \ A012 3456 789
14 169
13 10 1598
12 6811 128
113 66912 89
10048 47128 9
9285 45109 8
8852 69710
7424 97914
6048 7918
5247 101115
44108 1010
38116 1010
2655 9
1444 6
Table 2. Waveform Gradient Matrix
Each cell contains the minimum gradient.

The symmetric dynamic programming algorithm has been implemented in two forms: a classical, crisp form and a fuzzy form. The crisp form calculates the distance at each step by taking the absolute magnitude of the difference between the amplitudes of the two waveforms. The total distance measure between the two waveforms is then given by the sum of these differences divided by the sum of the lengths of the waveforms. This final normalization is necessary so that short waveforms and long waveforms have a common distance measure. The best match is chosen by selecting the waveform with the shortest total distance. The next section discusses the fuzzy implementation.

3. Fuzzy SDP

The fuzzy implementation assumes that all waveforms contain uncertainty. This uncertainty comes from speaker variation, waveform quantization, noise, and the inability to completely specify the process of speech recognition. Each amplitude is therefore represented as a fuzzy number. A fuzzy number may be viewed as a set of numbers around a certain interval. For example, integers close to x can be represented by a fuzzy set in which the closer a number is to x, the higher its membership in the fuzzy set. The fuzzy set must be normal, since x must have maximum membership. [KLIR95]

During the distance calculation, amplitudes are assumed to vary by some specified amount from the measured values. Various values were tested, but a maximum of 16 was experimentally determined to give the best results. Therefore, when the absolute magnitude of the distance between two points is computed, it is adjusted to be a maximum of 16 points closer. The minimum is 0. The membership function, shown in Figure 5, is:

Degree of Membership Equation

For distances below the fuzzy distance threshold, in this case 16, the degree of membership is computed on the interval [0.5, 1]. For distances above the threshold, the degree of membership linearly decreases to zero as the distance approaches the maximum.

DOM Graph
Figure 5. Fuzzy Number Membership Function
Values closer to the actual value have a higher degree of membership, while values further away have lower membership.

The membership of the total distance is the average of the degree of membership of every point along the optimal path. The result of comparing each template to the unknown waveform is a fuzzy set consisting of the set of templates and their degrees of membership, which represent the templates' similarity to the unknown waveform. To defuzzify the result and select the most likely category, the maximum degree of membership is identified. Then the element from the set of maximum membership with the minimum distance is selected as the best match.

4. System Configuration

The majority of isolated word recognizers use a process called template matching to perform recognition. [LEA80] When an unknown waveform is presented to the system, it is compared to a template for each word in the system to find the best match. If found, that template's name is assigned to the unknown waveform. [FRIE68]

Although the recognition system designed for this paper can perform general word recognition, it was designed primarily to perform isolated digit recognition. Since the digits are relatively short, the unit of recognition is a word.

Multiple tests were conducted to determine the system's performance under various conditions. In each test, templates and samples were recorded using a low-cost unidirectional microphone in a noisy environment. The sampling frequency was 6 kHz with 8 bits per sample.

After recording a template or unknown waveform, the system performs segmentation to isolate the word. Various threshold values used by the segmentation routine were tested. The threshold maximum determines how loud a sample must be to indicate the start or end of the word. When processing the waveform, the segmentation routine searches for the first sample that exceeds the threshold. The threshold minimum determines how loud a sample must be to be considered part of the word. Once the threshold maximum is found, the routine searches backward until a sample below the minimum is found. The isolated word is then normalized and stored in memory.

Initial tests were conducted to test the usefulness of removing the waveform's phase and clipping sample values below a specified threshold. In both cases, the system suffered from reduced discrimination. [MILL95]

5. Initial Trial

The first trial was performed using a trained male speaker. The threshold maximum was set to 16, and the threshold minimum was set to 4. Template waveforms for each of the ten digits were recorded and saved first. Then for each digit, ten sample waveforms were recorded and saved. The system was then setup to analyze all 100 "unknown" waveforms using first the crisp classification algorithm and then the fuzzy classification algorithm. The results are shown in Table 3.

Digit% CorrectError% CorrectError
Table 3. Initial Results with a Trained Male Speaker
Ten unknown samples for each digit were classified. The system accuracy for each digit and the total accuracy are shown for both crisp and fuzzy techniques.

Error values represent the average distance from the correct classification to the actual classification. Error values were calculated by averaging the absolute magnitude of the differences between the distance from the correct classification and the distance from the actual classification:

Error Summation Equation

where Ei is the Error for digit i, d' is the distance to the correct classification for digit i and d is the distance to the actual classification made by the system for digit i.

Analysis of the crisp results revealed that when the system misclassified a waveform, it classified it as the waveform Six 83% of the time. Examination of the templates revealed that the waveform for Six was on average 2.25 times shorter than the other templates. Even though distance calculations are normalized to reduce the effects of template length, an extremely short template, relative to the lengths of the other templates, will predispose the system to that classification. The fuzzy results show a more even distribution among misclassifications.

The waveform for the template Six was much shorter than the other templates because it begins and ends with the unvoiced phoneme s. Unvoiced phonemes have a much lower relative volume than voiced phonemes. Since the threshold maximum was set to a relatively high value, the beginning and ending phoneme were almost completely removed from the template. In order to remove the classification bias, a much lower threshold maximum needs to be used.

6. Additional Trials

Using the same trained male speaker as in the initial trial, a new set of template and sample waveforms were recorded. The threshold maximum was set to 8, and the threshold minimum was set to 0. The results are shown in Table 4.

Digit% CorrectError% CorrectError
Table 4. Results with a Trained Male Speaker
Ten unknown samples for each digit were classified. Templates and unknowns were segmented using a lower threshold maximum to remove classification bias.

Digit% CorrectError% CorrectError
Table 5. Results with an Untrained Female Speaker

The results show a dramatic increase in accuracy for the crisp algorithm. Classification accuracy of all waveforms except Three and Seven increased. Interestingly, recognition for Seven dropped from 90% to 0%; this result is quite unexpected since seven is a two syllable word and has one of the most unique and consistent waveforms. It is interesting to note that the template for Zero was longer than the template for Four (Two was the shortest template).

Another trial was conducted with an untrained female speaker. The segmentation thresholds were the same as with the previous male speaker. The results are shown in Table 5. The system correctly classified all 100 waveforms using both the crisp and fuzzy algorithms.

In an attempt to explain the perfect results of the female speaker, crisp template correlations for each speaker were calculated. The results for the male speaker are shown in Table 6; the results for the female speaker are shown in Table 7. The template correlations are symmetric.

Digit 01 23 45 67 89
00 11.714.8 13.212.0 13.115.6 13.414.1 16.0
10 13.911.2 11.710.7 14.39.9 13.312.5
2 012.6 15.212.5 15.515.2 13.712.6
3 011.0 10.113.4 12.110.1 11.4
4 0 11.012.1 10.39.4 14.5
5 010.0 10.89.0 12.5
6 011.7 7.516.5
7 0 11.913.0
8 010.8
9 0
Table 6. Crisp Template Correlation for Male Speaker
Each cell shows the distance between a pair of templates.

Digit0 12 34 56 78 9
00 10.08.5 9.211.4 7.610.3 8.311.8 10.4
1 09.4 9.514.1 7.07.2 6.510.1 8.1
2 0 5.913.9 8.49.1 9.711.8 12.2
3 0 13.412.6 10.211.9 12.616.0
4 013.3 14.714.3 18.317.6
5 011.5 10.78.7 8.9
6 06.5 6.511.6
7 0 7.99.4
8 010.4
9 0
Table 7. Crisp Template Correlation for Female Speaker
Each cell shows the distance between a pair of templates.

The correlation results, while interesting, do not provide any revealing answers to the question of why the female speaker's results were so impressive. On average, the male speaker's templates were more diverse, which should indicate that they would be better for classification. One possible answer is that the female speaker was British, which may predispose her to speak clearly and accurately. More trials are needed to determine which factors most prominently affect the system.

7. Sub-Sampling Trials

Using the templates and a subset of the sample waveforms from the initial trial set, sub-sampling trials were performed to determine how well the crisp and fuzzy algorithms respond to information loss. Given a waveform recorded at a specific sampling frequency, sub-sampling involves finding the maximum (or peak) value from a group of samples within a specific time period. For example, the template and sample waveforms were sampled at 6 kHz. Sub-sampling at 1000 Hz involves finding the maximum value from every 6 samples; sub-sampling at 100 Hz means taking the maximum value from every 60 samples. Table 8 shows the results of sub-sampling.

The crisp system tends to be erratic and the results are not consistent as the degree of information loss increases. The fuzzy system is much more tolerant to information loss, and degrades well. These results were expected, and confirm the assertion that fuzzy systems are able to work effectively even in the presence of uncertainty.

Sub-SamplingCrisp Fuzzy
Frequency (Hz)% Correct % Correct
100020 75
40010 50
20035 45
10035 25
Table 8. Sub-Sampling Results
The Table shows the results of sub-sampling a various frequencies.

8. Conclusions

Analysis of the recognition technique presented here reveals that the use of fuzzy logic enhances the capabilities of a speech recognition system with little additional cost in either hardware or performance. For the male speaker, the fuzzy system performed considerably better than the crisp system. The results also showed that the fuzzy system degraded better than the crisp system as the information's uncertainty increased.

The ultimate goal of speech recognition is the design of a system capable of recognizing continuous speech from multiple speakers from a large vocabulary. Testing speakers using templates from other speakers should provide results that will aid in extending the system's ability to recognize speech from multiple speakers. In addition, clustering algorithms can be used to determine optimal templates for each word in the vocabulary and various segmentation threshold values should be tested to determine optimal levels for general recognition.

[DEMO83] De Mori, Renato. Computer Models of Speech Using Fuzzy Algorithms. Plenum, 1983.

[FRIE68] Friedman, David H. Detection of Signals by Template Matching. Johns Hopkins University Press, 1968.

[KLIR95] Klir, George J., and Bo Yuan. Fuzzy Sets and Fuzzy Logic: Theory and Applications. Prentice-Hall, 1995.

[LEA80] Lea, Wayne A., ed. Trends in Speech Recognition. Prentice-Hall, 1980.

[MILL95] Mills, Patrick M. "Fuzzy Speech Recognition." Thesis. University of South Carolina, 1995.

[WAIB90] Waibel, Alex and Kai-Fu Lee, ed. Readings in Speech Recognition. Morgan-Kaufmann, 1990.

Return to Main Page | Return to Fuzzy Logic Page

Contact me at: pmills@ieee.org - © 1995 - 2024 Patrick M. Mills. All Rights Reserved.