Shrinkage cavities and porosity are the main defects generated in the solidification process of castings. These defects are caused by the alloy’s contraction during solidification, with the final solidified area not being effectively compensated for by the liquid metal, resulting in cavitation defects. Shrinkage cavities and porosity significantly reduce the mechanical properties of castings and shorten their service lives, thus necessitating appropriate process to eliminate them. Utilizing numerical simulation technology can effectively predict the shrinkage of castings during solidification and optimize the process based on simulation results, thereby reducing the occurrence of shrinkage defects, which is a low-cost and high-efficiency method. In this work, a machine learning-driven dynamic mesh model is established to simulate the dynamic shrinkage behavior of castings during solidification. Cellular automata are used to simulate the solidification process of castings, dynamically marking the displacement of boundary points and calculating the displacement of other grids using RBF neural network algorithms and support vector machine algorithms, thereby achieving the dynamic simulation of the solidification process. The model is used to simulate the shrinkage cavity morphology of the Al-4.7%Cu alloy solidification process, and corresponding casting experiments are designed for verification. Comparisons between simulation results and experimental results indicate that this coupled method can effectively capture the casting deformation caused by solidification shrinkage, the evolution of complex solid-liquid interface morphologies, and the deformation of internal grids within the castings. Compared with the experimental results, the simulation results have an error of no more than 2%, providing a new approach for numerically simulating the solidification process.