Edge Architecture for High-Accuracy Disease Identification in Apple Plants Using Transfer Learning Approach

The agriculture sector is increasingly adopting drones for early-stage disease identification, highlighting the need for an improved Artificial Intelligence model in disease detection. While popular pre-trained architectures like DenseNet, EfficientNet, and Inception require cloud computing for implementation, edge architecture offers a cost-effective alternative for early-stage disease identification. Evaluating the effectiveness of edge architecture in disease identification is crucial. This study focuses on developing an edge architecture-based system that continuously detects diseases at the edge node. The proposed approach utilizes a CNN-based architecture, specifically the modified MobileNet_V2, for edge-based disease identification. Experimental evaluation on a benchmark dataset demonstrates the efficacy of the disease detection network, outperforming existing methods in recognizing and detecting infected regions. The proposed mechanism achieves an overall accuracy of 99.93% for scab, black-rot, and Apple Rust, with improved F1 scores compared to existing methods.


INTRODUCTION
Over the years, both India and the United States have witnessed substantial growth in apple production, contributing significantly to their agricultural sectors.India's apple production surged from 185,000 tonnes in 1961 to an impressive 2,276,000 tonnes in 2021, while the United States saw its production increase to 4,467,206 tonnes in the same period [1].This growth has been supported by technological innovations, government initiatives, and advancements in agricultural practices.Despite these achievements, both countries face a persistent challenge that threatens the sustainability of this success: the accurate and timely identification of crop diseases.
The current research introduces an innovative solution to this problem through the implementation of smart agricultural methods, utilizing cutting-edge technologies such as Artificial Intelligence (AI), the Internet of Things (IoT), and machine learning algorithms [2].These technologies enable the automated detection and identification of diseases in agricultural settings, employing various sensors, drones, and imaging techniques to analyze plant health [3,4].Such advancements offer a significant improvement over traditional methods, which largely rely on manual inspection and are subject to human error and biases [5,6].
Despite the advent of smart agricultural methods, the challenge remains in achieving high accuracy in disease identification, especially in remote and rural areas where access to cloud-based systems is limited.The reliance on cloud architecture for processing and analyzing data can introduce latency, require stable internet connectivity, and raise concerns about data security and privacy [7,8].Additionally, the cost of implementing cloud-based solutions can be prohibitive for small-scale farmers [9,10].
To address these challenges, this paper proposes a novel edge architecture-based system for high-accuracy disease identification in apple plants using a transfer learning approach.Edge architecture enables real-time data processing and analysis at the source -directly on edge devices or within a local network.This minimizes latency, reduces dependency on internet connectivity, and addresses privacy and security concerns by keeping data localized [11,12].AI algorithms, deployed at the edge, can analyze data in real-time, detecting early signs of diseases or stress in plants, thus enabling timely intervention to prevent the spread of diseases and minimize yield losses [13,14].
This work seeks to fill the gap in current research by providing an efficient, cost-effective, and scalable solution for disease identification that can operate independently of cloudbased systems.The edge architecture-based system represents a significant advancement over existing methods by offering a decentralized approach to disease detection, which is particularly advantageous for applications in remote or resource-constrained environments.By leveraging the power of AI and transfer learning, our system not only enhances the accuracy of disease identification but also contributes to sustainable agricultural practices, potentially transforming the management and outcome of crop diseases in apple production.

