382
A. Jmal et al.
5 Real-Time HAR Implementation in Raspberry PI
After collecting data from the BlueNRG-Tile and building the ANN model using
an accelerometer and a gyroscope, this section presents an implementation of the
developed algorithm in a Raspberry PI using MPU6050 to capture data for real
time predictions as shown in Fig. 6. The prototype is tested to a boy of 16 years
old for 15 s. As shown in the Fig. 6, The MPU6050 is placed on the right foot
attached to the raspberry PI with jumper.
Fig. 6. Connecting the Raspberry PI with the MPU6050
Table 1. Confusion matrix for the real-time implementation
Actual
Predicted
Sitting Walking Running
Sitting
93.34% 6.66%
0%
Walking 0%
86.66% 13.34%
Running 0%
20%
80%
Table 1 presents the confusion matrix for the real-time implementation for
15 s each activity. To express the efficacy of the algorithm, the performance metrics in term of accuracy and precision needs to discuss. The confusion matrix
validates our simulation results. To calculate the accuracy, True Positive (TP),
True Negative (TN), False Positive (FP) and False Negative (FN) are required.
After testing the prototype for 15 s, an accuracy of 86% is achieved with an
average precision approximately 84%. Real-time simulation with the Raspberry
PI shows good results in term of prediction and differentiation between sitting,
walking and running activities. Obtained results from simulations and results
A. Jmal et al.
5 Real-Time HAR Implementation in Raspberry PI
After collecting data from the BlueNRG-Tile and building the ANN model using
an accelerometer and a gyroscope, this section presents an implementation of the
developed algorithm in a Raspberry PI using MPU6050 to capture data for real
time predictions as shown in Fig. 6. The prototype is tested to a boy of 16 years
old for 15 s. As shown in the Fig. 6, The MPU6050 is placed on the right foot
attached to the raspberry PI with jumper.
Fig. 6. Connecting the Raspberry PI with the MPU6050
Table 1. Confusion matrix for the real-time implementation
Actual
Predicted
Sitting Walking Running
Sitting
93.34% 6.66%
0%
Walking 0%
86.66% 13.34%
Running 0%
20%
80%
Table 1 presents the confusion matrix for the real-time implementation for
15 s each activity. To express the efficacy of the algorithm, the performance metrics in term of accuracy and precision needs to discuss. The confusion matrix
validates our simulation results. To calculate the accuracy, True Positive (TP),
True Negative (TN), False Positive (FP) and False Negative (FN) are required.
After testing the prototype for 15 s, an accuracy of 86% is achieved with an
average precision approximately 84%. Real-time simulation with the Raspberry
PI shows good results in term of prediction and differentiation between sitting,
walking and running activities. Obtained results from simulations and results
