# Applying Machine Learning to Preselective Weighing of Moving Vehicles
## 5 Conclusions  
The presented model for estimating vehicle weight using the XGBoost machine learning algorithm enables estimating the weight of moving vehicles based on characteristic data represented by relevant vehicle features. The model achieves high prediction quality indicators and demonstrates a strong fit to the data, which indicates its high efficiency. The attributes implemented into the proposed model, in the form of characteristic data represented by appropriate vehicle features, allow for quite an accurate prediction of the mass of passing vehicles. The models trained on data from the Grodziec and Osowiec locations achieved impressive R\({}^{2}\) values of 0.941 and 0.956, respectively, with MAPE percentage errors of approximately 12%. These results suggest that the proposed model effectively supports preselective vehicle weighing. Analysis of the results for the XGBoost model at the Grodziec and Osowiec locations allows the following conclusions to be drawn. In both locations, R\({}^{2}\) indicates a very good quality of fit of the model to the data. R\({}^{2}\) values close to 1 suggest that the model explains most of the variability in the data. The model in Osowiec (R\({}^{2}\)=0.956) shows a better fit than Grodn (R\({}^{2}\) = 0.941). RMSE is a measure of the average prediction error of the model. The lower RMSE for Osowiec indicates that the model's predictions are more accurate at this location than at Grodziec. The differences may be due to the complexity of the data and the variation in values in the data (e.g., greater variability in Grodziec). MAPE expresses prediction error as a percentage of actual values. Both results (12.5% for Grodziec and 11.7% for Osowiec) indicate an acceptable error level. The lower MAPE in Osowiec (11.7%) means that the model is slightly more accurate at this location. The model is slightly more accurate in Osowiec (better R2, lower RMSE, and MAPE), which may be due to the larger training dataset and potentially less complex data structure at this location. The higher RMSE and MAPE suggest that the model in Grodziec faces more challenges in fitting the data. Preselective vehicle weighing aims to identify potentially overloaded vehicles, which are removed from traffic to thoroughly check total weight and axle load using highly accurate, legalized stationary scales. As a result, the accuracy of preselection weighing does not need to be critical in this process. The preselective weighing method proposed in this article should therefore be considered promising. Future work will involve testing the method under real-world conditions on a larger sample of vehicles to validate its performance and scalability. To increase the impact of the research, it is planned to see how the model can be adapted to different regions with different road conditions, vehicle types, and traffic patterns. In addition, future work plans to test the model on larger datasets under more diverse conditions. Plans also include ways to reduce computational costs for real-time applications. The model will also be used in other fields like logistics or public transportation monitoring. The proposed solution in the form of an ML model is intended to significantly support the process of preselecting vehicles in motion, thanks to which a simple vision system with a radar collecting data, which is part of the described WIM system, becomes unnecessary. The presented model has some performance limitations related to the training set. The model is slightly more accurate in Osowiec (better R2, lower RMSE, and MAPE), which may be due to the larger training dataset and potentially less complex data structure at this location. The higher RMSE and MAPE suggest that the model in Grodziec faces greater challenges in fitting the data (e.g., greater data variability or noise). These limitations may be offset by increasing the number of training samples at Grodziec. To improve the results, one can also try adjusting the model's hyperparameters (e.g., learning_rate, max_depth).