System and method for identifying and counting wheat powdery mildew spores

CN122929563APending Publication Date: 2026-10-16INST OF PLANT PROTECTION CHINESE ACAD OF AGRI SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610785378.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-02
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

该方式不仅操作繁琐、耗时耗力,还对操作人员专业能力有较高要求,同时监测结果存在明显滞后,难以满足病害及时预警的生产需求

Benefits of technology

本发明通过显微成像获取小麦白粉菌孢子图像,经预处理增强样本多样性;采用自适应全局特征融合AGF模块强化孢子特征、抑制背景噪声;结合多点距离交并比损失函数精准回归孢子边界框;通过AGF-YOLO识别模型自动识别孢子目标并完成计数,实现孢子快速、精准的自动化监测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929563A_ABST
    Figure CN122929563A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of crop pathogen identification, and specifically relates to a wheat powdery mildew spore identification and counting system and method. The system comprises an image acquisition module for receiving and labeling wheat powdery mildew spore images; a data preprocessing module for constructing a data set based on the acquired wheat powdery mildew spore images and performing image preprocessing; an AGF-YOLO identification model, which takes YOLOv8n as a baseline model, embeds a self-adaptive global feature fusion AGF module in the P4 feature layer of the Neck network, and adopts a multi-point distance intersection-over-union loss function to construct and train; the trained AGF-YOLO identification model takes the preprocessed spore image as the input feature map F, performs spore identification and counting, and outputs the identification result and counting information of the wheat powdery mildew spores, thereby improving the spore identification precision and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of crop pathogen identification technology, specifically to a system and method for identifying and counting wheat powdery mildew spores. Background Technology

[0002] Wheat powdery mildew spreads through the spores of the pathogen. The number of spores in the field is directly related to the severity of the disease; the higher the spore count, the more severe the powdery mildew outbreak. After powdery mildew spores infect wheat plants, symptoms typically appear after 7 to 10 days. Therefore, real-time monitoring of spore counts in the field is crucial for early prediction and control of powdery mildew.

[0003] Because powdery mildew spores are extremely small and cannot be observed directly with the naked eye, current conventional monitoring methods mainly rely on spore traps to collect samples, which are then brought back to the laboratory for manual observation and counting using a microscope. This method is not only cumbersome and time-consuming, but also requires a high level of expertise from the operators. Furthermore, the monitoring results are significantly delayed, making it difficult to meet the production needs for timely disease warnings.

[0004] To address the aforementioned existing problems, this invention proposes a wheat powdery mildew spore identification and counting system and method, aiming to achieve rapid and accurate spore identification and automatic counting, shorten the monitoring cycle, improve monitoring efficiency, and provide technical support for the prediction, forecasting, and scientific control of wheat powdery mildew. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a system and method for identifying and counting wheat powdery mildew spores.

[0006] The present invention is achieved through the following technical solution: a wheat powdery mildew spore identification and counting system, including an image acquisition module, a data preprocessing module, and an AGF-YOLO recognition model; The image acquisition module is used to receive and label images of wheat powdery mildew spores. The data preprocessing module is used to construct a dataset based on the acquired wheat powdery mildew spore images and to perform image preprocessing. The AGF-YOLO recognition model uses YOLOv8n as the baseline model, embeds an adaptive global feature fusion (AGF) module into the P4 feature layer of its Neck network, and employs a multi-point distance intersection-over-union (DIU) loss function. , constructed and trained to obtain; The trained AGF-YOLO recognition model uses the preprocessed spore image as input feature map F to identify and count spores, and outputs the identification results and counting information of wheat powdery mildew spores.

[0007] In the data preprocessing module, image preprocessing includes offline geometric transformation and online data augmentation; The offline geometric transformations include horizontal flipping, 90° rotation, 180° rotation, and 270° rotation; The online data enhancements include HSV color transformation, random scaling and panning, horizontal flipping, MixUp, and random erasure.

[0008] The AGF module includes a channel attention branch and a spatial attention branch, and the two branches are in parallel structure. The channel attention branch generates channel attention weights through global average pooling and consecutive 1×1 convolutions; The spatial attention branch directly performs a 7×7 convolution on the original input feature map to generate spatial attention weights, and finally achieves feature enhancement and background noise suppression by adding the weighted feature maps element by element.

