# Comparing End-to-End Machine Learning Methods for Spectra Classification
## 4 Experiments and Results
### Quantitative Model Evaluation  
In the 2D space segmentation problem setting, the training information and classification result of the proposed end-to-end binned FCNN with the automatically capturing weighting factors model is shown in Figure 4. It can be seen from the result that the classification confidence increases as the number of bins increases, and finally achieves 100% confidence. In addition, we can also easily understand that although the trainable parameters increase linearly, as the required training epochs decrease, the required training time also decreases. The classification results show that the binned weighting technique can minimize or even eliminate the impact of misclassification of data points in the overlapping regions with low separability, and even greatly reduce the training time. When using 15 or 16 bins, the model consumes approximately 20 s training time. When regarded as a general 1D time series data classification problem, all the applied or proposed models can achieve 100% classification confidence, and the classification boundaries obtained by different models are very stable, and only fluctuate in a small range, \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & **Training Samples** & **Trainable Parameters** & **Training (s)** & **Memory (GB)** & **Epochs** & **Classification Confidence** & **Classification Boundary** \\ \hline \multirow{2}{*}{1D FCNN} & 1581 & \multirow{2}{*}{1,204,335} & \multirow{2}{*}{1.576} & \multirow{2}{*}{0.1} & \multirow{2}{*}{300} & \multirow{2}{*}{100\%} & \multirow{2}{*}{(188,189)} \\  & (31 + 50 \(\times\) 31) & & & & & & \\  & 1581 & \multirow{2}{*}{23,307} & \multirow{2}{*}{0.753} & \multirow{2}{*}{0.0} & \multirow{2}{*}{5} & \multirow{2}{*}{100\%} & \multirow{2}{*}{(173,174)} \\  & (31 + 50 \(\times\) 31) & & & & & & \\ \multirow{2}{*}{\begin{tabular}{c} ResNets: \\ \end{tabular} } & 1581 & \multirow{2}{*}{2,354,535} & \multirow{2}{*}{8.208} & \multirow{2}{*}{7.1} & \multirow{2}{*}{6} & \multirow{2}{*}{100\%} & \multirow{2}{*}{(178,179)} \\  & (31 + 50 \(\times\) 31) & & & & & & \\  & 1581 & \multirow{2}{*}{6,273,391} & \multirow{2}{*}{0.463} & \multirow{2}{*}{0.9} & \multirow{2}{*}{25} & \multirow{2}{*}{100\%} & \multirow{2}{*}{(175,176)} \\  & (31 + 50 \(\times\) 31) & & & & & & \\ \multirow{2}{*}{\
\begin{tabular}{c} Transformer: \\ Convolutional \\ SCT Attention: \\ \end{tabular} } & 1581 & \multirow{2}{*}{1,830,511} & \multirow{2}{*}{0.449} & \multirow{2}{*}{0.1} & \multirow{2}{*}{30} & \multirow{2}{*}{100\%} & \multirow{2}{*}{(185,186)} \\  & (31 + 50 \(\times\) 31) & & & & & \\ \multirow{2}{*}{
\begin{tabular}{c} Convolutional \\ SCT Attention: \\ \end{tabular} } & 1581 & \multirow{2}{*}{1,953,353} & \multirow{2}{*}{1.269} & \multirow{2}{*}{0.5} & \multirow{2}{*}{5} & \multirow{2}{*}{100\%} & \multirow{2}{*}{(188,189)} \\  & (31 + 50 \(\times\) 31) & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Evaluation and Comparison of the state-of-the-art models on HED spectra dataset. that is \(\left(188-173\right)/349=4.3\%\), as shown in Figure 5 and Table 1. Among these models, the CNN-based model requires the least training parameters. The LSTM-based model has the most trainable parameters, which is mainly introduced by the LSTM units, but its convergence speed is very fast, the training time is short, and the memory consumption is low. Regarding the training time, the Transformer-based model requires the least training time (0.449 s), followed by the LSTM-based model, which needs slightly more training time (0.463 s). At the same time, it can be clearly seen that the curve of memory usage during training has a similar trend to the training time curve. Although the 1D FCNN model requires 300 training epochs, it does not consume so much training time (1.576 s), which is only 3 times that of the LSTM-based model, and it does not consume much memory.