RELATED WORKS
The quest for effective disease identification in apple plants has been a focal point of agricultural research, given its critical role in ensuring crop health and productivity.This literature review examines the evolution of disease identification methods, with a particular focus on the integration of Artificial Intelligence (AI) and the promising edge architecture approach, comparing it with traditional and existing methodologies.
Traditionally, disease identification in crops, including apple plants, relied heavily on manual inspection and the expertise of plant pathologists.This method, while foundational, has significant limitations in terms of scalability and accuracy, leading to the exploration of more advanced techniques [15].The advent of diagnostic laboratories marked a significant advancement, offering more precise identification through pathogen isolation and culturing techniques [16].
The late 20th century witnessed the application of remote sensing technologies for disease identification, utilizing aerial photography and satellite imagery to detect large-scale disease outbreaks by analyzing vegetation patterns [17,18].The introduction of sensor technologies, including spectrometers and thermal imaging, further enhanced disease detection capabilities by providing detailed insights into plant health at a much finer scale [19].
AI has revolutionized the field of plant disease identification, with machine learning algorithms and neural network architectures enabling the analysis of complex data sets to identify disease patterns accurately [20].The use of transfer learning techniques has been particularly notable, allowing the application of pre-trained models to new tasks, thereby improving the efficiency and generalization of disease identification models [21].
Integrating AI algorithms with low-cost sensors and imaging devices has facilitated real-time disease identification in the field, promoting early intervention strategies [22].This approach has been supported by empirical research demonstrating the successful integration of AI with low-cost technologies for accurate disease detection [23,24].
The introduction of edge architecture represents a significant leap forward in the field of disease identification in apple plants.Unlike traditional cloud-based systems, which are hampered by latency, connectivity dependency, and data privacy concerns, edge architecture enables real-time data processing and analysis directly at the source.This minimizes latency, reduces reliance on stable internet connectivity, and enhances data security by processing data locally [25,26].
Edge architecture's real-time processing capability is crucial for the timely identification of diseases, allowing for immediate action to control and manage outbreaks, thereby reducing crop losses [27].Moreover, edge architecture's ability to operate independently of cloud systems makes it particularly advantageous for remote and resource-constrained environments, where internet connectivity may be limited or non-existent.
The application of edge architecture in plant disease identification, particularly for leaf diseases, represents a cutting-edge shift in agricultural technology.Recent research emphasizes the integration of edge computing with Artificial Intelligence (AI) and Machine Learning (ML) algorithms to enable real-time, efficient disease detection directly at the data source, bypassing the latency and privacy concerns associated with cloud-based processing.This approach leverages sophisticated neural network architectures, such as Convolutional Neural Networks (CNNs), tailored for rapid analysis of high-resolution images captured in the field.

Visual Inspection
An effective approach for the early identification of dis eases is crucial.
However, the constant vigilance required can lead to human mistakes, as the process can become quite exhausting. [28]

Microscopic Examination
The diagnostic accuracy rate of this method is significantly high.
The process is time-consuming and complicated, which makes it impractical for field use.[29] Laboratory Analysis These techniques may involve culturing pathogen samples on selective media, conducting Polymerase Chain Reaction (PCR) assays for DNA-based identification, or using immunological methods such as Enzyme-Linked Immunosorbent Assays (ELISA).
Similar to Microscopic examination it is time consuming.[30] Image Analysis Utilizing cutting-edge methodologies, image interpretation has become an innovative strategy that leverages both computer vision and image manipulation techniques.
This approach autonomously identifies and classifies ailments found on apple foliage by scrutinizing their visual attributes. [31]

Molecular Techniques
Molecular techniques, such as DNA sequencing or geno typing, are employed to identify and characterize pathogens or disease-causing agents in apple leaves.
Daily application is challenging due to the need for specialized equipment, technical expertise, and the time consuming nature of the process, making realtime field diagnosis difficult.[32] Remote Sensing Remote sensing involves the use of sensors, satellite imagery, or drones to capture data about apple orchards at a large scale.
Daily implementation is challenging due to factors such as varying weather conditions, sensor accuracy, and the complexity of disease patterns in different crops.
[33] Edge architecture's main advantage lies in its ability to process and analyze data on-device, facilitating immediate disease identification and intervention.This is particularly crucial in agriculture, where early detection can significantly mitigate the spread of diseases, thus safeguarding crop health and productivity.Studies have demonstrated the effectiveness of edge-based systems in achieving high accuracy in disease classification, leveraging the compact yet powerful models like DLMC-Net, which are designed for low-resource environments and can operate with minimal dependency on internet connectivity.
Moreover, the integration of transfer learning techniques with edge computing has been highlighted as a promising strategy to enhance model performance and generalization capability across different types of leaf diseases and plant species.This synergy allows for the adaptation of pre-trained models to new tasks with limited additional training, optimizing the efficiency of disease identification processes.
In Table 1, the evolution of disease identification methods in apple plants from manual inspection to advanced AI and edge architecture highlights a trajectory of increasing precision, efficiency, and scalability.The comparative analysis reveals that edge architecture offers distinct advantages over traditional and existing methods, particularly in terms of real-time processing, reduced reliance on internet connectivity, and enhanced data security.This review underscores the importance of continuing to explore and integrate advanced technologies like edge architecture to improve disease identification and management in apple plants, thereby contributing to sustainable agricultural practices and enhanced crop yields.

