In the detection of the pests and diseases of flax, early wilt disease is elusive, yellow leaf disease symptoms are easily confusing, and pest detection is hampered by issues such as diversity in species, difficulty in detection, and technological bottlenecks, posing significant challenges to detection efforts. To address these issues, this paper proposes a flax pest and disease detection method based on an improved YOLOv8n model. To enhance the detection accuracy and generalization capability of the model, this paper first employs the Albumentations library for data augmentation, which strengthens the model’s adaptability to complex environments by enriching the diversity of training samples. Secondly, in terms of model architecture, a Bidirectional Feature Pyramid Network (BiFPN) module is introduced to replace the original feature extraction network. Through bidirectional multi-scale feature fusion, the model’s ability to distinguish pests and diseases with similar features and large scale differences is effectively improved. Meanwhile, the integration of the SimAM attention mechanism enables the model to learn information from three-dimensional channels, enhancing its perception of pest and disease features. Additionally, this paper adopts the EIOU loss function to further optimize the model’s bounding box regression, reducing the distortion of bounding boxes caused by high sample variability. The experimental results demonstrate that the improved model achieves a significant detection performance on the flax pest and disease dataset, with notable improvements in the detection accuracy and mean average precision compared to the original YOLOv8n model. Finally, this paper proposes a YOLOv8n model with a four-headed detection design, which significantly enhances the detection capability for small targets such as pests and diseases with a size of 4 × 4 pixels or larger by introducing new detection heads and optimizing feature extraction. This method not only improves the detection accuracy for flax pests and diseases but also maintains a high computational efficiency, providing effective technical support for the rapid and precise detection of flax pests and diseases and possessing an important practical application value.
Read full abstract