As new ways to solve partial differential equations (PDEs), physics-informed neural network (PINN) algorithms have received widespread attention and have been applied in many fields of study. However, the standard PINN framework lacks sufficient seepage head data, and the method is difficult to apply effectively in seepage analysis with complex boundary conditions. In addition, the differential type Neumann boundary makes the solution more difficult. This study proposed an improved prediction method based on a PINN with the aim of calculating PDEs with complex boundary conditions such as Neumann boundary conditions, in which the spatial distribution characteristic information is increased by a small amount of measured data and the loss equation is dynamically adjusted by loss weighting coefficients. The measured data are converted into a quadratic regular term and added to the loss function as feature data to guide the update process for the weight and bias coefficient of each neuron in the neural network. A typical geotechnical problem concerning seepage phreatic line determination in a rectangular dam is analyzed to demonstrate the efficiency of the improved method. Compared with the standard PINN algorithm, due to the addition of measurement data and dynamic loss weighting coefficients, the improved PINN algorithm has better convergence and can handle more complex boundary conditions. The results show that the improved method makes it convenient to predict the phreatic line in seepage analysis for geotechnical engineering projects with measured data.