Dataset
This investigation leveraged a publicly accessible dataset, which is a portion of the one assembled by Plant Village [34,35].The comprehensive dataset encompasses 9,714 highresolution images showcasing a variety of diseases found on apple leaves.These images were meticulously obtained under diverse conditions, incorporating variations in illumination, angles, and backgrounds, to guarantee an all-inclusive representation of potential scenarios.The dataset employed for this study includes 9,714 images of apple foliage, proportionally allocated across four categories: cedar apple rust, multiple diseases, healthy leaves, and apple scab.The primary purpose of this study is to precisely categorize apple foliage into these four distinct classifications [36].
Conventional Convolutional Neural Networks (CNNs) used for classification purposes are typically seen as an amalgamation of two primary elements: a block for feature extraction and a classifier segment.The role of the feature extraction block is to manipulate the input image via a sequence of convolutions, pooling processes, and linear activation functions.This results in the creation of a unique feature map at every step of the operation.Suppose we visualize a theoretical situation where Ga symbolizes the feature mapping of the a th layer within the CNN architecture.These features can be derived using the Eq. ( 1): In this equation, in the given network architecture, we utilize Ga to delineate the characteristic mapping of the present layer.Meanwhile, Ga-1 is employed to articulate the attributes from the convolutional operations of the preceding layer.The layer-specific weight parameters are symbolized by Ra, while sa is indicative of the offset vector associated with the a th layer.Furthermore, λ embodies a function that draws its inspiration from the Rectified Linear Unit (ReLU) mechanism.Further pooling layers play a crucial role in reducing spatial dimensions, thereby managing complexity and addressing the overfitting problem in neural networks.The pooling layer's  th feature as represented in Eq. ( 2) is obtained as an outcome from the  th localized receptive field, employing a downsampling function.
This process involves utilizing the previous layer's feature vector,  −1 , and a specified pooling size, ps.By minimizing spatial dimensions, pooling layers help in creating more efficient and generalized representations of the input data.The structure of a neural network encompasses a series of densely interconnected layers that succeed the convolutional and pooling layers.The chief function of these densely interconnected layers is to leverage the features that have been isolated for categorizing the images.The 'Softmax' function is then utilized to scrutinize the inferences drawn from the previous layers, which are founded on the isolated features.The Softmax function is represented by Eq. ( 3), where 'M' denotes the dimension of the vector 'd'.

Figure 1. AI model building steps involved
The ultimate outcome of this block is a condensed feature vector, representing the input image with only the most significant semantic features, effectively compressing the information.The compact feature array is subsequently directed to the categorization unit, an integral part of the structure that consists of an interconnected neural network system [37][38][39].The purpose of this categorization unit is to critically assess the feature array, and then generate a distinct array filled with likelihood values.These values represent the probability of the initial input image being associated with each individual category.The procedure involved in constructing an efficient system for distinguishing between healthy leaves and those affected by disease is depicted in Figure 1.
MobileNet_V2 was designed primarily for the task of image classification in the field of computer vision.It is a deep convolutional neural network architecture that focuses on efficient and lightweight models suitable for running on mobile and embedded devices with limited computational resources.The main goal behind MobileNet_V2 was to provide a network that could achieve high accuracy on image classification tasks while being efficient in terms of model size and computational cost.This makes it particularly well-suited for real-time applications on mobile devices, such as object recognition in smartphone cameras or other scenarios where computational resources are constrained.
In the concluding stages of the Convolutional Neural Network (CNN) structure, the categorization component processes the generated feature map via a fully connected layer that has outputs corresponding to the total number of classes [40].This is accomplished by employing the normalized exponential function, or softmax, as an activation function, thereby yielding the final predictions.In this particular implementation, a convolution with a kernel size of (1, 1) was used.This approach effectively condenses all the RGB channels of the input images into three channels for the network's operations.It's crucial to note that this reduction isn't determined by choosing important bands; the resulting three channels don't represent specific bands, but rather, they are a projection of the information in the original bands.This is akin to using Principal Component Analysis for band analysis and selecting the three most significant components.The training process of this CNN involves learning the necessary transformation to achieve this reduction in channels [41][42][43].In a similar vein, the classification section needed a revamp to cater to a quad classification problem, differentiating between healthy and infected samples.Consequently, the last activation map underwent linear compression, reducing it from 1024 to 64 channels, and was then converted into a one-dimensional representation by flattening it to obtain the feature vectors.The primary elements of the MobileNet feature extraction mechanism stay intact, while the remaining components of the application are customized to tackle our unique challenge.This adjustment ensures the solution is designed to target our specific problem, while maintaining the efficiency of the original feature identification structure inherent to MobileNet.
In essence, each RGB image showcasing apple foliage was initially adjusted to a resolution of 256 × 256 pixels.It was then converted into a tri-channel image using a linear transformation applied to each individual pixel, similar to the effect of a 1 × 1 kernel convolution, yielding three separate channels instead of bands.These channels were then fed into the pre-trained MobileNet_V2 model, which in turn generated an activation map of the dimensions 8 × 8 × 1024.This map was further condensed from 1024 channels down to a mere 64, a process accomplished via another convolution, this time utilizing a 1 × 1 kernel size.Ultimately, this final map was simplified into a one-dimensional form, resulting in a feature vector that was directly linked to the original image.

