🔒
International Research Press
Serving Researchers Since 2012

AgroScan AI: A Smart Agriculture System Combining Deep Learning and IoT for Multi-Crop Disease Detection and Soil Analysis

DOI : 10.17577/IJERTCONV14IS010013
Download Full-Text PDF Cite this Publication

Text Only Version

AgroScan AI: A Smart Agriculture System Combining Deep Learning and IoT for Multi-Crop Disease Detection and Soil Analysis

Anish Larson Pereira

Student, St. Joseph Engineering College, Mangalore

Abstract – Agriculture is one of the most essential parts of food production worldwide, but plant disease continues to create serious problems, especially for farmers who do not have easy access to expert help or early diagnostic tools. To help solve this issue, we created AgroScan AI, a smart farming system that brings together deep learning and IoT (Internet of Things) technology. The system is able to identify the crop diseases using the leaf images and also give real -time feedback on soil conditions.

In the center of AI AgroScan AI, there is a deep learning model called EfficientNetb0, which has been trained using the full Plantvillage dataset that includes 39 different categories of crop disease images. We also used a lighter model, MobileNetV2, for comparison. In our tests, EfficientNetB0 reached a high accuracy of 98.08%, while MobileNetV2 achieved only 64.08%, showing that a deeper model works better for handling many crop types.

Apart from identifying diseases from images, AgroScan AI also uses sensors to measure temperature, humidity, soil moisture, and light. After detecting a disease, the system compares these environmental readings with the ideal conditions for the affected crop. Based on the results, it suggests ways to improve the soil or even recommends different crops that might grow better in those conditions.

By combining accurate detection of images based on images with live sensor data and useful advice, AgroScan AI offers a practical and accessible solution, especially for small and medium farmers. It fills the gap between the modern AI tools and the real -life needs of the people who work in this field.

