Huazhong University of Science & Technology, China University at Buffalo, the State University of New York, USA Energy Characterization and Optimization of Embedded Data Mining Algorithms: A Case Study of the DTW-kNN Framework Presenter: Aosen Wang Authors: Hanqing Zhou, Lu Pu, Yu Hu, Xiaowei Xu, Huazhong University of S&T, China Aosen Wang, Wenyao Xu, SUNY Buffalo, USA Outline 1 Overview 1 Introduction of DTW-kNN 2 Energy Measurement Testbed 3 DTW-kNN Energy Characterization 4 DTW Energy Optimization 5 Conclusions 2 Overview (1/2) The DTW-kNN framework is widely applied for classification in data mining, such as speech recognition and financial market prediction. DTW-kNN has not been studied on mobile platform or embedded system. 3 Overview (2/2) Our work: Energy characterization and optimization of DTW-kNN framework We design an energy measurement testbed for DTW-kNN algorithms. We analyze the energy characterization of each component in the DTW- kNN framework based on our proposed energy measurement testbed; Three optimization strategies are proposed and implemented on the testbed from algorithmic level to improve energy efficiency. 4 Introduction of DTW-kNN (1/3) DTW-kNN: a widely applied classification framework. 5 Introduction of DTW-kNN (2/3) Dynamic Time Warping (DTW): a popular distance metric of similarity. Two time series: C = c1, c2, · · · , ci, · · · , cn, (1) T = t1, t2, · · · , ti, · · · , tm. DTW warping path: M (i, j ) = (ci − tj )*(ci − tj ) 6 Introduction of DTW-kNN (3/3) k-Nearest Neighbors (kNN): well-investigated method for pattern classification. 7 Energy Measurement Testbed (1/2) Framework: ARM Cortex-M3: STM32F103 Current-sense Amplifier: MAX471 MCU: MSP430 8 Energy Measurement Testbed (2/2) Framework picture: 9 DTW-kNN Energy Characterization (1/2) Characterization experiment setup: 5 datasets: from from a popular data warehouse; Short sequence length: limited RAM and ROM Memory-efficient operation method: Memory Space requirement from 2×N×N to 2×N 10 DTW-kNN Energy Characterization (2/2) Energy characterization: DTW calculation: as much as 97% ! Normalization DTW kNN total energy 11 DTW Energy Optimization (1/7) Experiment setup: All the selected and proposed methods have no influence on accuracy. 5 datasets, short sequence length, memory-efficient operation method; k=1: k does not have significant influence on the energy characterization; Training set: 10 and test set: 100; Energy calculation: 12 DTW Energy Optimization (2/7) Optimization method: the squared distance 13 DTW Energy Optimization (3/7) Optimization method: early abandon of DTW There exist at least 1 element in a row that belongs to the warping path. 14 DTW Energy Optimization (4/7) Optimization method: lower bound and indexing DTW Lower bounding functions are used to estimate the lower bound of DTW distances. An example of how lower bound (LB) and indexing work: Hard to calculate Easy to calculate DTW1 > LB1 DTW2 > LB2 DTW3 > LB3 Calculate the 3 LBs and sort them; Calculate the DTW with the lowest LB LB2 is the lowest, so calculate DTW2 Compare DTW2 with LB1 and LB3 As DTW2 is smaller than LB1 and LB3, DTW2<LB1<DTW1 and DTW2<LB3<DTW3 So calculations of DTW1 and DTW3 can be elimited 15 DTW Energy Optimization (5/7) Optimization method: lower bound and indexing DTW 3 LB methods are adopted. DTW Energy Optimization (6/7) Optimization method: Put the methods all together SD: Squared Distance; EA: Early Abandon; LB_***: Lower Bound method DTW Energy Optimization (7/7) Frequency scaling on dynamic energy: Conclusion In this paper, we investigate the energy characterization and optimization of DTWkNN framework from algorithmic level. The bottleneck of the DTW-kNN framework is distance matrix calculation accounting for 89.14% on average of the total energy consumption. The energy reduction of squared distance, early abandon and lower bounding methods are about 1%, from 29.5% to 89.9% and about 50% respectively. When all optimization methods are implemented, the energy reduction can be as much as 74.6%. Future Work We will continue our work by another two aspects to improve energy efficiency: Architecture-level: parallel computing of each template. Microarchitecture-level: hardware accelerator, such as speeding up the distance matrix calculation and warping path calculation. Huazhong University of Science & Technology, China University at Buffalo, the State University of New York, USA Thank you! Aosen Wang 21