Particle image velocimetry (PIV) enables the study of instantaneous fluid kinematics through flow visualization, which promotes the study of an object entering a liquid surface. However, even with PIV, the accurate extraction of the liquid phase region remains elusive due to the unsteady hydrodynamic forces involved. Therefore, we present a deep-learning network based on U-Net to solve the problems. The network, named MRes-Att-Unet, combines the mechanisms of residual connectivity and attention, which is proven to be effective in medical image segmentation. Considering the use of a training of network in supervised learning, we created a corresponding dataset based on the PIV experiment of an object entering water in two-phase flow and tested the images of an object entering water in an isolated wave crushing experiment. The results showed that the MRes-Att-UNet improved the segmentation accuracy of the gas–liquid boundaries, with especially enhanced results in a wide range of laser scattering, fuzzy bubbles, splash, and other complex interferences. Moreover, a WIDIM method is used to process the segmented and original images, and the results show that a deep learning method is feasible for segmenting PIV images and can effectively reduce the error vector of two-phase flow boundary.