
Figure 1:
Overview of proposed work. SAE, stacked autoencoder.
| Algorithm: MHSA-SAE |
|---|
| Input: X ∈ ℝn×t×d |
| Output: Y ∈ ℝn×c |
| 1. Preprocess: |
| X ← Normalize(X) |
| 2. Encode: |
| H ← fSAE (X) |
| 3. Apply Attention: |
| Q, K, V ← Linear(H) |
| A ← MHSA(Q, K, V) |
| 4. Classify: |
| Y ← Softmax (Wc · A+bc) |
| Return Y |
Table 1:
Performance of MHSA-SAE on test set
| Metric | Value (%) |
|---|---|
| Accuracy | 97.82 |
| Precision | 96.45 |
| Recall | 96.90 |
| F1-score | 96.67 |
| AUC | 98.10 |
Table 2:
Class-wise precision, recall, and F1-score
| Activity Class | Precision (%) | Recall (%) | F1-Score (%) |
|---|---|---|---|
| Standing | 98.1 | 98.4 | 98.2 |
| Walking | 97.3 | 96.9 | 97.1 |
| Running | 95.0 | 94.6 | 94.8 |
| Sitting | 96.7 | 97.0 | 96.8 |
| Lying down | 94.5 | 95.3 | 94.9 |
| Climbing stairs | 93.1 | 92.7 | 92.9 |

Figure 2:
Comparison against the activity class.

Figure 3:
Pictorial representation of physical activities (standing, sitting, walking, running, lying down, and climbing stairs) along with their corresponding recognition accuracies based on the MHSA-SAE model. MHSA-SAE, multi-head self-attention enhanced stacked autoencoder.

Figure 4:
Accuracy comparison. MASH, method for activity sleep harmonization; MHSA-SAE, multi-head self-attention enhanced stacked autoencoder; SVM, support vector machine.

Figure 5:
F1 score comparison. MHSA-SAE, multi-head self-attention enhanced stacked autoencoder; SVM, support vector machine.

Figure 6:
ROC curve. AUC, area under the receiver operating characteristic curve; MHSA-SAE, multi-head self-attention enhanced stacked autoencoder.
Table 3:
Comparison with existing methods