Determining soil categories in geotechnical engineering is critical to ensuring building safety, optimizing structural design, and controlling project costs. This study proposes a novel soil classification method based on an integrated machine-learning model. The integrated model synthesizes prediction results from four classification models, assigning weights to each model's probability outputs for various soil categories, then normalizes these aggregated probabilities to ensure that the predicted probabilities of the different soil categories add up to one, ultimately selecting the soil category with the highest normalized probability as the final classification. Initially, data from five distinct engineering projects located in Shanghai were collected, and 70% of data from each site was used to create a comprehensive dataset. It was then divided into training and testing datasets in a ratio of 8:2. Four classification algorithms, including decision tree, Random forest, KNN, and Adaboost, were trained using the training dataset. To enhance their collective predictive capability, Particle Swarm Optimization (PSO) was applied to fine-tune the weight coefficients among these models. The fitness function of PSO was defined as the integrated model's performance on the testing dataset. For the final stage of the study, the efficacy of the integrated model was subsequently validated using the remaining 30% of the data from each site. The experimental results show that the integrated model has high accuracy and robustness in multiple engineering sites compared with individual machine-learning models. In addition, the proposed integrated model exhibits significant superiority over traditional CPT-based direct methods. Overall, the integrated model shows accuracy and significant robustness across different project sites, highlighting its potential for application in geotechnical engineering.