# Developing Machine Learning-Based Models for Railway Inspection
## 3 Feature-Based Classification Method
### Model Evaluation  
In this work, the main task is to detect rail joints in which there may contain multiple positive detections. In terms of the rule of identification, whenever minimum number of positive acceleration data are greater than \(N_{c}\) in a given length of rail track, this piece of rail track will be detected as a joint. We define a detection rate as detected joint numbers divided by total joint numbers in the testing dataset. Eventually, we use accuracy and detection rate as the criteria for model evaluation and selection.  
Following the described methods, we conducted extensive experiments to demonstrate the feasibility and usefulness of the feature-based classification methods. The details can be found in [16]. As mentioned above, the acceleration data were collected from a rail inspection car. The data only covered a specific 64 km segment of rail track. There is not any rail defect detection-related data. All data are related to rail joints. In the experiments, we separated the collected data into a training dataset and a testing dataset. The training dataset contains 11 joints on the left side of the track, and 12 joints on the right side of the track. The testing dataset contains 19 left joints and 22 right joints. In the experiment, the window size for the joint is set as 4 cm based on common railway practice. Table 1 shows the experimental results of the model performance for four decision tree classifiers named by feature combinations. In Table 1, MA is trained with a decision tree learning algorithm running on feature data set, OrigFeature-L (left rail only), MB is trained with a decision tree learning algorithm running on feature data set, OrigFeature-R (right rail only). Similarly, MC and MD are trained with decision trees on feature data set, Wavelet-R and Wavelet-L. Since we applied a well-defined rule to combine the prediction from each model (\(N_{c}\) = 5), all false alerts are successfully filtered. Therefore, no false alerts of joint detection are returned by any of the models.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Feature Set** & **Accuracy** & **Detection Rate** & **False Alerts** \\ \hline MA & OrigFeature-L & 0.99860 & 90\% & 0 \\ MB & OrigFeature-R & 0.99834 & 89.5\% & 0 \\ MC & Wavelet-R & 0.99832 & 84\% & 0 \\ MD & Wavelet-L & 0.99834 & 100\% & 0 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Performance of the developed models.  
The experimental results indicate that the models can detect rail joints with good performance. However, there are two deficiencies: (1) the model requires feature engineering for new feature generation and (2) each side of the track needs a dedicated model for joint detection. This creates complexity in the deployment of the described models and requires other solutions to identify the location of defects, including the side of track, and the position of the defect on the railway. To address these issues we propose a deep learning-based approach to develop one model for defect detection on both rails using the raw data directly.