Information Technology Reference
In-Depth Information
different to the number of possible outputs of the HAR system: the unknown-activity
is incorporated. This produces a confusion matrix
C ∈ R
m
×
m
+
1 .
C still informative, we preserve in its diagonal the correct classifi-
cations, and the misclassifications outside from it except on its last column
To make the
C ( : , c + 1 )
which corresponds to the predicted unknown activities. This column is instead used to
allocate the correct predictions, based on the proposed error metric, of the unknown-
activity class that occur during PTs, so they do not appear as misclassifications outside
the diagonal. In a similar way, we assign as true positives of the PT class the samples
predicted during PTs that match the ground-truth of any of the neighboring window
samples, so they do not appear outside the diagonal either.
7.4.3 HARApp: The Android App for HAR
We developed HARApp, a smartphone application based on the PTA-HAR system.
An Android OS equipped smartphone was selected for this task (SGSII). The code
for the application user interface was written in Java and the most expensive tasks
such as signal processing, ML algorithm and activity filtering were written in C
for allowing faster performance. The NDK facilitated to embed these native code
components into the application.
The app was structured according to Algorithm 3. Two separate threads process
the main functions: Process I nertial Si
g
()
periodically receives from the OS
the inertial signals for conditioning. They get stored in a circular buffer. In parallel, the
execution of the OnlinePrediction
nals
function controls the prediction of activities
which is triggered by scheduled interruptions every 1
()
28 s (half window sample).
The duration of a complete cycle of this function, from window sampling to activity
estimation, takes in average about 152ms for the PTA-6A method and 162ms for
the PTA-7A using a SGSII smartphone. These times are similar as they share the
same feature extraction process which takes nearly 92% of the processing time.
The remaining time is dedicated to the SVM, which only varies in the number of
predicted classes per method, and the filtering stages. The app consumes around
6MB of memory and 4
.
2% of the CPU available time.
The multiclass SVM prediction is performed in real-time although the model
parameters (
.
w c and b c ) are learned offline and loaded into the app beforehand.
Furthermore, the online prediction can be visualized through the touchscreen of the
smartphone. Although this is rarely possible during operation as the device is located
on the waist which restricts this visualization. Figure 7.5 shows a screenshot of the
HARApp graphical interface. A log file also records the predicted activities and
their associated timestamps for subsequent analysis. Moreover, a communications
interface allows to access live prediction data from any other device through a Wi-Fi
connection.
 
Search WWH ::




Custom Search