In view of the poor robustness and low accuracy in lane line identification based on digital image processing, this paper proposes a Markov random field intelligent algorithm based on machine learning to identify lane lines. The complete lane line identification steps are as follows: First, high-quality traffic scenario images are created by means of image preprocessing, which includes image graying, grayscale transformation, and the extraction of regions of interest (ROIs). Then, the images are modeled according to Markov random field theory, and model reasoning is performed based on the binary graph cut method. In the reasoning process, to achieve accurate lane line segmentation, i.e., the optimal solution of the model, the energy potential function is introduced to optimize the binary graph cut method. Finally, the lane line pixel label is marked according to the segmentation result. The experiments showed that the algorithm could accurately segment the lane line pixels after only 10 iterations, indicating that the identification method has good performance in both reasoning speed and identification accuracy, which takes account of both accuracy and real-time processing, and can meet the requirements of lane recognition for lightweight automatic driving systems.