A corn leaf disease detection algorithm and system based on YOLOv7

By improving the CAFMFusion module, ESMFA module and SIOU loss function of the YOLOv7 algorithm, the problems of insufficient detection accuracy and poor robustness in corn leaf disease detection are solved, efficient and accurate disease detection is achieved, and disease identification is supported in the field of agricultural automation.

CN119963975BActive Publication Date: 2025-08-12INNER MONGOLIA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510057823.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-08-12
Estimated Expiration
2045-01-14

AI Technical Summary

Technical Problem

Traditional methods of artificial detection of corn leaf diseases are time-consuming and labor-intensive and error-prone. The existing deep learning algorithms have problems of insufficient detection accuracy and poor robustness in corn leaf disease detection, making it difficult to effectively deal with complex backgrounds and multiple disease types.

Method used

The corn leaf disease detection algorithm based on YOLOv7 is adopted, and the feature fusion is enhanced by using the CAFMFusion module, and the ESMFA module performs multi-scale feature aggregation, and the SIOU loss function is used to replace the CIoU loss function in YOLOv7, and the model structure and loss function are optimized to improve detection accuracy and robustness.

Benefits of technology

It realizes rapid and accurate detection of corn leaf diseases, improves detection accuracy and robustness, reduces labor and time costs, provides efficient disease identification tools for agricultural automation, and significantly reduces crop losses caused by diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963975B_ABST
    Figure CN119963975B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of disease detection and discloses a corn leaf disease detection algorithm based on YOLOv7. The algorithm utilizes the corn leaf disease detection model Corn‑YOLO based on the YOLOv7m algorithm. The model replaces the original Concat layer with the CAFMFusion module and the original ELAN module with the ESMFA module to better enhance feature fusion, and uses the SIOU loss function to improve accuracy. The present invention combines different data sets to create a diversified data set and uses LableImg for image annotation. In order to improve the elasticity of the model, the data set is enhanced, including operations such as random combination scaling, translation, rotation, and contrast adjustment. In order to enhance the feature extraction capability, a CAFMFusion module is proposed, which improves the overall performance of the model and the disease feature extraction capability by fusing feature information at different scales.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to but is not limited to the field of disease detection technology, and in particular relates to a corn leaf disease detection algorithm and system based on YOLOv7. Background Art

[0002] Corn diseases are one of the main factors affecting corn yield, most of which are caused by bacteria, viruses, and fungi. Manual visual inspection has long been used to detect diseases early, safeguard crop production, and prevent corn harvest damage. However, this traditional method of manual inspection in the field is not only time-consuming and labor-intensive, but also prone to errors in judgment due to incompetence or carelessness of inspectors, resulting in economic losses. Manual identification can no longer meet the demands of modern agricultural output. In contrast, deep learning algorithms, with their automation and high efficiency, far outperform traditional methods and are therefore becoming a major research direction for future crop pest identification.

[0003] Crop disease and insect pest detection based on machine learning technology has gradually become a research hotspot. However, compared with deep learning, traditional machine learning still has certain deficiencies in generalization and transfer learning capabilities. As deep learning algorithms represented by convolutional neural networks (CNN) have achieved remarkable results in the field of computer vision, the application of deep convolutional neural networks in image processing and analysis has become increasingly common [7]. More and more image processing and analysis applications are using deep learning convolutional neural networks. Many deep learning models have also been gradually applied to crop disease recognition, such as AlexNet [8], GoogleNet [9], VGGNet

[10] , ResNet

[11] , MobileNet

[12] , Vision2's 14 Transformer, etc. Kumar et al. proposed a tomato leaf disease and infection classification method based on ResNet. Elfatimi et al. developed a bean leaf spot classification system based on MobileNet. Sun et al. used the multi-scale feature fusion instance detection method of SSD to realize corn leaf blight detection. Although these methods have achieved remarkable results in classification tasks, they are mainly oriented towards single disease classification and are difficult to effectively deal with the complex situation where different types of lesions coexist. In practice, classifying leaves based only on the most obvious disease may overlook the potential impact of smaller lesions.

[0004] In contrast, the object detection network can identify different types of leaf disease spots at the same time, which provides a more advantageous solution. The YOLO series of algorithms is a recognized real-time object detection technology that is very suitable for simultaneously identifying multiple disease spots on corn leaves. YOLO was first released in 2016. Its structure was much faster than other object detection algorithms at the time, and it gradually became known as one of the most popular algorithms in object detection networks. Now, the YOLO series of algorithms are often used for plant leaf disease detection. Mathew et al. used YOLOv5 to identify bacterial disease spots on bell pepper plants by observing the symptoms on the leaves of bell pepper plants. Soeb et al. created a diagnosis and identification system based on YOLOv7, which is reliable and accurate in managing and preventing tea diseases. YOLO has achieved extensive research results in achieving end-to-end detection of plant leaf diseases.

[0005] Therefore, compared to traditional classification algorithms, the YOLO series of object detection algorithms is undoubtedly a more suitable choice. However, with the continuous updates of the YOLO series of algorithms, different versions of the YOLO algorithm have brought different new breakthroughs in the field of object detection. Therefore, choosing the right YOLO version for leaf spot detection is particularly important. et al. used YOLOv5 to YOLOv8 for object detection in harsh underwater environments and concluded that YOLOv5 and YOLOv7 showed the highest precision and recall, respectively. Lin et al. used YOLOv5 to YOLOv8 for vehicle detection and found that YOLOv7 performed better than YOLOv8. Summary of the Invention

[0006] In response to the problems existing in the prior art, the present invention provides a corn leaf disease detection algorithm based on YOLOv7.

[0007] The present invention is implemented as follows: a corn leaf disease detection algorithm based on YOLOv7, which utilizes the corn leaf disease detection model Corn-YOLO based on the YOLOv7m algorithm. The model replaces the original Concat layer with the CAFMFusion module and the original ELAN module with the ESMFA module to better enhance feature fusion, and uses the SIOU loss function to improve accuracy.

[0008] Furthermore, the Corn-YOLO network structure is divided into three parts: input, backbone network and detection head; the input includes operations such as adaptive anchor box calculation and adaptive image scaling; the backbone network mainly consists of three modules: CBS, ELAN and MP; among them, the CBS module is responsible for feature extraction; the ELAN module is specifically responsible for feature information fusion; the MP module is responsible for downsampling, mainly reducing the size of the feature map;

[0009] The detection head mainly consists of the SPPCSPC and the CAFMFusion and ESMFA modules proposed in this paper; the SPPCSPC module greatly improves the feature representation by aggregating image features; the CAFMFusion module realizes efficient feature map fusion; the ESMFA module deeply extracts and integrates local and global features, further improving the robustness of features; finally, the Rep module adjusts the number of output feature channels and then combines it with a 1×1 convolutional layer for prediction and output.

