AgBioForum, 25(1): 58-67. ©2023 AgBioForum Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm Wang Xinming Dr, professor, Ph.D., Department of Mechanical and Manufacturing Engineering, UPM,43400, Malaysia Email: gs62785@student.upm.edu.my Tang Sai Hong* * Dr professor, Ph.D., Department of Mechanical and Manufacturing Engineering, UPM,43400, Malaysia Email: saihong@upm.edu.my Mohd Khairol Anuar b. Mohd Ariffin Dr, professor, Ph.D., Department of Mechanical and Manufacturing Engineering, UPM,43400, Malaysia Email: khairol@upm.edu.my Mohd Idris Shah b. Ismail Dr, professor, Ph.D., Department of Mechanical and Manufacturing Engineering, UPM,43400, Malaysia Email: ms_idris@upm.edu.my Agriculture is the primary occupation of nearly all nations that feed the world's population. The population growth and rising demand for food require farmers to increase food production to meet the requirements. On the other hand, farming is not regarded as a lucrative occupation, as farmers incur significant losses due to pests and diseases that reduce the quality and quantity of farm produce. Consequently, predicting plant diseases using modern technologies will aid producers in making well-informed decisions early on. This study employs and compares the results of two important computer vision algorithms, YOLOv4 and YOLOv7, for classifying leaf diseases from images of leaves from various plant species. The models are trained with images of individual leaves captured in various environments, imparting resilience and adaptability. Both models annotate and predict leaf diseases with high confidence for each class. Other classification metrics, such as Precision, F1-score, Mean Average Precision, and recall, also demonstrate competitive performance. However, YOLOv7 performs better because its flexible labeling mechanism dynamically learns the class labels. In addition, the work can be expanded to utilize recommendation strategies to predict the extent of injury. Keywords: Plant leaf disease, YOLO v4, YOLO v7, Spatial pyramid pooling, Mean average precision, IoU, Compound scaling, precision agriculture 1. Introduction The world's population is expected to increase by 30% over the next 35 years, bringing the total to over 8 billion (As shown in Fig. 1). According to a report by the Food and Agricultural Organization (FAO), it is necessary to increase agricultural yields by at least 60 percent in order to meet global food demands (Alexandratos & Bruinsma, 2012). The agricultural harvests of the past 50 years demonstrate that an ambitious objective of 2800 Kcal/person/day can be reached from 2200 Kcal/person/day. Despite this growth, many people are starving because food distribution is not uniform. Fig 1: World population growth trend Green Revolution, the replacement of traditional agricultural practices with modern technologies, use of agrochemicals, mechanization of labor, efficient water management, expansion of irrigated land, and advancements in food storage and processing technologies are the primary boosters of food production, according to Siedow (2001). As shown in Fig. 2, there is an annual upward trend in the yields of primary commodities. Fig 2: Increase in yield of primary crops around the world Despite these positive factors, urbanization, industrialization, labor market scarcity, climatic factors, and ancient agricultural techniques threaten global agriculture. This climatic barrier has spawned a potential biological hazard to crops, reducing food production quality and quantity (Nguyen, Sahin, & Howes, 2021). Farmers and governments attempt to adopt effective control measures by correlating the plant's epidemiological parameters with their cultivation landscape (Gilligan, 2008). The damages caused by pest and disease attacks should not be minimized because they significantly threaten crop productivity. Plant diseases are categorized broadly as abiotic or non- infectious and biotic or infectious. Unfavorable environmental conditions promote the development of non-communicable diseases in plants, which are the primary cause of disease transmission. In addition, the fragile physicochemical composition of atmospheric factors such as air and soil also plays a significant role in the genesis of disease. As depicted in Figure 3, microorganisms such as fungi, viruses, bacteria, parasites, mailto:gs62785@student.upm.edu.my mailto:saihong@upm.edu.my mailto:khairol@upm.edu.my mailto:ms_idris@upm.edu.my AgBioForum, 25(1), 2023 | 59 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm and nematodes cause infections and diseases in various plant parts (Anderson et al., 2004). Monitoring conditions such as spotted leaves, leaf exfoliation, ulceration, rots, alterations in leaf structure, anthracnose, etc., makes it simple to identify infected plants. In addition to affecting the quality, the damage caused by these infections inevitably reduces productivity. Consequently, the agricultural sector is adopting modern agricultural practices with technologies such as Agriculture 4.0, Precision Agriculture (PA), and others. Fig 3: Genesis of plant diseases Shafi et al. (2019) Precision agriculture concentrates on a holistic approach to agricultural management that combines spatial, temporal, and individual data with other pertinent information to manage crops effectively. PA would result in increased productivity, efficiency, profitability, and quality (Cisternas, Velásquez, Caro, & Rodríguez, 2020). The PA has encouraged using digital and analytical instruments in agricultural settings. After the introduction of data-driven technologies such as Computer Vision (CV), Machine Learning (ML), Internet of Things (IoT), Deep Learning (DL), and Big Data Analytics in the farming-based decision-making process, the agricultural sector has experienced explosive growth (Aravindhan & Tamjis, 2022; Sharanya, Venkataraman, & Murali, 2021). Fig 4: Applications of Computer Applications in Precision Agriculture According to the literature, CV algorithms are utilized in plant health monitoring, harvesting, pruning, planting, and weather analysis. CV is an AI subfield that enables machines to analyze, interpret, and visualize data. Incorporating CV into the agricultural sector is a game- changer that enables automated agricultural processing (Lu & Young, 2020). The use of CV algorithms enables producers to make informed decisions. When satellite and geospatial images were incorporated into the research, technological advancements attained their pinnacle (Jia Liu et al., 2021). Figure 4 depicts the most prevalent agrovision applications in Pennsylvania. As CV systems ensure non-destructive, non-intrusive, and non-invasive procedures, particularly for image-based issues, they are readily implemented in agriculture. In addition, it can record and store data for an extended period of time, allowing it to be utilized in the near future (Firdaus & Kamil, 2022). These algorithms can supplant laborious, inefficient, time-consuming, and inaccurate manual inspection (Ratnayake, Dyer, & Dorin, 2021). This more robust sensing technology can be used to monitor numerous agricultural areas because CV algorithms rely on The three fundamental phases of CV, which consist of image collection from a live camera feed or recorded source, image processing, and image analysis. Fig 5: Types of CV problems The identification or detection of an image verifies whether the object in the image conforms to a pattern described in the source. This validation is based on the similarity measure of the extracted features of the image embeddings (Yuan, Chen, Wu, & Li, 2022). Object detection algorithms, conversely, are a step ahead by determining the coordinates or exact locations of objects that fit under a specific class label (Persello, Tolpekin, Bergado, & De By, 2019). The classification of an image assigns the object to a specific class label (Hashemi-Beni & Gebrehiwot, 2020). CV algorithms can detect multiple objects within a single image. CV algorithms can perform semantic segmentation to comprehend the image's context or scenic information (Anand, Sinha, Mandal, Chamola, & Yu, 2021; Chai, Zeng, Li, & Ngai, 2021). Powerful DL algorithms are versatile and robust and produce more accurate results in nearly all real-time image recognition problems due to their adaptability and durability. Deep Genesis of plant leaf disease Biotic Factors • Virus • Bacteria • Fungal infections • Nematodes • Algal growth • Protozoans • Parasitic plant growth Abiotic Factors • Insufficient nutrient levels • Overuse/ underuse of pesticides • Impact of pollutants • Inappropriate climatic conditions • Imbalanced soil moisture level Types of problems in computer vision Image classification Classification and Localization Object Detection Semantic Segmentation AgBioForum, 25(1), 2023 | 60 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm Neural Networks (DNN), Convolutional Neural Networks (CNN), ResNET, YOLO, RNN-CNN, Inception net, AlexNET, LeNET, etc. Patrício and Rieder (2018) catalyzed the main breakthrough in CV. These architectures made it feasible to develop CV and image recognition-based solutions for accurately identifying, classifying, and analyzing agricultural images. 2. Leaf disease detection Traditional methods for isolating and detecting plant diseases rely on agricultural specialists' manual experience and unaided eye examination. This requires continuous monitoring of plants, which is extremely monotonous, time-consuming, and inaccurate. In addition, the cost of the manual inspection in large farms is quite significant. In addition, a limited number of domain specialists are available for consultation, which impacts accessibility and increases waiting times (Allahyari, Mohammadzadeh, & Nastis, 2016). Under such circumstances, the disease may spread and affect a significantly larger area of crops. Consequently, automatic surveillance of plants to detect the presence of any type of disease is a natural alternative that would be much cheaper and quicker, even for large farms. Automatic plant leaf disease detection is achieved by using machine vision algorithms to provide image- based process control, monitoring, and guidance via appropriate decision support systems (Sujatha, Chatterjee, Jhanjhi, & Brohi, 2021). The entire procedure is depicted in Figure 7. Consequently, contemporary technologies such as IoT, ML, DL, BDA, and cloud computing are utilized to detect plant leaf maladies in various plant species by analyzing various physical plant characteristics. The overall investigation is conducted by examining morphological properties and characteristics such as intensity, dimension, and color (Gavhale & Gawande, 2014). Fig. 7 depicts several prevalent plant diseases. Fig 6: Process of plant lead disease detection Detection of leaf diseases promptly enables producers to initiate early disease management strategies, thereby increasing agricultural output. As is evident, PA is the foundation for leveraging modern technologies to improve and modernize agricultural practices. The CV algorithms are an efficient method for image-based crop monitoring. This study employs the well-known You Only Look Once (YOLO v4 and YOLO v7) models to detect and classify leaf diseases. In addition, it analyzes the distinguishing characteristics of both models and compares their efficacy in classifying plant leaf diseases. The YOLO belongs to the category of Single Shot Detection (SSD) algorithms (Jiang, Ergu, Liu, Cai, & Ma, 2022); it can classify or label diseased leaves with a substantial improvement in both time and accuracy, making it more suited for real-time farming applications. Fig 7: Types of plant leaf diseases Pre-process and Normalize Detection of infected areas Extraction of features from infected and normal area Pre-process and Normalize Leaf Images AgBioForum, 25(1), 2023 | 61 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm 3. Literature Survey Traditional agricultural practices involved manual inspection of leaves. The advent of AI, DL, and CV has made pest and plant disease identification simpler and more accurate. This evolution results from cutting-edge computing technologies, which have attracted many researchers to explore PA further and develop novel models. Noguchi, Reid, Zhang, and Tian (1998) developed a hybrid ML model that combined Genetic Algorithm (GA) with optimized fuzzy rules to select more suitable crop features from the images. Singh and Misra (2017) state that Artificial Neural Networks (ANN) are used to isolate plants in fields at various growth stages. The primary contribution of this work is extracting weeding information from the Geographic Information System (GIS) for a more precise separation of weeds of varying heights. A com. Arivazhagan, Shebiah, Ananthi, and Varthini (2013) examines various soft computing techniques in addition to the design of a novel model by integrating GA and Support Vector Machine (SVM). GA is used to segment or isolate the infected portion, whereas SVM employs minimum distance for classification. To isolate diseased pine leaves, segmentation is performed using color co-occurrence. The PA is advancing in a new dimension after the advent and development of CV, ML, and DL algorithms. In DL and ML-based methods, image classification is performed in stages that enable the detection and localization of single and multiple objects from an input image. This is accomplished in two ways: 1) Generate a sequence of candidate frames to serve as samples. ML or DL algorithms will classify the images based on these reference images, as in RCNN, speedier RCNN, and R- FCN (Dai, Li, He, & Sun, 2016; Girshick, Donahue, Darrell, & Malik, 2014; Ren, He, Girshick, & Sun, 2015). W. Liu et al. (2016) categorized the transformation of object locations by drawing bounding frames and modifying the application as a regression problem. Li, Ahmed, Wu, and Sethi (2022) conducted a comprehensive investigation of leaf disease in jute plants and constructed a YOLO-JD architecture with three feature extraction modules. This model examines the input image from multiple perspectives, including constructing features via spatial pyramid pooling, Sand clock, and deep sand clock methods, to extract significant features from leaf images. Mohandas, Anjali, and Varma (2021) note that a distinguishing feature of YOLO is incorporating the disease detection module as a mobile application to facilitate its deployment in agricultural fields. In addition, Ponnusamy, Coumaran, Shunmugam, Rajaram, and Senthilvelavan (2020) have developed a wearable device to detect leaf diseases. A computational module on the device performs classification using the YOLO framework. Alternately, a pyramid of tomato leaf images was used to enhance the multi-scale feature detection, thereby enhancing the performance efficacy of YOLO (Jun Liu & Wang, 2020). Using a pre-trained Alexnet architecture and 13,689 reference images, the detection of common leaf maladies in apple plants was accomplished. The infected leaf is identified by a robust CNN (Fuentes, Yoon, Kim, & Park, 2017; Mohanty, Hughes, & Salathé, 2016). R-CNN integrated with Long Short-Term Memory (LSTM) is used to detect tomato leaf disease and parasite disease. Metadata from Faster R-CNN, RCNN, SSD, and R-FCN are compared with meta-features extracted from ResNet and VGG in a comparative analysis of CV architectures for leaf disease identification. The classification of 13 leaf maladies using the CNN framework in the Caffe framework is performed (Sladojevic, Arsenovic, Anderla, Culibrk, & Stefanovic, 2016) with high accuracy. Sibiya and Sumbwanyambe (2019) is a publication that employs CNN to designate maize leaf diseases. The model could annotate three categories of diseases in South African maize field images. Extensive research indicates that CV algorithms based on deep learning are extraordinarily useful for producers. Despite these advancements, models for plant disease detection still face several obstacles: 1. The plant foliage may be captured against various cluttered backgrounds, hindering detection. 2. Every plant species has a distinct leaf arrangement and structure, so the model must also understand this. 3. There is a high probability that the leaves retain their original structure but are covered in mud, and stalks, are partially torn, have withered blossoms, etc. 4. Parasites, diseases, and grazing animals alter the morphological properties of the leaves. This complicates the detection process. 5. Image quality is affected by environmental conditions, camera fidelity, and the atmosphere. 6. Drawing a sharp, well-defined line between infected and uninfected areas is difficult. 7. The disease's symptoms are not typical. Climate, environment, and geographic location influence changes in disease-causing agents. This makes the detection and labeling processes difficult. The enumerated difficulties in leaf disease classification demonstrate the need for a comprehensive and robust framework for labeling leaf diseases in given leaf samples. According to the available literature, only a few models can accurately identify leaf diseases. The pre-trained YOLO model is one of the most effective leaf disease detection methods in SSD. There are numerous versions and updates of the YOLO framework. This work compares the architectures, features, and prediction efficiency of YOLO v4 and YOLO v7 in the context of leaf disease prediction. 4. YOLO v4 in the classification of plant leaf disease The study of CV algorithms reveals the use of numerous versions of YOLO, such as YOLOv2, YOLOv3, YOLOv4, AgBioForum, 25(1), 2023 | 62 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm YOLOv7, etc. The construction of many residual network modules that support multi-scale prediction is a key factor that has made the pre-trained YOLO models more successful than other DL-based CV models. This significantly improves the accuracy of predictions. This study contrasts two successful YOLO versions, YOLOv4 and YOLOv7, for classifying the detection of plant leaf diseases. The RGB images of multiple plant foliage of different species with various diseases are input to the models. Each image is partitioned into S x S grids. As prediction metrics, the YOLO models utilize confidence scores. The score of confidence for a sound leaf will be returned as 0. In the case of diseased leaves, the predicted confidence score is calculated using the Intersection Over Union (IoU) between the prediction bounding box and the ground truth. This SSD algorithm employs multiple 3 x 3 and 1 x 1 convolution layers to extract leaf image features. The principal components of YOLO are the backbone network and the cranium and neck. The proposed YOLOv4 model utilizes the Cross Stage Partial Darknet53 to extract important image features. This serves as a feature extractor because it consists of convolutional and CSP blocks. These blocks divide the feature maps and then converge them cross-phase. This enables the propagation of important information as gradients. Fig. 8 depicts the configuration details of YOLO version 4. Fig 8: Configuration details of YOLOv4 Figure 9 depicts the YOLO architecture for classifying leaf diseases. As part of dimensionality reduction, a max- pooling layer is added following every Convolution Backnorm and Leaky RELU (CBL) block. Each Cross Stage Partial (CSP) is joined at both extremities to a CSP block. The Path Aggregation Network (PANet) serves as the model's spine. In addition, the model employs Spatial Pyramid Pooling (SPP), which is responsible for compressing the input derived from multiple convolution layers to produce feature maps with identical dimensions. This improves the model's robustness as it can manage images with dimensions greater than (w, h)= (180, 224) and images with arbitrary scaling. The PANet in YOLOv4 combined the bottom-up and top- down trajectories of feature vectors to preserve semantic information in the feature maps (Sarkar & Johnson, 2022). This improves instance-based segmentation while simultaneously preserving contextual and spatial information. This information is crucial for disease identification in leaves, as healthy and infected regions are nearby within a small area. This work utilizes YOLO v4 with 26 x 26 and 13 13 feature maps. Fig 9: YOLOv4 model to predict the Leaf Disease AgBioForum, 25(1), 2023 | 63 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm 5. YOLO v7 in the classification of plant leaf diseases YOLO v7 is used to classify plant leaf disease from healthy leaves by drawing bounding outlines. Figure 9 depicts the entire YOLO architecture for plant leaf disease detection and classification. The deployed model draws prominent bounding outlines around infected regions with greater precision and speed. The following are notable features of YOLO v7: • YOLOv7 uses the concept of bag-of-freebies methods for object detection. • The dynamic label assignment is a distinguishing feature of YOLOv7, which has specialized re- parameterized modules for achieving this. • The model follows extended and compound scaling to finetune the parameters. Fig 10: YOLO v7 architecture for plant leaf disease classification The YOLOv7 architecture utilizes extended Efficient Layer Aggregation Networks (E-ELAN) to stabilize the model. Regardless of the gradient path length, the leaf images are processed by layering computational blocks vertically. The E-ELAN uses the expand-shuffle-merge cardinality functions to enhance learning without altering the gradient path. To execute these operations, the convolutions are grouped to increase the number of channels and the cardinality of the blocks. Universally, the same quantity of group parameters and channel multiplier is applied to all computational units. The feature maps are shuffled into 'g' groups based on the specified group parameter, then concatenated to preserve their originality. Using the merge cardinality function, the clusters of feature maps are then instructed to learn unique features. This model scales the model to modify the image's resolution, depth, stage, and width. YOLOv7 employs Network Architecture Search (NAS) that iterates through image parameters to converge on the optimal scaling factors, as opposed to the compound model scaling, to maintain depth and width coherence. The compound scaling process is depicted in Figure 11. Fig 11: Compound model scaling in YOLOv7 (Wang, Bochkovskiy, & Liao, 2022) AgBioForum, 25(1), 2023 | 64 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm The YOLOv7 architecture uses extended Efficient Layer Aggregation Networks (E-ELAN) to ensure the stability of the model. Regardless of the gradient path length, leaf images are processed by vertically stacking computational blocks. The E-ELAN employs the expand-shuffle-merge cardinality functions to improve learning without modifying the gradient path. In order to carry out these operations, the convolutions are grouped to increase the number of channels and cardinality of the blocks. The same number of group parameters and channel multiplier is applied universally to all computational units. The feature maps are shuffled into 'g' groups based on the group parameter, then concatenated to preserve their uniqueness. The feature map clusters are then instructed to learn unique features using the merge cardinality function. This model adjusts the image's resolution, depth, stage, and breadth by scaling the model. In order to maintain depth and width coherence, YOLOv7 employs Network Architecture Search (NAS) that iterates through image parameters to converge on the optimal scaling factors, as opposed to the compound model scaling. The process of compound scaling is depicted in Figure 11. Predicting the Bounding boxes The YOLO models employed in this work deploy the Complete Intersection over Union (CIoU) loss to optimize the bounding box prediction. The confidence score (Cj i) of the jth bounding box in the ith grid is given in Equ 1: Ci j =Ai, j*IoU (1) The leaf is denoted as Ai,j, while IoU is the union between the predicted and actual bounding boxes. The total loss (Ltotal) in these models is computed as the accumulation of three major loss functions: loss in classification (Lcla), loss in regression loss ( Lreg), and loss in confidence (Lconf), and it is mentioned in Equ 2. loss = lbox + lobj + lcls (2) 6. Experimental analysis The models are validated using the Plant Village Dataset, which comprises 54,305 high-resolution images of 14 plant species afflicted with 26 diseases (Hughes & Salathé, 2015). The dataset is comprised of both training and testing subsets. Table 1 summarizes the classes, plants, and diseases with testing and training data. Table 1: Summary statistics of Plant Village Dataset Crop Disease Training images Testing images Crop Disease Training images Testing images Apple Apple cab 504 126 Apple Black rot 496 125 Apple Cedar apple rust 220 5 Apple healthy 1316 329 Blueberry Healthy 1202 300 Cherry Healthy 684 170 Cherry Powdery mildew 842 210 Corn Cercospora leaf spot 410 103 Corn Common rust 953 239 Corn Healthy 929 233 Corn Northern leaf blight 788 197 Grape Black rot 944 236 Grape Esca 1107 276 Grape Healthy 339 84 Grape Leaf blight 861 215 Orange Haunglongbing 4405 1102 Peach Bacterial spot 1838 459 Peach Healthy 288 72 Pepper bell Bacterial spot 797 200 Pepper bell Healthy 1183 295 Potato Early blight 800 200 Potato Healthy 121 31 Potato Late blights 800 200 Raspberry Healthy 297 74 Soybean Healthy 4072 1018 Squash Powdery mildew 1468 367 Strawberry Healthy 364 92 Strawberry Leaf scorch 887 222 Tomato Bacterial spot 1702 425 Tomato Early blight 800 200 Tomato Healthy 1273 318 Tomato Late blight 1527 382 Tomato Leaf mold 761 191 Tomato Septoria leaf spot 1417 354 Tomato Spider mites 1341 335 Tomato Target spot 1123 281 Tomato Mosaic virus 299 74 Tomato Yellow curls 4286 1071 The input image dimensions are 224 by 224, and the learning rate for both models is 0.001. The epochs were limited to 3000, with a weight decay rate of 0.00005 and a momentum decay rate of 0.90. Table 2 compares YOLOv4 and YOLOv7 on the COCO benchmark dataset. Table 2: Comparison of YOLO v4 and YOLO v7 Model No of parameters FLOPs Size Average Precision Average Precision on 50% IoU Average Precision on 75% IoU YOLO v4 64.4M 142.8G 640 49.7 68.2 54.3 YOLO v7 36.9M 104.7G 640 51.2 69.7 55.5 Fig 12 and 13 shows a few sample plant leaf disease classification using YOLO v4 and YOLO v7 models. The annotations and the confidence score of both models are equivalent and are competitive with each other. The real comparison can be made by assessing other classification metrics. Fig 12: Plant leaf disease classification using YOLOv4 AgBioForum, 25(1), 2023 | 65 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm Fig 13: Plant leaf disease classification using YOLOv7 The confidence score is the likelihood (Pr) that the bounding box has a leaf and is computed using Equ 3. Box confidence=Pr (Object) * IoU ( Truth Predict ) (3) IoU is estimated as the proportion of intersection and union of predicted and ground truth bounding boxes. The calculation IoU is done according to Equation (4). (4) Each grid cell in the leaf image is assigned the value 1 as conditional class probability, Pr(class| object), which indicates the likelihood of the leaf class. The confidence score is computed as Equ 5. Class confidence= box confidence * Pr (class | object) (5) Accuracy verified the efficacy of the models, Mean Average Precision (MAP), precision, and Recall as given in Equations (6) to (9). Precision= True_Positives True_Positives+False_Positives (6) Recall= True_Positives True_Positives+False_Negatives (7) F1 Score= 2 * Precision * Recall Precision+Recall (8) MAP= 1 𝐶 ∑ 𝑇𝑟𝑢𝑒_𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠 𝐹𝑎𝑙𝑠𝑒_𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠 + 𝑇𝑟𝑢𝑒_𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒𝑠 𝑐 𝜖 𝑐𝑙𝑎𝑠𝑠𝑒𝑠 (9) The performance comparison between YOLO v4 and YOLOv7 is given in Table 3. It can be seen that the YOLOv7 has better values of precision, F1-score, recall, and MAP than YOLO v4. The YOLOv7 model performs better as it can dynamically allocate the classes, quintessential in datasets with more classes, such as plant; leaf disease classification. The YOLOv4 could not perform well because it could not train well on dynamic classes, a distinguishing feature of YOLOv7. Table 3: Performance comparison of different models Model Precision Recall F1-Score MAP YOLO v4 0.74 0.621 0.703 0.786 YOLO v7 0.82 0.78 0.80 0.822 Thus this study indicates that recent versions of YOLO are showing more advancements, from forming feature maps to adding more powerful layers. 7. Conclusions and Future Works This study compares the performance of two prominent object detection and classification models, YOLO v4 and YOLO v7, in detecting diverse leaf diseases. The performance comparison reveals that both architectures have a competitive edge, but YOLOv7's compound scaling and dynamic labeling provide superior performance. In addition, E-ELAN, reparameterization, and model scaling for drawing adaptive bounding boxes have significantly increased the model's predictive power and localization capability. YOLO v4 should not be viewed as a suppressive model. Classification of plant leaf diseases is facilitated by its PANet-learned features with adaptive bounding boxes. Nonetheless, YOLOv7 outperforms YOLOv4, as the former performs better across all classification metrics. In addition, YOLOv7 is more robust in isolating diseased leaf regions from healthy leaf regions with varying resolutions, scales, growth cycles, and environmental conditions. As future extensions, models could be constructed to output the infection stage and extent of the plant leaf so that producers are well-informed about the plant's health and can take corrective measures. References Alexandratos, N., & Bruinsma, J. (2012). World agriculture towards 2030/2050: the 2012 revision. Research in Agricultural & Applied Economics, (11), 1-147. doi: http://dx.doi.org/10.22004/ag.econ.288998 Allahyari, M. S., Mohammadzadeh, M., & Nastis, S. A. (2016). Agricultural experts’ attitude towards precision agriculture: evidence from Guilan Agricultural Organization, Northern Iran. Information Processing in Agriculture, 3(3), 183-189. doi: https://doi.org/10.1016/j.inpa.2016.07.001 Anand, T., Sinha, S., Mandal, M., Chamola, V., & Yu, F. R. (2021). AgriSegNet: Deep aerial semantic segmentation framework for IoT-assisted precision agriculture. IEEE Sensors Journal, 21(16), 17581-17590. doi: https://doi.org/10.1109/JSEN.2021.3071290 Anderson, P. K., Cunningham, A. A., Patel, N. G., Morales, F. J., Epstein, P. R., & Daszak, P. (2004). Emerging infectious diseases of plants: pathogen pollution, climate change and agrotechnology drivers. Trends in ecology & evolution, 19(10), 535-544. doi: https://doi.org/10.1016/j.tree.2004.07.021 Aravindhan, S., & Tamjis, M. (2022). Leaf Disease Detection by Using Convolutional Pretrained Model. International http://dx.doi.org/10.22004/ag.econ.288998 https://doi.org/10.1016/j.inpa.2016.07.001 https://doi.org/10.1109/JSEN.2021.3071290 https://doi.org/10.1016/j.tree.2004.07.021 AgBioForum, 25(1), 2023 | 66 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm Journal of Communication Networks and Information Security, 14(1s), 114-120. doi: https://doi.org/10.17762/ijcnis.v14i1s.5619 Arivazhagan, S., Shebiah, R. N., Ananthi, S., & Varthini, S. V. (2013). Detection of unhealthy region of plant leaves and classification of plant leaf diseases using texture features. Agricultural Engineering International: CIGR Journal, 15(1), 211-217. Retrieved from https://cigrjournal.org/index.php/Ejounral/article/vi ew/2338 Chai, J., Zeng, H., Li, A., & Ngai, E. W. (2021). Deep learning in computer vision: A critical review of emerging techniques and application scenarios. Machine Learning with Applications, 6, 100134. doi: https://doi.org/10.1016/j.mlwa.2021.100134 Cisternas, I., Velásquez, I., Caro, A., & Rodríguez, A. (2020). Systematic literature review of implementations of precision agriculture. Computers and Electronics in Agriculture, 176, 105626. doi: https://doi.org/10.1016/j.compag.2020.105626 Dai, J., Li, Y., He, K., & Sun, J. (2016). R-fcn: Object detection via region-based fully convolutional networks. In NIPS'16: Proceedings of the 30th International Conference on Neural Information Processing Systems (Vol. 29, pp. 379–387). doi: https://doi.org/10.48550/arXiv.1605.06409 Firdaus, M. Y., & Kamil, M. (2022). Climate Change Analysis Based on Satellite Multispectral Image Processing in Feature Selection Using Reinforcement Learning. International Journal of Communication Networks and Information Security, 14(2), 261-272. doi: https://doi.org/10.17762/ijcnis.v14i2.5520 Fuentes, A., Yoon, S., Kim, S. C., & Park, D. S. (2017). A robust deep-learning-based detector for real-time tomato plant diseases and pests recognition. Sensors, 17(9), 2022. doi: https://doi.org/10.3390/s17092022 Gavhale, K. R., & Gawande, U. (2014). An overview of the research on plant leaves disease detection using image processing techniques. Iosr journal of computer engineering (iosr-jce), 16(1), 10-16. Retrieved from https://www.researchgate.net/profile/Ujwalla- Gawande/publication/314436486 Gilligan, C. A. (2008). Sustainable agriculture and plant diseases: an epidemiological perspective. Philosophical Transactions of the Royal Society B: Biological Sciences, 363(1492), 741-759. doi: https://doi.org/10.1098/rstb.2007.2181 Girshick, R., Donahue, J., Darrell, T., & Malik, J. (2014). Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 580-587). IEEE Computer Society. doi: https://doi.org/10.1109/CVPR.2014.81 Hashemi-Beni, L., & Gebrehiwot, A. (2020). Deep learning for remote sensing image classification for agriculture applications. The International Archives of Photogrammetry, Remote Sensing and Spatial Information Sciences, 51-54. doi: https://doi.org/10.5194/isprs-archives-XLIV-M- 2-2020-51-2020 Hughes, D., & Salathé, M. (2015). An open access repository of images on plant health to enable the development of mobile disease diagnostics. arXiv preprint arXiv:1511.08060, 1-13. doi: https://doi.org/10.48550/arXiv.1511.08060 Jiang, P., Ergu, D., Liu, F., Cai, Y., & Ma, B. (2022). A Review of Yolo algorithm developments. Procedia Computer Science, 199, 1066-1073. doi: https://doi.org/10.1016/j.procs.2022.01.135 Li, D., Ahmed, F., Wu, N., & Sethi, A. I. (2022). Yolo-JD: A Deep Learning Network for jute diseases and pests detection from images. Plants, 11(7), 937. doi: https://doi.org/10.3390/plants11070937 Liu, J., & Wang, X. (2020). Tomato diseases and pests detection based on improved Yolo V3 convolutional neural network. Frontiers in plant science, 11, 898. doi: https://doi.org/10.3389/fpls.2020.00898 Liu, J., Xiang, J., Jin, Y., Liu, R., Yan, J., & Wang, L. (2021). Boost precision agriculture with unmanned aerial vehicle remote sensing and edge intelligence: A survey. Remote Sensing, 13(21), 4387. doi: https://doi.org/10.3390/rs13214387 Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.-Y., & Berg, A. C. (2016). SSD: Single Shot MultiBox Detector. In B. Leibe, J. Matas, N. Sebe, & M. Welling (Eds.), Computer Vision – ECCV 2016 (pp. 21-37). Springer International Publishing. doi: https://doi.org/10.1007/978-3-319-46448-0_2 Lu, Y., & Young, S. (2020). A survey of public datasets for computer vision tasks in precision agriculture. Computers and Electronics in Agriculture, 178, 105760. doi: https://doi.org/10.1016/j.compag.2020.105760 Mohandas, A., Anjali, M., & Varma, U. R. (2021). Real-Time Detectionand Identification of Plant Leaf Diseases using YOLOv4-tiny. In 2021 12th international conference on computing communication and networking technologies (ICCCNT) (pp. 1-5). IEEE. doi: https://doi.org/10.1109/ICCCNT51525.2021.9579783 Mohanty, S. P., Hughes, D. P., & Salathé, M. (2016). Using deep learning for image-based plant disease detection. Frontiers in plant science, 7, 1419. doi: https://doi.org/10.3389/fpls.2016.01419 Nguyen, T.-H., Sahin, O., & Howes, M. (2021). Climate change adaptation influences and barriers impacting the Asian agricultural industry. Sustainability, 13(13), 7346. doi: https://doi.org/10.3390/su13137346 Noguchi, N., Reid, J. F., Zhang, Q., & Tian, L. F. (1998). Vision intelligence for precision farming using fuzzy logic optimized genetic algorithm and artificial neural network. American Society of Agricultural Engineers, St. Joseph, MI, ASAE paper, 983034. Retrieved from https://www.researchgate.net/publication/242365792 Patrício, D. I., & Rieder, R. (2018). Computer vision and https://doi.org/10.17762/ijcnis.v14i1s.5619 https://cigrjournal.org/index.php/Ejounral/article/view/2338 https://cigrjournal.org/index.php/Ejounral/article/view/2338 https://doi.org/10.1016/j.mlwa.2021.100134 https://doi.org/10.1016/j.compag.2020.105626 https://doi.org/10.48550/arXiv.1605.06409 https://doi.org/10.17762/ijcnis.v14i2.5520 https://doi.org/10.3390/s17092022 https://www.researchgate.net/profile/Ujwalla-Gawande/publication/314436486 https://www.researchgate.net/profile/Ujwalla-Gawande/publication/314436486 https://doi.org/10.1098/rstb.2007.2181 https://doi.org/10.1109/CVPR.2014.81 https://doi.org/10.5194/isprs-archives-XLIV-M-2-2020-51-2020 https://doi.org/10.5194/isprs-archives-XLIV-M-2-2020-51-2020 https://doi.org/10.48550/arXiv.1511.08060 https://doi.org/10.1016/j.procs.2022.01.135 https://doi.org/10.3390/plants11070937 https://doi.org/10.3389/fpls.2020.00898 https://doi.org/10.3390/rs13214387 https://doi.org/10.1007/978-3-319-46448-0_2 https://doi.org/10.1016/j.compag.2020.105760 https://doi.org/10.1109/ICCCNT51525.2021.9579783 https://doi.org/10.3389/fpls.2016.01419 https://doi.org/10.3390/su13137346 https://www.researchgate.net/publication/242365792 AgBioForum, 25(1), 2023 | 67 Xinming, Hong, Mohd Ariffin, Ismail. — Comparative study on Leaf disease identification using Yolo v4 and Yolo v7 algorithm artificial intelligence in precision agriculture for grain crops: A systematic review. Computers and Electronics in Agriculture, 153, 69-81. doi: https://doi.org/10.1016/j.compag.2018.08.001 Persello, C., Tolpekin, V., Bergado, J. R., & De By, R. (2019). Delineation of agricultural fields in smallholder farms from satellite images using fully convolutional networks and combinatorial grouping. Remote sensing of environment, 231, 111253. doi: https://doi.org/10.1016/j.rse.2019.111253 Ponnusamy, V., Coumaran, A., Shunmugam, A. S., Rajaram, K., & Senthilvelavan, S. (2020). Smart glass: real-time leaf disease detection using YOLO transfer learning. In 2020 International Conference on Communication and Signal Processing (ICCSP) (pp. 1150-1154). IEEE. doi: https://doi.org/10.1109/ICCSP48568.2020.9182146 Ratnayake, M. N., Dyer, A. G., & Dorin, A. (2021). Towards computer vision and deep learning facilitated pollination monitoring for agriculture. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 2921-2930). IEEE. doi: https://doi.org/10.1109/CVPRW53098.2021.00327 Ren, S., He, K., Girshick, R., & Sun, J. (2015). Faster r- cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems, 28, 1-9. doi: https://doi.org/10.1109/TPAMI.2016.2577031 Sarkar, S., & Johnson, N. (2022). A deep-learning, vision-based framework for testing swarm algorithms using inexpensive mini drones. In Unmanned Systems Technology XXIV (Vol. 12124, pp. 93-100). SPIE. doi: https://doi.org/10.1117/12.2618137 Shafi, U., Mumtaz, R., García-Nieto, J., Hassan, S. A., Zaidi, S. A. R., & Iqbal, N. (2019). Precision agriculture techniques and practices: From considerations to applications. Sensors, 19(17), 3796. doi: https://doi.org/10.3390/s19173796 Sharanya, S., Venkataraman, R., & Murali, G. (2021). Estimation of remaining useful life of bearings using reduced affinity propagated clustering. Journal of Engineering Science and Technology, 16(5), 3737-3756. Retrieved from https://jestec.taylors.edu.my/Vol%2016%20Issue %205%20October%202021/16_5_09.pdf Sibiya, M., & Sumbwanyambe, M. (2019). A computational procedure for the recognition and classification of maize leaf diseases out of healthy leaves using convolutional neural networks. AgriEngineering, 1(1), 119-131. doi: https://doi.org/10.3390/agriengineering1010009 Siedow, J. N. (2001). Feeding ten billion people. Three views. Plant Physiology, 126(1), 20-22. doi: https://doi.org/10.1104/pp.126.1.20 Singh, V., & Misra, A. K. (2017). Detection of plant leaf diseases using image segmentation and soft computing techniques. Information Processing in Agriculture, 4(1), 41-49. doi: https://doi.org/10.1016/j.inpa.2016.10.005 Sladojevic, S., Arsenovic, M., Anderla, A., Culibrk, D., & Stefanovic, D. (2016). Deep neural networks based recognition of plant diseases by leaf image classification. Computational intelligence and neuroscience, 2016. doi: https://doi.org/10.1155/2016/3289801 Sujatha, R., Chatterjee, J. M., Jhanjhi, N., & Brohi, S. N. (2021). Performance of deep learning vs machine learning in plant leaf disease detection. Microprocessors and Microsystems, 80, 103615. doi: https://doi.org/10.1016/j.micpro.2020.103615 Wang, C.-Y., Bochkovskiy, A., & Liao, H.-Y. M. (2022). YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (pp. 7464-7475). doi: https://doi.org/10.48550/arXiv.2207.02696 Yuan, Y., Chen, L., Wu, H., & Li, L. (2022). Advanced agricultural disease image recognition technologies: A review. Information Processing in Agriculture, 9(1), 48-59. doi: https://doi.org/10.1016/j.inpa.2021.01.003 https://doi.org/10.1016/j.compag.2018.08.001 https://doi.org/10.1016/j.rse.2019.111253 https://doi.org/10.1109/ICCSP48568.2020.9182146 https://doi.org/10.1109/CVPRW53098.2021.00327 https://doi.org/10.1109/TPAMI.2016.2577031 https://doi.org/10.1117/12.2618137 https://doi.org/10.3390/s19173796 https://jestec.taylors.edu.my/Vol%2016%20Issue%205%20October%202021/16_5_09.pdf https://jestec.taylors.edu.my/Vol%2016%20Issue%205%20October%202021/16_5_09.pdf https://doi.org/10.3390/agriengineering1010009 https://doi.org/10.1104/pp.126.1.20 https://doi.org/10.1016/j.inpa.2016.10.005 https://doi.org/10.1155/2016/3289801 https://doi.org/10.1016/j.micpro.2020.103615 https://doi.org/10.48550/arXiv.2207.02696 https://doi.org/10.1016/j.inpa.2021.01.003