[0009] The channel attention branch performs global average pooling on the input feature map F to extract the global average response along the channel dimension. The pooling result is then processed by two consecutive 1×1 convolutions with a ReLU activation function inserted in between, and finally activated by a Sigmoid function to generate the channel attention weights. .

[0010] The channel attention weight The calculation formula is as follows: ; Where GAP represents global average pooling operation, Conv 1×1 This represents a 1×1 convolution operation. σ represents the ReLU activation function, and σ is the Sigmoid activation function. The feature map after channel attention branch weighting can be represented as F⊙ , where ⊙ represents element-wise multiplication.

[0011] The spatial attention branch directly performs a 7×7 convolution operation on the input feature map F, and then generates spatial attention weights through Sigmoid activation. The final output feature map is obtained by adding the weighted feature maps of the channel attention branch and the spatial attention branch element by element.

[0012] The spatial attention weight The calculation formula is as follows:

[0013] In the formula, This represents a 7×7 convolution operation, where σ is the Sigmoid activation function; Output feature map The representation is as follows: ; In this context, ⊙ represents element-wise multiplication, and + represents element-wise addition.

[0014] The multi-point distance intersection-over-union loss function Distance constraints are introduced at the four vertices of the bounding box, as shown below: ; In the formula, IoU represents the intersection-union ratio between the predicted box and the ground truth box, d1, d2, d3, and d4 are the Euclidean distances between the four vertices of the predicted box and the four vertices of the ground truth box, respectively, and c is the diagonal length of the minimum bounding rectangle.

[0015] The method for identifying and counting wheat powdery mildew spores, applied to the aforementioned wheat powdery mildew spore identification and counting system, includes the following steps: S1. Receive wheat powdery mildew spore images and annotate the wheat powdery mildew spore images; S2. Construct a dataset based on the labeled wheat powdery mildew spore images and perform image preprocessing; S3. Using YOLOv8n as the baseline model, an Adaptive Global Feature Fusion (AGF) module is embedded in the P4 feature layer of its Neck network, employing a multi-point distance intersection-over-union (DIU) loss function. The AGF-YOLO recognition model was constructed. S4. Use the preprocessed spore image as the input feature map F, input it into the trained AGF-YOLO recognition model for recognition and counting, and output the recognition and counting results of wheat powdery mildew spores.

[0016] After the input feature map F is processed by the AGF-YOLO recognition model, it is post-processed by the distance intersection ratio non-maximum suppression to obtain the final wheat powdery mildew spore recognition and counting results.

[0017] Compared with the prior art, the beneficial effects of the present invention are: This invention acquires images of wheat powdery mildew spores through microscopic imaging, enhances sample diversity through preprocessing, strengthens spore features and suppresses background noise using an adaptive global feature fusion (AGF) module, accurately regresses spore bounding boxes using a multi-point distance intersection-union loss function, and automatically identifies and counts spore targets using an AGF-YOLO recognition model, achieving rapid, accurate, and automated monitoring of spores.

[0018] This application uses YOLOv8n as the baseline model and embeds an adaptive global feature fusion (AGF) module. By strengthening the effective features of spores and suppressing background noise through a dual-branch structure of channel attention and spatial attention, it significantly improves the feature extraction capability of wheat powdery mildew microspores and densely clustered spores in microscopic images.

[0019] This application employs a multi-point distance intersection-union loss function to impose distance constraints on the vertices of the predicted bounding box and the ground truth bounding box, effectively improving the regression bias problem of small target bounding boxes, reducing the false detection rate and the false detection rate, and significantly improving the spore recognition accuracy and localization accuracy.

[0020] This application expands the dataset by relying on offline geometric transformation and various online data augmentation methods, improves feature diversity, enhances model generalization ability, adapts to spore image recognition scenarios under different shooting angles, and has stronger robustness.

[0021] The system described in this application has a simplified structure, low model parameter and computational load, and fast inference speed. It can quickly complete the automatic identification and counting of spores, reduce manual dependence, and realize timely, rapid and accurate monitoring of wheat powdery mildew spores, providing reliable technical support for accurate early warning of field diseases and application of pesticides and green prevention and control. Attached Figure Description

