Based on the electromagnetic wave propagation principle, a prediction model based on the phase difference of coaxial lines to measure the void fraction of the slug flow is proposed, and experiments on vertical pipe slug flow are conducted under 70 working conditions. A new mixing dielectric constant measurement model is established by adding a phase mixer device to the sensor to stir the slug flow into a popular and stable homogeneous flow. The homogeneous flow under the same experimental conditions is used as the reference true value of the slug flow measurement section void fraction model, and the prediction model is validated and optimized. The results show that the MAPE value of the optimized measurement model is reduced from 2.96% to 1.02% without the addition of a phase mixer, and the prediction of the void fraction of the slug flow is improved compared with the previous one.