# Time-Series Classification Based on Fusion Features of Sequence and Visualization
## 4 Experiment
### Experiment Setting and Model Configuration  
All experiments were conducted using Python (Keras 2.2.4 [49] and Tensorflow 1.12.0 [50] as the backend). The Python packages used for data loading, visualization, and pre-processing included Numpy 1.16.5, Pandas 0.24.2, Scikit 0.20.4, and MatPlotLib 2.2.4. The hardware information was as follows:  
* CPU: Intel(R) Xeon(R) Gold 6140 CPU @ 2.30 GHz (2 CPUs, 18 cores per CPU).
* GPU: NVIDIA Corporation GK210 GL [Tesla K80] (8 GPUs).
* RAM: 256 GB and 128 GB video RAM for GPUs.
* OS: Ubuntu 18.04.3 LTS.  
Table 1 shows the hyper-parameters of LSTM-A and CNN-A. Relu was selected as the activation function of the activation layer. As the basis of the proposed model is the features extracted by pre-trained LSTM-A and CNN-A from TS data, the training of the two sub-models had a great impact on feature extraction. Therefore, we adopted multiple methods to improve the training of the two sub-models in the experiments. First, we trained the two sub-models using the loss function of \"categorical cross-entropy\" with the Adam optimizer [51]. The initial learning rate was \(1e-3\), reducing by a factor of 0.5 to the final learning rate of \(1e-4\) every 50/100 epochs (depending on epoch sizes; for epoch sizes smaller than 100, this was set to 50, otherwise 100) of no improvement in the validation score. Second, we used the early stop method to prevent the model from overfitting. When the change range of validation accuracy was less than 0.0003% every 50 epochs, the training was stopped. Finally, we replaced the Fully-connected layer with a global average pooling layer before the softmax layer in the CNN-A model, which greatly reduced the amount of parameters. In addition, we did not perform additional pre-processing on the data (e.g., regularization), as the UCR data sets have already been z-normalized. The batch and epoch sizes were chosen from [5, 20, 100, 200] and [50, 250, 1000, 2000], respectively. The pixel size of the Area Graphs converted from TS data was chosen from [30 \(\times\) 30, 150 \(\times\) 150].  
Figure 5: Depiction of pixel Average pooling.  
\begin{table}
\begin{tabular}{l l l} \hline \hline
**Name** & \multicolumn{2}{c}{**Configuration (the Parameter Value Was Selected from \{-\}, According to the Optimal Accuracy on the Validation Set in Different Experiments).**} \\ \hline \hline \multicolumn{3}{c}{TSC-FF} \\ \hline Fully-connected Layer & \([64,128,256]\) & LSTM-A \\ \hline LSTM layer1 & \([64,128,256]\) & \\ LSTM layer2 & \([64,128,256]\) & \\ LSTM layer3 & \([64,128,256]\) & \\ Dropout & \([0.2,0.5,0.8]\) & \\ Batch Normalization & momentum = 0.99, epsilon = 0.001 & \\ Fully-connected Layer & \([64,128,256]\) & \\ \hline \multicolumn{3}{c}{CNN-A} \\ \hline Conv2D1 & filter number \([32,64,128]\), kernel size \([5\times 5,8\times 8,10\times 10]\), strides \([1,2,4]\) \\ Conv2D2 & filter number \([32,64,128]\), kernel size \([5\times 5,8\times 8,10\times 10]\), strides \([1,2,4]\) \\ Conv2D3 & filter number \([32,64,128]\), kernel size \([5\times 5,8\times 8,10\times 10]\), strides \([1,2,4]\) \\ Dropout & \([0.2,0.5,0.8]\) & \\ Batch Normalization & momentum = 0.99, epsilon = 0.001 & \\ Avg. Pool & pool size \([5\times 5,8\times 8]\) & \\ Max Pool & pool size \([5\times 5,8\times 8]\) & \\ Fully-connected Layer & \([64,128,256]\) & \\ \hline \end{tabular}
\end{table}
Table 1: Model Configuration.  
In the field of TSC research, much work based on LSTM, CNN [27; 52], and hybrid LSTM-CNN [39; 40; 41] has been carried out, achieving promising results. The architectures of these models are used for reference. In the experiments, we also tried models with different LSTM layers or CNN layers. We found that reducing the number of layers damaged the performance of model, while increasing the number of layers not only damaged the performance of model as well, but also increased the model training time.