深度步態分析與低功耗設計之研究
A Study of IMU-based Deep Gait and Its Low Power Design
摘要
步態參數分析在醫療照護、運動訓練或是日常行走監控都是一大指標,因此近年來有許多研究利用慣性測量單元(IMU)以進行各種步態參數的萃取與分析。本論文為了避免以往研究所使用的複雜的感測器校正與額外環境設定,因此提出了一個基於深度神經網路的步態分析系統,本論文更實做出一個極低功耗的CNN加速器以實現在IMU感測器端進行即時的步態參數分析。
本論文首先提出三個深度神經網路模型預測四個最重要的步態參數,分別為步態軌跡、步態週期、步長與走跑判斷。對於預測步態軌跡,本論文提出一個三維混和深度神經網路模型-3-D Fusion Model,此模型可將IMU所量測到的資料做足部的軌跡預測,並且只使用單一模型便可同時獲取三維座標的位置。為了增加網路的穩定性與準確率,此研究使用滑動窗口與隨機窗口採樣的方式增加資料的多樣性。最終,此網路的平均誤差可在3D座標軸中分別達到2.3cm(X軸)、0.91cm(Y軸)、0.58cm (Z軸)。
針對步態週期預測,我們提出一個基於分割方法的深度神經網路-IMU-Net,此網路可以輕易的應用在不同的走路與跑步速度的情況。由於IMU-Net是使用分割的方法實現步態週期預測,因此能避免以往研究需要依照資料型態而設定不同大小的滑動窗口所造成的不穩定問題,此網路更不受限於IMU的採樣頻率所影響,可以使用在1000Hz的資料上以獲得高精確的結果或是使用在20Hz上來達到即時運算,因此IMU-Net相較於以往的研究能更加的廣泛使用。最終,網路的平均誤差在擺盪週期的時間可達到8.86ms、站立靜止週期的時間可達到9.12ms,而在步態的辨識率可達到96.44%,在步數的偵測上則可達到99.97%的準確率,準確率都較高於以往的研究,而由於此網路夠輕量化,因此能夠在手機端進行即時的運算,使用手機計算一秒的IMU資料只需要36ms。
對於步長與走跑判斷的部分,我們提出一個深度神經網路SL-Net。為了避免資料不足夠的問題,此網路首先對無標註資料做三種資料增補並產生大量的無標註資料(共623.7分鐘),並使用此大量的無標註資料進行自監督訓練 - 重建任務,最後再使用少量的有標註資料(共2.8分鐘)進行監督訓練 - 步長與走跑判斷,經過此訓練過程後,此網路能有效的降低資料不足所造成的過擬合問題,本論文更提出一個新的損失函數PEW_RMSE,此損失函數將百分比誤差與均方根误差融合以平衡走路與跑步的步長差距。最終此網路在步長的平均百分比誤差上能低於以往研究中最好的7.44%,達到4.78%,而走跑判斷的準確率則達到99.83%。本論文將IMU-Net與SL-Net整合為步態分析系統,其可獲得四個重要的步態參數並延伸出五個額外的參數。我們最終將此步態分析系統實作於網頁伺服器與手機端上,可分別進行離線分析與即時運算。
本論文為了在IMU感測器端執行步態參數分析系統而將模型最佳化並設計極低功耗的CNN加速器。本論文的步態分析系統是由兩個深度神經網路所組成,分別為步態週期偵測(IMU-Net)與步長預測(SL-Net),因此我們針對兩個網路分別做最佳化處理。首先,我們降低IMU-Net的輸入資料採樣頻率,並且將網路量化為二值網路,最終可將網路的MACs減少99.9%。其次,我們將SL-Net量化為8位元網路,並且使用CSPNet的結構來最佳化網路結構,最終可將此網路的MACs減少90%。最終,此深度步態分析系統僅有22KB的大小,因此可以嵌入晶片中並只使用內部的記憶體便可進行運算,以減少外部記憶體所造成的功率消耗。對於內部記憶體的功率消耗,我們提出池大小交錯處理順序的方式以重複使用內部資料,此處理順序也適用於時序的資料型態。最終我們使用TSMC的28nm製程實作我們的硬體,此硬體只需要7.56uW的動態功率消耗,相較於在ARM Cortex M4上減少了99.9%的功率消耗。
本論文首先提出三個深度神經網路模型預測四個最重要的步態參數,分別為步態軌跡、步態週期、步長與走跑判斷。對於預測步態軌跡,本論文提出一個三維混和深度神經網路模型-3-D Fusion Model,此模型可將IMU所量測到的資料做足部的軌跡預測,並且只使用單一模型便可同時獲取三維座標的位置。為了增加網路的穩定性與準確率,此研究使用滑動窗口與隨機窗口採樣的方式增加資料的多樣性。最終,此網路的平均誤差可在3D座標軸中分別達到2.3cm(X軸)、0.91cm(Y軸)、0.58cm (Z軸)。
針對步態週期預測,我們提出一個基於分割方法的深度神經網路-IMU-Net,此網路可以輕易的應用在不同的走路與跑步速度的情況。由於IMU-Net是使用分割的方法實現步態週期預測,因此能避免以往研究需要依照資料型態而設定不同大小的滑動窗口所造成的不穩定問題,此網路更不受限於IMU的採樣頻率所影響,可以使用在1000Hz的資料上以獲得高精確的結果或是使用在20Hz上來達到即時運算,因此IMU-Net相較於以往的研究能更加的廣泛使用。最終,網路的平均誤差在擺盪週期的時間可達到8.86ms、站立靜止週期的時間可達到9.12ms,而在步態的辨識率可達到96.44%,在步數的偵測上則可達到99.97%的準確率,準確率都較高於以往的研究,而由於此網路夠輕量化,因此能夠在手機端進行即時的運算,使用手機計算一秒的IMU資料只需要36ms。
對於步長與走跑判斷的部分,我們提出一個深度神經網路SL-Net。為了避免資料不足夠的問題,此網路首先對無標註資料做三種資料增補並產生大量的無標註資料(共623.7分鐘),並使用此大量的無標註資料進行自監督訓練 - 重建任務,最後再使用少量的有標註資料(共2.8分鐘)進行監督訓練 - 步長與走跑判斷,經過此訓練過程後,此網路能有效的降低資料不足所造成的過擬合問題,本論文更提出一個新的損失函數PEW_RMSE,此損失函數將百分比誤差與均方根误差融合以平衡走路與跑步的步長差距。最終此網路在步長的平均百分比誤差上能低於以往研究中最好的7.44%,達到4.78%,而走跑判斷的準確率則達到99.83%。本論文將IMU-Net與SL-Net整合為步態分析系統,其可獲得四個重要的步態參數並延伸出五個額外的參數。我們最終將此步態分析系統實作於網頁伺服器與手機端上,可分別進行離線分析與即時運算。
本論文為了在IMU感測器端執行步態參數分析系統而將模型最佳化並設計極低功耗的CNN加速器。本論文的步態分析系統是由兩個深度神經網路所組成,分別為步態週期偵測(IMU-Net)與步長預測(SL-Net),因此我們針對兩個網路分別做最佳化處理。首先,我們降低IMU-Net的輸入資料採樣頻率,並且將網路量化為二值網路,最終可將網路的MACs減少99.9%。其次,我們將SL-Net量化為8位元網路,並且使用CSPNet的結構來最佳化網路結構,最終可將此網路的MACs減少90%。最終,此深度步態分析系統僅有22KB的大小,因此可以嵌入晶片中並只使用內部的記憶體便可進行運算,以減少外部記憶體所造成的功率消耗。對於內部記憶體的功率消耗,我們提出池大小交錯處理順序的方式以重複使用內部資料,此處理順序也適用於時序的資料型態。最終我們使用TSMC的28nm製程實作我們的硬體,此硬體只需要7.56uW的動態功率消耗,相較於在ARM Cortex M4上減少了99.9%的功率消耗。
Wearable inertial measurement unit (IMU) sensors based gait parameter extraction becomes popular in recent years for medical care, sports training, or daily life monitoring. However, conventional approaches suffered from complicated sensor calibration, extra sensor settings, and environment limitations due to inherent nonlinearity of IMU sensors and limited capabilities of signal processing algorithms. This dissertation proposes a gait analysis system with deep neural networks to overcome above limitations and its ultra low power accelerator to enable on sensor device processing.
For gait analysis, we proposes three deep neural networks to extract four important gait parameters, gait trajectories, gait phase, stride length, and classification of running/walking. To obtain gait trajectories, we presents a 3-D Fusion Model to predict the foot trajectory recorded by the high-speed camera VICON. The proposed approach fuses predictions of three-dimensional output into one model. The training data are further augmented by sliding and random window samplings on IMU sensor data to increase data diversity for better performance. The proposed 3-D Fusion Model can achieve average error of 2.30 cm in the X-axis, 0.91 cm in the Y-axis, and 0.58 cm in the Z-axis.
For gait phase detection, we proposes a segmentation-based model - IMU-Net, which can easily adapt to both walking and running at various speeds. Previous gait phase detection using convolutional neural network based classification task requires cumbersome manual setting of time delay or heavy overlapped sliding windows to accurately classify each phase under different test cases. The proposed approach uses CNN based segmentation with gait phase aware receptive field setting and IMU oriented processing order, which can fit high sampling rate of IMU up to 1000Hz for high accuracy and low sampling rate down to 20Hz for real-time calculation. The proposed model can achieve average error of 8.86 ms in swing time, 9.12 ms in stance time, and 96.44% accuracy of gait phase detection, and 99.97% accuracy of stride detection. Its real-time implementation on mobile phones only takes 36 ms for 1 second length of sensor data.
For stride length and running/walking classification task, we proposed a multi-task model - SL-Net. Current deep learning methods suffer from few labeled data problems. To solve the above problems, this model trains its pretext task with self-supervised learning on a large unlabeled dataset (623.7 minutes) for feature learning, and its downstream task on the stride length estimation and classification tasks with supervised learning with a small labeled dataset (2.8 minutes). For its loss function, we adopt a percentage error weighted RMSE to balance data difference of running and walking stride length. The proposed model can achieve better average percent error, 4.78%, on running and walking stride length regression and 99.83% accuracy on running and walking classification, when compared to the previous approach, 7.44% on the stride length estimation. Above IMU-Net and SL-Net are integrated into a gait analysis system, which can extract four important gait parameters from deep learning models, and derive five other parameters. This system has been implemented on the server for off-line execution and mobile phone for real-time calculation.
To real-time execute our gait analysis system on sensor devices, we presents a deep gait analysis accelerator with low power optimizations on the model and hardware design. The model is constructed with a cascaded gait phase detection (IMU-Net) and stride length prediction (SL-Net) to enable stride length prediction only on the swing phase. Furthermore, the segmentation based gait phase detection model allows 20Hz instead of 1000Hz sampling rate and binary weight precision, which reduces 99.9% of operations with small accuracy loss. The stride length prediction model is quantized to 8-bit and slimmed to save 90% of operations. The final 22KB lightweight model can be embedded on chip to enable on-chip whole model execution without external intermediate data access. The internal SRAM access power is further reduced with our pooling size interleaved processing order to reuse temporal shared data while fit streaming data processing. The final implementation with TSMC 28nm CMOS process only needs 7.56uW of dynamic power, which reduced 99.9% of power compared with execution on ARM Cortex M4 microcontroller.
For gait analysis, we proposes three deep neural networks to extract four important gait parameters, gait trajectories, gait phase, stride length, and classification of running/walking. To obtain gait trajectories, we presents a 3-D Fusion Model to predict the foot trajectory recorded by the high-speed camera VICON. The proposed approach fuses predictions of three-dimensional output into one model. The training data are further augmented by sliding and random window samplings on IMU sensor data to increase data diversity for better performance. The proposed 3-D Fusion Model can achieve average error of 2.30 cm in the X-axis, 0.91 cm in the Y-axis, and 0.58 cm in the Z-axis.
For gait phase detection, we proposes a segmentation-based model - IMU-Net, which can easily adapt to both walking and running at various speeds. Previous gait phase detection using convolutional neural network based classification task requires cumbersome manual setting of time delay or heavy overlapped sliding windows to accurately classify each phase under different test cases. The proposed approach uses CNN based segmentation with gait phase aware receptive field setting and IMU oriented processing order, which can fit high sampling rate of IMU up to 1000Hz for high accuracy and low sampling rate down to 20Hz for real-time calculation. The proposed model can achieve average error of 8.86 ms in swing time, 9.12 ms in stance time, and 96.44% accuracy of gait phase detection, and 99.97% accuracy of stride detection. Its real-time implementation on mobile phones only takes 36 ms for 1 second length of sensor data.
For stride length and running/walking classification task, we proposed a multi-task model - SL-Net. Current deep learning methods suffer from few labeled data problems. To solve the above problems, this model trains its pretext task with self-supervised learning on a large unlabeled dataset (623.7 minutes) for feature learning, and its downstream task on the stride length estimation and classification tasks with supervised learning with a small labeled dataset (2.8 minutes). For its loss function, we adopt a percentage error weighted RMSE to balance data difference of running and walking stride length. The proposed model can achieve better average percent error, 4.78%, on running and walking stride length regression and 99.83% accuracy on running and walking classification, when compared to the previous approach, 7.44% on the stride length estimation. Above IMU-Net and SL-Net are integrated into a gait analysis system, which can extract four important gait parameters from deep learning models, and derive five other parameters. This system has been implemented on the server for off-line execution and mobile phone for real-time calculation.
To real-time execute our gait analysis system on sensor devices, we presents a deep gait analysis accelerator with low power optimizations on the model and hardware design. The model is constructed with a cascaded gait phase detection (IMU-Net) and stride length prediction (SL-Net) to enable stride length prediction only on the swing phase. Furthermore, the segmentation based gait phase detection model allows 20Hz instead of 1000Hz sampling rate and binary weight precision, which reduces 99.9% of operations with small accuracy loss. The stride length prediction model is quantized to 8-bit and slimmed to save 90% of operations. The final 22KB lightweight model can be embedded on chip to enable on-chip whole model execution without external intermediate data access. The internal SRAM access power is further reduced with our pooling size interleaved processing order to reuse temporal shared data while fit streaming data processing. The final implementation with TSMC 28nm CMOS process only needs 7.56uW of dynamic power, which reduced 99.9% of power compared with execution on ARM Cortex M4 microcontroller.