Surface waviness is crucial for the quality of components produced via the wire and arc additive manufacturing (WAAM) process. This study presents a novel method for predicting surface waviness, employing an advanced model to optimize process parameter configurations using a combination of Rank-Gaussian particle swarm optimization (RGPSO) and an Artificial Neural Network (ANN). The novelty of this process is that the RGPSO not only optimizes the hyperparameters of the ANN model to enhance prediction performance, but also addresses surface waviness optimization. The RGPSO algorithm's optimization performance is evaluated using 23 benchmark functions, demonstrating competitiveness against nine comparative meta-heuristic algorithms. Experimental data on surface waviness from the literature are utilized to train, test and validate three different prediction models, including a standalone ANN model, a PSO optimized ANN (PSO-ANN) model, and an RGPSO optimized ANN (RGPSO-ANN) model. The results indicate that the developed RGPSO-ANN model achieves the highest accuracy in terms of the metrics RMSE (0.019), R (0.996), R20.990,MAE (0.013), RMSLE0.013,and MAPE (3.46 %). It performs better than the PSO-ANN model (RMSE 0.026, R 0.975, R20.982,MAE 0.019, RMSLE0.019,and MAPE 5.73 %), and better than the ANN (RMSE 0.046, R0.991, R20.944,MAE 0.034, RMSLE0.032 and MAPE 9.31 %). The RGPSO, PSO and other optimization algorithms are then applied to minimize the surface waviness of a WAAM component. RGPSO achieved the optimal value (0.1631 mm), which corresponds to a 12.6 % reduction compared to the best value obtained using PSO.