The assessment of scour depth downstream of weirs holds paramount importance in ensuring the structural stability of these hydraulic structures. This study presents groundbreaking experimental investigations highlighting the innovative use of baffles to enhance energy dissipation and mitigate scour in the downstream beds of rectangular piano key weirs (RPKWs) and trapezoidal piano key weirs (TPKWs). By leveraging three state-of-the-art supervised machine learning algorithms—multi-layer perceptron (MLP), extreme gradient boosting (XGBoost), and support vector regression (SVR)—to estimate scour hole parameters, this research showcases significant advancements in predictive modeling for scour analysis. Experimental results reveal that the incorporation of baffles leads to a remarkable 18–22% increase in energy dissipation and an 11–14% reduction in scour depth for both RPKWs and TPKWs. Specifically, introducing baffles in RPKWs resulted in a noteworthy 26.7% reduction in scour hole area and a 30.3% decrease in scour volume compared to RPKWs without baffles. Moreover, novel empirical equations were developed to estimate scour parameters, achieving impressive performance metrics with an average R2 = 0.951, RMSE = 0.145, and MRPE = 4.429%. The MLP models demonstrate superior performance in predicting maximum scour depth across all scenarios with an average R2 = 0.988, RMSE = 0.035, and MRPE = 1.036%. However, the predictive capabilities varied when estimating weir toe scour depth under diverse circumstances, with the XGBoost model proving more accurate in scenarios involving baffled TPKWs with R2 = 0.965, RMSE = 0.048, and MRPE = 2.798% than the MLP and SVR models. This research underscores the significant role of baffles in minimizing scouring effects in TPKWs compared to RPKWs, showcasing the potential for improved design and efficiency in water-management systems.