Carbon dioxide (CO 2 ) enhanced oil recovery (EOR) is an important technology to achieve carbon neutrality by sequestering CO 2 underground while simultaneously recovering crude oil. Reservoir pore structure is a key factor influencing CO 2 EOR. In this study, we utilized advanced online in situ CT scanning and digital rock techniques to obtain, for the first time, evolution profiles of the finger area during water flooding and CO 2 flooding processes, quantitatively assessing the differences in fluid patterns. Additionally, we first introduced an innovative approach using advanced machine learning techniques, especially XGBoost and SHAP, to construct a predictive model of the relative change of oil phase occupancy (RCPOC) based on pore structure parameters and evaluated the importance of each pore structure parameter. Importantly, our results revealed that CO 2 can significantly increase the sweep efficiency area while substantially reducing residual oil saturation, in stark contrast to the relatively uniform water front observed during water flooding. Furthermore, we elucidated the critical role of capillary forces, demonstrating that water flooding primarily extracts trapped oil from small pores, while CO 2 flooding effectively extracts oil from larger pores. During CO 2 flooding, there is a positive correlation between coordination number, mean throat radius (MeanTR), and mean throat length (MeanTL) and the change in oil occupancy, whereas their influence during water flooding is limited. In summary, this study contributes to the understanding of flow patterns and pore structure effects on residual oil during water flooding and the CO 2 flooding processes. It also provides a novel approach based on pore structure parameters to predict RCPOC and assess the importance of influencing factors, thereby expanding our research perspective on this issue.