Next Article in Journal
Effects of Noise and Vibration Changes from Agricultural Machinery on Brain Stress Using EEG Measurement
Previous Article in Journal
A New Way to Identify Mastitis in Cows Using Artificial Intelligence
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Tomato Fungal Disease Diagnosis Using Few-Shot Learning Based on Deep Feature Extraction and Cosine Similarity

by
Seyed Mohamad Javidan
1,
Yiannis Ampatzidis
2,*,
Ahmad Banakar
1,
Keyvan Asefpour Vakilian
3 and
Kamran Rahnama
4
1
Department of Biosystems Engineering, Tarbiat Modares University, Tehran 4916687755, Iran
2
Agricultural and Biological Engineering Department, Southwest Florida Research and Education Center, University of Florida, 2685 FL-29, Immokalee, FL 34142, USA
3
Department of Biosystems Engineering, Gorgan University of Agricultural Sciences and Natural Resources, Gorgan 4913815739, Iran
4
Department of Plant Protection, Faculty of Plant Production, Gorgan University of Agricultural Sciences and Natural Resources, Gorgan 4913815739, Iran
*
Author to whom correspondence should be addressed.
AgriEngineering 2024, 6(4), 4233-4247; https://doi.org/10.3390/agriengineering6040238
Submission received: 20 September 2024 / Revised: 4 November 2024 / Accepted: 7 November 2024 / Published: 11 November 2024

Abstract

:
Tomato fungal diseases can cause significant economic losses to farmers. Advanced disease detection methods based on symptom recognition in images face challenges when identifying fungal diseases in tomatoes, especially with limited training images. This study utilized novel techniques designed for limited data scenarios, such as one-shot and few-shot learning, to identify three tomato fungal diseases, i.e., Alternaria solani, Alternaria alternata, and Botrytis cinerea. Automated feature extraction was performed using the ResNet-12 deep model, and a cosine similarity approach was employed during shot learning. The accuracy of diagnosing the three diseases and healthy leaves using the 4-way 1-shot learning method was 91.64, 92.37, 92.93, and 100%. For the 4-way 3-shot learning method, the accuracy improved to 92.75, 95.07, 96.63, and 100%, respectively. These results demonstrate that the proposed method effectively reduces the dependence on experts labeling images, working well with small datasets and enhancing plant disease identification.

1. Introduction

Disease detection is a key aspect of agriculture management, as it allows for the early identification of potential issues that may reduce crop yield, quality, and profitability [1]. In many cases, early detection and intervention can prevent the spread of diseases, thereby reducing losses and ensuring food safety for consumers. One of the most exciting developments in recent years has been the use of artificial intelligence (AI) and image processing in plant disease detection. The primary advantages of using AI and image processing in plant disease detection are the increased accuracy and speed it provides. Traditional methods of disease detection often rely on visual inspections or manual sampling, which can be time-consuming and subject to human error [2,3]. In contrast, AI algorithms can accurately identify diseases based on visual cues, minimizing the risk of false positives and negatives [4]. This can lead to better decision-making, allowing farmers to take action in a more timely and effective manner. Another advantage of using AI and image processing in plant disease detection is the real-time monitoring capabilities. By capturing and analyzing data in real-time, farmers can quickly identify and respond to potential issues, reducing the risk of disease outbreaks and optimizing crop management. This can help minimize the impact of weather events and other unforeseen disruptions, leading to better overall crop health.
Building on recent progress in machine learning and deep learning for plant disease diagnosis, research has not only focused on developing new architectures but also on comparing the effectiveness of various algorithms. For instance, one study proposed a network architecture named INAR-SSD, inspired by VGGNet and Inception, which achieved an accuracy of 78.8% in diagnosing apple leaf diseases [5]. Other studies have utilized machine learning techniques, such as an artificial neural network (ANN) combined with adaptive particle grey wolf optimization (APGWO), to classify mango leaf diseases into categories like anthracnose, Gall midge, Powdery mildew, and healthy leaves [6].
Machine learning methods in this domain typically analyze shape, color, and texture features in images. These methods follow a structured process, including preprocessing steps like background removal, followed by feature extraction. Color features might involve metrics such as the mean and standard deviation of R, G, B, H, S, and V channels, while shape features may include measurements like area, perimeter, eccentricity, major/minor axis lengths, orientation, convex area, equivalent diameter, solidity, and the area-to-bounding-box ratio. Texture features are often derived from gray level co-occurrence matrix (GLCM) attributes. The final steps involve classification and feature selection, leveraging both traditional and advanced machine learning algorithms. In a comparative study on citrus disease diagnosis, researchers evaluated the performance of machine learning algorithms, such as random forest (RF) (76.8%), support vector machine (SVM) (87.0%), and stochastic gradient descent (SGD) (86.5%), alongside deep learning models like VGG-16 (89.5%), VGG-19 (87.4%), and Inception-v3 (89%). The findings demonstrated that deep learning approaches consistently outperformed traditional machine learning methods, underscoring the potential of deep architectures in achieving higher diagnostic accuracy [7].
While conventional feature extraction methods have shown good performance in plant disease classification, they can struggle with multi-class detection, particularly when diseases exhibit similar symptoms. In such cases, deep learning offers a promising alternative by automatically extracting specific features that aid in distinguishing between diseases with overlapping visual symptoms [8,9]. To further enhance classification accuracy, especially for diseases caused by pathogens like Alternaria solani and Phytophthora infestans, another study applied a hybrid approach combining a genetic algorithm (GA) with a convolutional neural network (CNN), achieving an impressive 97.3% accuracy [10]. This high accuracy underscores the potential of integrating optimization techniques with deep learning architectures for more precise and effective plant disease diagnosis.
Despite the promising results demonstrated in these studies, deep learning approaches for plant disease detection still face several limitations. One of the most notable challenges is the need for high-quality large datasets to train such algorithms [11]. If the data are incomplete or inaccurate, deep learning-based algorithms may not be able to accurately identify diseases. To address these data limitations, advanced techniques like one-shot and few-shot learning have been explored. One-shot learning refers to a machine learning scenario where the model is trained on a single sample of the target class or disease, whereas few-shot learning involves training the model on a small number of instances of the target class or disease. One-shot learning is particularly challenging because the model needs to learn the characteristics of the target class or disease from a single instance. Few-shot learning is less challenging because the model has access to a small number of samples from the target class or disease, but it still requires the model to discern underlying patterns from limited data. In plant disease detection, using one-shot learning or few-shot learning can help reduce the dependence on expert-labeled data [12]. These approaches are particularly useful in scenarios where obtaining a large number of labeled images is impractical or expensive. Few-shot learning algorithms can quickly learn to identify new examples of a disease or pest class that the model has not seen before, making real-time detection possible. This is particularly valuable in agriculture, where the need for quick and accurate disease detection and management is critical to maintaining crop health and productivity. Few-shot learning has become an increasingly popular approach to improving accuracy in plant disease detection [13], and has the potential to revolutionize the ability of farmers to quickly detect and manage diseases and pests in their crops, leading to improved crop health and productivity. As more research and development is performed in this area, this technology will become more accessible, adaptable, and effective in a wide range of agricultural contexts.
This study introduced a novel and efficient approach for identifying major tomato fungal diseases using minimal training data. Leveraging one-shot and few-shot learning techniques, it aimed to classify three visually similar fungal diseases, Alternaria solani, Alternaria alternata, and Botrytis cinerea. The method employed the ResNet-12 deep model for feature extraction, combined with a cosine similarity approach during shot learning, to enhance detection precision even with limited data. The study’s innovation lies in two key areas as follows: first, it addresses the classification of diseases with highly similar symptoms, a challenging aspect often overlooked in prior research. Second, instead of relying on traditional manual feature extraction, which can be inefficient and labor-intensive, it utilizes deep learning models to automatically extract distinguishing features. This approach not only minimizes the data dependency typically required by deep learning but also underscores the potential of one-shot and few-shot learning to streamline plant disease detection, offering a promising solution for rapid and accurate disease management in agriculture.