[0010] Furthermore, the CAFMFusion module cleverly combines CAFM and CGAFusion technologies. It first performs an addition operation on feature maps obtained from different scales to achieve feature fusion;

[0011] The CAFMFusion module leverages the strengths of CAFM, integrating the characteristics of two mainstream feature extraction technologies: convolutional neural networks (CNNs) and transformers. Specifically, the convolutional layer processes local features, improving the algorithm's ability to capture surface characteristics of corn leaf diseases, especially subtle features such as small leaf spots, localized lesions, and color changes. The attention mechanism captures global features, helping the model understand the distribution of diseases across the entire leaf and identify large-scale disease manifestations. This combination of local and global features allows the model to focus on both the specific and overall characteristics of lesions, effectively avoiding the dilution of feature information that can occur with a single convolutional module, enabling the model to more accurately distinguish various lesions on the leaf.

[0012] In the subsequent part of the CAFMFusion module, the adaptive fusion of some low-level features of the encoder and the corresponding high-level features is achieved through a shuffle operation. The low-level features and high-level features refer to features of different sizes obtained from different layers of the Feature Pyramid Network (FPN). Specifically, the low-level features of the encoder are added to the high-level features and the weights are calculated by the CAFMFusion module. Finally, these features are combined using the weighted sum method as follows:

[0013] F fuse =C 1×1 (F low W+F high (1-W)+F low +F high ) (1)

[0014] This fusion strategy ensures that the model fully utilizes feature information at different levels to improve the model's prediction performance, thereby improving the model's accuracy and robustness in identifying corn leaf diseases;

[0015] Generally speaking, the Concat module simply concatenates feature maps of different scales. In contrast, the CAFMFusion module dynamically obtains the output weights of feature maps of different scales through convolution and self-attention mechanisms, thereby better merging feature maps.

[0016] Furthermore, the DELAN module replaces the typical convolution with the ELAN-based deep separable convolution, thereby reducing the number of parameters and improving computational efficiency. At the same time, the GeLU function is used instead of the SiLU function, further enhancing the expressiveness and robustness of the model.

[0017] ESMFA, enhanced multi-scale structural feature aggregation; this structure fully utilizes the advantages of the DELAN module in local feature extraction and the ability of the EASA module in global feature exploration; through the combination of the two, the network can simultaneously capture the local disease characteristics and global disease information of corn leaves and effectively fuse them, thereby further improving the model's ability and reliability in identifying corn leaf diseases.

[0018] Furthermore, the SIoU loss function consists of four parts: distance loss, shape loss, angle loss, and IoU loss. Specifically, the angle loss effectively reduces the orientation mismatch problem by accurately calculating the angle difference between the GT box and the predicted box. The distance loss quantifies the spatial distance between the GT box and the predicted box. The shape loss considers the shape difference between the GT box and the predicted box. The IoU loss evaluates the accuracy of the predicted box by calculating the area intersection ratio and union ratio between the GT box and the predicted box.

[0019] By combining these four losses, the SIoU loss function can not only help the model avoid overfitting problems, but also significantly improve the accuracy and robustness of the corn leaf disease detection model. Given the significant advantages of the SIoU loss function in solving the direction mismatch problem, the SIoU function is chosen to replace the CIoU loss function in the YOLOv7 model. The definition of the SIoU loss function is as follows:

[0020]

[0021] Furthermore, the algorithm adopts established evaluation metrics. Specifically, precision (P), recall (R), and mean average precision (mAP) are used as evaluation metrics; precision indicates how many positive predicted samples are correct, as shown below:

[0022] Precision indicates how many of the positive predicted samples are correct, as shown below:

[0023]

[0024] Recall represents the number of samples that were predicted to be positive among the true positive samples, as shown below:

[0025]

[0026] The average precision (AP) of different categories is calculated by mAP as follows:

[0027]

[0028] mAP is the process of averaging the accuracy of each category and is defined as follows:

[0029]

[0030] Where n is the number of categories, kAP is the precision of the kth category; true positive (TP) means that the prediction is positive and the label value is positive, so the prediction is correct; false negative (FN) means that the prediction result is negative and the label value is positive, so the prediction result is inaccurate; false positive (FP) means that the prediction value is positive but the label value is negative, so the prediction is wrong; true negative (TN) means that the prediction value is negative and the label value is negative, so the prediction is correct;

[0031] In addition, in order to correctly reflect the complexity of the model, the number of parameters and giga-floating-point operations (GFLOPs) are used as evaluation metrics.

[0032] The present invention provides a corn leaf disease detection system based on YOLOv7, which includes:

[0033] An image acquisition module is used to acquire high-resolution images of corn leaves and pre-process the images;

[0034] A disease detection module, which detects corn leaf diseases based on the improved YOLOv7m algorithm model Corn-YOLO. The Corn-YOLO model uses the CAFMFusion module to achieve feature fusion, the ESMFA module to achieve multi-scale feature aggregation, and uses the SIoU loss function to improve detection accuracy;

[0035] The data analysis and output module is used to generate a disease distribution analysis report based on the test results and output the test conclusions in the form of charts or text.

[0036] Furthermore, the disease detection module includes:

[0037] An input unit, configured to receive the captured image and adjust the image features through adaptive anchor box calculation and adaptive image scaling;

[0038] The backbone network unit includes the CBS module for feature extraction, the CAFMFusion module for feature fusion, the MP module for downsampling, and the ESMFA module for enhancing multi-scale features;

[0039] The detection head unit aggregates feature maps and generates disease prediction results through the SPPCSPC module and the Rep module.

[0040] The system further comprises:

[0041] Performance evaluation module, used to evaluate disease detection performance based on precision (P), recall (R), and mean average precision (mAP);

[0042] A model optimization module that evaluates model complexity by parameter count and GFLOPs, and dynamically adjusts network parameters to optimize the efficiency and accuracy of disease detection;

[0043] The data storage module is used to store image data, detection results, and model parameters, and supports historical data backtracking and comparative analysis.

[0044] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0045] First, this paper proposes a real-time intelligent corn leaf disease detection method, Corn-YOLO, which achieves a reasonable combination of accuracy, speed, and computational complexity, while achieving impressive results in testing. This paper combines different datasets to create a diverse dataset and uses LabelImg for image annotation. To improve the accuracy of the model, the dataset is enhanced, including operations such as random brightness adjustment, scaling, translation, rotation, and contrast adjustment. To enhance feature extraction capabilities, the CAFMFusion module is proposed. By fusing feature information at different scales, it improves the overall performance of the model and its disease feature extraction capabilities. Furthermore, the ESMFA module is designed to replace the ELAN module in YOLOv7, achieving an effective fusion of local and global features, further improving the recognition accuracy of corn leaf diseases. Furthermore, the SIOU loss function is introduced to replace the CIOU loss function in YOLOv7, significantly improving the model's performance in target positioning accuracy. Using cross-validation, the model is divided into training, test, and validation sets in a ratio of 8:1:1 to evaluate the model's generalization ability on the test set. Finally, the accuracy was 89.5%, the recall was 88.8%, and the average precision was 89.9%. This demonstrates the robustness of the model. In summary, the Corn-YOLO model performed well in detecting corn leaf diseases. Furthermore, the Corn-YOLO model can help more people quickly identify corn leaf diseases without requiring specialized knowledge, while reducing the manpower and time required for identification. This provides technical support for disease identification in the field of agricultural automation and an effective means for crop protection.