[0022] Figure 1 This is a schematic diagram of the system framework structure of this application; Figure 2 This is a schematic diagram of the structural framework of the AGF-YOLO recognition model in this application; Figure 3 This is the AGF module operation flowchart of this application; Figure 4 This is a flowchart of the existing CBAM module operation; Figure 5 This is an example of a representative microscopic image of wheat powdery mildew spores in Example 3; Figure 6 This is an example diagram of offline geometric transformation processing in Example 3; Figure 7 This is an example diagram of online data augmentation in Example 3. Detailed Implementation

[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0024] Example 1 Combination Figure 1 This embodiment proposes a wheat powdery mildew spore identification and counting system, including an image acquisition module, a data preprocessing module, and an AGF-YOLO recognition model; The image acquisition module is used to receive and label images of wheat powdery mildew spores.

[0025] Microscopic images are preferred for wheat powdery mildew spores. Microscopic imaging clearly presents the fine morphological features of powdery mildew spores, effectively magnifies the spore target outline, weakens the background interference of spore capture bands, and makes it easier for the model to accurately extract effective features such as spore texture and morphology, thereby further improving the recognition accuracy and stability of microspore targets.

[0026] In actual collection, microscopic images of wheat powdery mildew spores under different fields of view and different resolutions can be obtained through microscopic imaging equipment, which enriches the feature dimensions of image samples. Combined with subsequent annotation, dataset construction and image preprocessing operations, the model's ability to identify powdery mildew spores under microscopic perspective can be significantly improved, which is more in line with the actual application scenario of field spore capture and microscopic monitoring.

[0027] The data preprocessing module is used to construct a dataset based on the acquired wheat powdery mildew spore images and to perform image preprocessing.

[0028] In this embodiment, the constructed dataset is divided into a training set (Train), a validation set (Val), and a test set (Test) in a ratio of 8:1:1.

[0029] This embodiment employs offline data augmentation (flipping, rotating) and online data augmentation (HSV transformation, MixUp, random erasure) strategies to expand the dataset and improve the model's generalization ability.

[0030] Furthermore, image preprocessing includes offline geometric transformations and online data augmentation. The offline geometric transformations include horizontal flipping, 90° rotation, 180° rotation, and 270° rotation. The online data augmentation includes HSV color transformation, random scaling and translation, horizontal flipping, MixUp, random erasing, etc.

[0031] The AGF-YOLO recognition model is constructed and trained using YOLOv8n as the baseline model, with an adaptive global feature fusion AGF module embedded in the P4 feature layer of its Neck network, and multi-point distance intersection-union ratio (MPDIoU) loss function.

[0032] The conventional YOLOv8n architecture consists of three parts: the backbone network, the Neck feature fusion network, and the Head detection head. The Neck network adopts the PANet structure, which includes multi-scale feature layers such as P3, P4, and P5. The P4 feature layer is a medium-scale feature layer that contains rich semantic information and preserves sufficient spatial details. In this application, the AGF module is embedded in the P4 feature layer.

[0033] Combination Figure 2This embodiment integrates SPPF (Spatial Pyramid PoolingFast), MHSA (Multi-Head Self-Attention), and AGF modules on top of the baseline model. The AGF module is embedded in the P4 feature layer, suppressing background noise and enhancing spore target features through the synergistic effect of channel attention and spatial attention. The model uses a multi-point distance intersection-over-union (IoU) loss function instead of the traditional full intersection-over-union (QIO) loss function, improving the bounding box localization accuracy of small targets through multi-point distance constraints.

[0034] The backbone network of the baseline model assigns equal weights to all channels during feature extraction, making it impossible to selectively enhance spore target features or suppress background noise. In complex microscopic images, interfering factors such as bubbles and textures have similar shallow features to spores, making it difficult for the model to effectively distinguish between the target and the background. Based on this, inspired by channel attention and spatial attention mechanisms, this application designs an AGF module. Unlike the serial attention calculation method of CBAM, the AGF module adopts a parallel channel and spatial attention calculation structure and fuses the information from the two branches through weighted feature addition.

[0035] Furthermore, the AGF module structure is as follows: Figure 3 As shown, it includes a channel attention branch and a spatial attention branch (which integrates a dual attention mechanism). The two branches calculate the attention weights in parallel for the same input feature map. Finally, feature enhancement and background noise suppression are achieved by adding the weighted features element by element.

[0036] Compared to CBAM, the AGF module has made two key improvements: 1. The channel and spatial attention weights are calculated in parallel on the same input feature map, instead of being calculated sequentially; 2. The weighted features of the two branches are fused by element-wise addition, instead of sequential multiplication.