Methodology
This research employs a systematic approach to modifying the MobileNet_V2 architecture for the identification of diseases in apple leaves, focusing on hyperparameter tuning and architectural refinement to enhance performance on the current dataset.The methodology is structured into six key components: Dataset Preparation: We curated a comprehensive dataset of apple leaf images, annotated with disease classifications.This dataset includes images of healthy leaves and those affected by common diseases.Images were pre-processed for normalization, augmentation, and splitting into training, validation, and testing sets to ensure model robustness and generalizability.
Model Selection: The MobileNet_V2 architecture was chosen as the base model due to its efficiency and effectiveness in image classification tasks.Its lightweight nature makes it suitable for edge computing applications, where computational resources are limited.
Hyperparameter Tuning: Extensive experiments were conducted to fine-tune the hyperparameters of the MobileNet_V2 model, including learning rate, batch size, and the number of epochs.The objective was to find the optimal settings that maximize accuracy while minimizing overfitting.
Architectural Modifications: We introduced specific modifications to the architecture to better cater to the nuances of apple leaf disease identification.This included adjusting the depth multiplier, layer freezing during transfer learning, and incorporating custom layers to enhance feature extraction capabilities specific to leaf disease patterns.
Training and Validation: The modified MobileNet_V2 model was trained on the prepared dataset, utilizing a combination of real-time data augmentation to enhance diversity and robustness.Validation was performed iteratively throughout the training process to monitor performance and prevent overfitting.
Performance Evaluation: The model's accuracy, precision, recall, and F1 score were evaluated against a held-out test set.Comparative analysis was conducted against baseline models and existing approaches to demonstrate the improvements achieved through the proposed modifications.
By meticulously adjusting the MobileNet_V2 architecture and optimizing it for the specific challenge of apple leaf disease identification, this study aims to set a new benchmark for accuracy and efficiency in agricultural disease detection applications.

Experimental validation
To ensure the robustness and effectiveness of our modified MobileNet_V2 architecture for identifying diseases in apple leaves, we meticulously designed an experimental validation framework.This framework encompasses the experimental setup, detailed training process, evaluation metrics, and a comprehensive validation strategy aimed at preventing overfitting while assuring model performance on unseen data.
Our experiments were conducted using a custom dataset comprising high-resolution images of apple leaves categorized into healthy and various disease states.The dataset was augmented to enhance model robustness against variations in lighting, orientation, and background.The modified MobileNet_V2 model was implemented in TensorFlow 2.0, leveraging a CUDA-enabled GPU for efficient training.
The model underwent a two-phase training process.Initially, the model's base layers, pre-trained on ImageNet, were frozen to transfer learned features to our task.Subsequently, the entire model was fine-tuned on our apple leaf dataset with a reduced learning rate to adapt the high-level features specifically for our disease identification task.Training was performed over 50 epochs with a batch size of 32, using the Adam optimizer for its adaptive learning rate capabilities.Data augmentation techniques such as rotation, zoom, and horizontal flipping were applied to increase the diversity of the training data, simulating a wide range of real-world conditions.
Evaluation Metrics: We evaluated the model's performance using accuracy, precision, recall, and the F1 score as primary metrics.Accuracy measures the overall correctness of the model, precision evaluates the model's ability to identify diseased leaves correctly, recall assesses the model's capability to detect all actual disease cases, and the F1 score provides a balance between precision and recall, offering a holistic view of the model's performance.
Adopting knowledge from a task and applying it to a similar, yet distinct task is a robust strategy in machine learning known as transfer learning.This technique proves exceptionally beneficial in the initialization of neural networks.It is often more effective to commence the training process with models that have been pre-trained on expansive and well-labeled datasets, such as the widely-used ImageNet, rather than initiating the process from the ground up with arbitrary weight initialization.In our exploration, we focus on the application of pre-existing models, honed on the comprehensive and illustrative ImageNet dataset.These models are then meticulously adapted to align with the specifications of the desired dataset.The key steps involved in transfer learning entail identifying the suitable base networks, constructing a new neural network, and fine-tuning the model to adapt it for the desired task at hand.By following these transfer learning methodologies, we can efficiently capitalize on the preexisting knowledge captured by the base models and seamlessly integrate them into our specific task.By adopting transfer learning, we can significantly expedite the training process and achieve enhanced performance with less computational burden.The use of pre-trained models facilitates the extraction of meaningful features from the base dataset, which can be effectively leveraged to tackle the target dataset's intricacies. Step