[0046] Second, the expected benefits and commercial value of this invention's technical solution after implementation are: it is expected to significantly improve the accuracy and efficiency of corn leaf disease detection, reducing crop and economic losses caused by diseases. Regarding commercial value, this technical solution can be applied to agricultural automation, providing technical support for disease identification and promoting the development of precision agriculture. Furthermore, this technical solution can be further expanded to disease detection in other crops, demonstrating broad market application prospects and commercial potential.

[0047] The technical solution of the present invention fills the technological gap in the industry: by enhancing the feature fusion of the model (specifically using technical means such as the CAFMFusion module, the ESMFA module, and the SIOU loss function), the model performance is further enhanced, thereby improving the accuracy and efficiency of corn leaf disease detection, thereby filling the technical gap in high-precision real-time detection of corn leaf diseases.

[0048] The technical solution of the present invention solves a long-cherished but unsuccessful technical challenge: traditional manual methods for detecting corn leaf diseases are time-consuming, labor-intensive, and error-prone, failing to meet the demands of modern agriculture. While deep learning-based disease detection methods offer advantages, they still face technical challenges in practical application, such as improving detection accuracy and robustness. The technical solution of the present invention, by improving and optimizing the YOLOv7 algorithm and proposing the Corn-YOLO model, successfully addresses these challenges, enabling rapid and accurate detection of corn leaf diseases.

[0049] The technical solution of this invention overcomes technical biases: Previous disease detection tasks often relied on traditional classification algorithms or simple object detection algorithms, which have limitations when dealing with complex backgrounds and multiple disease types. The technical solution proposed in this invention overcomes these technical biases by introducing advanced deep learning techniques and optimization algorithms, achieving efficient and accurate detection of corn leaf diseases. This technical solution not only improves the accuracy of disease detection but also provides new ideas and methods for disease detection in other crops.

[0050] Third, the present invention proposes an improved corn leaf disease detection algorithm based on YOLOv7, aiming to solve the problems of insufficient detection accuracy, poor robustness and limited feature extraction capabilities in the existing technology. On the basis of the traditional YOLOv7 algorithm, by introducing the CAFMFusion module, ESMFA module and SIoU loss function, the model's capabilities in feature fusion, feature extraction and accuracy optimization are significantly improved. The CAFMFusion module replaces the original Concat layer, optimizes the efficient feature map fusion process, and enhances the adaptability of the disease detection model to complex backgrounds and diverse disease features; the ESMFA module replaces the ELAN module, greatly improving the multi-scale feature extraction and integration capabilities, ensuring the model's detection performance under different disease manifestations; the SIoU loss function replaces the CIoU loss function, improving the accuracy and robustness of the model, and effectively reducing the positioning error in the detection results.

[0051] The present invention has achieved significant technological progress in the industrial application of corn leaf disease detection. Compared with the existing technology, the present invention solves the problem of low detection accuracy in corn disease images caused by complex disease types, diverse distribution, occlusion, etc. through structural optimization of the YOLOv7 model. Through adaptive anchor frame calculation and image scaling operations, the model of the present invention achieves efficient capture of disease areas of different sizes and shapes; the backbone network integrates feature extraction modules (CBS, MP) and multi-scale fusion modules (ESMFA, CAFMFusion), further enhancing the feature expression ability of the model. The detection head introduces the SPPCSPC module to aggregate image features, ensuring the stable performance of the detection model in highly complex scenarios, and improving the efficiency and accuracy of disease detection as a whole.

[0052] The technical solution of this invention fills a technological gap in the field of corn leaf disease detection, providing an intelligent solution for agricultural disease monitoring. By constructing a high-precision disease detection model, this invention can be widely applied in farmland monitoring, disease early warning, and precision agriculture management, providing farmers with a fast, efficient, and low-cost disease identification tool. The promotion of this technology will significantly improve the efficiency of agricultural disease management, reduce the impact of diseases on corn yield and quality, and inject new impetus into the development of intelligent agriculture. It has important commercial value and promotion prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is an example of dataset annotation and label classification provided by an embodiment of the present invention;

[0054] Figure 2 This is a diagram of the Corn-YOLO architecture provided by an embodiment of the present invention;

[0055] Figure 3 This is a CAFMFusion diagram provided by an embodiment of the present invention;

[0056] Figure 4 This is information fusion provided by the embodiment of the present invention;

[0057] Figure 5 This is the ESMFA module structure provided by an embodiment of the present invention;

[0058] Figure 6 This is a Corn-YOLO training effect diagram provided by an embodiment of the present invention;

[0059] Figure 7 This is a comparison chart of Corn-YOLO and other target detection models;

[0060] Figure 8 This is the effect diagram of each module of Corn-YOLO. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0062] This paper uses YOLOv7 to detect leaf diseases and improves its accuracy. In this study, the Corn-YOLO algorithm for corn disease detection was designed and proposed. The full content of this work is as follows:

[0063] 1) A CAFMFusion module was designed to replace the original Concat layer in YOLOv7. This module can extract corn leaf disease characteristics by effectively combining multi-scale features, significantly improving the overall performance of the model and its ability to identify disease characteristics.

[0064] 2) The ESMFA module was used to replace the ELAN module in YOLOv7. The ESMFA module enhances the model's ability to identify complex lesions by fusing global contextual information with local detail information, enabling it to accurately detect lesions in more complex situations, thereby effectively improving the recognition accuracy of corn leaf diseases.

[0065] 3) In Corn-YOLO, the SIOU loss function replaces the original CIOU loss function. The SIOU loss function can better measure the shape difference between the predicted box and the GT box, thereby significantly improving the localization quality of the model when dealing with complex lesion shapes.

[0066] 4) On an experimental dataset, the Corn-YOLO model achieved excellent results in detecting corn leaf diseases, achieving 89.5% precision, 88.8% recall, and 89.9% average precision, outperforming several detection algorithms (Fast-RCNN, YOLOv8m, and YOLOv11m). Furthermore, ablation experiments were conducted to analyze the contribution of each module and technique to Corn-YOLO's performance, validating the advantages of each innovative module and demonstrating their importance in improving overall model performance.

[0067] Example 1: Intelligent Farmland Disease Monitoring System

