This exploration reviews machine learning ( \(ML\) ) tactics to project the collapse potential ( \(CP\) ) of gypseous sandy soil based on key soil parameters. An Extra Tree Regression ( \(ETR\) ) scheme was developed utilizing a database of 180 experimental records compiled from existing literature. To enhance model performance, the \(ETR\) ’s hyperparameters were optimized using two metaheuristic algorithms: Sea Horse Optimization ( \(SH\) ) and Artificial Protozoa Optimization ( \(AP\) ). Seven input variables were used to estimate \(CP\) . The results demonstrate that the recommended \(ML\) -based approach offers a reliable framework for CP projection of gypseous sandy soils. The seven input elements are the following: first dry unit weights, first voids ratio, starting water content, specific gravity, gypsum content, and % passing sieve #200. Based on the results, both \(SH(ETR)\) and \(AP(ETR)\) demonstrated strong predictive capabilities for estimating \(CP\) . The \(AP(ETR)\) model acquired the peak R2, with values of 0.9901 for training and 0.9788 for testing. In contrast, the \(SH(ETR)\) model produced R2 values of 0.9818 (training) and 0.9695 (testing), which were accompanied by higher error percentages-0.8396% during training and 0.9545% during testing-indicating lower reliability. Overall, the \(AP(ETR\) ) approach outperformed \(SH(ETR)\) , offering more accurate and robust predictions.