This study seeks to present a sophisticated artificial intelligence (AI) framework to model the compressive strength () of concrete containing waste foundry sand (WFS), with the aim of minimizing the need for time‐consuming laboratory tests and skilled technicians. For this purpose, artificial neural network (ANN) is hybridized with two metaheuristic algorithms—particle swarm optimization (PSO) and ant colony optimization (ACO) to predict the of 340 samples containing WFS collected from the literature. Results indicated that the ACO + ANN model showed the best performance with the Pearson coefficient of 0.9971, mean absolute error of 0.0221 MPa, and root mean squared error of 0.7473 MPa. The values of prediction errors exhibited that more than 90% of them in the ACO + ANN model fall within the range of (−1.5 MPa, 1.5 MPa), while this range for the PSO + ANN and traditional ANN models was obtained as (−3 MPa, 3 MPa) and (−4 MPa, 4 MPa), respectively. Furthermore, the proposed ACO + ANN model predicted the in the range of 5.24–54.48 MPa. Besides, the results indicated that the water‐to‐cement ratio, cement strength class, and cement content had the most significant impact on the of WFS‐containing concrete. Finally, a comparison was made between the proposed ACO + ANN model and four other AI models recently proposed in the literature, in which the performance criteria demonstrated that the proposed ACO + ANN model outperformed the models in the literature.