1: Identification of Base Networks
In the process of transfer learning, we identify the base networks that will serve as the foundation for our model.These base networks are allocated weights (W1, W2, ..., Wn) obtained from a pre-trained CNN model. Step

2: Building the Neural Network
To create a new structure for our network, we can modify it by replacing, inserting, or deleting layers as needed.This step allows us to customize the architecture to suit the specific requirements of our task.
Step 3: Fine-tuning the Neural Network With our own dataset d and its corresponding labels W, we proceed to fine-tune the newly constructed neural networks.The objective is to minimize the loss function (F) through this fine-tuning process, resulting in a more tailored model for our specific task as indicated in Eq. (4).

𝐹𝐹(𝑅𝑅)
In the framework of our research, we denote the weight attributed to the convolutional layers and fully-linked layers as 'R'.The parameter 'n' is indicative of the total count of examples utilized during the training process, with 'x' functioning as a marker for the particular examples in training.We also employ 'y' as a symbol to denote the index of classes.The likelihood of an input denoted by 'dx' falling into the class predicted as 'y' can be articulated as Q(dx=y).The process to gauge the precision of 'R' is executed by lessening the loss function (F) on the original set of data, as articulated in the succeeding Eq. ( 5).

Figure 2. Architecture of the proposed AI model
Figure 2 illustrates the architecture of the proposed AI model.This approach allows us to assess the model's performance and its ability to predict the correct class labels for the given inputs.By effectively adjusting the weights and optimizing the loss function, we can improve the model's accuracy and enhance its predictive capabilities.The learning rate denoted by "l" and the class index "y" play essential roles in the process.Consequently, we employ the MobileNet_V2 pre-trained model to conduct transfer learning on the images and train the newly acquired neural networks using our dataset.The method termed "fine-tuning" entails employing the pre-set weights from a pre-existing Convolutional Neural Network (CNN) as a launchpad for the training of a new CNN, followed by its gradual optimization.This procedure aids in the adaptability of the feature extractor to a novel domain.In the development of our model, we implemented this technique, leveraging a feature extractor from MobileNet_V2 that was pre-optimized on ImageNet.We then fine-tuned this using our own dataset of apple leaf images.
A pivotal component to achieving successful transfer learning is the careful training of a CNN, which ensures that the initial pre-set weights are not entirely overwritten during the re-optimization process.In our application, we elected to freeze the weights of the pre-optimized MOBILENET_V2, focusing solely on updating the weights of the newly introduced layers for a total duration of 20 epochs.An epoch, in this context, is defined as 12 iterations that employ Stochastic Gradient Descent (SGD), effectively covering our complete dataset once over.To reach this goal, we utilized the SGD variant known as the Adam optimizer, setting the learning rate at 0.0001 and processing 16 images per batch.
We utilized the powerful capabilities of Python's TensorFlow 2.0 library to educate our Convolutional Neural Network (CNN).During this progression, we opted for categorical cross-entropy (as represented in Eq. ( 6)) as our loss function, courtesy of its beneficial mathematical characteristics for diminishing issues related to multi-class classification.For our main evaluative measure, we selected accuracy (as delineated in Eq. ( 7)), considering its excellent clarity when it comes to gauging the effectiveness of the model.
Validation Strategy: To prevent overfitting and ensure the model's generalization to unseen data, we employed a rigorous validation strategy.A hold-out validation set, comprising 20% of the dataset, was used to monitor the model's performance during training.Early stopping was implemented to halt training if the validation loss did not improve for ten consecutive epochs, preventing overfitting.Additionally, kfold cross-validation was conducted post-training to further evaluate the model's robustness and reliability across different subsets of the data.