[0037] The channel attention branch performs global average pooling on the input feature map to extract the global average response along the channel dimension. The pooling result is then processed by two consecutive 1×1 convolutions with a ReLU activation function inserted in between, and finally activated by a Sigmoid function to generate the channel attention weights. The formula is defined as follows: ; Where GAP represents global average pooling operation, Conv 1×1 This represents a 1×1 convolution operation. σ represents the ReLU activation function, and σ is the Sigmoid activation function.

[0038] The feature map after channel attention branch weighting can be represented as F⊙ , where ⊙ represents element-wise multiplication.

[0039] The spatial attention branch directly performs a 7×7 convolution operation on the input feature map F, and then generates spatial attention weights through Sigmoid activation. The formula is defined as follows:

[0040] In the formula, This represents a 7×7 convolution operation. It is the Sigmoid activation function.

[0041] Final output feature map , where ⊙ represents element-wise multiplication (Hadamard product) and + represents element-wise addition.

[0042] The AGF module in this embodiment is designed to: adaptively enhance the feature channel weights related to the spore target through channel attention, while suppressing interfering channels related to background noise; and focus on the spatial region where the spore is located through spatial attention, while weakening the feature response of the background region. These two mechanisms work synergistically to enable the model to accurately focus on the spore target even in complex backgrounds.

[0043] Compared to SE-Net, which only uses channel attention, the AGF module adds a spatial attention branch, making it more suitable for handling spatially uneven background noise in microscopic images. The multi-scale feature fusion strategy borrows from the design principles of EfficientDet, and weighted feature fusion outperforms simple stitching. Compared to CoordinateAttention, the AGF module has a simpler structure, reducing computational overhead while maintaining performance. Compared to ECA-Net's efficient channel attention structure, the AGF module further incorporates spatial dimension information fusion, achieving more comprehensive feature enhancement.

[0044] Reference Figure 3 and Figure 4 The AGF module employs a parallel structure of channel attention branches and spatial attention branches, which differs from the serial attention calculation method of CBAM. The core differences are as follows: Unlike CBAM, which uses a sequential computation of channel and spatial attention, the AGF module uses a parallel structure of channel attention branches and spatial attention branches. The two branches independently calculate attention weights on the same input feature map, and finally achieve feature enhancement by adding the weighted features element by element.

[0045] The channel attention branch generates channel attention weights through global average pooling and consecutive 1×1 convolutions, focusing on enhancing feature channels related to the spore target. The spatial attention branch directly performs 7×7 convolutions on the input feature map to generate spatial attention weights, focusing on the spatial region where the spore target is located. The two branches work together to suppress background noise and enhance the spore target features.

[0046] The AGF module is embedded in a key location within the Neck network (P4 feature layer), which is responsible for medium-scale feature fusion. This location was chosen because the P4 layer features contain sufficient semantic information while preserving necessary spatial details, making them suitable for attention enhancement; embedding the AGF module at this location provides higher-quality feature representations for subsequent multi-scale feature fusion.

[0047] Furthermore, in order to determine the optimal embedding position of the AGF module in the feature pyramid network, this application conducted systematic comparative experiments by adding the AGF module at different feature levels (P3, P4, P5) and at all levels. The results are shown in Table 1.

[0048] Table 1 Ablation experiments on the placement of AGF modules

[0049] As shown in Table 1, the scheme of embedding the AGF module only in the P4 (40×40) feature layer achieved better recognition performance, with mAP@0.5 reaching 87.85% - an improvement of 2.18 percentage points compared to the baseline model without AGF.

[0050] This scheme outperforms the scheme that embeds AGF separately in the P3 layer (mAP@0.5 is 86.72%, an improvement of 1.05 percentage points), the P5 layer (mAP@0.5 is 86.40%, an improvement of 0.73 percentage points), and the scheme that embeds it simultaneously in all layers (mAP@0.5 is 87.10%, an improvement of 1.43 percentage points).

[0051] Furthermore, the structure that embeds AGF only in the P4 layer maintains the same lightweight parameter size (3.03M) as the P3 and P5 layer solutions, while significantly improving accuracy compared to the full-layer solution. The full-layer solution has a parameter size of 3.05M, which, although only 0.02M more, does not bring a corresponding performance improvement.

