YOLOv7-based corn leaf disease detection algorithm and system
By introducing the CAFMFusion module, ESMFA module and SIoU loss function in the YOLOv7 algorithm, the problems of insufficient detection accuracy and poor robustness in corn leaf disease detection are solved, and efficient and accurate disease recognition is achieved.
Patent Information
- Application Number
- CN202510057823.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-01-14
AI Technical Summary
The prior art has problems such as insufficient detection accuracy, poor robustness and limited feature extraction capabilities in corn leaf disease detection.
By introducing the CAFMFusion module, ESMFA module and SIoU loss function based on the YOLOv7 algorithm, feature fusion, multi-scale feature extraction and detection accuracy are enhanced.
It significantly improves the accuracy and robustness of corn leaf disease detection, and realizes effective identification of complex backgrounds and diverse disease characteristics.
Smart Images

Figure CN119963975A_ABST
Abstract
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] China is a major corn-growing country, ranking second in the world in both total corn production and planting area. Corn diseases are one of the main factors affecting corn yields, most of which are caused by bacteria, viruses and fungi. For a long time, people have been using manual visual monitoring to detect diseases early, ensure crop production and prevent damage to corn harvests. However, this traditional method of relying on agricultural experts or farmers to conduct manual inspections in the field is not only time-consuming and labor-intensive, but also prone to misjudgment due to incompetence or carelessness of inspectors, resulting in economic losses. Manual identification can no longer meet the needs of contemporary agricultural output. In contrast, deep learning algorithms are far superior to traditional methods due to their advantages of automation and high efficiency, and therefore have become the main research direction for future crop pest identification.
[0003] In recent years, crop pest and disease 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 (CNNs) 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 aimed at single disease classification and are difficult to effectively deal with the complex situation where different types of lesions coexist. In practice, categorizing leaves based only on the most obvious disease may overlook the potential impact of smaller lesions.
[0004] In contrast, object detection networks can identify different types of leaf disease spots at the same time, which provides a more advantageous solution. The YOLO family of algorithms is a recognized real-time object detection technology that is well suited to simultaneously identifying multiple disease spots on corn leaves. YOLO was first released in 2016, and its structure was much faster than other object detection algorithms at the time, and gradually became known as one of the most favored algorithms in object detection networks. Now, the YOLO family of algorithms is 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. made a diagnosis and identification system based on YOLOv7 that has credibility and accuracy 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 with traditional classification algorithms, the YOLO series of object detection algorithms are undoubtedly a more suitable choice. However, with the continuous updating of the YOLO series of algorithms, different versions of the YOLO algorithm have brought different new breakthroughs in the field of object detection. Therefore, it is particularly important to choose a suitable YOLO version for leaf spot detection. 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 view of 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 a corn leaf disease detection model Corn-YOLO based on the YOLOv7m algorithm, which replaces the original Concat layer with a CAFMFusion module and the original ELAN module with an ESMFA module to better enhance feature fusion, and uses a SIOU loss function to improve accuracy.
[0008] Furthermore, the network structure of Corn-YOLO is divided into three parts: input, backbone network and detection head; the input includes: adaptive anchor frame calculation and adaptive image scaling operations; the backbone network is mainly composed 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 to reduce the size of the feature map;
[0009] The detection head is mainly composed of 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 the 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 the two technologies of CAFM and CGAFusion. First, the feature maps obtained from different scales are added to achieve feature fusion;
[0011] The CAFMFusion module gives full play to the advantages of CAFM and integrates the characteristics of two mainstream feature extraction technologies, namely convolutional neural network (CNN) and transformer. Specifically, the convolution layer is used to process local features, which improves the algorithm's ability to capture the surface features of corn leaf diseases, especially the ability to identify subtle features such as small leaf spots, local lesions and color changes. The attention mechanism is used to capture global features, helping the model understand the disease distribution pattern of the entire leaf, and then identify the disease manifestations on the leaf on a large scale. This method of combining local and global features enables the model to focus on both the specific situation of the lesion and the overall situation, effectively avoiding the problem of feature information dilution that may be caused by a single convolution module, so that the model can 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; low-level features and high-level features refer to features of different sizes obtained from different layers in 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 summation 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 makes full use of 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 includes 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 indicators. Specifically, precision (P), recall (R), and mean average precision (mAP) are used as evaluation indicators; precision indicates how many positive predicted samples are correct, as shown below:
[0022] Precision indicates how many positive predicted samples are correct, as shown below:
[0023]
[0024] Recall represents the number of samples predicted to be positive among the truly 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, the label value is positive, and the prediction is correct; false negative (FN) means that the prediction result is negative, but the label value is positive, and the prediction result is inaccurate; false positive (FP) means that the prediction value is positive, but the label value is negative, and the prediction is wrong; true negative (TN) means that the prediction value is negative, the label value is negative, and 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, the system comprising:
[0033] An image acquisition module, used for acquiring high-resolution images of corn leaves and preprocessing the images;
[0034] A disease detection module is used to detect corn leaf diseases based on an improved YOLOv7m algorithm model Corn-YOLO. The Corn-YOLO model implements feature fusion through a CAFMFusion module, implements multi-scale feature aggregation through an ESMFA module, and uses a 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, used for receiving the acquired image and adjusting the image features through adaptive anchor frame 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] Model optimization module, which 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, the present invention proposes a real-time intelligent corn leaf disease detection method Corn-YOLO, which achieves a reasonable combination of accuracy, speed and computational complexity, and achieves considerable results in testing. The present invention combines different data sets to create a diversified data set and uses LabelImg for image annotation. In order to improve the accuracy of the model, the data set is enhanced, including operations such as random brightness adjustment, scaling, translation, rotation and contrast adjustment. In order to enhance the feature extraction capability, the CAFMFusion module is proposed, which improves the overall performance of the model and the disease feature extraction capability by fusing feature information of different scales. At the same time, the ESMFA module is designed to replace the ELAN module in YOLOv7, realizing the effective fusion of local features and global features, and further improving the recognition accuracy of corn leaf diseases. In addition, the SIOU loss function is introduced to replace the CIOU loss function in YOLOv7, which significantly improves the performance of the model in terms of target positioning accuracy. The model is divided into a training set, a test set and a validation set in a ratio of 8:1:1 using the cross-validation method to evaluate the generalization ability of the model on the test set. Finally, the accuracy was 89.5%, the recall was 88.8%, and the average precision was 89.9%. This proves the robustness of the model. In summary, the Corn-YOLO model performs well in detecting corn leaf diseases. In addition, the Corn-YOLO model can help more people quickly identify corn leaf diseases without the need for professional knowledge, while reducing the manpower and time required for identification, providing technical support for disease identification in the field of agricultural automation and providing an effective means for crop protection.
[0046] Second, the expected benefits and commercial value of the technical solution of the present invention after transformation are: it is expected to significantly improve the accuracy and efficiency of corn leaf disease detection and reduce crop losses and economic losses caused by diseases. In terms of commercial value, the technical solution can be applied to the field of agricultural automation, provide technical support for disease identification, and help promote the development of precision agriculture. In addition, the technical solution can be further expanded to disease detection of other crops, with broad market application prospects and commercial potential.
[0047] The technical solution of the present invention fills the technical gap in the industry at home and abroad: by enhancing the feature fusion of the model (specifically using technical means such as CAFMFusion module, ESMFA module and 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 at home and abroad.
[0048] The technical solution of the present invention solves a technical problem that people have been eager to solve but have never succeeded in solving: the traditional manual method of detecting corn leaf diseases is time-consuming, labor-intensive, error-prone, and cannot meet the needs of modern agriculture. Although the disease detection method based on deep learning has advantages, there are still some technical difficulties in practical applications, such as how to improve the accuracy and robustness of detection. The technical solution of the present invention proposes the Corn-YOLO model by improving and optimizing the YOLOv7 algorithm, successfully solving these technical problems and realizing rapid and accurate detection of corn leaf diseases.
[0049] The technical solution of the present invention overcomes technical bias: In previous disease detection tasks, people often rely 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 by the present invention overcomes these technical biases by introducing advanced deep learning technology and optimization algorithms, and achieves 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 of 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 capability in the prior art. On the basis of the traditional YOLOv7 algorithm, by introducing the CAFMFusion module, the ESMFA module and the 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 detection performance of the model 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 technical progress in the industrial application of corn leaf disease detection. Compared with the prior art, 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) to further enhance the feature expression ability of the model. The detection head part introduces the SPPCSPC module to aggregate image features, ensuring the stable performance of the detection model in highly complex scenarios, and overall improving the efficiency and accuracy of disease detection.
[0052] The technical solution of the present invention fills the technical gap in the field of corn leaf disease detection and provides an intelligent solution for agricultural disease monitoring. Through the construction of a high-precision disease detection model, the present invention can be widely used in farmland monitoring, disease early warning and precision agricultural 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 agricultural intelligence, which has important commercial value and promotion prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 is an example of dataset annotation and label classification provided by an embodiment of the present invention;
[0054] Figure 2 is a Corn-YOLO structure diagram provided by an embodiment of the present invention;
[0055] Figure 3 It is a CAFMFusion diagram provided by an embodiment of the present invention;
[0056] Figure 4 It is the information fusion provided by the embodiment of the present invention;
[0057] Figure 5 It is the ESMFA module structure provided by the 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 solution 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 used to limit the present invention.
[0062] This paper uses YOLOv7 to detect leaf diseases and improves its accuracy. In this study, Corn-YOLO algorithm for corn disease detection is designed and proposed. The full content of this work is as follows:
[0063] 1) The 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) Use the ESMFA module to replace the ELAN module in YOLOv7. The ESMFA module enhances the model's ability to identify complex lesions by fusing global context information and 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 positioning quality of the model when dealing with complex lesion shapes.
[0066] 4) On the experimental dataset, the Corn-YOLO model achieved excellent results in detecting corn leaf diseases, with an accuracy of 89.5%, a recall of 88.8%, and an average precision of 89.9%, ahead of some detection algorithms (faster-RCNN, YOLOv8m, YOLOv11m). In addition, ablation experiments were conducted to analyze the contribution of each module and technology to the performance of Corn-YOLO, verify the advantages of each innovative module, and prove their important role in improving the performance of the entire model.
[0067] Example 1: Intelligent farmland disease monitoring system
[0068] Based on the Corn-YOLO algorithm of the present invention, an intelligent farmland disease monitoring system has been developed, which is widely used in disease warning and management in large-scale corn planting areas. The system consists of a drone acquisition module, an edge computing module, and a data analysis platform. The drone collects high-resolution images of corn leaves through a planned flight path and transmits them to the onboard edge computing device in real time. The image is processed in real time using the integrated Corn-YOLO algorithm to accurately identify the corn disease area and type. The test results include the type of disease, distribution range, and severity, and are then uploaded to the background data analysis platform via a wireless network for further summary and processing.
[0069] The system generates disease distribution visualization maps and early warning reports, and provides farmers with specific farming advice, such as targeted pesticide application or early disease control plans for specific areas. Compared with traditional manual inspections, the system can significantly improve the efficiency of disease monitoring, covering large areas of farmland while ensuring high accuracy of test results. Through precise disease monitoring and management, not only can the risk of disease spread be effectively reduced, but the use of pesticides can also be significantly reduced, 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 the present invention is applied to an agricultural intelligent robot to achieve real-time detection and precise prevention of corn leaf diseases in the field. The robot is equipped with a high-definition camera and combines the Corn-YOLO algorithm to dynamically analyze corn leaf images, quickly identify diseased areas, and locate disease types. The detection results directly drive the robot's precision spraying module, which adjusts the position and amount of the nozzle to perform fixed-point treatment only on the diseased area, avoiding waste of medicines while protecting healthy crops. This method is particularly suitable for complex lighting conditions and diverse disease distribution scenarios, and has extremely high detection accuracy and environmental adaptability.
[0072] In addition, agricultural robots will synchronize disease detection data to agricultural management systems to form continuous field data records for trend analysis and optimization of disease prevention and control strategies. Compared with traditional farmland spraying, this solution significantly reduces pesticide usage and labor costs, while improving disease prevention and 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, which uses a corn leaf disease detection model Corn-YOLO based on the YOLOv7m algorithm. The model replaces the original Concat (feature concatenation) layer with a CAFMFusion (convolution and attention full hybrid fusion module) module, and replaces the original ELAN (efficient layer aggregation network) module with an ESMFA (efficient spatial multi-scale feature aggregation) module to better enhance feature fusion, and uses a SIOU loss function to improve accuracy.
[0074] 1. Dataset
[0075] The datasets used for the experiments in this paper are mainly from the PlantVillage dataset and the CD&S
[24] dataset, and are mixed with the Crop Disease (Ghana) dataset on Kaggle. The obtained photos are manually annotated using the LabelImg program to accurately depict the diseased area.
[0076] The specific labeling strategies are as follows: For cercospora leafspot disease and grey leafspot, since they are scattered on corn leaves and near the main veins, a non-compact labeling strategy is used 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, commonrust, southern rust, streak, northern leafblight, grey leafspot and aureobasidiumzeae, as well as the annotations of asymptomatic healthy leaves, a total of eight types. Table 1 shows the number of images and GT boxes for each type of leaf. For the imbalance of the dataset, the present invention uses the "--image weight" parameter to solve it, see 2.4 for details.
[0078] Table 1 Dataset information
[0079]
[0080] In order to increase the diversity of the data set and improve the universality and adaptability of the model, the present invention uses the functions of the imgaug library to randomly combine scaling, translation, rotation and contrast adjustment, etc., thereby further enhancing the data set. Specific parameters are shown in Table 2. After the above processing, the final constructed data set contains 10580 images. The present invention divides these images into a training set, a validation set and a test set according to a ratio of 8:1:1, that is, 8464 images are a training set, 1058 images are a test set, and 1058 images are a 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]
[0084] 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 frame calculation and adaptive image scaling; the backbone network is mainly composed 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 to reduce the size of the feature map;
[0085] The detection head is mainly composed of 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 the 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.
[0086] The CAFMFusion module cleverly combines the two technologies of CAFM and CGAFusion. First, the feature maps obtained from different scales are added to achieve feature fusion.
[0087] The CAFMFusion module gives full play to the advantages of CAFM and integrates the characteristics of two mainstream feature extraction technologies, namely convolutional neural network (CNN) and transformer. Specifically, the convolution layer is used to process local features, which improves the algorithm's ability to capture the surface features of corn leaf diseases, especially the ability to identify subtle features such as small leaf spots, local lesions and color changes. The attention mechanism is used to capture global features, helping the model understand the disease distribution pattern of the entire leaf, and then identify the disease manifestations on the leaf on a large scale. This method of combining local and global features enables the model to focus on both the specific situation of the lesion and the overall situation, effectively avoiding the problem of feature information dilution that may be caused by a single convolution module, so that the model can more accurately distinguish various lesions on the leaf.
[0088] 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; low-level features and high-level features refer to features of different sizes obtained from different layers in 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 summation method, as follows:
[0089] F fuse =C 1×1 (F low ·W+F high (1-W)+F low +F high ) (1)
[0090] 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;
[0091] 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.
[0092] 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 to further enhance the expressiveness and robustness of the model.
[0093] The ESMFA, enhanced multi-scale structural feature aggregation, makes full use of 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.
[0094] 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.
[0095] 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:
[0096]
[0097] 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:
[0098] Precision indicates how many positive predicted samples are correct, as shown below:
[0099]
[0100] Recall represents the number of samples predicted to be positive among the truly positive samples, as shown below:
[0101]
[0102] The average precision (AP) of different categories is calculated by mAP as follows:
[0103]
[0104] mAP is the process of averaging the accuracy of each category and is defined as follows:
[0105]
[0106] Where n is the number of categories, kAP is the precision of the kth category; true positive (TP) means that the prediction is positive, the label value is positive, and the prediction is correct; false negative (FN) means that the prediction result is negative, but the label value is positive, and the prediction result is inaccurate; false positive (FP) means that the prediction value is positive, but the label value is negative, and the prediction is wrong; true negative (TN) means that the prediction value is negative, the label value is negative, and the prediction is correct;
[0107] 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.
[0108] 2Corn-YOLO network structure
[0109] 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.
[0110] 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 to reduce the size of the feature map.
[0111] 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 the 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.
[0112] In general, Corn-YOLO has made further improvements and enhancements in feature fusion to provide a more powerful network structure and achieve higher target detection performance. Specifically, the present invention makes the following improvements to the network structure of YOLOv7:
[0113] 1) Through the CAFMFusion module, maps of objects of different scales can be fused more efficiently and accurately.
[0114] 2) The ESMFA module replaces the original ELAN module and enhances feature fusion and expression capabilities.
[0115] 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.
[0116] 2.1 CAFMFusion
[0117] The Concat module plays an important role in deep learning architectures and is often used to achieve the connection or fusion of 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.
[0118] 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 FIG. Figure 4 This greatly reduces the memory requirements of the model while increasing the retention of effective feature information at each scale.
[0119] The CAFMFusion module fully leverages the advantages of CAFM and integrates the characteristics of two mainstream feature extraction technologies: convolutional neural networks (CNNs) and transformers. Specifically, the convolution layer is used to process local features, which improves the algorithm's ability to capture the surface features of corn leaf diseases, especially the ability to identify subtle features such as small leaf spots, local lesions, and color changes. The attention mechanism is used to capture global features, helping the model understand the distribution pattern of diseases on the entire leaf, and then identify the manifestation of diseases on a large scale on the leaf. This method of combining local and global features allows the model to focus on both the specific situation of the lesion and the overall situation, effectively avoiding the problem of feature information dilution that may be caused by a single convolution module, so that the model can more accurately distinguish various lesions on the leaves.
[0120] 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 in 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:
[0121] F fuse =C 1×1 (F low ·W+F high (1-W)+F low +F high ) (1)
[0122] 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.
[0123] 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.
[0124] 2.2ESMFA
[0125] The ELAN module enhances the network's ability to learn more features by carefully adjusting the shortest path to keep it consistent with the longest gradient path. However, the inherent receptive field limitation of the convolution operation itself is an issue that cannot be ignored. Although the receptive field of the model can be gradually expanded by increasing the number of convolutional layers, this also brings the risk of continuous loss of feature information.
[0126] 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. This module replaces the typical convolution with the ELAN-based deep separation convolution, thereby reducing the number of parameters and improving the computational efficiency. At the same time, the present invention also uses the GeLU function instead of the SiLU function, further enhancing the expressiveness and robustness of the model.
[0127] 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.
[0128] The EASA module has a moderate computational cost and implements an efficient approximate self-attention mechanism to explore global information. It first extracts low-frequency components through downsampling operations, then processes these components using 3×3 depthwise convolutions and introduces the variance of the input features as the statistical discreteness of spatial information, thereby generating feature maps rich in global structural information.
[0129] On the other hand, the LDE module only uses dilated depthwise convolution with 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.
[0130] In order to better integrate local and global information, the present invention 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 structure makes full use of 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 ability and reliability of the model to identify corn leaf diseases.
[0131] 2.2.3.SIoU
[0132] The performance 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 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.
[0133] 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. In view of the significant advantages of the SIoU loss function in solving the direction mismatch problem, the present invention 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:
[0134]
[0135] 2.3 Performance Evaluation Method
[0136] In order to demonstrate the significance of the work of the present invention, evaluate the efficacy of the Corn-YOLO network model in detecting corn leaf diseases, and ensure the credibility and value of data comparison, the present invention adopts established evaluation indicators. Specifically, precision (P), recall (R), and mean average precision (mAP) are used as evaluation indicators. Precision indicates how many positive predicted samples are correct, as shown below:
[0137] Precision indicates how many positive predicted samples are correct, as shown below:
[0138]
[0139] Recall represents the number of samples predicted to be positive among the truly positive samples, as shown below:
[0140]
[0141] The average precision (AP) of different categories is calculated by mAP as follows:
[0142]
[0143] mAP is the process of averaging the accuracy of each category and is defined as follows:
[0144]
[0145] Where n is the number of categories, and kAP is the precision of the kth category. True Positive (TP) means that the prediction is positive, the label value is positive, and the prediction is correct. False Negative (FN) means that the prediction result is negative, but the label value is positive, and the prediction result is inaccurate. False Positive (FP) means that the prediction value is positive, but the label value is negative, and the prediction is wrong. True Negative (TN) means that the prediction value is negative, the label value is negative, and the prediction is correct.
[0146] In addition, in order to correctly reflect the complexity of the model, the present invention uses the number of parameters and GFLOPs as evaluation indicators.
[0147] The training process of the experiment was carried out on the Windows 11 operating system, the processor was AMD Ryzen 9 5900HX, Radeon Graphics 3.30GHz, memory was 32GB, the graphics card was NVIDIA GeForce RTX3080 Laptop 16GB, CUDA version was 11.8, Python version was 3.7.16, and PyTorch version was 1.13.1. The size of the input image 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.
[0148] For the imbalance of data sets, the present invention uses the parameter named "-image weight" provided by the YOLOv7 model to balance the category weights. This parameter counts the actual number of boxes in each category, calculates its reciprocal, and then performs normalization (i.e., divides each value by the sum of the reciprocals of all categories), and finally multiplies it by the number of categories for weight adjustment to achieve the effect of balancing the category weights.
[0149] Specific examples:
[0150] The datasets used in this paper are mainly from the PlantVillage dataset and the CD&S
[24] dataset, and are mixed with the Crop Disease (Ghana) dataset on Kaggle. After data enhancement, the results are verified on the test set divided into 8:1:1. Figure 1 shown.
[0151] like Figure 7According to the dataset used in this experiment, the present invention 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. The present invention first analyzes the results of Corn-YOLO. Figure 6 As shown in Figure 2. Although the loss curve of Corn-YOLO fluctuates slightly in the early stage, it eventually stabilizes.
[0152] Table 3. Comparison results of maize leaf disease detection algorithms among models including the maize-yol o model on the dataset. mAP@0.5 is the average precision of each category when the representative accuracy evaluation IoU threshold is 0.5. The metric mAP@0.5:0.95 stands for “mean average precision” and is calculated over the IoU threshold range of 0.5 to 0.95.
[0153]
[0154] like Figure 8 In terms of the number of parameters (38.9M), Corn-YOLO exhibits relatively good model lightweight characteristics, which is higher than YOLOv7m (37.2M), YOLOv8m (25.9M) and YOLOv11m (20.1M), but much lower than FasterR-CNN (136.9M). Corn-YOLO has an accuracy of 89.5%, a recall of 88.8%, and an mAP@0.5 of 89.9%. These indicators are higher than other models, especially in terms of mean average precision, which is 2.4%, 0.3%, and 0.1% higher than YOLOv7m, YOLOv8m, and YOLO11m, respectively, indicating that it has a clear advantage in accuracy.
[0155] In summary, Corn-YOLO shows balanced performance in multiple performance indicators, achieving an appropriate balance between accuracy and computational complexity. Notably, it outperforms other models in both precision and recall. This makes Corn-YOLO particularly advantageous in real-world object detection applications, especially in scenarios that require high detection accuracy. By optimizing the model structure and parameter configuration, Corn-YOLO becomes an efficient and reliable solution in the field of corn leaf disease detection.
[0156] In order to distinguish the impact of CAFMFusion, EMSFA module and SIOU function on model performance, ablation experiments were used. The purpose of ablation experiments is to verify the performance of new modules by evaluating the impact of gradually introducing components into the algorithm on model performance. The impact of each module on the model is evaluated in turn. Ablation experiments use indicators widely used in the field of object detection, such as precision, recall, mAP, and number of parameters, as evaluation indicators, which can show the changes in the performance of each model in multiple dimensions. The experimental results are shown in Table 4, where the best results are shown in bold. The experimental results prove that the modules added to the YOLOv7m basic model help improve the model.
[0157] Table 4 Ablation test results on this experimental dataset
[0158]
[0159]
[0160] Table 4 lists the experimental results of adding the CAFMFusion module, SMFA module, ESMFA module and SIOU loss function in sequence. It can be seen that after adding the proposed modules in the YOLOv7m benchmark model in sequence, the overall trend of the model's evaluation indicators precision, recall rate and mAP is rising.
[0161] As a basic model, YOLOv7m has shown strong target detection capabilities. After integrating the CAFMFusion module, the precision of YOLOv7m-CAFMFusion increased by 0.8%, the recall rate increased by 0.9%, and the mAP increased by 0.3%. This shows that the CAFMFusion module plays an effective role in enhancing the feature fusion capability of the model and improving the overall detection performance.
[0162] After adding the ESMFA module, the system was further improved. 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 show that the ESMFA module significantly improves the precision, recall, and average precision of the model. This demonstrates the positive impact of combining local and non-local features on model performance, thereby proving the practicality of the ESMFA module.
[0163] At the same time, the average values of precision, recall and average precision of the YOLOv7m-CAFMFusion-ESMFA model (i.e., Corn-YOLO model) using the SIoU loss function are 3.1%, 1.1% and 0.3% higher than those of the model using the CIoU function as the loss function. Therefore, the present invention considers the SIoU loss function to be an excellent bounding box loss function for the model.
[0164] It can be seen that Corn-YOLO has shown excellent performance in terms of accuracy, 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 more 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.
[0165] In addition, according to the 3rd and 4th rows of Table 4, the P, R, and mAP values using CAFMFusion and the unmodified SMFA module are 89.2%, 87.1%, and 88.9%, respectively. Using the improved EMSFA module, although the precision value (86.4%) has decreased, the recall rate and mAP value are higher, 87.7% and 89.6%, respectively. This shows that the improvement of the ESMA module by the present invention is effective, and now it enables the model to more accurately identify corn leaf diseases.
[0166] Table 5 Comparison of the accuracy of various disease ablation experiments in this experimental dataset
[0167]
[0168] Tables 5, 6, and 7 analyze the performance of each model in different disease classifications. It can be seen from Table 5 that Corn-YOLO performs best in the identification of common rust, with an accuracy of 97.0%, which is much higher than other models. Corn-YOLO also has an advantage in identifying cercospora leafspot and aureobasidium zeae, with accuracy rates of 91.2% and 87.4%, respectively. However, in the identification of streak and northern leaf blight, YOLO's performance is not satisfactory, with accuracy rates of 80.7% and 96.0%, respectively, which indicates that the model mistakenly classifies some negative samples as positive samples. YOLOv7m-CAFMFusion-SMFA performs best.
[0169] Table 6 Comparison of recall rates of various disease ablation experiments in this experimental dataset
[0170]
[0171]
[0172] The data in Table 6 show that Corn-YOLO performs best in terms of overall recall, reaching 88.8%, which is 4.8% higher than YOLOv7m, showing its comprehensive advantages in multi-category disease detection. Corn-YOLO performs well in aureobasidium zeae, grey leaf spot, health, northern leafblight, southern rust, and streak categories, and performs poorly only in cercospora leaf spot disease and common rust categories. This indicates that the model misclassifies some positive samples as negative samples. On the other hand, YOLOv7m-CAFMFusion-SMFA performs best compared to Corn-YOLO.
[0173] Table 7 Comparison of mAP@0.5 of various disease ablation experiments in this experimental dataset
[0174]
[0175] As can be seen from Table 7, Corn-YOLO performs best in most disease categories, especially in cercospora leaf spot, northern leafblight, grey leafspot, aureobasidium zeae, and health, all of which have the highest mAP. It outperforms other models overall and in most subcategories, which shows that it has the most comprehensive performance. YOLOv7m-CAFMFusion-SMFA achieves better performance in southern rust, common rust, and streak category detection, which may be 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, which may be because ESMFA enhances the detection of global features. Global features mainly focus on long-range spatial relationships rather than being limited to pixels within a local neighborhood. This long-range spatial relationship helps capture the overall structure in the image, but also leads to ignoring local details in the image. Therefore, the detection effect of dense spots such as common rust, southern rust and streaks is bound to be poor.
[0176] In summary, Corn-YOLO has strong advantages in identifying a variety of diseases, especially in tasks requiring high precision, and is the best choice for corn disease detection. In short, Corn-YOLO is not only accurate, but also meets the standards for real-time diagnosis of corn leaf diseases. At the same time, it has achieved good results in identifying both dense and sparse spot diseases. It can be seen that the Corn-YOLO model has incomparable advantages in corn leaf disease detection, and performs well in key indicators such as P, R, and mAP, and can efficiently and accurately detect various types of corn diseases. The leading performance in multiple categories proves its ability to accurately identify corn leaf diseases. These advantages of Corn-YOLO make it the best choice for corn leaf disease detection tasks, with strong application potential and promotion value.
[0177] 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 part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, 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. Such code is provided on the carrier medium. The device and its 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, etc., 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, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.
[0178] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope 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 CAFMFusion module to replace the original Concat layer to enhance feature fusion; Use ESMFA module to replace the original ELAN module to improve feature extraction capabilities; The SIoU loss function is used instead of the original CIoU loss function to improve the model accuracy and robustness.
2. The corn leaf disease detection algorithm according to claim 1, characterized in that: 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 operation; The backbone network consists of CBS module, ELAN module and MP module, where CBS module is responsible for feature extraction and 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 the feature expression capability by aggregating image features, the CAFMFusion module realizes efficient feature map fusion, and the ESMFA module completes multi-scale feature extraction and integration.
3. The corn leaf disease detection algorithm according to claim 1, characterized in that: 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 feature adaptive fusion, thereby significantly improving the accuracy and robustness of corn leaf disease detection.
4. The corn leaf disease detection algorithm according to claim 1, characterized in that: 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; The DELAN module and the EASA module are combined to realize local feature extraction and global feature exploration respectively. By integrating the two, the model's recognition ability and robustness of local and global disease information of corn leaves are improved.
5. The corn leaf disease detection algorithm according to claim 1, characterized in that: 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 direction deviation between the predicted box and the real box; IoU loss is used to measure the 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.
6. The corn leaf disease detection algorithm according to claim 1, characterized in that: Precision (P), recall (R) and mean 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 as diseases; mAP is the calculation of the average precision of all categories, which comprehensively measures the performance of the model in disease detection of each category. In addition, the number of parameters and GFLOPs are used as evaluation indicators of model complexity.
7. The corn leaf disease detection algorithm according to claim 1, characterized in that: 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 the training efficiency of the model; 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 the 1×1 convolutional layer for prediction and output, thereby optimizing the efficiency and accuracy of corn leaf disease detection.
8. A corn leaf disease detection system based on YOLOv7, characterized in that: The system includes: An image acquisition module, used for acquiring high-resolution images of corn leaves and preprocessing the images; A disease detection module is used to detect corn leaf diseases based on an improved YOLOv7m algorithm model Corn-YOLO. The Corn-YOLO model implements feature fusion through a CAFMFusion module, implements multi-scale feature aggregation through an ESMFA module, and uses a 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.
9. The corn leaf disease detection system based on YOLOv7 according to claim 1, characterized in that: The disease detection module comprises: An input unit, used for receiving the acquired image and adjusting the image features through adaptive anchor frame 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.
10. The corn leaf disease detection system based on YOLOv7 according to claim 1, characterized in that: The system also includes: Performance evaluation module, used to evaluate disease detection performance based on precision (P), recall (R), and mean average precision (mAP); Model optimization module, which 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
Photovoltaic panel dust detection method, device and equipment and storage medium
CN118608489A
Cited By
Double-branch remote sensing target intelligent detection method fusing privacy calculation
CN121366359A
A dual-branch remote sensing target intelligent detection method fusing privacy computing
CN121366359B