Performance evaluation
The efficacy of the model was evaluated through several metrics including accuracy, sensitivity, and specificity.Accuracy provides a measure of the overall percentage of images that were classified correctly.Sensitivity pertains to the ratio of correctly identified diseased apple leaves, whereas specificity refers to the fraction of healthy apple leaves that were accurately identified.To contextualize these results, consider a hypothetical model that consistently labels all samples as infected -this would yield an accuracy of 80% (given that 80% of the samples are infected), a specificity of 0% (as no healthy apple leaves are correctly identified), and a sensitivity of 100% (since all diseased apple leaves are detected).In addition, the F1 score, which is the balanced average of precision and recall, acts as an alternative yardstick to gauge the performance of the model's classification.Table 2 showcases a remarkably high true positive rate (or sensitivity) across all subsets: training, validation, and testing, exceeding 94% in every instance.The model's exceptional capacity to generalize in identifying diseased apple leaves is evident in the impressive sensitivity of 96.88% seen in the test set.The results for specificity, while still robust, were slightly more tempered, with figures of 84.22% in training, 88.96% in validation, and 74.02% in the test set.

Comparison study
This study further carried out a comparative analysis of four state-of-the-art AI models, namely MobileNet_V2, inception_V3, cnn2D, and EfficientNetB0, for the task of image classification.We evaluated their performance across five epochs and measured accuracy as the primary metric.Among these models, MobileNet_V2 demonstrated the highest accuracy, showcasing its potential for real-world applications.This research provides valuable insights into the suitability of various AI models for image classification for identifying infected leaf and healthy leaf.As shown in Table 2, the models' accuracy improved with each epoch, demonstrating their ability to learn and generalize from the training data.Inception_V3 and MobileNet_V2 also exhibited competitive performance, reaching accuracies of 98.02% and 99.01%, respectively.Both models demonstrated significant learning gains during the initial epochs.However, the progress in accuracy seemed to plateau after the third epoch.CNN2D, while showing an impressive improvement in accuracy from the first epoch (79.72%) to the fourth epoch (96.62%), fell short compared to the other models.Its limited capacity to capture complex features and patterns might explain the slower convergence.
Investigating Table 3 reveals a comprehensive comparison between the performance of our proposed model and other alternative models, along with different design options.As part of this comparison, we consider the MobileNet_V2 architecture, which stands out as the best-performing model and serves as our reference for evaluation.To leverage the transfer learning technique effectively, the MobileNet_V2 architecture underwent a two-step training process.In the first step, the MobileNet_V2 was pre-trained on a large-scale dataset to acquire essential features from diverse visual patterns.This pre-training step is crucial as it enables the model to capture generic information that can be applied to a wide range of visual recognition tasks.
The second step involved fine-tuning the pre-trained MobileNet_V2 on our specific task of interest, i.e., recognizing and classifying apple leaf images.During finetuning, the model was exposed to our dataset containing apple leaf images, allowing it to adapt its learned features to the nuances and intricacies specific to this task.
The combination of pre-training and fine-tuning led to impressive results, with the MobileNet_V2 architecture demonstrating superior performance on our validation and test sets.The model exhibited a remarkable ability to generalize well to previously unseen apple leaf images, showcasing its potential for real-world applications.The success of the MobileNet_V2 architecture in our task validates the effectiveness of transfer learning as a powerful technique for building robust and accurate image classification models.Leveraging pre-trained models like MobileNet_V2 is not only saves time and computational resources but also enables us to benefit from the knowledge gained from broader image datasets.Overall, our experiment with the MobileNet_V2 architecture reaffirms its value as a strong candidate for transfer learning-based applications, opening up exciting possibilities for further research and development in the field of image recognition and classification.
In the past, numerous studies have been conducted with the objective of identifying various bruises or diseases in apples through computer vision techniques.These studies primarily rely on conventional computer vision systems that utilize color information to differentiate between olives of varying quality.Zhang et al. [44] devised a bruising index for apples, incorporating other color and geometric parameters.Sai Reddy and Neeraja [45] previously classified apple leaf qualities based on real-time detection of external defects.Although these approaches yielded favorable outcomes, they all focused on visible damages and employed standard image processing techniques and classification in the cloud.The following study, however, focused classification of the diseases at the edge and in real time.
No prior research has been discovered concerning the identification of these leaf diseases or any other diseases in apple leaves through edge detection.Hence, this study represents a significant advancement in the management of fungal diseases in apples throughout the harvesting season without the need of cloud computing in identifying the disease at the edge.The sensitivity of the model, i.e., its ability to accurately recognize infected apple leaves, remains remarkably high even at the periphery of the model.From a commercial standpoint, these outcomes are relatively satisfactory as the objective is to identify the maximum number of infected leaves.Figure 3 shows the comparative performance of the MobileNet_V2 in identifying the healthy leaves as well as BlackCedar, Rust and scab by the model.Training an AI model typically requires an extensive dataset and significant computational resources.However, as models grow in size and complexity, they become resource-intensive, hindering their real-world deployment on devices with limited processing capabilities, such as smart phones, IoT devices, and edge devices.The focus of the research revolves around developing an intelligent system for detecting diseases in apple leaves using TinyML.Considering that the intended implementation of the model is on edge devices in real-time scenarios, a transfer learning technique was employed to construct a binary classifier.This allowed for evaluating the dataset's effectiveness using the MobileNet, Inception, EfficientNet and CNN architectures.To optimize memory usage, the trained models were transformed into tflite files and underwent posttraining optimization.The primary objective of this research is to compare the inference performance of these models on the apple leaf dataset.The results are shown in Figure 4 interprets that the MobileNet_V2 model outperforms the other models in terms of both accuracy and efficiency for this specific task.
The performance of the models was impressive, achieving an accuracy of 97.7% with MobileNet and 95% with Inception.Notably, MobileNet exhibited minimal memory consumption after quantization, making it highly suitable for deployment on edge devices.In terms of computational efficiency, the model demonstrated an average inference time of 93.8 ms and a latency of 10.7s when tested on an ARM Cortex M4 operating at 78 MHz.These results indicate the potential effectiveness and practicality of the proposed approach in real-world scenarios.(1) Enhanced Efficiency: By reducing the number of training parameters, we create more efficient models that demand fewer computational resources during both training and inference.This efficiency translates into faster processing times, enabling real-time applications and smoother user experiences, all while minimizing energy consumption.
(2) Optimal Resource Utilization: A streamlined model ensures optimal resource utilization, allowing developers to deploy AI solutions on edge devices without compromising performance.Such resource-efficient models are particularly crucial in remote or low-bandwidth settings, where cloud computing may not be readily accessible.
(3) Improved Generalization: Reducing training parameters aids in mitigating overfitting, a common challenge in deep learning.By keeping the model's complexity in check, we improve its ability to generalize to unseen data, enhancing its predictive accuracy across different environments.
(4) Lower Deployment Costs: As AI models become less computationally demanding, the cost of deploying AI applications reduces significantly.This cost-effectiveness encourages wider adoption of AI technologies, making them accessible to a broader range of users and industries.MobileNet_V2, a lightweight and efficient neural network architecture, exemplifies the importance of reducing training parameters for edge computing applications.Built upon the success of its predecessor, MobileNet_V1, this architecture embraces the concept of depth wise separable convolutions, significantly reducing the model's size while maintaining high accuracy owing to the factors like Computational Efficiency, Real-time Detection, Scalability and Adaptability.In the endeavor to construct an effective crop disease identification model, several convolutional neural networks (CNNs) were considered.These include Conv2D, MobileNet_V2, Inception, and EfficientNet, each of which has a distinct number of trainable parameters.The numbers range from the relatively simple Conv2D with 1,48,39,492 parameters, to the highly sophisticated EfficientNet boasting 32,11,076 parameters as shown in Figure 5.Among these, MobileNet_V2, with its 35,04,872 trainable parameters, has emerged as the most promising candidate for our purpose.To understand why, it's crucial to appreciate the key attributes of MobileNet_V2.
Unlike conventional architectures, MobileNet_V2 is streamlined for efficiency, achieving a delicate balance between accuracy and computational cost.This is crucial in real-world applications, particularly in areas such as crop disease identification where rapid, accurate responses are paramount.MobileNet_V2's superior performance can be attributed to its design principles.It leverages depth wise separable convolutions, a technique that significantly reduces computational requirements while maintaining performance.Depth wise separable convolutions split the standard convolution operation into two simpler operations: depth wise convolutions and point wise convolutions.The former applies a single filter per input channel, while the latter uses a 1×1 convolution to construct a linear combination of the output of the depth wise layer.This innovative approach reduces computational complexity and model size, making MobileNet_V2 faster and lighter compared to traditional CNNs.
The results, summarized in Table 4, showcase the superior performance of our modified MobileNet_V2 architecture over the compared models.Notably, our model achieved the highest accuracy and F1 score, indicating its effectiveness in identifying diseases in apple leaves with high precision and reliability.
The modified MobileNet_V2 architecture demonstrated an exceptional ability to accurately classify diseased and healthy apple leaves, surpassing the performance metrics of Inception_V3, CNN2D, and EfficientNetB0.This indicates not only the effectiveness of the architectural modifications and hyperparameter tuning but also the potential of edge computing architectures in agricultural applications.
Moreover, the architecture incorporates inverted residuals and linear bottlenecks, further improving efficiency.Inverted residuals allow for the expansion of feature maps prior to depthwise convolutions, enabling more complex feature learning.Meanwhile, linear bottlenecks ensure that no nonlinearity is introduced in the information path, preserving crucial features.In comparison, the other candidate models, while having their unique strengths, do not offer the same balance of computational efficiency and performance.Conv2D, while simpler and more straightforward, may not capture complex features effectively due to its lack of sophisticated techniques.Inception and EfficientNet, despite their impressive performance, can be computationally intensive, leading to slower response times and higher resource demands.This is not ideal for real-time, on-field applications.
In summary, MobileNet_V2's key strength lies in its unique architecture that balances the trade-off between accuracy and computational cost.It has been designed to be lean yet powerful, making it a robust choice for applications like crop disease identification, where both speed and precision are of the essence.While all models have their merits, MobileNet_V2's combination of efficiency and performance makes it stand out in this context.

