Abstract:Apple leaf diseases significantly affect the yield of apple trees, so it is crucial to monitor and diagnose them through computer vision in time and take effective preventive and control measures, designing detection algorithms is also a challenging task. There are multiple types of apple leaf diseases, and the leaves exhibit varying symptoms depending on the severity of the infection. The detection accuracy will be greatly affected by factors such as light and mutual shading between leaves. To solve the these problems, this paper suggests an improved YOLOv8n algorithm, abbreviated as ALWB-YOLOv8n, the model is comprised of four essential components: initially, AKConv replaces the convolution module, which significantly decreases both the model""s parameter count and its overall size. Secondly, the LSKNet attention mechanism is added in 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, W-IoU is used to replace 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 an FPS of 50.5.