Keywords – AgroScan AI, crop disease detection, EfficientNetB0, MobileNetV2, deep learning, PlantVillage dataset, image classification, IoT-based soil monitoring, smart agriculture, transfer learning, precision agriculture.

  1. INTRODUCTION

    Agriculture continues to be one of the most important sectors globally, but it faces constant challenges from crop diseases that can severely reduce yield and quality. These diseases often go undetected in their early stages, especially in rural and small-scale farming environments where access to expert support is limited. As a result, farmers may not realize there is a problem until the damage has already become significant. Early detection of plant diseases is therefore critical to ensuring food security, minimizing

    Dr. Gururaja S

    Asst Professor, St. Joseph Engineering College, Mangalore

    crop loss, and supporting sustainable farming practices.

    With the rise of artificial intelligence (AI), deep learning has emerged as a powerful tool for analyzing crop images and identifying diseases with high accuracy. Convolutional Neural Networks (CNNs) in particular have shown strong performance in classifying plant diseases based on visual symptoms. Among the various CNN architectures available,

    EfficientNetB0 has gained attention for its ability to achieve high accuracy with fewer parameters and lower computational cost. However, there is still a need to evaluate how well it performs in real-world, multi-crop scenarios and how it compares with lighter models like MobileNetV2, which are often used in mobile or embedded systems.

    In this work, we introduce AgroScan AI, a smart agriculture system that combines deep learning with IoT-based soil monitoring to offer both disease prediction and environmental analysis. Our system uses EfficientNetB0 as the main model and compares its performance to MobileNetV2, both trained on the full PlantVillage dataset containing 39 disease classes. In addition to image-based predictions, AgroScan AI includes real-time sensors to measure temperature, humidity, soil moisture, and light intensity. These sensor readings are analyzed to give farmers suggestions on how to improve soil conditions or grow alternative crops if needed.

    By combining computer vision and IoT, AgroScan AI aims to provide a practical, low-cost solution for farmers who need timely and accurate information to manage their crops. This integrated system bridges the gap between AI research and real-world agricultural needs, particularly in areas where resources and technical support are limited.

  2. LITERATURE REVIEW

    Over the years, detecting crop diseases using deep learning has become a major area of interest in agriculture. A lot of work has been conducted using the PlantVillage dataset, which provides a large collection of plant leaf images. Many researchers managed to achieve very high accuracy, almost perfect in some cases, using powerful models like ResNet and DenseNet. But these results are mostly from ideal conditions, where everything is clean and

    controlled. When tested in the real worldon farms with different lighting, leaf damage, or background clutterthese models dont always perform as well [1].

    Some studies tried to overcome these issues by combining multiple CNNs. The idea was to make the system more reliable by using the strengths of each model. But even though this worked in theory, the results didnt hold up well in practical settings. Also, running complex ensemble models needs more hardware and processing time, which isnt easy to manage in field conditions [2].

    Lightweight models like MobileNetV2 became more popular for this reason. These are easier to run on phones or low-power devices. But in most papers, these models were trained on only one crop or a small part of the PlantVillage datasetlike just tomato leaves. That means they dont perform well when applied to a wider variety of crops or unseen diseases [3].

    Some newer papers used transformer-based models. These are powerful and can pick up subtle patterns in images. But again, theyre heavy on computation and were mostly tested on just a few diseases, not the full range of 39 classes in PlantVillage [4][5]. Some teams even built mobile apps using these models, but they only gave predictions. There wasnt much support beyond that, no advice, no environmental suggestions, just labels [6].

    On a different note, a few studies discussed IoT-based farming tools. These included sensors to measure things like temperature, humidity, and soil moisture. But in most cases, these IoT systems worked separately from disease detection tools. That means even if a farmer knew the disease, they wouldnt get feedback on how the environment was contributing to itor what they could do about it [7].

    This is where our system, AgroScan AI, fills a clear gap. We didnt just stop at image classification. We trained two models, EfficientNetB0 and MobileNetV2, on the full PlantVillage dataset, covering all 39 disease categories. More importantly, we connected this with real-time sensor readings using IoT modules. So after the disease is predicted, the system checks the current temperature, humidity, light, and soil conditions, then compares that with the ideal environment for the affected crop. It even gives suggestions to fix the soil or recommends alternative crops if needed. This makes AgroScan AI a much more practical and complete system, especially for farmers who need fast and useful feedback in real conditions, not just a disease name.

  3. METHODOLOGY

    1. System Workflow Overview

      AgroScan AI uses EfficientNetB0 as its core deep learning architecture for crop disease detection. This model was chosen because it balances accuracy and efficiency by scaling its depth, width, and input resolution in a uniform way. Its designmakes it well-suited for multi-class classification problems, especially when working with limited computational resources.

      The architecture includes a series of convolutional layers followed by batch normalization and activation functions. It ends with global average pooling and a dense output layer with 39

      unitsone for each disease class in our dataset. A softmax activation function is applied to generate the final class probabilities.

      To compare architectural performance, we also used MobileNetV2, a lightweight CNN model optimized for mobile and embedded devices. While not the focus of the system, it served as a baseline to highlight the improvements gained from using a deeper and more advanced model like EfficientNetB0.

      Fig. 1. AgroScan AI workflow from image input to final prediction and IoT-based analysis.

    2. Dataset Description

      The dataset used in this study is sourced from the publicly available PlantVillage repository, which is widely used in agricultural machine learning research. It contains labelled leaf images spanning 39 different classes, covering a variety of common crops including tomato, potato, grape, apple, citrus, corn, pepper, peach, and strawberry. Each class includes both healthy and diseased leaf samples, along with a special Background_without_leaves category that helps the model ignore irrelevant visual information during classification.

      For this work, a total of 55,448 images were used. The dataset was divided into three subsets to ensure proper training and evaluation: around 80% of the images (44,343) were used for training, while the remaining images were split evenly between validation (5,542) and test (5,563) sets. Care was taken to preserve the class distribution across all splits. The datasets folder-based structure and consistent labelling made it easy to integrate into deep learning pipelines without requiring additional manual preprocessing. Its diversity and balance ensured that the model received a broad and representative sample of different disease types, improving its ability to generalize to unseen data.

      Fig. 2. Sample leaf images from the Plant Village dataset

    3. Data Preprocessing

      First of all, the entire leaf images were resized to 224×224 pixels, the common input size of both the EfficientNetB0 and MobileNetV2 models. We normalized the images following resizing, scaling pixel values to [0, 1]. This makes training faster, and the model discriminates well even against big differences in input values. The dataset was divided into three portions: 80% for training, 10% for validation, and 10% for testing. This split enables us to train the model on one part of the data and to fairly evaluate it on entirely unseen images.

      We utilized TensorFlows image_dataset_from_directory() function to efficiently load and batch the images from the dataset. This method also assigns labels automatically based on the directory names. During training, we applied real-time augmentation to the images using simple techniques like random horizontal flips and small rotations. These augmentations were applied in memory while training, meaning the original dataset remained unchanged. This method enhances the models ability to handle typical image variations such as changes in leaf orientation or lighting, which are common in real-world conditions.

      To make the training process more efficient, we enabled TensorFlows AUTOTUNE feature, which preloads data in the background while the GPU is still training on the current batch. This optimization ensures faster training by avoiding idle time. Lastly, we saved the class labels into a JSON file, which was useful later during predictions and for generating detailed performance reports. These preprocessing steps made sure the dataset was clean, balanced, and ready for training deep learning models effectively.

    4. Model Architecture

      The approach focuses on using deep learning architectures to classify plant diseases based on the PlantVillage dataset, which contains images representing 39 distinct disease categories across various crops. The images are preprocessed through steps like resizing and normalization to ensure consistent input dimensions for the model. Data augmentation techniques such as horizontal flipping and slight rotations are incorporated to introduce variability within the dataset, aiding in model generalization and reducing overfitting.

      We assess our models' performance by splitting the dataset into separate sets for training, validation, and testing. For classification, we use the EfficientNetB0 model, this model is recognized for balancing accuracy and complexity. We train EfficientNetB0 in two phases: first, we freeze the convolution base of the model so we can use the pretrained weights of the ImageNet dataset, and only allow the top layers of the model to adapt the training to solve this new problem. When phase 1 is complete, we then unfreeze all layers of the model to re-train and fine-tune our model on the specific pen characteristics of the plant disease images.

      To provide a comparative analysis, MobileNetV2, a lightweight convolutional neural network optimized for mobile and resource-

      constrained environments, is also trained under identical conditions. This comparison enables an assessment of trade-offs between model size, inference speed, and classification accuracy in multi-class scenarios involving a large number of disease classes. The experimental results offer insights into the performance characteristics of both architectures, highlighting the suitability of EfficientNetB0 for tasks requiring a balance of precision and efficiency, while demonstrating the practical advantages of MobileNetV2 in contexts where computational resources are limited.

    5. Training Configuration

      Both EfficientNetB0 and MobileNetV2 were trained in a GPU- enabled environment using TensorFlow and Keras. The goal was to compare a lightweight baseline model with a more advanced architecture under consistent training conditions.

      For EfficientNetB0, training was carried out in two distinct phases. First, the base layers were frozen and only the top classification head was trained for 10 epochs using a learning rate of 0.001. This allowed the model to adjust to the new task without altering the pre-trained ImageNet weights. In the second phase, all layers were unfrozen, and the model was fine-tuned for an additional 10 epochs with a reduced learning rate of 0.0001. This two-stage process helped balance generalization with task-specific learning.

      We used the Adam optimizer and the categorical cross-entropy loss function, which is standard for multi-class classification tasks. The training progress was monitored using accuracy and loss metrics on both the training and validation sets.

      For MobileNetV2, we used the same optimizer, loss function, and learning rate, but trained the model for 10 epochs without fine- tuning, as it served as a baseline. This consistent setup ensured that performance differences were due to the model architectures themselves, rather than variations in training conditions.

    6. Evaluation Strategy

    To assess the model's performance, we applied various metrics that capture both overall accuracy and how well each class is handled. Once training was complete, we tested EfficientNetB0 and MobileNetV2 on a separate test dataset that wasnt used during training or validation. This ensured that the results reflected how the models would perform on completely new, unseen data. The primary metric for comparison was overall accuracy, but we also analysed precision, recall, and F1-score, using both macro and weighted averages, to capture performance across all 39 classes.

    The confusion matrix was used to understand which classes the models confused with one another. This visual tool helped identify specific weaknesses in classification and allowed or a deeper understanding of where and why misclassifications occurred. We also created classification reports that included precision, recall, and F1-score for each class. This gave us clearer insights into how well the model performed on each category, especially in cases where the data was imbalanced.

    To illustrate the effectiveness of the models, we also displayed sample predictions side by side, showing input images, actual class labels, and predicted labels for both models. This qualitative analysis added context to the numerical metrics and helped demonstrate how EfficientNetB0 handled complex cases more accurately than MobileNetV2. We also visualized performance trends by plotting the training and validation accuracy and loss over the epochs, which helped us better understand how the models were learning over time, which showed the stability and convergence behaviour of each model.

    Together, these evaluation methods provided a detailed and fair comparison of both architectures and supported our conclusion that EfficientNetB0 was significantly more reliable and accurate for multi-class crop disease detection on the PlantVillage dataset.

  4. RESULTS AND DISCUSSION

    1. Overall Performance

      The EfficientNetB0 model delivered strong results on the PlantVillage test set, achieving an overall accuracy of 98.08%. In contrast, MobileNetV2, which was included as a lightweight baseline, achieved a significantly lower accuracy of 64.08%. These findings highlight the strength of deeper architectures like EfficientNetB0 for complex, multi-class classification problems involving 39 different crop diseases.

      In addition to accuracy, both models were evaluated using precision, recall, and F1-score, calculated using macro and weighted averages. EfficientNetB0 consistently achieved scores in the range of 9899%, showing reliable performance across both majority and minority classes. MobileNetV2, however, exhibited noticeably lower metrics, especially in recall and precision, indicating difficulty in handling imbalanced class distributions. Table 1 presents a detailed comparison of these metrics for both models.

      Table 1. Overall Classification Performance

      These results confirm that while lightweight models like MobileNetV2 may be appropriate for resource-constrained scenarios, they tend to struggle when scaled to larger, more diverse classification tasks. In contrast, EfficientNetB0, while slightly more computationally intensive, proved highly reliable even with only basic data augmentation techniques such as random flips and

      rotations.

      The training and validation accuracy/loss trends of both models are illustrated in Figure 3. As shown, EfficientNetB0 not only converged faster but also maintained more stable performance across epochs, reinforcing its robustness compared to MobileNetV2.

      Fig. 3. Accuracy and loss comparison between EfficientNetB0 and MobileNetV2 over training epochs.

    2. Class-wise Analysis

      To evaluate how consistently EfficientNetB0 performed across all crop types, we analysed its class-wise F1-scores. The chart below displays the F1-score for each of the 39 crop disease categories in the PlantVillage dataset.

      The model demonstrated highly consistent performance, with most classes achieving F1-scores above 95%. In particular, it handled several complex disease categories with excellent precision and recall, indicating its ability to capture subtle visual differences across a wide variety of leaf images. The variation between classes was minimal, suggesting that the model was not biased toward dominant or overrepresented categories.

      A few classes did show slightly lower scores, in the range of 85% to 90%, which could be due to overlapping visual features or fewer training samples. Despite these minor dips, the performance remained reliable, and there were no major failures in any category. This shows that the model not only performs well overall but also maintains a strong balance across all classes.

      Such consistency across diverse diseases highlights the robustness of EfficientNetB0. It is especially important in practical applications, where farmers may encounter a range of diseases under different conditions. This class-wise analysis confirms that the model is dependable for real-world scenarios, not just controlled test environments.

      Fig. 4. Top and bottom five classes based on F1-score. The lowest-performing classes are visually similar diseases.

    3. Sample Predictions

      To better visualize how each model performed in practice, we selected a few random test images and examined their predictions. These examples give an intuitive sense of how well the models distinguish between crop diseases when faced with unseen data.

      For EfficientNetB0, all selected samples were correctly classified. The model demonstrated strong confidence in its predictions and accurately identified disease symptoms across a range of crops, including those with visually similar features. These results align with the high F1-scores and overall accuracy reported earlier, confirming that EfficientNetB0 is not only statistically accurate but also reliable in individual test cases.

      On the other hand, MobileNetV2 showed less consistent performance. While it correctly predicted some classes, it also misclassified several samples, especially when the symptoms were subtle or the images had background noise. This behaviour reflects the lower F1-scores observed in the previous sections. These misclassifications highlight the limitations of lightweight models in complex, real-world classification problems with many similar categories.

      A comparison of sample predictions from both models is shown below. These examples help illustrate the practical impact of architecture choice: deeper models like EfficientNetB0 are better suited for high-precision agricultural tasks, while smaller models may struggle with fine-grained distinctions.

      Fig. 5. Sample validation images with predicted vs. actual labels.

    4. Comparison with Prior Works

    Compared to existing studies, our results show noticeable improvements in both accuracy and practical design. In [1], deep learning models like ResNet and DenseNet reported near-perfect accuracy on the PlantVillage dataset, but these results were mostly obtained under controlled lab conditions. When tested in real environments with varying lighting, damaged leaves, or cluttered backgrounds, their performance often dropped. Our model, EfficientNetB0, was trained on the complete PlantVillage dataset with standard image augmentation techniques such as random flips and rotations. Despite using only basic preprocessing, it still achieved a high accuracy of 98.08%, making it both effective and efficient for deployment in real-world agricultural settings.

    In contrast to the ensemble methods used in [2], which combine several CNNs to boost accuracy, our approach focuses on a single well-optimized architecture. Ensemble models often demand more computational power and memory, making them less suitable for mobile or edge devices. Our EfficientNetB0 setup delivers competitive results without increasing system complexity.

    For comparison, we also trained MobileNetV2, a lightweight model similar to those used in [3]. While it is resource-efficient and faster to run, its performance dropped significantly when applied to the full 39-class dataset, achieving only 64.08% accuracy. This highlights the trade-off between model size and accuracy, especially in complex classification tasks.

    Furthermore, prior works like [4][5][6] typically stopped at disease prediction and did not offer any additional support for farmers. While some IoT-based studies [7] incorporated environmental sensors, they were usually disconnected from the disease detection process. In contrast, AgroScan AI unifies both deep leaning and IoT. After identifying a disease, it collects real- time data on temperature, humidity, soil moisture, and light intensity. It then compares these values with ideal conditions for the affected crop and suggests environmental improvements or alternative crop choices. This level of integration is not commonly seen in earlier research.

  5. CONCLUSION AND FUTURE WORK

    This paper presented AgroScan AI, an integrated system that combines deep learning and IoT technologies to detect plant diseases and monitor soil conditions in real time. The systems core deep learning model, EfficientNetB0, was trained on the complete PlantVillage dataset containing 39 crop classes, and demonstrated high accuracy in disease classification, achieving 98.08% on the test set. In comparison, MobileNetV2, used as a lightweight baseline, achieved only 64.08%, showing that more

    advanced architectures are better suited for complex multi-class agricultural problems. Alongside image-based diagnosis, AgroScan AI incorporates a sensor module that collects live data on temperature, humidity, light intensity, and soil moisture, providing useful feedback to help farmers adjust environmental conditions or choose alternative crops when necessary.

    The integration of image classification with real-time IoT monitoring offers a more complete solution than many existing systems, which often stop at disease detection. AgroScan AI not only identifies the problem but also helps guide actionable responses, making it especially valuable in practical, field-level applications.

    Looking ahead, future improvements can include deploying the system on low-power embedded devices like the Raspberry Pi or ESP32-CAM for complete portability. Additionally, expanding the system with GPS-based location tagging and seasonal crop planning features would make it even more useful for precision farming. Further testing on real-world field imagesunder varying lighting, weather, and background conditions can help improve robustness. There is also potential to explore transformer- based models or hybrid architectures that balance accuracy with computational efficiency.

  6. REFERENCES

  1. A. J, J. Eunice, D. E. Popescu, M. K. Chowdary, and J. Hemanth, Deep Learning-Based leaf disease detection in crops using images for agricultural applications, Agronomy, vol. 12, no. 10, p. 2395, Oct. 2022, doi: 10.3390/agronomy12102395.

  2. F. Zubair, M. Saleh, Y. Akbari, and S. A. Maadeed, A robust ensemble model for plant disease detection using deep learning architectures, AgriEngineering, vol. 7, no. 5, p. 159, May 2025, doi: 10.3390/agriengineering7050159.

  3. S. Duhan, P. Gulia, N. S. Gill, and E. Narwal, RTR_LIte_MobileNETV2: A lightweight and efficient model for plant disease detection and classification, Current Plant Biology, p. 100459, Feb. 2025, doi: 10.1016/j.cpb.2025.100459.

  4. Tonmoy, Moshiur Rahman, Md Mithun Hossain, Nilanjan Dey, and M. F. Mridha. "MobilePlantViT: A Mobile-friendly Hybrid ViT for Generalized Plant Disease Image Classification." arXiv preprint arXiv:2503.16628 (2025).

  5. Wang, Yuchao, Peiyan Yuan, and Baofang Chang. "PMVT: a lightweight vision transformer for plant disease." Artificial Intelligence and Internet of Things for Smart Agriculture (2024): 7.

  6. D. Goklani, Real-Time Plant Disease Detection Using Mobile Device with TensorFlow Lite and Flutter, SSRN Electronic Journal, Jan. 2024, doi: 10.2139/ssrn.4921827.

  7. V. S. Dhaka, N. Kundu, G. Rani, E. Zumpano, and E. Vocaturo, Role of Internet of Things and Deep Learning Techniques in plant Disease Detection and Classification: A Focused review, Sensors, vol. 23, no. 18, p. 7877, Sep. 2023, doi: 10.3390/s23187877.