In this study, we used such three indicators to evaluate the classification systems as accuracy, execution time and CPU utilization. Accuracy refers to the ratio of correctly classified samples to the total number of samples. Execution time refers to the total time taken by the model, from training to evaluation through 10-fold cross-validation. CPU utilization refers to the proportion of CPU resources consumed during the model execution. We experimented on the computer equipped with an Intel(R) Core (TM) i5-12400F processor, 32.0 GB of memory, an NVIDIA GeForce RTX 4060 GPU, and 1 TB of SSD storage, running the Windows 10 operating system.
3.1. Results for a Single Multi-Class Classification System
For selecting the optimal subset of features, we set the parameter settings for each FS method as follows. The filtering threshold for PCC and MI is set to 0.2 since, if the threshold is higher than 0.2, no features are not selected. As the classifier model for SFS and SBS, we used the Gaussian Naive Bayes (GaussianNB) [
41] model since it requires low computational resources. We configured the parameters for ET using the default initialization settings in the sklearn library.
Figure 4 shows the number of features selected by each FS method. All FS methods effectively reduced the feature dimension compared with the original data. Even the SBS method, which selected the largest number of features, only selected 23 features compared to the 90 features of the original data, while the SFS method selected the least number of features, only 9.
We evaluated the accuracies of the 5 ML models using the features selected by the 5 FS methods, respectively.
Table 2 shows the results including using the original data. From the table, we can see that all FS methods show a similar level of accuracy as the original data. The accuracies of some FS’s are even better than that of original data. For example, the accuracy of DT is 0.9304 for the original data, while it is 0.9440 for the SFS method with only 9 features. The accuracy of KNN for the original data is 0.9288, while it is improved to 0.9712 for the ET method with 11 features. The accuracy of SVM for the original data is 0.9485, while it is improved to 0.9713 for the SBS method with 19 features.
Comparing all the accuracies of ML model and FS method combinations, the best-performing combination is XGBoost and SBS. This combination achieved an accuracy of 0.9849. Although the result was the same as that using the original data, the number of features was reduced from 90 to 19, significant reduction of feature dimensionality.
Table 3 and
Table 4 show the execution time and CPU utilization of each ML model for different FS methods. We can see that FS has a significant effect on reducing the time and CPU utilization. For example, the time of RF for the original data is up to 2.3920s, while the time of RF using the features selected by ET is reduced to 1.0990s. The CPU utilization of XGBoost for the original data is up to 25.40%, while it is reduced to 14.75% when using SFS. Among all the combinations, the combination with the least time is KNN and SFS, which takes only 0.029 s. In terms of CPU utilization, the combination of KNN and ET is relatively good, consuming only 0.10% of CPU.
Looking at the results, we found that the combinations with the best performance in terms of accuracy, execution time and CPU utilization are different. By observing the values of the three indicators, we determined the following two criteria for evaluating the best model:
(1) The minimum accuracy must be maintained above 0.95.
(2) Choose models with high accuracy, low execution time, and low CPU utilization as much as possible.
According to the criteria, the best combination is KNN and ET. The accuracy is 0.9712, which exceeds the criteria of 0.95. Although the accuracy is not the highest, it has the lowest execution time and CPU utilization of 0.300s and 0.10% respectively.
3.2. Results for Separate Binary Classification Systems
In this experiment, we evaluated the 4 binary classification systems where each selected class such as top, bottom, left, or right is distinguished from all other classes. The selected class is labeled as a positive (1), and all other classes are combined as a negative (0).
Figure 5 shows the number of features selected by the 5 FS methods for each classification system. In this study, we call each classification system Class 0, Class 1, Class 2, and Class 3 according to the top, bottom, left, and right position, respectively. Specifically, the minimum number of features for Class 0 is given by MI, which is only 1, while those for Class 1, Class 2 and Class 3 are given by SFS, which are 3, 4 and 2, respectively. In contrast to
Figure 4 where the minimum number of feature was 9 for SFS. The binary classification systems can reduce the feature dimensions more significantly, obtaining a smaller subset of features.
Table 5,
Table 6 and
Table 7 show the accuracy, execution time and CPU utilization for Class 0. Overall, the best combination is KNN and PCC. First, its accuracy 0.9576 is higher than the criteria of 0.95. Secondly, the execution time 0.310s is the least among all the combinations with an accuracy greater than 0.95. Finally, the CPU utilization is 0.20%, the minimum among all combinations.
Table 8,
Table 9 and
Table 10 show the accuracy, execution time and CPU utilization for Class 1. Overall, KNN and SBS is the best combination with the accuracy 0.9788, the execution time 0.0300s, and the CPU utilization 0.15%. The accuracy is higher than the criteria of 0.95. Although the execution time is greater than that of the KNN and SFS combination, the accuracy is higher. Furthermore, the CPU utilization is the least, only 0.15%.
Table 11,
Table 12 and
Table 13 show the accuracy, execution time and CPU utilization for Class 2. The best combination is DT and SFS. Its accuracy is 0.9909, which is higher than the criteria of 0.95. In addition, it has the lowest execution time and CPU utilization, only 0.0130s and 0.25% respectively.
Table 14,
Table 15 and
Table 16 show the accuracy, execution time and CPU utilization for Class 3. The best combination is DT and ET with an accuracy of 0.9803 above the criteria of 0.95. In terms of execution time, although DT and MI, DT and SFS, and DT and SBS take a little less execution time than DT and ET with 0.0130s, 0.0110s, and 0.0150s, respectively, their accuracy is 0.9773, 0.9562, and 0.9689 below that of DT and ET. Furthermore, DT and ET has the lowest CPU utilization, only 0.10%.
Table 17 summarizes the best combination for each classification system and its performance. We can see that the performances are different from each other. The best performance is for Class 2, the highest accuracy 0.9909, the lowest execution time 0.0130s and the lowest CPU utilization 0.05% respectively. The performance of Class 0 is the lowest with accuracy 0.9576, execution time 0.0310s and CPU utilization 0.20% respectively. When comparing with the best performance of the single multi-class classification system (accuracy 0.9712, execution time 0.300s and CPU utilization 0.10%), we know that using the single multi-class classification system produces more stable results than using a different binary classification system according to the target position.
Figure 6 shows the accuracy heat map for the 4 classes. The vertical axis represents the ML model, and the horizontal axis represents the FS method. Each number is the accuracy of the corresponding combination, the closer the color is to yellow the higher the accuracy, and the closer the color is to blue the lower the accuracy. We see that the overall color for Class 2 is closest to yellow, followed by Class 3 and Class 1. In contrast, Class 0 shows that the overall color is closest to dark green. This indicates that all combinations for Class 0 exhibit relatively poor performance. According to
Table 5, the combination with the worst classification performance for Class 0 is DT and MI, with accuracy 0.8020, while the worst performances for Class 1, Class 2, and Class 3 do not fall below 0.94.
Figure 7 shows the distribution of data for the 4 class systems after applying two dimensional Principal Component Analysis (PCA) [
43]. We found that the data distribution for Class 0 is particularly not concentrated compared with other classes, which is the reason why the classification performance of Class 0 is poor. The collisions at different positions will produce different natures of data. During data collection, collisions were conducted on different positions of the container. When collisions occurred, the container usually produced a slight offset along the collision direction, so the data generated was more concentrated, making it easier for the ML model to identify and classify. For example, in
Figure 7, Class 2 and Class 3 represent the data distribution for the left and right position respectively. Their data distributions are relatively concentrated. The accuracy of Class 2, even the worst combination of DT and MI, achieved an accuracy 0.9864, the best combination of RF and PCC an accuracy 0.9985.
In contrast, when the collision occurred at the top position of container, the displacement caused by the collision is hard to occur since the container is usually placed on the ground. The container can only vibrate at its original position, producing data that is more widely distributed than other positions, correspondingly more difficult to classify. As we can see the results in
Table 17 and
Figure 6, the performance for Class 2 is high, which means that Class 2 is easier to classify, while the performance for Class 0 is low, which means that Class 0 is most difficult to classify. This shows that the container collision data collected by sensor data have different properties.
In conclusion, the results show that it is rather reasonable to use the single multi-class classification system with a combination of KNN and ET than separate binary classification systems. Because the results of feature selection and classification are more easily affected by the nature of the data, one system to select the optimal feature subset and classify all classes is most stable and produces the best performance. Furthermore, one system is operationally simpler since separate systems demand a lot of additional workloads and more complicated workflow.