Weed management plays a crucial role in the growth and yield of lettuce, with timely and effective weed control significantly enhancing production. However, the increasing labor costs and the detrimental environmental impact of chemical herbicides have posed serious challenges to the development of lettuce farming. Mechanical weeding has emerged as an effective solution to address these issues. In precision agriculture, the prerequisite for autonomous weeding is the accurate identification, classification, and localization of lettuce and weeds. This study used an intelligent mechanical intra-row lettuce-weeding system based on a vision system, integrating the newly proposed LettWd-YOLOv8l model for lettuce–weed recognition and lettuce localization. The proposed LettWd-YOLOv8l model was compared with other YOLOv8 series and YOLOv10 series models in terms of performance, and the experimental results demonstrated its superior performance in precision, recall, F1-score, mAP50, and mAP95, achieving 99.732%, 99.907%, 99.500%, 99.500%, and 98.995%, respectively. Additionally, the mechanical component of the autonomous intra-row lettuce-weeding system, consisting of an oscillating pneumatic mechanism, effectively performs intra-row weeding. The system successfully completed lettuce localization tasks with an accuracy of 89.273% at a speed of 3.28 km/h and achieved a weeding rate of 83.729% for intra-row weed removal. This integration of LettWd-YOLOv8l and a robust mechanical system ensures efficient and precise weed control in lettuce cultivation.