[0068] Based on the Corn-YOLO algorithm of this invention, an intelligent farmland disease monitoring system has been developed for widespread application in disease early warning and management in large-scale corn-growing areas. The system consists of an unmanned aerial vehicle (UAV) acquisition module, an edge computing module, and a data analysis platform. The UAV collects high-resolution images of corn leaves along a planned flight path and transmits these images in real time to an onboard edge computing device. The integrated Corn-YOLO algorithm then processes the images in real time to accurately identify the area and type of corn disease. Detection results, including disease type, distribution range, and severity, are then uploaded to a backend data analysis platform via a wireless network for further aggregation and processing.

[0069] The system generates visual disease distribution maps and early warning reports, and provides farmers with specific agricultural advice, such as targeted pesticide application or early disease control strategies for specific areas. Compared to traditional manual inspections, this system significantly improves disease monitoring efficiency, covers large areas of farmland, and ensures high-precision detection results. Precise disease monitoring and management not only effectively reduces the risk of disease spread but also significantly reduces pesticide usage, which is of great significance to the development of smart agriculture.

[0070] Example 2: Agricultural intelligent robot assisted disease prevention

[0071] The Corn-YOLO algorithm of this invention is applied to an intelligent agricultural robot for real-time detection and precise prevention of corn leaf diseases in the field. The robot, equipped with a high-definition camera and using the Corn-YOLO algorithm, dynamically analyzes corn leaf images to quickly identify diseased areas and locate the disease type. The detection results directly drive the robot's precision spraying module, which adjusts the nozzle position and spray dosage to target only the diseased areas, avoiding wasted spray while protecting healthy crops. This method is particularly suitable for scenarios with complex lighting conditions and diverse disease distributions, demonstrating extremely high detection accuracy and environmental adaptability.

[0072] Furthermore, agricultural robots synchronize disease detection data with agricultural management systems, creating a continuous field data record for trend analysis and optimizing disease control strategies. Compared to traditional field spraying, this solution significantly reduces pesticide usage and labor costs while improving disease control efficiency. Through precise and intelligent disease management, agricultural intelligent robots, combined with the Corn-YOLO algorithm, provide efficient and low-cost solutions for modern precision agriculture, promoting the development of agricultural automation and green agriculture.

[0073] An embodiment of the present invention provides a corn leaf disease detection algorithm based on YOLOv7. The algorithm uses the corn leaf disease detection model Corn-YOLO based on the YOLOv7m algorithm. The model replaces the original Concat (feature concatenation) layer with the CAFMFusion (convolution and attention full hybrid fusion module) module and replaces the original ELAN (efficient layer aggregation network) module with the ESMFA (efficient spatial multi-scale feature aggregation) module to better enhance feature fusion, and uses the SIOU loss function to improve accuracy.

[0074] 1. Dataset

[0075] The dataset used for the experiment in this paper is mainly from the PlantVillage dataset and the CD&S

[24] dataset, and is mixed with the Crop Disease (Ghana) dataset on Kaggle. The obtained photos were manually annotated using the LabelImg program to accurately depict the diseased area.

[0076] The specific labeling strategies are as follows: For cercosporaleafspot disease and greyleafspot, since they are scattered near the leaves and main veins of corn, a non-compact labeling strategy is adopted when labeling the ground truth box (GT box) to facilitate the model to grasp the location information of the lesions on the leaves. For Southern rust, since the individual lesions are small, and aureobasidium zeae often occurs on the upper leaves close to maturity. Therefore, in order to more accurately locate the characteristics of these two diseases, the present invention mostly uses close-fitting GT boxes for labeling. For northern leafblight, the present invention also uses tight GT boxes for labeling. In addition, for the GT boxes of health, streak and common rust, the present invention directly adopts the labeling strategy of the Crop Disease (Ghana) dataset (the dataset used in the Ghana Crop Disease Detection Challenge) without any modification.

[0077] The annotations cover seven different disease types, including cercospora leafspot disease, common rust, southern rust, streak, northern leafblight, grey leafspot, and aureobasidium zeae, as well as annotations for asymptomatic healthy leaves, for a total of eight types. Table 1 shows the number of images and ground truth boxes for each leaf type. To address the imbalance in the dataset, we use the "--image weight" parameter, as detailed in 2.4.

[0078] Table 1 Dataset information

[0079]

[0080] To increase the diversity of the dataset and improve the universality and adaptability of the model, the present invention uses functions from the imgaug library to randomly combine scaling, translation, rotation, and contrast adjustment, thereby further enhancing the dataset. Specific parameters are shown in Table 2. After the above processing, the final constructed dataset contains 10,580 images. The present invention divides these images into a training set, a validation set, and a test set in an 8:1:1 ratio, that is, 8,464 images are used as the training set, 1,058 images are used as the test set, and 1,058 images are used as the validation set. Figure 1 A subset of the images from the final dataset is shown.

[0081] Table 2 Data augmentation methods and parameters

[0082]

[0083] like Figure 2 As shown in the figure, the network structure of Corn-YOLO is divided into three parts: input, backbone network and detection head; the input includes operations such as adaptive anchor box calculation and adaptive image scaling; the backbone network mainly consists of three modules: CBS, ELAN and MP; among them, the CBS module is responsible for feature extraction; the ELAN module is specifically responsible for the fusion of feature information; the MP module is responsible for downsampling, mainly reducing the size of the feature map;

[0084] The detection head mainly consists of the SPPCSPC and the CAFMFusion and ESMFA modules proposed in this paper; the SPPCSPC module greatly improves the feature representation by aggregating image features; the CAFMFusion module realizes efficient feature map fusion; the ESMFA module deeply extracts and integrates local and global features, further improving the robustness of features; finally, the Rep module adjusts the number of output feature channels and then combines it with a 1×1 convolutional layer for prediction and output.

[0085] The CAFMFusion module cleverly combines CAFM and CGAFusion technologies. It first performs an addition operation on feature maps obtained from different scales to achieve feature fusion.

[0086] The CAFMFusion module leverages the strengths of CAFM, integrating the characteristics of two mainstream feature extraction technologies: convolutional neural networks (CNNs) and transformers. Specifically, the convolutional layer processes local features, improving the algorithm's ability to capture surface characteristics of corn leaf diseases, especially subtle features such as small leaf spots, localized lesions, and color changes. The attention mechanism captures global features, helping the model understand the distribution of diseases across the entire leaf and identify large-scale disease manifestations. This combination of local and global features allows the model to focus on both the specific and overall characteristics of lesions, effectively avoiding the dilution of feature information that can occur with a single convolutional module, enabling the model to more accurately distinguish various lesions on the leaf.

[0087] In the subsequent part of the CAFMFusion module, the adaptive fusion of some low-level features of the encoder and the corresponding high-level features is achieved through a shuffle operation. The low-level features and high-level features refer to features of different sizes obtained from different layers of the Feature Pyramid Network (FPN). Specifically, the low-level features of the encoder are added to the high-level features and the weights are calculated by the CAFMFusion module. Finally, these features are combined using the weighted sum method as follows:

[0088] F fuse =C 1×1 (F low W+F high (1-W)+F low +F high ) (1)