2. Materials and Methods

Figure 1 shows the proposed method for diagnosing tomato diseases in this study. The process begins with image dataset preparation, followed by image preprocessing, feature extraction using a pre-trained ResNet-12 model, data normalization before learning, and few-shot learning based on cosine similarity. Key techniques employed in this workflow include the Canny edge detection algorithm, gray-level thresholding, and K-means clustering. All algorithms were implemented in the MATLAB 2023b programming environment (MathWorks, Natick, MA, USA), using default parameter values unless otherwise specified.

2.1. Preparation of Image Dataset

To prepare and isolate the disease agent, samples were taken from tomato fields. The samples were placed separately in paper envelopes and kept at a temperature of 4 °C after being transferred to the laboratory. Using a sterile scalpel, small pieces of 1 cm size were cut from the infected tissues. The cut pieces were surface disinfected in 10% sodium hypochlorite solution for 10 s and immediately washed twice with water [14]. After dewatering with filter paper, the samples were cultured on a nutrient medium (potato dextrose agar) PDA. Then, the plates were incubated for 3 to 5 days at 25 °C. The grown colonies that had the characteristics of the disease considered in this study were purified by removing a single spore or spore chain. Pieces of growing colonies that were 5 mm were removed and cultured on PDA. To stimulate the sporulation pattern, the plates were incubated at 24 °C with a light cycle of 8 h of light and 16 h of darkness for 5 to 7 days. The isolates were identified using the general patterns of sporulation, including the arrangement of spores on the spore carrier, the number of spores in each chain, and the branching pattern of the chains, and the pathogenicity test of the isolates was proved. After 10 days of purification, the surface of the Petri dish was washed with sterile distilled water. In total, 10 microliters of the solution obtained from disease spores was taken by a sampler, the number of the fungal spores was counted, and their concentration was determined by counting under a light microscope with a hemocytometer slide. In counting the spores, it is important that the spores attached to the square lines of the slide at the top and right side can be counted, and the spores at the bottom and left cannot be counted. The number of spores allowed at the time of disease transmission was 5 × 106 for each disease [14]. Then, healthy leaves and leaves with disease symptoms were photographed by Samsung A32 mobile phone equipped with a 64-megapixel camera with automatic focus from a distance of 20 cm. A gray background was used for photography and a halogen lamp was used for lighting.

2.2. Image Preprocessing

