The classification of vehicles presents notable challenges within the domain of image processing. Traditional models suffer from inefficiency, prolonged training times for datasets, intricate feature extraction, and variable assignment complexities for classification. Conventional methods applied to categorize vehicles from extensive datasets often lead to errors, misclassifications, and unproductive outcomes. Consequently, leveraging machine learning techniques emerges as a promising solution to tackle these challenges. This study adopts a machine learning approach to alleviate image misclassifications and manage large quantities of vehicle images effectively. Specifically, a contrast enhancement technique is employed in the pre-processing stage to highlight pixel values in vehicle images. In the feature segmentation stage, Mask-R-CNN is utilized to categorize pixels into predefined classes. VGG16 is then employed to extract features from vehicle images, while an autoencoder aids in selecting features by learning non-linear input features and compressing representation features. Finally, the CatBoost (CB) algorithm is implemented for vehicle classification (VC) in diverse critical environments, such as inclement weather, twilight, and instances of vehicle blockage. Extensive experiments are conducted using different large-scale datasets with various machine learning platforms. The findings indicate that CB (presumably a specific method or algorithm) attains the highest level of performance on the large-scale dataset named UFPR-ALPR, with an accuracy rate of 98.89%.