[0089] This fusion strategy ensures that the model fully utilizes feature information at different levels to improve the model's prediction performance, thereby improving the model's accuracy and robustness in identifying corn leaf diseases;

[0090] Generally speaking, the Concat module simply concatenates feature maps of different scales. In contrast, the CAFMFusion module dynamically obtains the output weights of feature maps of different scales through convolution and self-attention mechanisms, thereby better merging feature maps.

[0091] The DELAN module replaces typical convolution with ELAN-based deep separable convolution, thereby reducing the number of parameters and improving computational efficiency. At the same time, the GeLU function is used instead of the SiLU function to further enhance the expressiveness and robustness of the model.

[0092] The ESMFA, enhanced multi-scale structural feature aggregation, fully utilizes the advantages of the DELAN module in local feature extraction and the ability of the EASA module in global feature exploration. Through the combination of the two, the network can simultaneously capture the local disease characteristics and global disease information of corn leaves and effectively fuse them, thereby further improving the model's ability and reliability in identifying corn leaf diseases.

[0093] The SIoU loss function consists of four parts: distance loss, shape loss, angle loss, and IoU loss. Specifically, the angle loss effectively reduces the orientation mismatch problem by accurately calculating the angle difference between the GT box and the predicted box. The distance loss quantifies the spatial distance between the GT box and the predicted box. The shape loss considers the shape difference between the GT box and the predicted box. The IoU loss evaluates the accuracy of the predicted box by calculating the area intersection ratio and union ratio between the GT box and the predicted box.

[0094] By combining these four losses, the SIoU loss function can not only help the model avoid overfitting problems, but also significantly improve the accuracy and robustness of the corn leaf disease detection model. Given the significant advantages of the SIoU loss function in solving the direction mismatch problem, the SIoU function is chosen to replace the CIoU loss function in the YOLOv7m model. The definition of the SIoU loss function is as follows:

[0095]

[0096] The algorithm uses established evaluation metrics. Specifically, precision (P), recall (R), and mean average precision (mAP) are used as evaluation metrics; precision indicates how many positive predicted samples are correct, as shown below:

[0097] Precision indicates how many of the positive predicted samples are correct, as shown below:

[0098]

[0099] Recall represents the number of samples that were predicted to be positive among the true positive samples, as shown below:

[0100]

[0101] The average precision (AP) of different categories is calculated by mAP as follows:

[0102]

[0103] mAP is the process of averaging the accuracy of each category and is defined as follows:

[0104]

[0105] Where n is the number of categories, kAP is the precision of the kth category; true positive (TP) means that the prediction is positive and the label value is positive, so the prediction is correct; false negative (FN) means that the prediction result is negative and the label value is positive, so the prediction result is inaccurate; false positive (FP) means that the prediction value is positive but the label value is negative, so the prediction is wrong; true negative (TN) means that the prediction value is negative and the label value is negative, so the prediction is correct;

[0106] In addition, in order to correctly reflect the complexity of the model, the number of parameters and giga-floating-point operations (GFLOPs) are used as evaluation metrics.

[0107] 2Corn-YOLO network structure

[0108] In the field of plant leaf disease detection, the YOLO algorithm has become one of the technologies widely used by researchers due to its efficient processing speed and accurate target positioning. As an important version of the YOLO family, YOLOv7 has achieved a good balance between accuracy and speed. Therefore, the present invention improves the network structure of Corn-YOLO based on YOLOv7, such as Figure 2 shown.

[0109] Corn-YOLO's network architecture consists of three parts: input, backbone network, and detection head. The input includes operations such as adaptive anchor box calculation and adaptive image scaling. The backbone network consists of three modules: CBS, ELAN, and MP. The CBS module is responsible for feature extraction; the ELAN module is specifically responsible for feature fusion; and the MP module is responsible for downsampling, primarily reducing the size of feature maps.

[0110] The detection head primarily consists of the SPPCSPC module, as well as the proposed CAFMFusion and ESMFA modules. The SPPCSPC module significantly improves feature representation by aggregating image features; the CAFMFusion module implements efficient feature map fusion; and the ESMFA module deeply extracts and integrates local and global features, further improving feature robustness. Finally, the Rep module adjusts the number of output feature channels and then combines it with a 1×1 convolutional layer for prediction and output.

[0111] In general, Corn-YOLO has made further improvements and enhancements in feature fusion to provide a more powerful network structure and achieve higher object detection performance. Specifically, the present invention has made the following improvements to the network structure of YOLOv7:

[0112] 1) Through the CAFMFusion module, maps of objects at different scales can be fused more efficiently and accurately.

[0113] 2) The ESMFA module replaces the original ELAN module and enhances feature fusion and expression capabilities.

[0114] 3) In YOLOv7, the SIOU loss function is used to replace the original CIOU loss function, which effectively solves the direction mismatch problem and significantly improves the accuracy and reliability of object detection.

[0115] 2.1CAFMFusion

[0116] The Concat module plays an important role in deep learning architectures and is often used to connect or fuse feature maps between different layers. However, this operation also has some problems. For example, the Concat operation module generates a larger feature map by merging multiple feature maps, which increases the use of memory resources. In addition, although the Concat module can fully retain the information of all input feature maps, as the convolution operation continues, some key information may be gradually diluted in subsequent ELAN (or other related) modules, resulting in reduced information effectiveness. In addition, the Concat operation alone may bring another problem: the model may pay too much attention to the sequential representation of this information rather than its actual category representation. This tendency may cause the model to deviate from the correct direction during training, thereby affecting the final prediction performance.

[0117] Module Structure Diagram To overcome these challenges, this paper proposes a new module, namely CAFMFusion module. This module cleverly combines CAFM

[25] and CGAFusion

[26] technologies. Its structure is as follows Figure 3 In the CAFMFusion module, the present invention first performs an addition operation on the feature maps obtained from different scales to achieve feature fusion, as shown in Figure 4 This significantly reduces the memory requirements of the model while increasing the preservation of effective feature information at each scale.

[0118] The CAFMFusion module leverages the strengths of CAFM, integrating the characteristics of two mainstream feature extraction technologies: convolutional neural networks (CNNs) and transformers. Specifically, the convolutional layer processes local features, improving the algorithm's ability to capture the surface characteristics of corn leaf diseases, especially its ability to identify subtle features such as small leaf spots, localized lesions, and color changes. The attention mechanism is used to capture global features, helping the model understand the distribution pattern of diseases across the entire leaf and, in turn, identify large-scale manifestations of disease on the leaf. This combination of local and global features allows the model to focus on both the specific details of the lesion and the overall situation, effectively avoiding the problem of feature information dilution that can occur with a single convolutional module, allowing the model to more accurately distinguish various lesions on the leaf.

