Research Article

Energy-Efficient Real-Time Human Activity Recognition on Smart Mobile Devices

Algorithm 1

Variable activity recognition duration algorithm. The elements (, ) of the dynamic and static configuration tables contain the acceleration-sampling frequency and window size where th is the threshold to maintain a combination in the dynamic configuration table, is the repeating count of the static activity type, is the count continuously kept of any activity, and is the index of an element in the configuration table. There are seven classification models for each element in the control tables, and is the maximum sleep time.
(1) Set the SF f with the initial and the WS with the initial size;
(2) Load the classification model for f and ;
(3) Load the dynamic configuration table as [: (100 Hz, 128), : (50 Hz, 128), : (50 Hz, 256), : (50 Hz, 512)];
(4) Load the static configuration table as [: (100 Hz, 512), : (100 Hz, 256), : (100 Hz, 128)],
(5) the repeating count of SAT , and the repeating count of the same activity ; ;
(6) Set the threshold th for
(7) and the maximum sleep time ;
(8) While   Do
(9)   Start the accelerometer; fill window with ;
(10)   Classify the current activity from the window with ;
(11)    If the current activity is DAT Then
(12)     ; ;
(13)     If the current activity is equivalent to the previous activity Then
(14)       Increase ;
(15)       If exceeds th Then
(16)         Increase up to the size of the dynamic configuration table; ;
(17)       End If
(18)     Else
(19)       ; ;
(20)     End If
(21)     Update f and with the control table ;
(22)     Load the classification model for f and ;
(23)    Else
(24)     If is equivalent to 0 Then
(25)       ;
(26)     End If
(27)     Update f and with the control table ;
(28)     Load the classification model for f and ;
(29)     Calculate based on (1);
(30)     If exceeds   Then
(31)       Increase up to the size of the static configuration table; ;
(32)     End If
(33)     Stop the accelerometer;
(34)     Set the timeout of Sleeping with the repeating count of SAT ;
(35)     Delay for the timeout of Sleeping;
(36)     Increase ;
(37)   End If
(38) End While