# MLPs Are All You Need for Human Activity Recognition
## 7 Discussion  
Convolutions capture the spatial information in a local area of the data. However, they are not effective at learning long-term dependencies (temporal data) [24], unlike recurrent networks, which specialise in long-term dependencies. The self-attention mechanism learns the entire context of input patches. Additionally, it learns what to pay attention to based on its weights [40], allowing it to learn the relationship between the sensors and the different activities. The token-mixing MLPs can be considered a convolution layer that captures information about the entire input, combining spatial information from a single channel and distributing channel weights to increase efficiency, which allows the Mixer to perform better than previous techniques when an adequate amount of data is provided and the invariant features of the input are coherent. The normalised confusion matrices of the PAMAP2, Opportunity, and Daphnet datasets are illustrated in Figures 2-4, respectively. The model's ability to distinguish between activities in the PAMAP2 confusion matrix showed that it had learned the various spatial and temporal characteristics of each activity. The model did have some trouble \begin{table}
\begin{tabular}{l c c c c} \hline \hline  & \
\begin{tabular}{c} **Opportunity** \\ **Locomotion** \\ \end{tabular} &
\begin{tabular}{c} **Opportunity** \\ **Gestures** \\ \end{tabular} & **PAMAP2** & **Daphnet Gait** \\ \hline
**Metric** & \(\mathbf{F_{w}}\) & \(\mathbf{F_{m}}\) & \(\mathbf{F_{m}}\) & \\ \hline Ensemble LSTMs [32] & - & 0.726 & 0.854 & - \\ CNN-BiGRU [37] & - & - & 0.855 & - \\ AttenSense [22] & - & - & 0.893 & - \\ Multi-Agent Attention [38] & - & - & 0.899 & - \\ DeepConvLSTM [35] & 0.895 & 0.917 & - & - \\ BLSTM-RNN [33] & - & - & 0.93 & - \\ Triple Attention [39] & - & - & 0.932 & - \\ Self-Attention [40] & - & - & 0.96 & - \\ CNN [18] & - & 0.894 & 0.937 & 0.684 \\ b-LSTM-S [18] & - & **0.927** & 0.868 & 0.741 \\ MLP-Mixer & **0.90 \(\pm\) 0.005** & 0.912 \(\pm\) 0.002 & **0.97 \(\pm\) 0.002** & **0.842 \(\pm\) 0.007** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: State-of-the-art comparison for MLP-Mixer scores with bold font showing the best performing cases. Mixer results in the format mean \(\pm\) std. \(F_{w}\) is the weighted \(F_{1}\) score, and \(F_{m}\) is the \(F_{1}\) macro score. distinguishing between the \"ironing\" and \"standing\" activities; this is probably because the sensor data for these actions are similar in the chest and ankle regions but only slightly different in the hand regions. With further inspection, standing consisted of talking while gesticulating, further validating the possibility of similarities in the hand sensors. Furthermore, the model had little trouble differentiating between \"walking\", \"vacuum cleaning\", and \"descending stairs\" activities; this is understandable since it mistook these activities for similar ones. Figure 3: Normalised confusion matrix of the opportunity dataset. Figure 2: Normalised confusion matrix of the PAMAP2 dataset. It was more difficult for the model to distinguish between different activities in the Opportunity dataset. Because there were significantly more samples of Null activities than any other activity, the Opportunity confusion matrix, Figure 3, shows that the model frequently mistook activities for being unrelated. Furthermore, because the activities were short, the model had a more challenging time figuring out where a given activity began and ended in the sliding window. The confusion matrix demonstrates that the model was could pick up on some of the \"open door 2\" and \"close fridge\" activity characteristics. However, the model did not successfully capture features of \"open drawer 1\" and mistook this activity for \"close drawer 1\". Further investigation revealed that the activity, which consisted of opening and closing the drawer, took place in a single sequence, suggesting that the model could not determine when the activity began and, therefore, could not correctly distinguish between the two.