Removing the background and extracting the diseased areas are crucial to ensure that noise in the extracted properties and the trained framework is minimized. Automation of these processes is necessary to enhance usability and reduce human intervention. Canny edge detection together with morphological operations were used for background removal, while the automatic K-means clustering was used to extract the diseased areas from the leaves.
A significant challenge in images taken under natural conditions is the presence of shadows. Figure 2a illustrates a leaf with a shadow and background. In plant leaf images, the green color band often predominates. Figure 2b presents a leaf image after extracting the green color band. Edge detection was performed using the Canny algorithm, followed by morphological dilation to connect edge boundaries. The Canny edge detection method operates in five main steps as follows: first, a Gaussian filter is applied to reduce noise; second, the intensity gradients of the image are calculated; third, gradient magnitude thresholding is used to eliminate weak edge responses; fourth, a double threshold is applied to identify potential edges; and finally, edge tracking by hysteresis is conducted to confirm edge continuity [15]. This algorithm has proven effective in plant leaf detection applications [16]. Figure 2c,d depict the edges extracted from the image. In the subsequent step, empty spaces in the image were filled. The resulting image still contained some small noise, which was removed by area thresholding, as shown in Figure 2f. In this step, small noise with color pixels was eliminated using gray-level thresholding, resulting in the binary image of the leaf (Figure 2f). The final image of a leaf without a background is shown in Figure 2g.
Next, the automatic K-means clustering method was used to identify the diseased areas in leaf images (Figure 2h). K-means clustering is an effective technique for categorizing and grouping objects based on various features. It works by assigning each object to one of K classes, aiming to minimize the total sum of squared distances between the objects and their respective cluster centers. The K-means clustering algorithm can be broken down into four steps as follows: selecting K initial cluster centers either randomly or using heuristic methods, assigning each object to the cluster with the closest cluster center based on Euclidean distance, computing new cluster centers by averaging the objects within each cluster, and repeating the assignment and computation steps until convergence is achieved.
In studies that involve identifying diseased areas in plant leaves, selecting the appropriate value of K and the region of interest (ROI) can be time-consuming and prone to errors. To address this challenge, it is often advantageous to use automatic K-means clustering to accurately distinguish between disease symptoms and healthy areas of the leaf. This study employed K-means clustering to automatically identify disease symptoms in plant leaves. By determining the ROI automatically by thresholding based on color differences between diseased and healthy leaf areas, only the diseased area remained after thresholding. Figure 3 presents the diseases examined in this study—Alternaria alternata, Alternaria solani, and Botrytis cinerea—showing how image processing was used to remove the background and detect diseased areas.

2.3. Feature Extraction

The ResNet-12 model is a type of CNN architecture that is commonly used for feature extraction in image classification and computer vision tasks. With ResNet-12, features can be extracted from images in a variety of ways [17]. The first step for extracting features from an image using ResNet-12 involves resizing the image to a fixed size, normalizing the pixel values, and converting the image to a suitable color space (Figure 4). For the ResNet-12, the input image typically has a resolution of 224 × 224 pixels and is normalized to the [0, 1] range. In ResNet-12, the input image is passed through a stack of convolutional layers, which detect and extract patterns at different scales and orientations. Each convolutional layer convolves the input image with a set of learned filters, followed by a nonlinear activation function. The output of each convolutional layer is a feature map, which represents the filtered response of the input image at a specific location and scale.
After the convolutional layers, the feature maps are passed through a pooling layer, which reduces the spatial size of the feature maps. Pooling can be performed using techniques such as max pooling or average pooling, which helps to reduce the computational complexity of the model and improve the robustness of the extracted features. The final step in this feature extraction is to concatenate all the feature maps output by the convolutional and pooling layers and pass the resulting feature vector through a fully connected layer, which performs linear interpolation and produces the final output of the model. The ResNet-12 model is used for feature extraction by applying a stack of convolutional and pooling layers to an input image, followed by a fully connected layer. The output of this model can be used as a feature vector for subsequent machine learning tasks, such as image classification or object recognition [18].

2.4. Data Normalization

Normalization is one of the scaling and mapping techniques in the data mining process. In this method, data is mapped from its current interval to another interval. This approach is very helpful for forecasting and analysis purposes, so considering the diversity of forecasting models in data mining and in order to maintain this diversity, normalization techniques help to bring these forecasts closer to each other [19]. Data normalization improves the accuracy and performance of learning models [20]. The data normalization process is effective in algorithms based on the distance criterion by preventing features with high values from dominating the learning process. Min–max normalization, also known as rescaling, is the simplest method to change the numerical range of a set to [1, 0] or [1, −1] (Equation (1)):
X norm = X X min X max X min
where Xnorm is the normalized data, X is the original data, Xmax is the data with maximum value, and Xmin is the data with minimum value. It should be noted that the data must be averaged in few-shot learning before normalization, but this averaging is not needed in one-shot learning.

2.5. Few-Shot Learning

