An efficient charging time forecasting reduces the travel disruption that drivers experience as a result of charging behavior. Despite the machine learning algorithm’s success in forecasting future outcomes in a range of applications (travel industry), estimating the charging time of an electric vehicle (EV) is relatively novel. It can help the end consumer plan their trip based on the estimation data and, hence, reduce the waste of electricity through idle charging. This increases the sustainability factor of the electric charging station. This necessitates further research into the machine learning algorithm’s ability to predict EV charging time. Foreign object recognition is an essential auxiliary function to improve the security and dependability of wireless charging for electric vehicles. A comparable model is used to create the object detection circuit in this instance. Within this research, the ensemble machine learning methods employed to estimate EV charging times included random forest, CatBoost, and XGBoost, with parameters being improved through the metaheuristic Ant Colony Optimization algorithm to obtain higher accuracy and robustness. It was demonstrated that the proposed Ensemble Machine Learning Ant Colony Optimization (EML_ACO) algorithm achieved 20.5% of R2, 19.3% of MAE, 21% of RMSE, and 23% of MAPE in the training process. In comparison, it achieves 12.4% of R2, 13.3% of MAE, 21% of RMSE, and 12.4% of MAPE during testing.