## 2 Materials and Methods
### Data Augmentation Strategies  
A deep neural network has millions of parameters to learn, which means that it requires many iterations before it discovers the optimum values. If there are small volumes of data, the execution of many iterations can result in overfitting. A large dataset helps the network to avoid overfitting with a better performance. Data augmentation is a useful method for dealing with a small dataset without overfitting. Furthermore, data augmentation can boost the generalization ability of trained models by expanding the decision boundary of the model and decreasing overfitting [24]. The need for generalization is necessary for real-world data and can help designed networks, especially deep learning networks, to overcome datasets with imbalanced classes [25] or small datasets [26]. Most data augmentation strategies for time series classification are based on random transformations of the data, such as adding jittering [27], slicing [28], scaling, magnitude warping, and time dimension warping [29].  
**Jittering** is one of the effective data augmentation methods [30], which can be defined as:  
\[x^{{}^{\prime}}=x_{1}+\epsilon_{1},\cdots+x_{t}+\epsilon_{t},\cdots+x_{T}+ \epsilon_{T}, \tag{1}\]  
where \(\epsilon\) is the Gaussian noise added to each time step.  
In [30], the authors report that **rotation** data augmentation can increase accuracy when combined with other augmentation methods, where rotation is defined as:  
\[x^{{}^{\prime}}=Rx_{1},\ldots,Rx_{t},\ldots,Rx_{T}, \tag{2}\]  
where \(R\) is a rotation matrix for flipping for univariate time series and angle for multivariate time series.  
By a random scalar value, **scaling** can change the global intensity of a time series [30], where the scaling is defined as:  
\[x^{{}^{\prime}}=\alpha x_{1},\ldots,\alpha x_{t},\ldots,\alpha x_{T}, \tag{3}\]  
where the scaling parameter \(\alpha\) can be determined from a random value from a predefined set.  
Figure 4: Pre-Sequence Padding.  
**Magnitude warping** is a technique that warps the magnitude of a signal by a smoothed curve [30], which is defined as:  
\[x^{{}^{\prime}}=\alpha_{1}x_{1},\dots,\alpha_{t}x_{t},\dots,\alpha_{T}x_{T}, \tag{4}\]  
where \(\alpha_{1},\dots,\alpha_{t},\dots,\alpha_{T}\) is a sequence built by inserting a cubic spline \(S(u)\) with knots \(u=u_{1},\dots,u_{i},\dots,u_{I}\).  
**Slicing** augments the data by slicing time steps off the ends of the pattern [30], where slicing is defined as:  
\[x^{{}^{\prime}}=x_{\varphi},\dots,x_{t},\dots,x_{W+\varphi}, \tag{5}\]  
where \(W\) is the size of a window and \(\varphi\) is a random integer.  
**Time warping** is the perturbation of a pattern in the temporal dimension using a smooth warping path [30], which is defined as:  
\[x^{{}^{\prime}}=x_{\tau(1)},\dots,x_{\tau(t)},\dots,x_{\tau(T)}, \tag{6}\]  
where \(\tau()\) is a warping function that warps the time steps based on a smooth curve.  
Only a few works have applied data augmentation methods for time-series classification data. In this paper, the data augmentation strategies that we used include jittering, scaling, magnitude warping, time warping, slicing, and rotation as shown in Figure 5.