In the era of data-driven decision-making, it is becoming increasingly challenging to obtain the required amount of data to solve complex problems. This is especially true when it comes to classifying and labeling objects that are rare or hard to find. Traditionally, these tasks are addressed by using data augmentation or data labeling, but these methods can be time-consuming and expensive. When the number of examples per class is very small, data augmentation and labeling methods may not work efficiently. However, shot learning is an innovative method developed to solve these kinds of problems. Shot learning enables machine learning models to learn from a limited number of examples and generalize to new and unseen data, making it an effective solution when dealing with small datasets. The ability of shot learning to learn and generalize with limited data makes it a promising approach for plant disease diagnosis [21]. In a few-shot learning scenario, the model is given by a support set S and a query set Q. The query sample x ∈ Q is a new sample that has not been seen by the model before. The objective of the few-shot task is to accurately predict the class of the query sample based on the support set [22].
The support set is commonly arranged as an N-way, K-shot format, where N refers to the total number of categories and K is the number of annotated examples for each category. In few-shot scenarios, K is typically very small, which means that the number of annotated examples available for each category is extremely limited. To learn the model, a feature extraction method fθ is needed, which takes as input the support set samples and produces a feature representation for each sample. The class prototype ck is a representative of the samples in each category and can be represented as the mean feature of the support set samples in that class. To predict the class of a new sample x ∈ Q, a similarity measure is used to calculate the similarity between the query sample and each class prototype. The similarity function, denoted by sim(•), is used to compare the query sample and each class prototype by comparing their feature representations. Finally, a scaling transformation is performed on the similarities to scale them to a range between 0 and 1. The scaled similarities are then passed through a linear function, which generates the predicted class label for the query sample [19]. These steps are shown in Equation (2):
P ( y = k x ) = exp ( sim ( f θ ( x ) , c k ) . t j = 1 N exp ( sim ( f θ ( x ) , c j ) . t
where x ∈ Q denote the query sample, ck represents the class prototype, and N is the total number of classes in the few-shot scenario. The prototype is commonly represented by the mean feature of the support set samples in each category. The similarities between the query sample and the prototype are often transformed using a scaling transformation T.

2.6. Similarity Measure Based on Cosine Similarity

There are distance metrics that calculate the distance or proximity of data from each other. The similarity criteria have the opposite relationship with the distance criteria, and in other words, the higher the similarity, the smaller the distance between two objects. Cosine similarities are defined as the cosine of the angle between two vectors (x and y) in a high-dimensional space (Equation (3)).
cos ( x , y ) = x · y x · y = i = 1 n x i y j i = 1 n ( x i ) 2 i = 1 n ( y i ) 2
The cosine similarity metric is commonly used to measure the similarity between two documents, regardless of their size or dimensionality, by comparing the angle between the vectors representing the documents on a vector space. Mathematically, cosine similarity can be represented as the dot product of two normalized vectors divided by the product of their magnitude. The vector space can be seen as a high-dimensional representation of the document, with each dimension corresponding to a unique word in the document. Cosine similarity measures the orientation of documents relative to each other, which can be used to determine their similarity [23]. Cosine similarity can take on values ranging from −1 to 1, with similar vectors having a similarity close to 1 and opposite vectors having a similarity close to −1. In the context of data mining, it is commonly used to measure cohesion within clusters. One key advantage of cosine similarity in prediction tasks is that it is computationally efficient and suitable for sparse vectors, as only the non-zero coordinates need to be considered. This makes it an attractive choice for large-scale data analysis tasks such as plant disease diagnosis, where rapid and accurate similarity measurement is essential [24].

3. Results

3.1. Results of Disease Diagnosis Using One-Shot Learning

Figure 5 shows the cosine similarity between the feature vectors extracted in ResNet-12 with the feature vector of the test image in the four-way one-shot learning approach. These results were obtained for the images of the three diseases Alternaria alternate, Alternaria solani, and Botrytis cinerea, as well as the healthy leaves of tomato plants. The obtained results were used for one image of training data and one image of test data. Also, the developed algorithm was analyzed to compare the results in images with background (Figure 5a), images without background (Figure 5b), and images for the specified infected area (Figure 5c). The results show that in the main images of diseased and healthy leaves with the background, the similarity percentages were 80.11, 85.76, 83.53, and 88.48% for the three diseases Alternaria alternate, Alternaria solani, Botrytis cinerea, and healthy leaf, respectively. These values for images without background were 88.52, 89.94, 83.95, and 91.88%, respectively, which shows a high accuracy of detection in all three groups. Finally, the similarity percentage results for images with only the infected area for the three diseases Alternaria alternata, Alternaria solani, and Botrytis cinerea, as well as healthy leaves were 91.64, 92.37, 92.93, and 100%, respectively. The percentage shows a higher accuracy compared to the two approaches of images with background and images without background and shows that the pre-processing, including the separation and identification of the infected area along with background removal, increases the accuracy of disease diagnosis.
This performance shows the appropriateness of the proposed approach, i.e., processing input images and combining the feature extraction method by deep learning and cosine similarity. Figure 6 shows a comparison of the accuracy of the one-shot learning methods for the three tomato fungal diseases used in this research.

3.2. Results of Disease Diagnosis Using Few-Shot Learning

Figure 7 shows the cosine similarity values between the feature vectors extracted in ResNet-12 deep learning with the feature vector of the test image in the four-way three-shot learning approach. For this purpose, three images were used for each group of tomato leaves including three disease groups and one healthy leaf group. Feature extraction from images was performed by ResNet-12 deep learning and finally, cosine matching of the feature vectors extracted from the image was performed by one image for each group. The results for images with background for the three diseases Alternaria alternata, Alternaria solani, and Botrytis cinerea and healthy leaves were 90.96, 90.37, 88.33, and 95.02%, respectively. These results show a higher accuracy compared to the four-way one-shot learning method for this group of images. For the images with the removed background, the results for the similarity percentage were 91, 92.23, 90.13, and 97.63%, respectively. An improvement in the similarity percentages was observed for such images. Finally, the results showed a very good performance in the diagnosis of the three diseases and healthy leaves, respectively, with similarity percentages of 92.75, 95.07, 96.63, and 100% for tomato plant leaf images with removed backgrounds and separated infected areas. This few-shot disease diagnosis approach shows higher accuracy compared to the four-way one-shot learning method. Figure 8 shows a comparison of the accuracy of the few-shot learning methods for the three tomato fungal diseases used in this research.

4. Discussion

Timely diagnosis and treatment of plant diseases can minimize economic losses. However, traditional methods for the diagnosis of plant diseases are usually conducted manually by experts [25,26]. Few-shot learning has emerged as a solution for more effective identification of plant diseases, which can increase the speed, accuracy, and efficiency of detection by using a small number of labeled samples [27].
This research showed the acceptable performance of one-shot and few-shot learning methods in diagnosing plant diseases with a small number of images [28,29]. Furthermore, the use of image processing methods to remove the background and separate the diseased area from the leaves can improve the diagnosis of diseases in one-shot and few-shot learning methods. In previous research on plant fungal diseases, the superiority of image processing-based disease diagnosis is also reported, but by using large training datasets and a technique called majority voting [30]. Research has shown that the performance of machine learning methods is closely related to feature extraction and feature engineering [31]. Other researchers have proposed deep learning methods for plant disease classification [32,33,34], which typically rely on large training datasets. Specifically, regarding tomato fungal diseases, various studies utilizing deep learning approaches are summarized in Table 1. Many of these studies have leveraged publicly available datasets, such as PlantVillage, where the symptoms of diseases are easily identifiable. However, these datasets often lack the diversity and complexity found in real-world scenarios. In contrast, our work addresses a significant gap by focusing on datasets obtained from plants at various stages of disease development, presenting a more challenging yet realistic context for detection. This novel approach not only enhances the robustness of disease classification models but also improves their applicability in practical agricultural settings, ultimately facilitating more accurate and timely interventions in plant health management.
Data augmentation methods were also used, including flipping and rotating, cropping and resizing, color jittering, adding noise, image warping, and random erasing, to increase the size of datasets [40]. Methods based on combining feature extraction by deep learning and classification by machine learning have been also proposed for plant disease classification [41,42,43]. Although these methods are promising, they still require large datasets to support the algorithms. The use of hyperspectral imaging was also used for early disease diagnosis [44,45,46,47,48,49]. However, such approaches are expensive and still require a lot of data for model training. Methods similar to the one introduced in this research might solve past problems to provide reliable diagnosis of plant diseases with similar symptoms and assist farmers and plant pathology experts in disease management.

Practical Application of the Proposed Method

The proposed method leverages deep learning algorithms trained on limited datasets to facilitate rapid and accurate diagnosis of plant diseases, significantly reducing reliance on manual inspections by experts. This innovative application empowers farmers and plant pathology specialists by providing real-time insights into the presence and severity of plant diseases. Consequently, timely interventions can be implemented to stop the spread of diseases, ultimately preventing substantial economic losses. Moreover, this application serves as a critical decision-making tool in agriculture, supporting the transition toward more sustainable practices. By enabling efficient and prompt diagnosis of plant diseases, the method can lead to a reduced reliance on chemical pesticides, fostering an environmentally friendly and sustainable agricultural production system.
The integration of the Internet of Things (IoT) into plant disease monitoring represents a transformative approach in agriculture, especially for crops like tomatoes that are vulnerable to various pathogens. IoT technology enables a real-time, automated, and comprehensive system for tracking and managing plant health by connecting a network of sensors, cameras, and communication devices that continuously monitor environmental and plant conditions. By deploying these IoT-connected devices in greenhouses and open fields, farmers can detect early signs of plant diseases and take preemptive measures, enhancing both productivity and sustainability in agricultural practices. This IoT-based disease diagnosis method, which operates efficiently even with limited data, provides critical real-time insights. By combining these data inputs, IoT systems can detect anomalies that indicate early stages of disease, even before symptoms become visible to the human eye. When combined with machine learning algorithms, IoT systems can analyze these patterns to improve disease prediction accuracy over time, adapting to varying environmental conditions and plant responses.
Furthermore, integrating IoT into disease monitoring enables a networked alert system, which is crucial for preventing disease outbreaks across regions. In cases where sensors detect signs of infection, the system can instantly notify farmers, greenhouse managers, or neighboring farms, prompting them to take action before the disease spreads. This interconnected alert mechanism supports faster response times, reducing the risk of widespread damage that might otherwise go unnoticed until it is too late.
In addition to diagnostics, IoT systems can link with autonomous control systems to activate disease-control protocols, such as targeted pesticide application, optimized watering schedules, or climate control adjustments within greenhouses. By minimizing human intervention, these IoT-enabled control systems ensure that interventions are precisely timed and tailored, reducing costs and environmental impacts associated with traditional disease management practices. IoT plays a pivotal role in revolutionizing plant disease monitoring by offering real-time, continuous monitoring capabilities, supporting early detection, enabling rapid-response alerts, and facilitating precision interventions. The ongoing collection and analysis of data through IoT devices not only enhances the immediate detection and control of plant diseases but also contributes to long-term agricultural research, leading to more resilient and sustainable crop management practices in the future.

5. Conclusions

In this study, deep feature extraction was used for one-shot and few-shot learning using cosine similarity to diagnose three types of tomato fungal diseases: Alternaria alternata, Alternaria solani, and Botrytis cinerea. Features were extracted from three categories of images: original images with background, images with the background removed, and images showing only the infected area (aka., symptoms). Deep feature extraction was performed using the ResNet-12 model, demonstrating promising results in diagnosing plant diseases with limited data. The diagnosis accuracy using only the infected area and the 4-way 1-shot learning method was 91.64, 92.37, 92.93, and 100% for Alternaria alternata, Alternaria solani, Botrytis cinerea, and healthy leaves, respectively. With the 4-way 3-shot learning method, the accuracy improved to 92.75, 95.07, 96.63, and 100% respectively. Therefore, the proposed framework can improve the accuracy of diagnosing fungal diseases in tomatoes, even with limited training data, thereby advancing existing plant diagnostic techniques. This approach could also be adapted to diagnose various plant diseases across different crops.

Author Contributions

All authors contributed to the study’s conception and design. Methodology, writing—original draft preparation was performed by S.M.J. Supervision was performed by A.B. The part of plant pathology was performed in consultation with K.R. Final reviewing and editing were performed by K.A.V. and Y.A., and all authors commented on previous versions of the manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data supporting the results of this study are available from the first author upon reasonable request.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

References

  1. Ferentinos, K.P. Deep learning models for plant disease detection and diagnosis. Comput. Electron. Agric. 2018, 145, 311–318. [Google Scholar] [CrossRef]
  2. Javidan, S.M.; Banakar, A.; Asefpour Vakilian, K.; Ampatzidis, Y.; Rahnama, K. Diagnosing the spores of tomato fungal diseases using microscopic image processing and machine learning. Multimed. Tools Appl. 2023, 83, 67283–67301. [Google Scholar] [CrossRef]
  3. Mohamadzamani, D.; Sajadian, S.; Javidan, S.M. Detection of Callosobruchus maculatus F. with image processing and artificial neural network. Appl. Entomol. Phytopathol. 2020, 88, 103–112. [Google Scholar] [CrossRef]
  4. Saleem, M.H.; Potgieter, J.; Arif, K.M. Plant disease detection and classification by deep learning. Plants 2019, 8, 468. [Google Scholar] [CrossRef] [PubMed]
  5. Pham, T.N.; Tran, L.V.; Dao SV, T. Early disease classification of mango leaves using feed-forward neural network and hybrid metaheuristic feature selection. IEEE Access 2020, 8, 189960–189973. [Google Scholar] [CrossRef]
  6. Javidan, S.M.; Banakar, A.; Asefpour Vakilian, K.; Ampatzidis, Y. A feature selection method using slime mould optimization algorithm in order to diagnose plant leaf diseases. In Proceedings of the 2022 8th Iranian Conference on Signal Processing and Intelligent Systems (ICSPIS), Behshahr, Iran, 28–29 December 2022. [Google Scholar] [CrossRef]
  7. Javidan, S.M.; Banakar, A.; Asefpour Vakilian, K.; Ampatzidis, Y. Tomato leaf diseases classification using image processing and weighted ensemble learning. Agron. J. 2024, 116, 1029–1049. [Google Scholar] [CrossRef]
  8. Jiang, P.; Chen, Y.; Liu, B.; He, D.; Liang, C. Real-time detection of apple leaf diseases using deep learning approach based on improved convolutional neural networks. IEEE Access 2019, 7, 59069–59080. [Google Scholar] [CrossRef]
  9. Sujatha, R.; Chatterjee, J.M.; Jhanjhi, N.; Brohi, S.N. Performance of deep learning vs machine learning in plant leaf disease detection. Microprocess. Microsyst. 2021, 80, 103615. [Google Scholar] [CrossRef]
  10. Angayarkanni, D.; Jayasimman, L. Recognition of disease in leaves using genetic algorithm and neural network based feature selection. Indian J. Sci. Technol. 2023, 16, 1444–1452. [Google Scholar] [CrossRef]
  11. Massah, J.; Asefpour Vakilian, K.; Shabanian, M.; Shariatmadari, S.M. Design, development, and performance evaluation of a robot for yield estimation of kiwifruit. Comput. Electron. Agric. 2021, 185, 106132. [Google Scholar] [CrossRef]
  12. Argüeso, D.; Picon, A.; Irusta, U.; Medela, A.; San-Emeterio, M.G.; Bereciartua, A.; Alvarez-Gila, A. Few-shot learning approach for plant disease classification using images taken in the field. Comput. Electron. Agric. 2020, 175, 105542. [Google Scholar] [CrossRef]
  13. Li, Y.; Chao, X. Semi-supervised few-shot learning approach for plant diseases recognition. Plant Methods 2021, 17, 18. [Google Scholar] [CrossRef] [PubMed]
  14. Javidan, S.M.; Banakar, A.; Asefpour Vakilian, K.; Ampatzidis, Y.; Rahnama, K. Early detection and spectral signature identification of tomato fungal diseases (Alternaria alternata, Alternaria solani, Botrytis cinerea, and Fusarium oxysporum) by RGB and hyperspectral image analysis and machine learning. Heliyon 2024, 10, e38017. [Google Scholar] [CrossRef] [PubMed]
  15. Song, R.; Zhang, Z.; Liu, H. Edge connection based Canny edge detection algorithm. Pattern Recognit. Image Anal. 2017, 27, 740–747. [Google Scholar] [CrossRef]
  16. Fadzli WM, R.W.; Dak, A.Y.; Razak, T.R. A survey on various edge detection techniques in image processing and applied disease detection. J. Comput. Res. Innov. 2024, 9, 23–32. [Google Scholar] [CrossRef]
  17. Al-Shahrani, A.; Al-Amoudi, W.; Bazaraah, R.; Al-Sharief, A.; Farouquee, H. An image processing-based and deep learning model to classify brain cancer. Eng. Technol. Appl. Sci. Res. 2024, 14, 15433–15438. [Google Scholar] [CrossRef]
  18. Sarwinda, D.; Paradisa, R.H.; Bustamam, A.; Anggia, P. Deep learning in image classification using residual network (resnet) variants for detection of colorectal cancer. Procedia Comput. Sci. 2021, 179, 423–431. [Google Scholar] [CrossRef]
  19. Kern, R.; Al-Ubaidi, T.; Sabol, V.; Krebs, S.; Khodachenko, M.; Scherf, M. Astro- and geoinformatics–visually guided classification of time series data. In Knowledge Discovery in Big Data from Astronomy and Earth Observation; Elsevier: Amsterdam, The Netherlands, 2020; pp. 267–282. [Google Scholar] [CrossRef]
  20. Singh, D.; Singh, B. Investigating the impact of data normalization on classification performance. Appl. Soft Comput. 2020, 97, 105524. [Google Scholar] [CrossRef]
  21. Fan, Y.; Li, Y.; Zhu, A. A Few-shot Learning algorithm based on attention adaptive mechanism. J. Phys. Conf. Ser. 2021, 1966, 012011. [Google Scholar] [CrossRef]
  22. Wang, H.; Tian, S.; Fu, Y.; Zhou, J.; Liu, J.; Chen, D. Feature augmentation based on information fusion rectification for few-shot image classification. Sci. Rep. 2023, 13, 3607. [Google Scholar] [CrossRef]
  23. Lahitani, A.R.; Permanasari, A.E.; Setiawan, N.A. Cosine similarity to determine similarity measure: Study case in online essay assessment. In Proceedings of the 2016 4th International Conference on Cyber and IT Service Management, Bandung, Indonesia, 26–27 April 2016. [Google Scholar] [CrossRef]
  24. Rajput, A.S.; Shukla, S.; Thakur, S.S. Cosine similarity measures of (m, n)-rung orthopair fuzzy sets and their applications in plant leaf disease classification. Symmetry 2023, 15, 1385. [Google Scholar] [CrossRef]
  25. Javidan, S.M. Identifying plant pests and diseases with artificial intelligence: A short comment. Int. J. Eng. Technol. Inform. 2023, 4, 1–2. [Google Scholar] [CrossRef]
  26. Mohammadi, P.; Asefpour Vakilian, K. Machine learning provides specific detection of salt and drought stresses in cucumber based on miRNA characteristics. Plant Methods 2023, 19, 123. [Google Scholar] [CrossRef] [PubMed]
  27. de Andrade Porto, J.V.; Dorsa, A.C.; de Moraes Weber, V.A.; de Andrade Porto, K.R.; Pistori, H. Usage of few-shot learning and meta-learning in agriculture: A literature review. Smart Agric. Technol. 2023, 5, 100307. [Google Scholar] [CrossRef]
  28. Lin, H.; Tse, R.; Tang, S.-K.; Qiang, Z.; Pau, G. Few-shot learning for plant-disease recognition in the frequency domain. Plants 2022, 11, 2814. [Google Scholar] [CrossRef]
  29. Saad, M.H.; Salman, A.E. A plant disease classification using one-shot learning technique with field images. Multimed. Tools Appl. 2023, 83, 58935–58960. [Google Scholar] [CrossRef]
  30. Javidan, S.M.; Banakar, A.; Asefpour Vakilian, K.; Ampatzidis, Y. Diagnosis of grape leaf diseases using automatic K-means clustering and machine learning. Smart Agric. Technol. 2023, 3, 100081. [Google Scholar] [CrossRef]
  31. Javidan, S.M.; Banakar, A.; Rahnama, K.; Asefpour Vakilian, K.; Ampatzidis, Y. Feature engineering to identify plant diseases using image processing and artificial intelligence: A comprehensive review. Smart Agric. Technol. 2024, 8, 100480. [Google Scholar] [CrossRef]
  32. Borhani, Y.; Khoramdel, J.; Najafi, E. A deep learning based approach for automated plant disease classification using vision transformer. Sci. Rep. 2022, 12, 11554. [Google Scholar] [CrossRef]
  33. Wu, Q.; Ma, X.; Liu, H.; Bi, C.; Yu, H.; Liang, M.; Zhang, J.; Li, Q.; Tang, Y.; Ye, G. A classification method for soybean leaf diseases based on an improved ConvNeXt model. Sci. Rep. 2023, 13, 19141. [Google Scholar] [CrossRef]
  34. Prasad, K.V.; Vaidya, H.; Rajashekhar, C.; Karekal, K.S.; Sali, R.; Nisar, K.S. Multiclass classification of diseased grape leaf identification using deep convolutional neural network (DCNN) classifier. Sci. Rep. 2024, 14, 9002. [Google Scholar] [CrossRef] [PubMed]
  35. Brahimi, M.; Boukhalfa, K.; Moussaoui, A. Deep learning for tomato diseases: Classification and symptoms visualization. Appl. Artif. Intell. 2017, 31, 299–315. [Google Scholar] [CrossRef]
  36. Rangarajan, A.K.; Purushothaman, R.; Ramesh, A. Tomato crop disease classification using pre-trained deep learning algorithm. Procedia Comput. Sci. 2018, 133, 1040–1047. [Google Scholar] [CrossRef]
  37. Karthik, R.; Hariharan, M.; Anand, S.; Mathikshara, P.; Johnson, A.; Menaka, R. Attention embedded residual CNN for disease detection in tomato leaves. Appl. Soft Comput. 2020, 86, 105933. [Google Scholar] [CrossRef]
  38. Chen, X.; Zhou, G.; Chen, A.; Yi, J.; Zhang, W.; Hu, Y. Identification of tomato leaf diseases based on combination of ABCK-BWTR and B-ARNet. Comput. Electron. Agric. 2020, 178, 105730. [Google Scholar] [CrossRef]
  39. Nazari, K.; Ebadi, M.J.; Berahmand, K. Diagnosis of alternaria disease and leafminer pest on tomato leaves using image processing techniques. J. Sci. Food Agric. 2022, 102, 6907–6920. [Google Scholar] [CrossRef]
  40. Zeng, W. Image data augmentation techniques based on deep learning: A survey. Math. Biosci. Eng. 2024, 21, 6190–6224. [Google Scholar] [CrossRef]
  41. Yao, J.; Tran, S.N.; Sawyer, S.; Garg, S. Machine learning for leaf disease classification: Data, techniques and applications. Artif. Intell. Rev. 2023, 56, 3571–3616. [Google Scholar] [CrossRef]
  42. Sarkar, C.; Gupta, D.; Gupta, U.; Hazarika, B.B. Leaf disease detection using machine learning and deep learning: Review and challenges. Appl. Soft Comput. 2023, 145, 110534. [Google Scholar] [CrossRef]
  43. Jain, S.; Jaidka, P.; Jain, V. Plant leaf disease classification using deep learning based hybrid approach. In Proceedings of the 2023 International Conference on Communication, Security and Artificial Intelligence (ICCSAI), Greater Noida, India, 23–25 November 2023. [Google Scholar] [CrossRef]
  44. Moghadam, P.; Ward, D.; Goan, E.; Jayawardena, S.; Sikka, P.; Hernandez, E. Plant disease detection using hyperspectral imaging. In Proceedings of the 2017 International Conference on Digital Image Computing: Techniques and Applications (DICTA), Sydney, NSW, Australia, 29 November–1 December 2017. [Google Scholar] [CrossRef]
  45. Abdulridha, J.; Batuman, O.; Ampatzidis, Y. UAV-based remote sensing technique to detect citrus canker disease utilizing hyperspectral imaging and machine learning. Remote Sens. 2019, 11, 1373. [Google Scholar] [CrossRef]
  46. Feng, L.; Wu, B.; He, Y.; Zhang, C. Hyperspectral imaging combined with deep transfer learning for rice disease detection. Front. Plant Sci. 2021, 12, 693521. [Google Scholar] [CrossRef] [PubMed]
  47. Albattah, W.; Nawaz, M.; Javed, A.; Masood, M.; Albahli, S. A novel deep learning method for detection and classification of plant diseases. Complex Intell. Syst. 2021, 8, 507–524. [Google Scholar] [CrossRef]
  48. Zhang, X.; Vinatzer, B.A.; Li, S. Hyperspectral Imaging Analysis for the Early Detection of Tomato Bacterial Leaf Spot Disease; Research Square Platform LLC: Durham, NC, USA, 2023. [Google Scholar] [CrossRef]
  49. Qi, H.; Li, H.; Chen, L.; Chen, F.; Luo, J.; Zhang, C. Hyperspectral imaging using a convolutional neural network with transformer for the soluble solid content and pH prediction of cherry tomatoes. Foods 2024, 13, 251. [Google Scholar] [CrossRef] [PubMed]
Figure 1. The schematics of the proposed method for diagnosing tomato diseases.
Figure 1. The schematics of the proposed method for diagnosing tomato diseases.
Agriengineering 06 00238 g001
Figure 2. The preprocessing steps involved in analyzing plant images for disease detection. The processes include the following: (a) Original image, (b) extraction of the green color band from the image, (c) edge detection, (d) morphological dilation to connect the edges, (e) filling in the blanks in the edge image, (f) noise removal, (g) background removal, and (h) infected area extraction.
Figure 2. The preprocessing steps involved in analyzing plant images for disease detection. The processes include the following: (a) Original image, (b) extraction of the green color band from the image, (c) edge detection, (d) morphological dilation to connect the edges, (e) filling in the blanks in the edge image, (f) noise removal, (g) background removal, and (h) infected area extraction.
Agriengineering 06 00238 g002
Figure 3. The tomato fungal diseases investigated in this research along with their symptom descriptions.
Figure 3. The tomato fungal diseases investigated in this research along with their symptom descriptions.
Agriengineering 06 00238 g003aAgriengineering 06 00238 g003b
Figure 4. Feature extraction using pre-training ResNet-12.
Figure 4. Feature extraction using pre-training ResNet-12.
Agriengineering 06 00238 g004
Figure 5. Four-way one-shot learning, (a) original image with background, (b) removed background, and (c) infected area.
Figure 5. Four-way one-shot learning, (a) original image with background, (b) removed background, and (c) infected area.
Agriengineering 06 00238 g005
Figure 6. Results of one-shot learning for classifying three tomato diseases and healthy leaves.
Figure 6. Results of one-shot learning for classifying three tomato diseases and healthy leaves.
Agriengineering 06 00238 g006
Figure 7. Four-way three-shot learning, (a) Original image with background, (b) removed background, and (c) infected area detected.
Figure 7. Four-way three-shot learning, (a) Original image with background, (b) removed background, and (c) infected area detected.
Agriengineering 06 00238 g007
Figure 8. Results of few-shot learning for classifying three tomato diseases and healthy leaves.
Figure 8. Results of few-shot learning for classifying three tomato diseases and healthy leaves.
Agriengineering 06 00238 g008
Table 1. A comparison of available methods for tomato fungal disease detection.
Table 1. A comparison of available methods for tomato fungal disease detection.
DatasetMethodDisease TypeAccuracyReference
PlantVillageCNNTomato fungal, viral, and bacterial diseases99%[35]
PlantVillageAlexNetTomato fungal diseases97%[36]
PlantVillageVGG NetTomato fungal, viral, and bacterial diseases97%[36]
PlantVillageResidual CNNTomato fungal, viral, and bacterial diseases98%[37]
Hunan Vegetable InstituteB-ARNetTomato fungal, viral, and bacterial diseases89%[38]
PlantVillageANFISTomato fungal, viral, and bacterial diseases98%[39]
Prepared in this workFew-shot learningTomato fungal diseases96%Proposed method
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Javidan, S.M.; Ampatzidis, Y.; Banakar, A.; Asefpour Vakilian, K.; Rahnama, K. Tomato Fungal Disease Diagnosis Using Few-Shot Learning Based on Deep Feature Extraction and Cosine Similarity. AgriEngineering 2024, 6, 4233-4247. https://doi.org/10.3390/agriengineering6040238

AMA Style

Javidan SM, Ampatzidis Y, Banakar A, Asefpour Vakilian K, Rahnama K. Tomato Fungal Disease Diagnosis Using Few-Shot Learning Based on Deep Feature Extraction and Cosine Similarity. AgriEngineering. 2024; 6(4):4233-4247. https://doi.org/10.3390/agriengineering6040238

Chicago/Turabian Style

Javidan, Seyed Mohamad, Yiannis Ampatzidis, Ahmad Banakar, Keyvan Asefpour Vakilian, and Kamran Rahnama. 2024. "Tomato Fungal Disease Diagnosis Using Few-Shot Learning Based on Deep Feature Extraction and Cosine Similarity" AgriEngineering 6, no. 4: 4233-4247. https://doi.org/10.3390/agriengineering6040238

APA Style

Javidan, S. M., Ampatzidis, Y., Banakar, A., Asefpour Vakilian, K., & Rahnama, K. (2024). Tomato Fungal Disease Diagnosis Using Few-Shot Learning Based on Deep Feature Extraction and Cosine Similarity. AgriEngineering, 6(4), 4233-4247. https://doi.org/10.3390/agriengineering6040238

Article Metrics

Back to TopTop