CONCLUSIONS
This research contributes significantly to the advancement of agricultural technology by integrating edge computing with AI to enhance the accuracy and efficiency of leaf disease identification in apple plants.Through meticulous experimentation and analysis, we demonstrated that our modified MobileNet_V2 architecture significantly outperforms existing methods in detecting key diseases such as Scab, Black Rot, and Cedar Rust with high precision.Our approach not only leverages the strengths of MobileNet_V2, including its innovative use of inverted residuals and linear bottlenecks, but also enhances its capability through careful hyperparameter tuning and architectural modifications tailored to the unique challenges of agricultural disease detection.
The incorporation of inverted residuals expands feature maps to enable complex feature learning, while linear bottlenecks preserve essential features without introducing non-linearity, ensuring the model's efficiency and effectiveness.This balance between computational efficiency and performance accuracy is crucial for real-time applications, particularly in resource-constrained environments like agricultural fields.Although other models like Conv2D, Inception, and EfficientNet offer substantial capabilities, their computational demands make them less suited for on-field, real-time applications where MobileNet_V2's efficiency becomes a decisive advantage.
Importantly, our findings suggest that the modified MobileNet_V2 architecture is not only highly effective but also capable of running smoothly on lightweight computing platforms, such as the ARM Cortex M4.This compatibility underscores the practical applicability of our approach, promising seamless integration into existing agricultural IoT setups and enabling on-site, immediate disease detection without the need for extensive computing resources.

