## 4 Anomaly Detection Model Training
### One-Class SVM  
Like the target data in this paper, when the number of data per class is unbalanced, a model is sometimes learned using only a class with a large number of data, which is called one-class classification [75]. One-class SVM is a representative method in one-class classification [76]. Because the target data in this study were also disproportionate in the number of normal/anomaly data, as shown in Table 2, we trained the models to detect anomalies in engine clutch engagement/disengagement data using one-class SVM and only normal data.  
Figure 11 shown the engine clutch engagement/disengagement anomaly detection model training structure using one-class SVM. For effective training, we performed z-score normalization and principal component analysis (PCA). The one-class SVM model was trained with data dimensionally reduced to the principal component space through PCA. We used data projected into the three-dimensional principal component space because the principal component contribution analysis of the target signal showed that the cumulative contribution rate of the three principal components was 71-77%.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Model** & **The Number of Convolution Layers** \\ \hline CNN-m1 & 1 \\ CNN-m2 & 3 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Convolution layer settings for the CNN-based anomaly detection models.  
Figure 10: CNN-based anomaly detection model training architecture.  
The input/output data structure for training the one-class SVM model consisted of two types. The first type consisted of target data per pattern as input and normal/anomaly per pattern as output (Type 1). The second type consisted of normal/anomaly per data instance of the target signals as output, and the input data were the same as Type 1 (Type 2). The model learned with this configuration determines the normal/anomaly state of the data instance. Training examples for each type are shown in Figure 12. However, for vehicle data, the duration of a particular situation can be a criterion for normal/anomaly status. For example, for hydraulic pressure following errors in engine clutches, the errors above a certain level for a short time may occur because it takes a certain amount of time for hydraulic pressure to be generated. This situation should be seen as normal. As configuring normal/anomaly per data instance as the output of the model makes it difficult to determine normal/anomaly for the duration of this situation, we configured the signal duration (\(DT_{k},\ k=1,2,\cdots\)) as shown in Figure 13 as additional input data to the model. As shown in the figure, the signal duration was derived by separating the interval of the signal based on when any target signals change, and for this, continuous signals should be discretized. If the configured signal duration satisfies an anomaly criterion, all data instances in the corresponding signal interval are labeled as anomalies.  
The models based on one-class SVM also learned with various hyperparameter configurations, as shown in Table 8. For the discretization method, the method using domain knowledge discretized the target continuous signals densely where dense discretization is required and coarsely where it is not. The area where dense discretization or coarse discretization is needed was determined by domain knowledge. Dense discretization discretized the target continuous signals to be sufficiently narrow and evenly spaced. The outlier fraction is the prediction ratio of how much anomalous data will be within the training data. A small outlier fraction means predicting that there will be fewer anomalous data within the training data and a large outlier fraction means predicting that there will be many anomalous data within the training data. In this work, we performed the one-class SVM learning with only data labeled as normal. Thus, we trained the model with small outlier fraction values. For training, 80% of the data shown in Table 3 were