Snake net and balloon force with a neural network for detecting multiple phases