The fruit industry is a significant economic sector in China, with modern orchards gradually transitioning to trellis orchards. For mechanized orchard operations, automatic vehicle navigation is essential. However, in trellis orchards, the shading from trees results in low average light intensity and large variations in lighting, posing challenges for path navigation. To address this, a path navigation algorithm for trellis orchards is proposed based on the UNet-CBAM model. The network structures of UNet, FCN, and SegNet are compared to identify and select the optimal structure for further improvement. Among the three attention mechanisms of channel attention, spatial attention, and combined attention, the most effective mechanism is identified. The optimal attention mechanism is incorporated into the optimized network to enhance the model’s ability to detect path edges and improve detection performance. To validate the effectiveness and generalizability of the model, a total of 400 images were collected under varying lighting intensities. The experimental results show that this method achieves an accuracy of 97.63%, a recall of 93.94%, and an Intersection over Union (IoU) of 92.19%. These results significantly enhance path recognition accuracy in trellis orchards, particularly under low light under conditions. Compared to the FCN and SegNet algorithms, this method provides higher detection accuracy and offers a new theoretical foundation and research approach for path recognition in low-light environments.