[0119] In the subsequent part of the CAFMFusion module, the present invention realizes the adaptive fusion of some low-level features of the encoder with the corresponding high-level features through a shuffle operation. The low-level features and high-level features refer to features of different sizes obtained from different layers of the Feature Pyramid Network (FPN). Specifically, the present invention adds the low-level features of the encoder to the high-level features and calculates the weights through the CAFMFusion module. Finally, the present invention combines these features using a weighted summation method, as follows:

[0120] F fuse =C 1×1 (F low W+F high (1-W)+F low +F high ) (1)

[0121] This fusion strategy ensures that the model fully utilizes feature information at different levels to improve the model's prediction performance, thereby improving the model's accuracy and robustness in identifying corn leaf diseases.

[0122] Generally speaking, the Concat module simply concatenates feature maps of different scales. In contrast, the CAFMFusion module dynamically obtains the output weights of feature maps of different scales through convolution and self-attention mechanisms, thereby better merging feature maps.

[0123] 2.2ESMFA

[0124] The ELAN module enhances the network's ability to learn more features by carefully adjusting the shortest path to align with the longest gradient path. However, the inherent receptive field limitations of the convolution operation are a significant issue. While the model's receptive field can be gradually expanded by increasing the number of convolutional layers, this also carries the risk of continued loss of feature information.

[0125] In order to further improve the performance of the ELAN module, the present invention improves the ELAN module and proposes a DELAN module, such as Figure 5 As shown in the figure. This module replaces typical convolution with ELAN-based depthwise separable convolution, thereby reducing the number of parameters and improving computational efficiency. Furthermore, the present invention uses GeLU functions instead of SiLU functions, further enhancing the expressiveness and robustness of the model.

[0126] In addition, in order to break the field of view limitation of the convolution operation and minimize the loss of feature information, it is particularly important to deeply mine the global information of corn leaf diseases. Corn leaf diseases usually have complex manifestations (such as different sizes, densities, and colors). At the same time, various types of lesions may appear at different scales and locations, so relying solely on local features is not enough to fully reflect the overall disease status. In this regard, the SMFA

[27] module captures local information by integrating the efficient approximate self-attention (EASA) branch and the local detail estimation (LDE) branch, achieving an excellent fusion of local and global features.

[0127] The EASA module has a moderate computational cost and implements an efficient approximate self-attention mechanism for exploring global information. It first extracts low-frequency components through downsampling, then processes these components using 3×3 depthwise convolutions. It also introduces the variance of the input features as the statistical dispersion of spatial information, thereby generating a feature map rich in global structural information.

[0128] On the other hand, the LDE module only uses dilated depthwise convolution with a kernel size of 3×3 to capture local features, and generates local features through two 1×1 convolutions with hidden GELU activations. However, according to the present invention, this module has limitations in fully capturing local features.

[0129] In order to better integrate local and global information, this paper combines the EASA module and the DELAN module and proposes a new module ESMFA (Enhanced Multi-Scale Structure Feature Aggregation), such as Figure 5 This architecture leverages the DELAN module's strengths in local feature extraction and the EASA module's capabilities in global feature exploration. By combining the two, the network can simultaneously capture and effectively fuse local disease characteristics and global disease information on corn leaves, further improving the model's ability and reliability in identifying corn leaf diseases.

[0130] 2.2.3.SIoU

[0131] The effectiveness of object detection depends largely on the loss function used

[28] . Most classic loss functions for object detection are based on a set of bounding box regression metrics, including the distance between the predicted box and the GT box, the area of the overlapping area, and the aspect ratio. However, the CIoU loss function ignores the orientation mismatch between the GT box and the predicted box, which will lead to deviations in the training results and thus affect the performance of the model. To solve this problem, Gevorgyan et al. proposed the SIoU loss function

[29] . The SIoU loss function consists of four parts: distance loss, shape loss, angle loss, and IoU loss. Specifically, the angle loss effectively reduces the orientation mismatch problem by accurately calculating the angle difference between the GT box and the predicted box; the distance loss quantifies the spatial distance between the GT box and the predicted box; the shape loss considers the shape difference between the GT box and the predicted box; and the IoU loss evaluates the accuracy of the predicted box by calculating the area intersection ratio and union ratio between the GT box and the predicted box.

[0132] By combining these four losses, the SIoU loss function not only helps the model avoid overfitting problems, but also significantly improves the accuracy and robustness of the corn leaf disease detection model. Given the significant advantages of the SIoU loss function in solving the direction mismatch problem, this paper chooses to use the SIoU function to replace the CIoU loss function in the YOLOv7 model. The definition of the SIoU loss function is as follows:

[0133]

[0134] 2.3 Performance Evaluation Method

[0135] To demonstrate the significance of this work, evaluate the effectiveness of the Corn-YOLO network model in detecting corn leaf diseases, and ensure the credibility and value of data comparisons, we used established evaluation metrics. Specifically, precision (P), recall (R), and mean average precision (mAP) were used as evaluation metrics. Precision indicates how many positive predictions were correct, as shown below:

[0136] Precision indicates how many of the positive predictions are correct, as shown below:

[0137]

[0138] Recall represents the number of samples that were predicted to be positive among the true positive samples, as shown below:

[0139]

[0140] The average precision (AP) of different categories is calculated by mAP as follows:

[0141]

[0142] mAP is the process of averaging the accuracy of each category and is defined as follows:

[0143]

[0144] Where n is the number of classes, and kAP is the precision for the kth class. A true positive (TP) indicates a positive prediction, and the labeled value is positive, resulting in a correct prediction. A false negative (FN) indicates an inaccurate prediction, and the labeled value is positive. A false positive (FP) indicates an incorrect prediction, and the labeled value is negative. A true negative (TN) indicates a negative prediction, and the labeled value is negative, resulting in a correct prediction.

[0145] In addition, in order to correctly reflect the complexity of the model, the present invention uses the number of parameters and giga floating point operations (GFLOPs) as evaluation indicators.

[0146] The training process of the experiment was carried out on the Windows 11 operating system, with an AMD Ryzen 9 5900HX processor, Radeon Graphics 3.30GHz, 32GB of memory, an NVIDIA GeForce RTX 3080 Laptop 16GB graphics card, CUDA version 11.8, Python version 3.7.16, and PyTorch version 1.13.1. The input image size was configured to be 640 pixels by 640 pixels, the batch size was set to 16, the initial learning rate was 0.01, the momentum was set to 0.937, and the weight decay was set to a stochastic gradient descent (SGD) optimization value of 0.005.

[0147] To address dataset imbalance, this paper uses a parameter called "-image weight" provided by the YOLOv7 model to balance class weights. This parameter counts the actual number of boxes in each class, calculates its reciprocal, and then normalizes it (i.e., divides each value by the sum of the reciprocals of all classes). Finally, it multiplies the value by the number of classes to achieve balanced class weights.

[0148] Specific examples:

[0149] The dataset used in this paper is mainly from the PlantVillage dataset and the CD&S

