Abstract:Cucumber is one of the most important vegetables and economic crops in the world. The occurrence of fungal diseases in cucumbers seriously threatens the safety of cucumber production, with powdery mildew being one of the most common fungal diseases. With the rapid development of computer technology, more and more deep learning algorithms are being applied to identify powdery mildew fungus. However, existing algorithms suffer from low accuracy in recognizing small and occluded targets, as well as insufficient localization precision. To address this issue, the parallelized patch-aware attention (PPA) module was firstly introduced into the backbone network of YOLO v8s. By employing a parallel multi-branch structure and attention mechanism, it effectively captured multi-scale features of small targets, preserved critical information during multiple downsampling processes, and enhanced the performance of small target detection. Additionally, the global-to-local spatial aggregation (GLSA) module was introduced into the neck, which combined global contextual information with local detail features, significantly improving the model’s feature representation capability. This module enhanced the detection performance for small targets and complex scenes by better capturing multi-scale features. Experimental results showed that PG-YOLO v8s significantly improved powdery mildew fungus detection performance compared with YOLO v8s. The network achieved high precision in detecting powdery mildew fungus, with notable improvements in the detection accuracy of small and occluded targets. The research result can provide a high-throughput method for detecting powdery mildew fungus, enabling precise early detection and guiding early intelligent decision-making in cucumber production. This approach can help to improve disease control efficiency, ensure cucumber yield and quality, and it was of great significance for the sustainable development of agricultural production.