Abstract:This paper suggests an improved you only look once version 8n (YOLOv8n) algorithm for apple leaf disease detection, abbreviated as ALWB-YOLOv8n. The model is comprised of four essential components. Initially, arbitrary kernel convolution (AKConv) replaces the convolution module, which significantly decreases both the model’s parameter count and its overall size. Secondly, the large selective kernel network (LSKNet) attention mechanism is added in the Backbone, which can dynamically adjust the spatial sensory domain, and experiments have proved that this method is extremely advantageous for small target detection. Third, a weighted bi-directional feature pyramid network is introduced, which enables the model to achieve multi-scale feature fusion and is more concise and faster. Finally, wise intersection over union (WIoU) is used to replace complete intersection over union (CIoU) in YOLOv8, and the idea of focal loss is introduced, which effectively solves the detection problems in cases such as apple leaves occluding each other and blurred boundaries of diseased leaves. The improved algorithm exhibits superior performance compared to other common object detection algorithms. Compared with YOLOv8n, the improved algorithm achieves 2.3% improvement in precision, 3.8% improvement in recall, and 2.5% and 2.7% improvement in mAP0.5 and mAP0.5:0.95, respectively. Compared with YOLOv8n, the improved model reduces the number of parameters and size of the model and realizes real-time monitoring with a frames per second (FPS) of 50.5.