[0052] The experimental results show a clear non-monotonic trend on the feature pyramid: the model performance reaches its peak at the P4 feature layer, while diminishing returns are observed at the high-resolution P3 layer, the low-resolution P5 layer, and when AGF is added to all layers simultaneously.

[0053] Based on this, the P4 layer can be determined as the optimal embedding position of the AGF module, which can achieve the best balance between recognition accuracy and model efficiency in the microspore detection task.

[0054] In existing technologies, the baseline uses the full intersection-over-union (CIoU) loss function for bounding box regression. In the development of the CIoU loss function, the generalized CIoU loss function first addressed the non-differentiability problem when boxes do not overlap. Subsequently, the distance-based CIoU loss function and the full CIoU loss function added center distance and aspect ratio constraints. The focal-effective CIoU loss function further introduces a focal mechanism to handle hard samples. However, these methods still have limitations in the accurate localization of small targets. For small targets with dimensions of 20–50 pixels, even a small pixel shift can cause a significant drop in the CIoU, leading to gradient instability.

[0055] This application employs a multi-point distance intersection-and-comparison loss function. This problem is mitigated by directly minimizing the distance between corner points, providing stable gradients even when the overlap area is zero or negligible. Multi-point distance intersection-union loss function. Distance constraints are introduced at the four vertices of the bounding box, providing richer gradient information during the regression process. The formula is defined as follows: ; In the formula, the Intersection over Union (IoU) is the intersection over union ratio between the predicted box and the ground truth box, d1, d2, d3, d4 are the Euclidean distances between the four vertices of the predicted box and the four corresponding vertices of the ground truth box, and c is the diagonal length of the minimum bounding rectangle.

[0056] The innovation of the multi-point distance intersection-union loss function lies in constraining the distances between the predicted bounding box and multiple corner and edge points of the ground truth bounding box, rather than focusing only on the center point. This design provides richer geometric supervision information, and is especially suitable for small targets such as spores that are nearly circular and have very small aspect ratios (it is difficult to achieve accurate differentiation by relying solely on center distance, while multi-point geometric constraints can significantly improve the localization effect).

[0057] Therefore, this application, based on the multi-point distance intersection-union loss function, can still provide effective gradients through vertex distance even when the predicted box and the ground truth box are highly overlapping, guiding the model to further optimize the bounding box position, thereby improving the localization accuracy of small targets.

[0058] The trained AGF-YOLO recognition model takes the preprocessed spore image as input, identifies and counts the spores, and finally outputs the recognition results and counting information of wheat powdery mildew spores.

[0059] Example 2 Combination Figure 1The wheat powdery mildew spore identification and counting system described in Example 1 includes the following identification method: S1. Receive wheat powdery mildew spore images and annotate the wheat powdery mildew spore images.

[0060] S2. Construct a dataset based on the labeled wheat powdery mildew spore images and perform image preprocessing.

[0061] The image preprocessing includes offline geometric transformation and online data enhancement. The offline geometric transformation includes horizontal flipping, 90° rotation, 180° rotation, and 270° rotation. The online data enhancement includes HSV color transformation, random scaling and translation, horizontal flipping, MixUp, random erasing, etc.

[0062] S3. Using YOLOv8n as the baseline model, an Adaptive Global Feature Fusion (AGF) module is embedded in the P4 feature layer of its Neck network, employing a multi-point distance intersection-over-union (DIU) loss function. The AGF-YOLO recognition model was constructed.

[0063] The AGF module is embedded in the P4 feature layer, and the synergistic effect of channel attention and spatial attention suppresses background noise and enhances spore target features. The model uses a multi-point distance intersection-union loss function instead of the traditional full intersection-union loss function, and improves the bounding box localization accuracy of small targets through multi-point distance constraints.

[0064] S4. Use the preprocessed spore image as the input feature map F, input it into the trained AGF-YOLO recognition model for recognition and counting, and output the recognition and counting results of wheat powdery mildew spores.

[0065] After the input image is processed by the AGF-YOLO recognition model, it is post-processed by Distance Intersection over Union Non-maximum Suppression (DIoU-NMS) to obtain the final spore recognition result (output). The recognition result includes the target bounding box position and confidence score.

