Acid Mine Drainage (AMD) poses a significant environmental challenge, frequently occurring at mining, smelting, and closed mine locations. This phenomenon arises when sulfide ores come into contact with oxygen and water, forming sulfuric acid. This acid subsequently dissolves in mine water, increasing its acidity. Sulfate (SO4) serves as a crucial indicator of acid mine water quality. Precise prediction of SO4 concentrations post-treatment is essential for achieving compliant and stable wastewater discharge, thereby mitigating environmental risks. In this paper, we introduce IPSO-GRU, a novel artificial intelligence algorithm designed to predict water quality accurately. Our IPSO-GRU model employs particle swarm optimization to enhance support vector regression for SO4 prediction. The performance indices of the model show a Root Mean Square Error (RMSE) of 0.104, a Mean Absolute Error (MAE) of 0.061, and a Coefficient of Determination (R²) of 0.79. Comparative evaluations with IPSO-RNN and IPSO-LSTM models reveal that IPSO-GRU outperforms these alternatives across RMSE, MAE, and R² metrics, confirming its efficacy as the most suitable model for predicting SO4 concentrations in mine wastewater.