## 3 Materials and Methods
### Performance Metrics and Evaluation of the Trained Model  
In evaluating the efficacy of the developed models, several performance metrics are employed, each providing unique insights into the model's capability to accurately classify human activities.  
Accuracy is the primary metric to evaluate the overall correctness of predictions made by the model. Accuracy represents the proportion of correctly classified instances (both positive and negative) to the total instances. This metric provides a broad indication of the model's reliability and effectiveness across all activity categories. The mathematical expression for accuracy is given by  
\[Accuracy=\frac{TP+TN}{TP+TN+FP+FN}. \tag{8}\]  
Precision is another critical metric in this study, particularly when differentiating between similar activities. It indicates the proportion of correctly predicted positive observations to the total predicted positives. High precision is crucial in minimizing false positives, which could otherwise compromise the system's utility in real-world applications. The mathematical expression for precision is given by  
\[Precision=\frac{TP}{TP+FP}. \tag{9}\]  
Recall (Sensitivity), another critical metric, measures the model's ability to identify all relevant instances. This is especially vital for activities that are subtly distinct, such as differentiating between sitting and standing. A higher recall rate ensures that fewer actual events of interest are missed, maintaining the system's reliability across diverse scenarios. The mathematical expression for recall is given by  
\[Recall=\frac{TP}{TP+FN}. \tag{10}\]  
The F1 Score is used to find the balance between precision and recall. An optimal F1 Score is indicative of the robustness of the model against the potentially imbalanced nature of the dataset, ensuring consistent performance in identifying correct activities while reducing false identifications. The mathematical expression for the F1 Score is given by  
\[F1\ Score=2\bigg{(}\frac{Precision\cdot Recall}{Precision+Recall}\bigg{)}. \tag{11}\]  
Lastly, a confusion matrix offers a comprehensive visualization of the model's performance across all activity categories. It provides clarity on how accurately each category is predicted by displaying TP, FP, FN, and TN (Table 6). This matrix is instrumental in evaluating the model's ability to differentiate between similar activities, such as walking and running. For example, the matrix can reveal how well the model distinguishes between  
\begin{table}
\begin{tabular}{c c} \hline \hline
**No.** & **Simulation Parameters** & **Value** \\ \hline
1 & Number of frequency for data collection & 50 Hz \\
2 & Total number of samples for each volunteer in one activity & 19,200 samples \\
3 & Total number of samples for one window & 128 samples \\
4 & Number of windows for non-overlapping case in one activity & 150 windows \\
5 & Number of windows for 50\% overlapping case in one activity & 300 windows \\
6 & Window size & 2.56 s \\
7 & Total time to collect the data per activity & 7 min \\
8 & Number of nested cross-validation (outer, inner) & 5, 3 \\
9 & Number of features (non-overlapping, 50\%-overlapping) & 42, 84 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Simulation Parameters for Machine Learning and Deep Learning Model Evaluation.  
these activities and help in assessing the impact of potential adjustments, such as increasing the number of sensors, on the overall performance of the system.  
Collectively, these metrics facilitate a thorough evaluation of the model's performance and are essential for guiding the iterative refinement of the activity recognition system.