Limitations and Future Directions
While our research marks a significant step forward, it is not without limitations.The dataset, although comprehensive, could be expanded to include a wider variety of disease types and environmental conditions to further test and refine the model's robustness.Future work will also explore the integration of additional sensors and data types, such as spectral and thermal imaging, to enrich the model's input and enhance its diagnostic capabilities.
Moreover, exploring the deployment of our model across different edge computing platforms will be crucial in ensuring its adaptability and scalability.The potential for execution on platforms like the ARM Cortex M4, without glitches, highlights the model's versatility and sets the stage for its application in a broader range of agricultural and environmental monitoring tasks.
In conclusion, our research offers a promising direction for the future of smart agriculture, providing a robust, efficient tool for farmers and agricultural professionals to detect and manage crop diseases proactively.By continuing to refine and expand this technology, we can look forward to more sustainable, productive agricultural practices that benefit both producers and consumers worldwide.

Figure 3 .
Figure 3. Comparative performance of all AI model evaluated

Figure 4 .
Figure 4. Accuracy achieved for each healthy and infected leaves model as tested in individual test subset

Figure 5 .
Figure 5.Comparison of training parameters of each model evaluated in the study

Table 2 .
Accuracy, sensitivity, specificity, and F1 score for the subset

Table 3 .
Evaluated model performance comparison

Table 4 .
Comparative performances of MobileNet_V2 with other architecture