[0066] Example 3 This experiment was conducted at the Langfang Experimental Station of the Institute of Plant Protection, Chinese Academy of Agricultural Sciences (Hebei Province, 39.5°N, 116.6°E). In October 2024, winter wheat variety 'Zhongmai 2', moderately susceptible to wheat powdery mildew, was planted in the experimental field. In March 2025, when the wheat entered the greening stage, a batch of wheat seedlings infected with wheat powdery mildew, which had been propagated in a greenhouse in advance, were transplanted to adjacent locations with healthy seedlings in the field to induce infection. Subsequently, in mid-April 2025, a 7-day Burkard volumetric spore trap was placed in the experimental field to collect airborne wheat powdery mildew (… BgtSpores were collected. The spore trap was installed 0.6m above the ground (above the wheat canopy), with a sampling flow rate set at 10L / min (equivalent to sampling 14.4m³ of air over 24 hours). Airborne spores were continuously adsorbed onto a 345mm long trap strip (48mm long for daily sampling, totaling 336mm over 7 days, with an additional 9mm reserved for fixation). The trap strip was replaced weekly, and monitoring continued until early June 2025. After sampling, the weekly spore trap strips were cut into seven equal-length segments in a clean bench in the laboratory, fixed onto clean glass slides, and used for microscopic observation and photography.

[0067] Image acquisition: The prepared slides were placed on the stage of an Olympus BX63 automated fluorescence microscope (Japan) equipped with a DP80 digital camera, and the entire process was controlled and processed using cellSens Standard software.

[0068] Each slide was observed row by row and column by column at 200x magnification (20x objective, 10x eyepiece). When a field of view containing wheat powdery mildew conidia was detected, the operator adjusted the focus to the optimal sharpness using the fine-tuning knob and then captured the image, ultimately obtaining two high-quality original images in two formats: 4160×3210 pixel TIFF format (lossless and uncompressed) and 1380×1070 pixel JPEG format (lossy compression).

[0069] This embodiment is based on spore-capturing zones collected over two months, resulting in a final wheat powdery mildew spore dataset containing 1128 images. Representative microscopic images of the spores in different scenarios are shown in the following examples. Figure 5 As shown, (a) represents a microscopic image of spores in a sparse scene, (b) represents a microscopic image of spores in a medium-density scene, (c) represents a microscopic image of spores in a densely adhered scene, and (d) represents a labeled example.

[0070] This embodiment uses the Interactive Semi-Automatic Tool (ISAT) annotation software for image annotation. During the annotation process, each spore target is outlined along the spore contour using polygon annotation, accurately depicting the boundary morphology of the spore. Based on the annotated polygon contours, the minimum bounding rectangle (MBR) is automatically calculated to generate the bounding box annotations required for training the target recognition model. Finally, the completed annotation results are exported in YOLO format, and the file includes bounding box coordinates, category labels, and image size information.

[0071] To improve the model's generalization and feature representation capabilities, this study employs a comprehensive data augmentation strategy, combining offline geometric transformations with online random augmentation. In the offline augmentation stage, four geometric transformations are applied to each original training image: horizontal flipping (Flip...) H), 90° rotation (Rot) 90), 180° rotation (Rot) 180° and 270° rotation (Rot) (270), four enhanced images are generated from a single original image. During enhancement, the bounding box coordinates are simultaneously transformed to ensure consistency between the annotations and the images. Quality checks are performed on all enhanced images, and the annotations are automatically associated. The dataset is then divided into training, validation, and test sets in approximately an 8:1:1 ratio. Dataset statistics and the sample allocation for the training / validation / test sets are shown in Table 2. An example of offline data augmentation results is shown below. Figure 6 As shown, (a) represents the original image, (b) represents the image after horizontal flipping, (c) represents the image after 90° rotation, (d) represents the image after 180° rotation, and (e) represents the image after 270° rotation.

[0072] Table 2. Statistics on the dataset of wheat powdery mildew spore images and the division of training / validation / test sets.

[0073] Through geometric transformation, each spore image generates multiple training samples from different perspectives, effectively expanding the dataset size and improving the model's adaptability to changes in orientation.

[0074] This embodiment employs online data augmentation during training, performing real-time random transformations on the training images to further enhance sample diversity. Online augmentation does not generate additional physical files; instead, it performs random transformations on the images in each training batch, exposing the model to different variations of the same image across different training rounds, thereby strengthening the learning effect. Specific configurations for online data augmentation are shown in Table 3, and examples of augmentation effects are provided. Figure 7 As shown, (a) represents the original image, (b) represents the image after HSV color transformation, (c) represents the image after MixUp enhancement, and (d) represents the image after random erasure.

[0075] Table 3 Online Data Augmentation Strategy Configuration Table

[0076] As shown in Table 3, mosaic enhancement was not used in this embodiment. This is because downsampling would excessively reduce the microspore features (20-50 pixels) and cause a 2.3 percentage point decrease in mAP@0.5 in the preliminary experiments.

[0077] This embodiment demonstrates model training on a workstation equipped with an NVIDIA RTX 4090 graphics card, and inference speed evaluation on a local workstation equipped with an 11th-generation Intel Core i5-11320H CPU (4 cores, base clock speed 3.20GHz). The software environment consists of Python 3.8, PyTorch 1.12, and Ultralytics YOLOv8. CPU inference utilizes the native CPU backend of PyTorch and is executed in a single-threaded manner. All FPS figures represent the average throughput from 100 inference runs on the complete test set (114 images). Inference time is calculated end-to-end, including preprocessing and post-processing.

[0078] The model was trained using the Stochastic Gradient Descent (SGD) algorithm with an initial learning rate of 0.01, momentum of 0.937, and weight decay of 0.0005. Over 200 training epochs, to ensure stable convergence and avoid the model getting trapped in local optima, a cosine annealing learning rate decay strategy was employed, gradually reducing the learning rate from the initial value to a final learning rate of 0.0001.

[0079] To further verify the AGF proposed in this application The superiority and efficiency of the YOLO model are demonstrated by comparing it with several existing mainstream advanced target recognition models, including YOLOv5n, the baseline model (YOLOv8n), YOLOv9t, YOLOv10n, YOLOv11n, and RT. The comprehensive comparison results of DETR, etc., are shown in Table 4. As can be seen from the table, AGF... YOLO not only achieved higher recognition accuracy (92.02% mAP@0.5), but also maintained highly competitive parameter efficiency compared to models with a larger number of parameters. Despite RT DETR Models like L have strong feature extraction capabilities, but their computational cost is enormous. In contrast, this model achieves the optimal balance between accuracy and computational efficiency in identifying small targets.

[0080] Table 4. Overall Performance Comparison with Existing Target Recognition Models

[0081] As shown in Table 4, the proposed model exhibits excellent recognition accuracy, with mAP@0.5 and mAP@0.5:0.95 reaching 92.02% and 73.43%, respectively, and precision and recall reaching 94.73% and 86.29%, respectively. Furthermore, this method achieves higher inference speed than all comparison models, reaching 206.5 FPS, significantly faster than other lightweight models: 1.03 times that of YOLOv5n (201.5 FPS), 3.09 times that of YOLOv9t (66.8 FPS), 1.63 times that of YOLOv10n (126.3 FPS), and 1.28 times that of YOLOv11n (160.7 FPS). Compared with the large-scale model RT-DETR-I, this application reduces the number of parameters by 90.8% (3.02M vs 32.97M), the computational cost by 92.4% (8.2 GFLOPs vs 108.3 GFLOPs), and the inference speed by 5.15 times (206.5 FPS vs 40.1 FPS).

[0082] Compared to the baseline model, this model significantly improves mAP@0.5 by 6.35 percentage points and mAP@0.5:0.95 by 7.26 percentage points, while increasing the number of parameters by only 0.01M and decreasing the inference speed by only 6.3%, resulting in a significant improvement in model recognition performance.

[0083] Overall, this application achieves a better balance between recognition accuracy, model compactness, and inference efficiency. Its lightweight design and high-speed inference capabilities make it ideal for real-time deployment on resource-constrained agricultural monitoring equipment, meeting the practical needs of precision agriculture applications.

[0084] This application provides dual protection for both the system and the method. The solution is highly practical and can be easily deployed in multiple scenarios such as cloud computing and mobile mini-programs. It can also be applied to the detection of other fungal spores and microscopic images of microorganisms, making it widely applicable.

[0085] The above description is merely an optional embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the content of the present invention under the concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. A wheat powdery mildew spore identification and counting system, characterized in that, It includes an image acquisition module, a data preprocessing module, and an AGF-YOLO recognition model; The image acquisition module is used to receive and label images of wheat powdery mildew spores. The data preprocessing module is used to construct a dataset based on the acquired wheat powdery mildew spore images and to perform image preprocessing. The AGF-YOLO recognition model uses YOLOv8n as the baseline model, embeds an adaptive global feature fusion (AGF) module into the P4 feature layer of its Neck network, and employs a multi-point distance intersection-over-union (DIU) loss function. , constructed and trained to obtain; The trained AGF-YOLO recognition model uses the preprocessed spore image as input feature map F to identify and count spores, and outputs the identification results and counting information of wheat powdery mildew spores.

2. The wheat powdery mildew spore identification and counting system according to claim 1, characterized in that, In the data preprocessing module, image preprocessing includes offline geometric transformation and online data augmentation; The offline geometric transformations include horizontal flipping, 90° rotation, 180° rotation, and 270° rotation; The online data enhancements include HSV color transformation, random scaling and panning, horizontal flipping, MixUp, and random erasure.

3. The wheat powdery mildew spore identification and counting system according to claim 1, characterized in that, The AGF module includes a channel attention branch and a spatial attention branch, and the two branches are in parallel structure. The channel attention branch generates channel attention weights through global average pooling and consecutive 1×1 convolutions, while the spatial attention branch directly generates spatial attention weights by performing 7×7 convolutions on the original input feature map. Finally, feature enhancement and background noise suppression are achieved by element-wise addition of the weighted feature maps.

4. The wheat powdery mildew spore identification and counting system according to claim 3, characterized in that, The channel attention branch performs global average pooling on the input feature map F to extract the global average response in the channel dimension; The pooling result is processed through two consecutive 1×1 convolutions with a ReLU activation function inserted in between, and then channel attention weights are generated by Sigmoid activation. .

5. The wheat powdery mildew spore identification and counting system according to claim 4, characterized in that, The channel attention weight The calculation formula is as follows: ; Where GAP represents global average pooling operation, Conv 1×1 This represents a 1×1 convolution operation. σ represents the ReLU activation function, and σ is the Sigmoid activation function. The feature map after channel attention branch weighting can be represented as F⊙ , where ⊙ represents element-wise multiplication.

6. The wheat powdery mildew spore identification and counting system according to claim 4, characterized in that, The spatial attention branch directly performs a 7×7 convolution operation on the input feature map F, and then generates spatial attention weights through Sigmoid activation. The final output feature map is obtained by adding the weighted feature maps of the channel attention branch and the spatial attention branch element by element.

7. The wheat powdery mildew spore identification and counting system according to claim 6, characterized in that, The spatial attention weight The calculation formula is as follows: In the formula, This represents a 7×7 convolution operation, where σ is the Sigmoid activation function; Output feature map The representation is as follows: ; In this context, ⊙ represents element-wise multiplication, and + represents element-wise addition.

8. The wheat powdery mildew spore identification and counting system according to claim 6, characterized in that, The multi-point distance intersection-over-union loss function Distance constraints are introduced at the four vertices of the bounding box, as shown below: ; In the formula, IoU represents the intersection-union ratio between the predicted box and the ground truth box, d1, d2, d3, and d4 are the Euclidean distances between the four vertices of the predicted box and the four vertices of the ground truth box, respectively, and c is the diagonal length of the minimum bounding rectangle.

9. A method for identifying and counting wheat powdery mildew spores, characterized in that, The wheat powdery mildew spore identification and counting system according to any one of claims 1 to 8 includes the following steps: S1. Receive wheat powdery mildew spore images and annotate the wheat powdery mildew spore images; S2. Construct a dataset based on the labeled wheat powdery mildew spore images and perform image preprocessing; S3. Using YOLOv8n as the baseline model, an Adaptive Global Feature Fusion (AGF) module is embedded in the P4 feature layer of its Neck network, employing a multi-point distance intersection-over-union (DIU) loss function. The AGF-YOLO recognition model was constructed. S4. Use the preprocessed spore image as the input feature map F, input it into the trained AGF-YOLO recognition model for recognition and counting, and output the recognition and counting results of wheat powdery mildew spores.

10. The method for identifying and counting wheat powdery mildew spores according to claim 9, characterized in that, After the input feature map F is processed by the AGF-YOLO recognition model, it is post-processed by the distance intersection ratio non-maximum suppression to obtain the final wheat powdery mildew spore recognition and counting results.