[24] dataset, and is mixed with the Crop Disease (Ghana) dataset on Kaggle. After data enhancement, the effect is verified on the test set divided into 8:1:1. Various images such as Figure 1 shown.

[0150] like Figure 7Based on the dataset used in this experiment, this paper compares Corn-YOLO with other current object detection networks, including YOLOv7m, YOLOv8m

[30] , YOLOv11m

[31] and Faster-RCNN (with ResNet50 as the backbone network), as shown in Table 3. This paper first analyzes the results of Corn-YOLO, as shown in Table 3. Figure 6 As shown in Figure 2. Although the loss curve of Corn-YOLO fluctuates slightly in the early stage, it eventually stabilizes.

[0151] Table 3. Comparison of corn leaf disease detection algorithms across models, including the corn-yolo model, on the dataset. mAP@0.5 is the mean average precision of each class at an IoU threshold of 0.5. The metric mAP@0.5:0.95 stands for "mean average precision" and is calculated over an IoU threshold range of 0.5 to 0.95.

[0152]

[0153] like Figure 8 In terms of the number of parameters (38.9M), Corn-YOLO demonstrates relatively good model lightweight characteristics. Although it is higher than YOLOv7m (37.2M), YOLOv8m (25.9M), and YOLOv11m (20.1M), it is far lower than FasterR-CNN (136.9M). Corn-YOLO achieves a precision of 89.5%, a recall of 88.8%, and a mAP@0.5 of 89.9%. These metrics are higher than those of other models, especially in terms of mean average precision, where Corn-YOLO improves by 2.4%, 0.3%, and 0.1% compared to YOLOv7m, YOLOv8m, and YOLO11m, respectively, indicating a clear advantage in accuracy.

[0154] In summary, Corn-YOLO demonstrates balanced performance across multiple metrics, striking an appropriate balance between accuracy and computational complexity. Notably, it surpasses other models in both precision and recall. This makes Corn-YOLO particularly advantageous in real-world object detection applications, especially in scenarios requiring high detection accuracy. By optimizing its model structure and parameter configuration, Corn-YOLO has become an efficient and reliable solution for corn leaf disease detection.

[0155] To differentiate the impact of CAFMFusion, the EMSFA module, and the SIOU function on model performance, ablation experiments were conducted. The purpose of conducting ablation experiments is to validate the performance of new modules by evaluating the impact of gradually introducing components into the algorithm. The impact of each module on the model was evaluated in turn. The ablation experiments used widely used metrics in the field of object detection, such as precision, recall, mean average prediction (MAP), and number of parameters, to demonstrate how each model's performance varied across multiple dimensions. The experimental results are shown in Table 4, with the best results in bold. These experimental results demonstrate that the modules added to the base YOLOv7m model contribute to model improvement.

[0156] Table 4 Ablation test results on this experimental dataset

[0157]

[0158] Table 4 lists the experimental results of sequentially adding the CAFMFusion module, SMFA module, ESMFA module, and SIOU loss function. It can be seen that after the proposed modules are sequentially added to the YOLOv7m baseline model, the overall trend of the model's evaluation indicators, precision, recall, and mAP, is upward.

[0159] As a base model, YOLOv7m demonstrates strong object detection capabilities. Integrating the CAFMFusion module improves YOLOv7m-CAFMFusion's precision by 0.8%, recall by 0.9%, and mAP by 0.3%. This demonstrates the effectiveness of the CAFMFusion module in enhancing the model's feature fusion capabilities and improving overall detection performance.

[0160] The system was further improved after the addition of the ESMFA module. YOLOv7M-CAFMFusion-ESMFA showed additional improvements, with precision, recall, and mAP increased by 0.6%, 2.8%, and 1.1%, respectively, compared to the variant without the ESMFA module. These findings indicate that the ESMFA module significantly improves the model's precision, recall, and average precision. This demonstrates the positive impact of combining local and non-local features on model performance, thus demonstrating the practicality of the ESMFA module.

[0161] At the same time, the YOLOv7m-CAFMFusion-ESMFA model (i.e., the Corn-YOLO model) using the SIoU loss function achieved an average improvement of 3.1%, 1.1%, and 0.3% in precision, recall, and average precision, respectively, compared to the model using the CIoU loss function. Therefore, the present invention believes that the SIoU loss function is an excellent bounding box loss function for this model.

[0162] As can be seen, Corn-YOLO has demonstrated excellent performance in terms of precision, recall, and mAP. In addition, it is worth noting that Corn-YOLO's GFLOPs value is as high as 116.1, the largest among all models, but not much higher than YOLOv7m. Although Corn-YOLO's number of parameters (38.92M) and number of layers (441) are not the least, due to its outstanding performance, the increase in these aspects has not excessively affected its performance. On the contrary, these optimizations make Corn-YOLO more valuable in object detection tasks, stand out from similar models, and enhance its market competitiveness.

[0163] Furthermore, according to rows 3 and 4 of Table 4, the P, R, and mAP values for the CAFMFusion and unmodified SMFA modules are 89.2%, 87.1%, and 88.9%, respectively. Using the improved EMSFA module, although the precision value (86.4%) decreases, the recall and mAP values are higher, at 87.7% and 89.6%, respectively. This demonstrates that the improvements made to the ESMA module are effective and now enable the model to more accurately identify corn leaf diseases.

[0164] Table 5 Comparison of the accuracy of various disease ablation experiments in this experimental dataset

[0165]

[0166] Tables 5, 6, and 7 analyze the performance of each model in classifying different diseases. Table 5 shows that Corn-YOLO performs best in identifying common rust, achieving an accuracy of 97.0%, significantly higher than the other models. Corn-YOLO also performs well in identifying cercospora leafspot and aureobasidium zeae diseases, with accuracy rates of 91.2% and 87.4%, respectively. However, YOLO's performance in identifying streak and northern leaf blight was less than satisfactory, with accuracy rates of 80.7% and 96.0%, respectively, indicating that the model incorrectly classified some negative samples as positive. YOLOv7m-CAFMFusion-SMFA performed best.

[0167] Table 6 Comparison of recall rates of various disease ablation experiments in this experimental dataset

[0168]

[0169] The data in Table 6 shows that Corn-YOLO achieved the best overall recall, reaching 88.8%, 4.8% higher than YOLOv7m, demonstrating its comprehensive advantage in multi-category disease detection. Corn-YOLO performed well in the aureobasidium zeae, grey leaf spot, healthy, northern leaf blight, southern rust, and streak categories, but performed poorly only in the cercospora leaf spot disease and common rust categories. This suggests that the model misclassified some positive samples as negative. On the other hand, YOLOv7m-CAFMFusion-SMFA performed the best compared to Corn-YOLO.

[0170] Table 7 Comparison of mAP@0.5 of various disease ablation experiments in this experimental dataset

[0171]

[0172]

