## 2 Literature Review  
Rehabilitation has gained much attention in recent years, though it has been serving people since ancient times. Many people have conducted research in this field and some of their works are related to our objectives and motivations. A comprehensive summary of the previous works and a critical analysis of the information pave the way for a new research outcome by describing the previous quality of works on post-stroke rehabilitation conducted by prominent authors and comparing them to find out the research gap and scopes of new research. Rehabilitation is a vast field where ML is applied to stroke-based rehabilitation and a lot of work has been carried out by prolific scholars. Some of the renowned research regarding the TRSP dataset is described in the table below. Table 1 shows that [PERSON] et al. [9] applied deep learning algorithms on the TRSP dataset in 2021 and evaluated the final result with previous works. RNN, GRU, transformer, and LSTM are applied to detect compensatory movements of upper limb rehabilitation. Decreasing focal loss reduces the imbalanced data distribution of the Kinect sensor data. A Kinect camera along with a robotic arm ensures the detection of compensations as well as joint positions. A vector analysis and threshold techniques are applied to find out the compensations in terms of angles. Firstly, LSTM is applied to the dataset as it has a noteworthy impact on RNN architecture. LSTM is mainly different from the conventional recurrent unit in that LSTM is capable of handling information for a longer time basis. Another upgraded version of the recurrent neural network is GRU which uses cell memory to memorize sequence information. This architecture is simple as well as less time-consuming as it does not contain any memory cells. Last but not least, the type of deep learning algorithm used here is the transformer network which uses an encoder-decoder system dependent on attention layers with three inputs, query, key, and value [12]. As transformers do not process data on an ordered basis, they can pass the inputs parallelly. Based on the recurrent and attention mechanisms, some selected models are used. One recurrent layer of 20 units is used to activate the ReLUoutput in the model. Increasing the depth of the network increases the possibility of accuracy. For this reason, 10 units are set for two individual layers that are also connected to the classifier. Setting the starting learning rate to 0.01, the models are trained with a batch size of 128 for 50 epochs. It is seen that the training models have performed better in the case of per class and average \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Ref.** & **Publication Year** & **Used Models** & **Objective and Contribution** \\ \hline
[9] & 2021 & Transformer & Deep learning-based compensatory movements of stroke survivors and GRU gained better performance \\ \hline
[10] & 2020 & SVM & Explore class imbalance and identify compensatory movements of stroke patients \\ \hline
[11] & 2017 & – & Detect upper limb compensatory movements of stroke survivors to use proper positioning \\ \hline
[11] & 2017 & SVM, RNN & SVM-based computer vision system to detect robotic stroke rehabilitation therapy \\ \hline \hline \end{tabular}
\end{table} 
Table 1: A comparison of the previous works using the TRSP dataset. precision, recall, and F1 score in comparison with previous works. The precision is 90% in the NC class, whereas it is less than 30% in the other classes. In the case of LSTM and GRU, models that contain two layers have become more accurate. Though the GRU model performs better in this case, the transformer model is also close to the GRU model. Another work by [PERSON] et al. [10] was conducted in 2020 with the dataset where they found the class imbalance to be a probable cause of lower F1 scores while classifying with ML algorithms. The TRSP dataset contains 25 three-dimensional values which have 75 numerical values per second.