# Real-Time Human Activity Recognition on Embedded Equipment: A Comparative Study
## 3 Proposed Framework for Real-Time HAR  
This section outlines the real-time human activity recognition (HAR) framework, comprising three essential stages: (1) the identification of optimal features; (2) a dynamic segmentation method in real-time, which discerns the initiation and conclusion of each activity segment; and (3) a classification step. Prior to these stages, there is an initial data pre-processing step (i.e., cleaning, filtering, and standardizing the raw sensor data before feature extraction and analysis). The selection of a pertinent sensor configuration is an important aspect of HAR. In fact, some of them are not relevant or redundant for activities recognition. The objective of selecting a minimum sensor configuration is not to exclude the other sensors from the house but to filter the sensors as input to the real-time HAR algorithm so that it goes faster with an acceptable compromise on recognition performance, but with a performance gain in terms of real-time processing time. In this work, the minimum sensor setup is selected using the mutual information criterion proposed by [23]. Thus, one of the challenges is how to split the sensor sequence into a series of event chunks that are associated with corresponding activities. In [11], the dynamic segmentation of events is proposed. It is determined using the Pearson product moment correlation (PMC) coefficient between the events [24]. PMC, or more formally \(\rho_{X,Y}\), is a measure of \begin{table}
\begin{tabular}{c c c c} \hline
**Reference** & **Algorithm** & **Performance** & **Hardware Architecture** \\ \hline
[15] & CNN & 92.46\% &
\begin{tabular}{c} Nucleo-L452 RE-P \\ SparkFun Edge board \\ (ARM Cortex-M4F) \\ \end{tabular} \\ \hline
[19] & RNN \& LSTM & 95.54\% &
\begin{tabular}{c} STM32L476 RG (ARM \\ Cortex-M4F) \\ \end{tabular} \\ \hline
[16] & LSTM & 93.54 \% &
\begin{tabular}{c} Intel-i7 CPU, NVIDIA \\ GTX 960M GPU \\ \end{tabular} \\ \hline
[17] & RNN and LSTM & 95.78 \% &
\begin{tabular}{c} Raspberry Pi 3 (ARM \\ Cortex A53) \\ \end{tabular} \\ \hline
[18] & LSTM & 86.40\% & GPU \\ \hline \end{tabular}
\end{table} 
Table 1: Cont. the linear correlation between two variables, \(X\) and \(Y\) (two events in our case study). It is calculated using Equation (1). \[\rho_{X,Y}=\frac{cov(X,Y)}{\sigma_{X}\sigma_{Y}} \tag{1}\]  
where: \(cov(X,Y)\), \(\sigma_{X}\) and \(\sigma_{Y}\) represent, respectively, the covariance of \(X\) and \(Y\) are the standard deviation of \(X\) and \(Y\), respectively. It produces a value between \(-1\) and \(1\). Three cases are distinguished:  
* \(X\) and \(Y\) are totally positively correlated if \(\rho_{X,Y}=1\)
* \(X\) and \(Y\) are totally negative correlated if \(\rho_{X,Y}=-1\)
* \(X\) and \(Y\) are no correlated if \(\rho_{X,Y}=0\)  
The aim of this work is to implement trade-offs that enable real-time activity recognition on constrained embedded hardware. We seek to maintain acceptable performance in terms of decisions while being moderate in terms of consumption of computing resources. The work described in [11] precisely proposes to simplify one step: real-time segmentation, with the general idea of relying on the \"usual correlations\" between events within activities. The results show that the proposed approach segments the flow of events well and is even able to guess the desired activities (Sleeping, Bed to toilet, Meal preparation, Eating, Housekeeping, Working, Enter home, and Leave home) with an F1 score of 0.63 to 0.99. Note that in our context, \"real-time\" means being able to make a decision before the next event occurs. For this, the minimization of the setup described in [23] further simplifies the calculations. The proposed framework is visually depicted in Figure 1. These steps are presented sequentially in the following paragraphs. The subsequent phase of the proposed framework (depicted in Figure 1) involves the execution of recognition.