[0173] As can be seen in Table 7, Corn-YOLO performs best in most disease categories, particularly in cercospora leaf spot, northern leaf blight, grey leaf spot, aureobasidium zeae, and healthy, all of which achieve the highest mAP. It outperforms the other models overall and in most subcategories, demonstrating its comprehensive performance. YOLOv7m-CAFMFusion-SMFA achieves better performance in southern rust, common rust, and streak detection, likely because ESMFA undergoes more convolutional layers when extracting local features compared to SMFA, resulting in partial feature loss. YOLOv7m-CAFMFusion achieves better performance in southern rust, common rust, and streak detection, likely because ESMFA enhances the detection of global features. Global features focus primarily on long-range spatial relationships rather than pixels within a local neighborhood. These long-range spatial relationships help capture the overall structure of the image, while also causing the neglect of local details. Therefore, the detection effect of dense spots such as common rust, southern rust and streaks is bound to be poor.

[0174] In summary, Corn-YOLO demonstrates strong advantages in identifying a wide range of diseases, performing particularly stably in tasks requiring high precision, making it the current optimal choice for corn disease detection. In summary, Corn-YOLO is not only accurate but also meets the standards for real-time diagnosis of corn leaf diseases. Furthermore, it achieves excellent results in identifying both dense and sparse spot diseases. This demonstrates that the Corn-YOLO model possesses unparalleled advantages in corn leaf disease detection, performing exceptionally well in key metrics such as P, R, and mAP, enabling efficient and accurate detection of various types of corn diseases. Its leading performance across multiple categories demonstrates its ability to accurately identify corn leaf diseases. These advantages make Corn-YOLO an optimal choice for corn leaf disease detection, with strong application potential and widespread adoption.

[0175] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods can be implemented using computer-executable instructions and / or contained in processor control code, for example, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, or can be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0176] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.

Claims

1. A corn leaf disease detection algorithm based on YOLOv7, characterized in that: Using the improved YOLOv7m algorithm model Corn-YOLO, the model achieves improved disease detection performance through the following improvements: Use the CAFMFusion module to replace the original Concat layer to enhance feature fusion; Use the ESMFA module to replace the original ELAN module to improve feature extraction capabilities; Use SIoU loss function instead of CIoU loss function to improve model accuracy and robustness; The network structure of the Corn-YOLO model includes input, backbone network and detection head, which is specifically implemented as follows: The input part includes adaptive anchor box calculation and adaptive image scaling operations; The backbone network consists of CBS module, ELAN module and MP module, among which the CBS module is responsible for feature extraction and the MP module is used for feature map downsampling; The detection head consists of the SPPCSPC module, the CAFMFusion module, and the ESMFA module. The SPPCSPC module improves feature expression capabilities by aggregating image features, the CAFMFusion module achieves efficient feature map fusion, and the ESMFA module completes multi-scale feature extraction and integration. The CAFMFusion module combines CAFM and CGAFusion technologies and is specifically implemented as follows: Perform addition operations on feature maps of different scales to achieve preliminary feature fusion; The convolutional layer is used to extract local disease features, and the attention mechanism captures global disease information; Through adaptive weight calculation, the low-level features and high-level features in the Feature Pyramid Network (FPN) are weighted and summed to achieve adaptive feature fusion, thereby significantly improving the accuracy and robustness of corn leaf disease detection. The ESMFA module uses depthwise separable convolution instead of typical convolution to reduce the number of parameters and improves performance in the following ways: Use GeLU activation function instead of SiLU activation function to enhance the expressiveness of the model; Combining the DELAN module and the EASA module, local feature extraction and global feature exploration are realized respectively. By fusing the two, the model's recognition ability and robustness of local and global disease information of corn leaves are improved.

2. The corn leaf disease detection algorithm according to claim 1, wherein: The SIoU loss function combines four loss calculation methods, including: Distance loss, used to quantify the spatial distance between the predicted box and the true box; Shape loss, which is used to calculate the shape difference between the predicted box and the true box; Angle loss, used to reduce the directional deviation between the predicted box and the real box; IoU loss, which is used to measure the degree of overlap between the predicted box and the true box; By combining the above losses, the SIoU loss function improves the accuracy of disease detection and effectively avoids the overfitting problem.

3. The corn leaf disease detection algorithm according to claim 1, wherein: The precision P, recall R and average precision mAP are used as evaluation indicators, where: Precision represents the proportion of samples predicted to be diseased that are actually diseased; Recall rate indicates the proportion of actual disease samples that are correctly predicted to be diseases; mAP is the calculation of the average precision of all categories, which comprehensively measures the performance of the model in disease detection of various categories; In addition, the number of parameters and GFLOPs are used as evaluation indicators of model complexity.

4. The corn leaf disease detection algorithm according to claim 1, wherein: Optimize model performance through the following techniques: Use adaptive anchor box calculation to dynamically adjust the size and shape of the anchor box; Adaptive image scaling technology normalizes the input image to improve model training efficiency; The SPPCSPC module is used to aggregate multi-scale image features to improve feature expression; The Rep module adjusts the number of output feature channels and combines it with a 1×1 convolutional layer for prediction and output, thereby optimizing the efficiency and accuracy of corn leaf disease detection.

5. A YOLOv7-based corn leaf disease detection system implementing the YOLOv7-based corn leaf disease detection algorithm according to any one of claims 1 to 4, characterized in that: The system includes: An image acquisition module is used to acquire high-resolution images of corn leaves and pre-process the images; A disease detection module, which detects corn leaf diseases based on the improved YOLOv7m algorithm model Corn-YOLO. The Corn-YOLO model uses the CAFMFusion module to achieve feature fusion, the ESMFA module to achieve multi-scale feature aggregation, and uses the SIoU loss function to improve detection accuracy; The data analysis and output module is used to generate a disease distribution analysis report based on the test results and output the test conclusions in the form of charts or text.

6. The corn leaf disease detection system based on YOLOv7 according to claim 5, characterized in that: The disease detection module includes: An input unit, configured to receive the captured image and adjust the image features through adaptive anchor box calculation and adaptive image scaling; The backbone network unit includes the CBS module for feature extraction, the CAFMFusion module for feature fusion, the MP module for downsampling, and the ESMFA module for enhancing multi-scale features; The detection head unit aggregates feature maps and generates disease prediction results through the SPPCSPC module and the Rep module.

7. The corn leaf disease detection system based on YOLOv7 according to claim 5, characterized in that: The system also includes: Performance evaluation module, used to evaluate disease detection performance based on precision P, recall R, and average precision mAP; The model optimization module evaluates model complexity by parameter count and GFLOPs, and dynamically adjusts network parameters to optimize the efficiency and accuracy of disease detection; The data storage module is used to store image data, detection results, and model parameters, and supports historical data backtracking and comparative analysis.

Citation Information

Patent Citations

  • Corn aflatoxin detection method based on YOLO

    CN113506242A

  • Improved corn leaf disease and insect pest automatic detection method based on YOLO model

    CN116310836A