Temporal data sequences and spatial-temporal data sequences constitute a large portion of information stored in databases. Many applications need to measure similarity between data sequences instead of exact matches. A common way to analyze two time series signals or data sequences is to measure ‘distances’ between the two sequences. If the distance is zero, then the sequences are identical, and if the distance is less than a predetermined threshold, the sequences are considered similar.
Such analysis can be used in applications such as image retrieval, DNA pattern recognition, economic growth patterns, price and stock trends, weather and astrophysics patterns, and geological feature identification. For example, an image can be represented as a color histogram, which is a data sequence. Similar images have similar color histograms.
However, if the sequences have shape deformations, non-linear shifts, scaling, and phase shifts, then conventional distance metrics often fail. Furthermore, there is no method that can concurrently determine a distance metric between sequences, while aligning the sequences.
A major drawback of prior art ‘bin-by-bin’ distance measures, e.g., Minkowski, Intersection, Lorentzian, Chi, Bhattacharyya, etc., is that they account only for correspondences between bins with the same index. They do not use information across bins. For example, a shift of a bin index can result in larger distances, although the two sequences otherwise match, wielding erroneous results.
For color histograms of an image, quantization is yet another consideration. A slight change in lighting conditions can result in a corresponding shift in the color histogram. This causes the metrics to completely miss any similarity. Contribution of empty bins is also important. Weighted versions of the Minkowski metric can underestimate distances because they tend to accentuate the similarity between color sequences with many non-empty bins. Furthermore, not all sequences have the same number of bins, and the bin size can vary within the same sequence.
Not all distance measures can be extended to multi-dimensional sequences, e.g., the Kolmogrov-Smimov statistic. Computational complexity of cross-bin measures is higher than the bin-by-bin measures. In cases where the number of bins is large, or sequences are multi-dimensional, the earth mover's distance (EMD), the Hausdorff distance, and the quadratic form become infeasible.
Although cross-bin matching is possible for EMD, the Hausdorff, and the quadratic form distance, those methods do not have any mechanism to preserve the ordering of the sequences. Obviously, changing the order of the sequences can significantly deteriorate the accuracy of the distance when the similarity of the sequences is already marginal.