ISSN: E 2347-226X, P 2319-9857

All submissions of the EM system will be redirected to Online Manuscript Submission System. Authors are requested to submit articles directly to Online Manuscript Submission System of respective journal.

Identifying and Predicting Pests on Tea Leafs using Image Processing

Majid Ashouri*, Vahid Rostami

Department of Electrical, Computer, IT and Biomedical Engineering, Islamic Azad Unievrsity, Qazvin Branch, Iran

*Corresponding Author:
Majid Ashouri
Department of Electrical,
Computer, IT and Biomedical Engineering,
Islamic Azad Unievrsity, Qazvin Branch,
Iran
E-mail: majidashoori65@gmail.com

Received: 24-May-2024, Manuscript No. JAAS-24-137174; Editor assigned: 27-May-2024, PreQC No. JAAS-24-137174 (PQ); Reviewed: 10-Jun-2024, QC No. JAAS-24- 137174; Revised: 03-Jan-2025, Manuscript No. JAAS-24-137174 (R); Published: 10-Jan-2025, DOI: 10.4172/2347-226X.14.1.003

Citation:Ashouri M, et al. Identifying and Predicting Pests on Tea Leafs using Image Processing. J Agri Allied Sci. 2025;14:003.

Copyright: © © 2025 Ashouri M, et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution and reproduction in any medium, provided the original author and source are credited.

Visit for more related articles at Research & Reviews: Journal of Agriculture and Allied Sciences

Abstract

Quality serves as the paramount factor for success in the global market export arena, thus it becomes crucial to mechanize and employ intelligent methods for identification and detection of pests in the leaves of agriculture products. It is important to ensure high quality production and timely control of pests in goods ready for export. To achieve this objective, various activities are being pursued, including the development of a system for detecting and identifying pests in the mentioned plant. This paper addresses a system that involves maintaining a database of photos depicting both healthy and infested plants in the leaf area, which are continuously monitored through CCTV cameras or robots. The captured images are then sent to a central server, where the proposed method recognizes the type of pest. One of the keys aims of this system is to establish HAAR-wavelet transform in color and the shape of the tea leaf diseases, which is the timely diagnosis of the diseases and reduce the error rate in diagnosis. Ultimately, this approach applied boosting classifier to identify pests in the leaf areas. The proposed method has been evaluated using created database and the recognition rate 93.7% in experimental results on this dataset shows that can be comparison with former approaches.

Keywords

Pest; Tea leaf; Image processing; Diagnosis; Plant

INTRODUCTION

The primary method for detecting plant pests is through visual observations made by experts, relying on their naked eye. However, this approach necessitates continuous monitoring by these experts, leading to high costs, particularly on large farms [1]. Moreover, in certain developing countries, farmers may face challenges in traveling long distances and communicating with experts, incurring additional time and financial expenses. Consequently, automatic detection of plant diseases has emerged as a crucial research topic, aiming to monitor a significant quantity of products and promptly identify disease signs and symptoms upon their emergence [2]. Therefore, xploring a rapid, automated, cost-effective and accurate method for diagnosing plant diseases becomes highly important.

Utilizing machine learning to diagnose and recognize plant diseases can offer valuable insights for early-stage identification and treatment. In contrast, visually identifying plant diseases proves to be costly, inefficient and challenging, necessitating the expertise of trained specialists and botanists. In the contemporary world, the prevalence of image processing applications is steadily growing [3]. Pest management poses a formidable challenge, as the precise quantification of pests has not been extensively studied and explored. Consequently, there is an increasing demand for comprehending intricate images and patterns [4].

In biological sciences, it is not uncommon to generate thousands of photographs during a single experiment. These images can be utilized for various purposes, such as waste classification and calculating the areas consumed by insects. Currently, most of these tasks are performed manually or with software packages, though this is not sufficient. To conduct complex experiments, biologists often require efficient computer software capable of automatically analyzing the content [5]. In this context, image processing plays a crucial role and a comprehensive review has been conducted to assess the advancements in different image processing techniques. It is worth noting that the application of image processing in agriculture has received relatively less research attention, despite its potential in this field [6]. The current study aims to explore the applications of image processing in identifying and eliminating pests, to raise awareness and promote its adoption in this domain. Today, image processing has experienced significant advancements and widespread usage [7]. The primary focus of this article revolves around the utilization of image processing in agriculture, specifically in detecting pests and diseases affecting tea leaves. The objective is to develop a system that can effectively detect and identify pests in tea plants. This system maintains a comprehensive database of photographs depicting healthy and infested plants in the leaf area. The plants are continuously monitored using CCTV cameras or robots throughout a specified period. Once the images are sent to the central server, the machine compares and recognizes the type of pest present.

One of the key goals of this system is to enable timely diagnosis of diseases affecting tea leaves reduce errors in diagnosis, and provide treatment recommendations for farmers. Ultimately, the aim is to enhance the quality of tea leaves for export, considering the high value of this product.

Innovation in the field of pest detection and prediction on tea leaves is achieved through the application of image processing techniques. This approach leverages artificial intelligence and deep learning methodologies to detect and identify pests effectively. By utilizing cameras and imaging systems, images of tea leaves are captured. Subsequently, image processing algorithms are employed to identify and diagnose the presence of pests on the leaves. These algorithms analyze specific characteristics of the pests, such as shape, color and patterns on the leaves, enabling the separation of pests from healthy foliage. Once the pests are identified, machine learning algorithms can be utilized to predict and prevent their occurrence. Deep learning models, trained on data collected from leaf and pest images, can identify patterns in pests and anticipate the leaves on which pests are likely to appear, based on environmental conditions and pest characteristics. The utilization of image processing and deep learning techniques for pest identification and prediction in tea leaves offers significant advantages. It enables automated and rapid pest detection, facilitating prompt measures to prevent their spread. Furthermore, this approach reduces the reliance on chemical pesticides and solvents, thereby contributing to environmental preservation.

MATERIALS AND METHODS

Image pre-processing

Typically, pre-processing involves extracting the brightness value of a pixel in the output image by examining a small neighborhood surrounding the corresponding pixel in the input image. This operation is commonly referred to as filtering. Pre-processing tasks encompass image reconstruction and geometric correction of data, which may be necessary due to variations in scene lighting, display geometry and environmental conditions. By performing these operations, the image quality is significantly enhanced before undergoing the main processing steps. In the context of pest detection, the application of image pre-processing techniques can be highly advantageous in noise removal and improving the method's accuracy [8]. Numerous pre-processing techniques exist, each with specific applications depending on the method employed and the type of distortions present in the image.

Histogram

The image histogram is a graphical representation that indicates the frequency or count of pixels for each brightness level in the input image. The histogram chart displays the gray levels along the horizontal axis, typically ranging from zero (representing absolute darkness) to 255 (representing absolute brightness). The vertical axis represents the number of pixels related to each specific gray level in the image. The histogram serves as a valuable tool for various spatial domain processing techniques. Manipulating the histogram is employed to enhance image quality [9]. Additionally, the histogram proves highly beneficial in image processing applications like image compression and segmentation.

Histogram processing offers cost-effective calculations for both software and hardware implementations, making it an ideal tool for real-time image processing. It provides valuable insights into the image, aiding tasks such as auto-focusing in digital cameras and improving contrast in dark, bright, and low-contrast images. Figure 1 illustrates the histogram processing for different intensity conversions.

Figure 1. Four windows from different points of an image, the original image (left) and their corresponding histogram (middle,) and a modified image (right).

In images with low brightness, the significant elements of the histogram are concentrated in the lower intensity range. Similarly, in bright images, the important components of the histogram are concentrated in the higher intensity range.

A low-contrast image exhibits a histogram that primarily focuses on the brightness of pixels near the middle of the intensity scale. Conversely, a high-contrast image displays histogram components covering a wide range of the brightness intensity scale, resulting in a relatively uniform distribution of pixel frequencies. Accordingly, an image with pixels occupying a broad range of brightness levels will have auniform histogram, indicating high contrast [10].

Image texture

Texture refers to characterizing of a set of pixels based on their local statistical properties. It provides insights into the nonmorphological features in an image. Texture analysis holds great promise for detecting pests on leaves. It involves measuring various characteristics, such as smoothness, roughness, regularity, directional variations and regular differences across different surfaces. Texture extraction and classification find numerous applications in image processing and machine vision [11]. Some examples include object detection in medical or ultrasound images, object tracking in videos, quality assessment in industrial settings and analysis of remote sensing images.

Texture can be defined as a function of spatial changes in the brightness intensity of pixels. While humans can easily recognize texture, it poses complexities in the context of machine vision and image processing [12]. One of the texture analyses is in the statistical methods.

Statistical methods

Texture information is obtained by analyzing the statistical properties of pixels, which represents one of the initial methods for extracting texture [13]. This includes employing first and second-order statistical descriptors that operate on the gray-level values of the image pixels. Another statistical approach utilizes the image histogram to extract texture information [14]. Additionally, other statistical methods commonly employ the adjacency matrix to extract texture features.

Wavelet transform

Wavelet analysis, built upon extensive research in harmonic analysis, is considered a remarkable accomplishment in pure mathematics. Over the years, it has found significant applications in various fields of science and engineering, opening up new possibilities for understanding its mathematical foundations and expanding its practical implementations. Texture analysis and classification, the wavelet transform holds a crucial position [15]. This transform breaks down an image into a low-resolution image and multiple detail images. The effectiveness of this transformation is primarily attributed to its ability to accurately represent one-dimensional piecewise smoothing functions. Wavelet transforms excel at capturing singular points, further enhancing their utility.

Wavelet analysis, similar to Fourier analysis, involves expanding functions; however, this expansion is carried out using wavelets. A wavelet is a specific function assumed to have zero mean, and the expansion occurs based on the transitions of this function. Unlike trigonometric polynomials, wavelets are examined locally in space, establishing a closer relationship between certain functions and their coefficients. This approach enables improved numerical stability in reconstruction and calculations [16]. By formulating applications that traditionally rely on the fast Fourier transform using wavelets, it becomes possible to obtain more localized spatial information. This has implications for signal and image processing and the development of fast numerical algorithms for integral operators. The convenience and simplicity of wavelet analysis have led to the creation of efficient coding chips for signal and image compression [17]. Currently, wavelet analysis has found diverse applications, including medical imaging and CT scans, segmentation of brain tissues in magnetic resonance images, automatic detection of micro-calcification clusters, analysis of magnetic resonance spectral images and functions [18,19] and even the detection of pests on tea leaves in leaf areas.

The wavelet transform is formed by a pair of low-pass and high-pass filters, sequentially applied to the signal. At each stage, the low scales of the transformed images capture the details and high-frequency components, while the higher scales represent the overall features and low-frequency components.

Classification

During the classification process, individual data points are allocated to specific classes based on the extracted features. Classifiers of different types are employed to establish class models and make classification decisions. In the train phase, the boundaries of each class are defined based on the train data. The method for determining these boundaries varies depending on the strategy employed by the classifier [20]. During the testing phase, the class to which a data point belongs is determined by evaluating its position related to the defined boundaries.

Support vector machine: Support Vector Machine (SVM) is a supervised classification algorithm employed for both classification and regression tasks [21]. This method is considered relatively modern and has demonstrated superior performance compared to older approaches in recent years. SVM is widely utilized in classification problems and uses a technique called kernel trick to transform the data. By applying this transformation, SVM identifies the optimal boundary that separates different output categories. In simpler terms, it performs intricate transformations on the data and then determines how to separate the data based on predefined labels or outputs effectively. The core principle of SVM is to linearly classify the data, aiming to select a line with a higher margin of confidence in separating the data points [22].

Thresholding

In grayscale images, the pixel values range from 0 to 255 i.e., if the middle value, which is 128, is taken into account, the resulting grayscale image will neither be too dark nor too bright. Figure 2 illustrates how the pixel values of a grayscale image can be displayed on a graph.

Figure 2. Applying thresholding 128 on the pest image.

And the image becomes darker as the thresholding value rises (Figure 3):

Figure 3. Grayscale image.

As depicted in the aforementioned graph, grayscale images exhibit a spectrum. However, the question arises: Why do we apply thresholding to grayscale images? When thresholding is applied to an image, it results in a binary image where pixels in the lighter half are white or light, while pixels in the darker half are black or dark. This effectively transforms the image into a black-and-white representation (Figure 4).

Figure 4. The selection of pest location by the appropriate window

Figure 2 illustrates the application of this technique to an infected image. As observed in the aforementioned Figure 2 (thresholding technique), the image transforms to a binary format using this tool. The purpose of thresholding the image is twofold: Firstly, it reduces the image size, and secondly, it enhances the processing speed of the images. However, it is important to note that this method has a significant drawback, which is the potential decrease in photo quality. Altering the threshold value will result in a corresponding change in the output leaves accurately. The approach involves utilizing features, specifically 8 × 5 features for each image block. Since the number of features is relatively small, there is no need for a feature reduction step. The proposed algorithm comprises several stages, including pre-processing, feature extraction, which incorporates a two-level wavelet transform stage and statistical feature extraction, the utilization of a classifier (SVM), and data validation. The article concludes by presenting the obtained results and displaying the output images.

Introducing the databases

Due to the absence of a standardized database for tea leaf pests and the crucial need for such a database to validate the results, this article focuses on creating a standardized database specifically for tea leaf pests.

Database preparation

To enable learning algorithms to detect the location of pests, a specialized program was designed in this study. This program processed a collection of photos, including images from healthy gardens and those from gardens with a sufficient number of pests. By analyzing these photos, windows corresponding to the pests were identified by selecting regions from the healthy parts of the images. Each window's X and Y coordinates were then stored in a text file as a cell variable. Choosing the Cell variable was advantageous as it could accommodate varying volumes and numbers of variables, considering the differing number of pests in different images. The images captured from the gardens exhibited diverse qualities due to variations in time frames and camera equipment. The highest-quality image had dimensions of 1920 × 2560, while the lowest-quality image, sourced from the internet, had dimensions of 488 × 435. The photos were taken in favorable conditions, characterized by sunny weather, clarity, and minimal noise. Consequently, there was no need for noise removal techniques to be applied to the images. The initial step involved selecting the infested areas using appropriate windows. This process entailed recording the X and Y coordinates of the infested areas for all the photos.

The second step involves identifying and saving all the X and Y coordinates corresponding to the selected regions with pests, as shown in the previous Figure 3. In the given example, the Table 1 indicates a total of nine points, each consisting of two components: the starting area and the selected end area.

Table 1. The selected points of infested areas in database preparation.

In the third step, based on the points selected in the previous phase, the computer program colorizes the infested areas of the leaves, allowing for precise and distinct separation. This process is conducted for all the photos, serving as the learning and practice phase for the system.

RESULTS AND DISCUSSION

Pre-processing

The database of images used in this study exhibits variations in quality due to differences in camera equipment and resolutions. This variability in image dimensions and occasional low-quality images can be considered a weakness of the database. Additionally, the high dimensions of certain images pose a challenge as they significantly increase the computational load required for pest localization. However, based on the algorithm employed, excessively high image quality is unnecessary for accurate pest identification.

To address these challenges, several pre-processing steps were implemented on the images. These steps aimed to minimize additional computational requirements during processing and ensure that the images used in subsequent stages were of optimal quality and processed efficiently.

The initial step in the pre-processing phase involved standardizing the dimensions of the images. To achieve this, images with dimensions exceeding the permissible limit were resized to 600 × 800, ensuring consistent image sizes for all calculations.

The subsequent step focused on histogram normalization or brightness adjustment in the images. Due to the utilization of energy-based algorithms and corresponding functions in the proposed algorithm, it was essential to ensure that the pixel brightness values in the images ranged from 0 to 255. To achieve this, linear histogram correction was employed considering the image conditions and the outdoor environment where the photos were taken. By applying a simple linear mapping technique, the maximum brightness in each image was mapped to 255, and the minimum brightness was mapped to zero. Through this mapping process, a linear equation was derived, along with the corresponding slope coefficient, to map all the pixels in the image to values between 0 and 255. Finally, the resulting values were appropriately stored in the 8-bit space. The significance of histogram equalization is demonstrated in Figures 5 and 6, where an image from the database is presented alongside its corresponding histogram before and after correction. This visual representation allows readers to understand the concept of histogram equalization and its impact on image quality.

Figure 5. The image of the sample database along with its histogram before modification.

Figure 6. The image of the sample database along with its histogram after modification.

Following this step, considering the project's objective of working with leaf pests, it can be inferred that the green color is of greater importance in the images. To achieve this objective, a color filter was employed during the transformation of the image to grayscale. This filter prioritized the green channel as the primary component while reducing the contribution of the red and blue channels. The combined values of the red and blue channels were considered as the magnitude of the green channel. The filtering process and its impact are illustrated in Figure 7. In the resulting image, the background color appears bolder due to a lower presence of green color, resulting in reduced brightness. Conversely, the green and white parts appear brighter as they contain a higher proportion of green color compared to the rest of the image. This brightness difference is evident when comparing the images before and after applying the color filter.

Figure 7. The gray images of sample leaves before and after applying filtering.

Feature extraction

The feature extraction stage is crucial in all detection algorithms. If an incorrect feature is selected, it will undoubtedly lead to inaccurate results or incorrectness in the classification phase. To address this challenge, various methods used in the diagnosis of diseases in color medical images were employed, considering the distinct nature of working with tea and medical sample images. The wavelet transform approach was chosen among the feature extraction methods due to its widespread usage and reliability demonstrated in numerous articles. In the proposed method, the initial step involved applying a wavelet transform to the image, extracting different information levels in horizontal, vertical, diagonal and approximate channels. Subsequently, the statistical features of these transformed images were extracted using five conventional statistical operators. This extraction process was performed by windowing different parts of the image. After obtaining these features and employing an appropriate mapping technique, the classifier was trained to identify pests of various categories based on the distinctive features. The train process resulted in highly accurate pest extraction.

This approach was effective because pests disrupt the normal texture of the leaf and the extracted features were based on changes in pixel texture. Hence, regardless of the pest type, the features could correctly identify the pest's location. It is important to note that if a pest has a color other than green, it will manifest as a disruption in the green leaf texture during the color filtering process and therefore, this aspect is emphasized again.

Wavelet transforms: The wavelet transform has emerged as a highly suitable alternative to Fourier transform and other fixed-frequency-based transforms in various applications of disease diagnosis in medicine, as well as signal and image processing. Its effectiveness lies in its capability to simultaneously detect time-varying frequency changes. Wavelet transform offers several advantages in extracting detailed information from different high and low-frequency bands of an image. Moreover, it allows for setting different frequency ranges based on variations in color components and the corresponding frequency characteristics of the image. This flexibility in frequency selection makes the wavelet transform well-suited for identifying pest-infested regions in images.

The use of wavelet transform in applications like medical engineering and disease diagnosis poses one main challenge, determining the optimal number of wavelets transform levels and the choice of the wavelet mother function as the algorithm's foundation. The selection of the mother transformation function and the number of levels significantly impact the accuracy and effectiveness of the proposed method.

In certain applications, the dimensions of the window utilized in the wavelet transform are also of great importance. However, constant window size has been considered in the proposed method. This decision was made due to the uncertainty regarding the size of pests in leaf images, as they can vary greatly from small dimensions to larger areas. By default, the window size was set to 48 × 48. This choice was based on previous applications in medical engineering and the consideration that it would be suitable for applying two levels of analysis. Additionally, the selected window dimensions were aligned with the minimum size of pests, taking into account the image quality. It is important to note that for pests such as the leaf-eating mite, which may occupy a significant portion of the image, non-overlapping windows of size 48 × 48 would be able to accurately identify the pest's location with reasonably good precision.

Based on the given descriptions, various wavelet functions in the MATLAB software that operate in two dimensions were utilized. Ultimately, the function and level count that yielded greater precision were chosen for the simulation and implementation of the proposed algorithm.

The transformations conducted encompassed Daubechies (level 1-45), Coiflets (level 1-5), Symlets (level 2-45), and Haar. Among these functions, Haar's Wavelet algorithm yielded the most favorable outcome in terms of accuracy and distinction, as observed visually. To highlight the significance and impact of selecting the mother wavelet function for a sample image, Figures 8-11 depict the two-dimensional wavelet output using the Haar and 4 Daubechies algorithms, demonstrating the superior ability of the Haar algorithm to extract fine details.

Figure 8. Wavelet output with Haar mother function in four horizontal-vertical-diagonal channels on the surface.

Figure 9. Wavelet output with Haar mother function in four horizontal-vertical-diagonal channels on the surface.

Figure 10. Violet output with Daubechies mother function in four horizontal-vertical-diagonal channels at level 2.

Figure 11. Violet output with Daubechies mother function in four horizontal-vertical-diagonal channels at level 2.

After evaluating the results of the Wavelet Haar algorithm in the output images, it is chosen as the most suitable algorithm. By closely examining the various levels of wavelet in the horizontal and vertical channels (ch and cv), the image in both levels of wavelet Haar exhibited clear details, whereas this was not the case in the outputs of wavelet 4 Daubechies. Two levels were sufficient considering the number of wavelet levels, as no valuable information was obtained beyond the third level. To demonstrate this, a sample image of the third level of wavelet generated using the Haar algorithm was included, which illustrates that the wavelet output does not contain useful information beyond the second level.

When examining the output of the third level of the wavelet transform using the Haar algorithm, it becomes evident that it lacks essential information, particularly in the general, horizontal, and diagonal channels. Figure 12 highlights the distortion in the image at the third level. Furthermore, considering a window size of 48 × 48, the output dimensions at the third level are significantly smaller, reaffirming that two levels are entirely adequate.

Figure 12. Information display of three levels of wavelet transform of a sample image using HAAR algorithm.

Extracting statistical features: The preceding sections determined the appropriate mother function of the wavelet, also known as the wavelet filter, and the optimal number of levels in the wavelet transform by specifying these two indeterminate parameters in the two-dimensional wavelet transform, a total of 8 main images were generated. These images have consistent dimensions at both the first and second levels. The focus of attention lies in identifying the locations of pests within these eight wavelet output images, which encompass approximate details, and horizontal, vertical, and diagonal channels of the original image.

Examining the shapes depicted in Haar's wavelet transform levels, it becomes evident that pests manifest as ridges or subtle changes in the wavelet transform's horizontal, vertical and diagonal channels. Considering this energy disparity between pest-infested areas and normal regions in the image features capable of capturing these energy variations will be used. Therefore, for training the algorithm, operators based on energy and pixel changes in the image prove to be more suitable.

Another crucial aspect regarding the chosen operator is that, given the uncertainty surrounding the size of pest tissue, the pests in the image can possess varying dimensions. Thus, the features should not rely on size and must offer consistent dimensions across all outputs. This ensures that the classifier can be trained using the same operator and dimensions in subsequent steps.

Based on these explanations and the application of the wavelet transform to the input image, a set of wavelet images is obtained based on the predetermined size of the pests in the database. These images have varying dimensions. For normal tissue, which is required for training, a fixed size of 48 × 48 was selected. This size provides enough pixels to apply two levels of wavelet and is determined based on the size of the final images before the wavelet transform. The crucial aspect of this size selection is that it should equal the minimum possible size of the pests in the images.

Considering the aforementioned description, directly using the images for feature extraction is not feasible due to the varying dimensions of the images, which is not acceptable for classification purposes the disease diagnosis techniques commonly used in medical imaging were utilized to overcome this challenge and extract features independent of the input image dimensions. If the output images of the wavelet have arbitrary dimensions of m*n, formulas such as entropy, mean set energy, variance set, and cluster tendency can be utilized to extract features at all levels.

A total of 8 images were obtained based on the dimensions of the applied images. From each of these images, five features were extracted, resulting in a total of 40 features. The number of features is appropriate, as there is no need for feature reduction algorithms. Additionally, introducing more features may increase method's complexity without significantly improving accuracy. Therefore, in such cases, the number of features appears relatively proportional.

Initially, the extracted features are fed into the classifier. If the desired accuracy is not achieved, further attempts can be made to modify or increase the number of features.

Method of generating train and test data: Once the desired features and the method to extract them were determined in the proposed algorithm, the process proceeded as follows: Firstly, the locations of the pests were extracted based on the specified points in the database. From these locations, a two-level wavelet transform was obtained using the HAAR mother function, and the corresponding features for each part were extracted.

Since all classification algorithms require samples of healthy tissue in addition to infected tissue, and the location of healthy tissue was not specified in the database, a suitable algorithm was employed to determine the locations of pests in the image. These locations were then applied to the original image as a mask. From the remaining areas, considering all the tissues, 48 × 48 windows were randomly selected. These windows were carefully chosen to ensure they did not overlap with the infected tissue. The randomly selected windows, free from any overlap with the infected tissue, were subjected to the feature extraction process. The features extracted from these regions were utilized as features for healthy tissue in the input of the classifier.

It is worth noting that, given the relatively small volume of infected tissue compared to normal tissue in conventional leaf images, it is easier to increase the number of images related to normal tissue in this step. The number of normal tissue images should be approximately 1.5 to twice that of infected tissue images. By doing so, the number of healthy class samples at the input of the classifier exceeds the number of infected class samples. Typically, it is recommended to have an approximately equal number of samples in a two-class classification algorithm to ensure the learning algorithm can converge and perform effectively. Therefore, in the implementation of this project, the selected number of normal areas slightly exceeds the number of infected tissue samples at the input of the selected class. With the completion of this step, the feature extraction phase is fully concluded.

Features mapping: Based on the values presented in Table 2, it is evident that the features possess extremely large numerical values. In such cases, the features' size often overrides the classifier's effectiveness, leading to a decrease in accuracy. Various methods are employed to address the issue of excessive or insufficient features in the input of the classifier, such as normalization to a range between zero and one or similar techniques. However, in the algorithm proposed in this project impossible to map all the features to the zero and one interval due to the inability to estimate the features' absolute maximum and minimum values. Considering this limitation, a non-linear mapping approach was utilized to transfer the features to an interval where the efficiency of the interval class remains intact while demonstrating conventional effectiveness. Multiple mappings were tested based on the features' type and dimensions; ultimately, the most efficient mapping with the highest accuracy percentage was selected and implemented.

As shown in Table 2, the features exhibit positive values, sometimes ranging from 1012 to 1015. A function that can handle both positive and negative ranges is required to map these values. For this purpose, the power of one-third to the features is initially applied. For instance, if a feature had a value of 1015, taking its third root would result in a value of 105. Following this step, a simple linear mapping was employed to convert all the features into positive numbers. Once the features were transformed into positive values, a base 10 logarithm is applied. The logarithm function offers the advantage of reducing large powers of 10 to a more manageable order with sufficient accuracy. This ensures that the class input remains errorfree. Various other functions, such as fifth or seventh degrees and exponential functions, were tested for feature mapping. However, none of these mappings achieved the same level of accuracy as the combined approach of using the power of one-third and the base 10 logarithm. Consequently, the selected mapping applied the power of one-third followed by the logarithm in base 10.

To avoid potential issues with negative logarithm values in base 10 for numbers less than one, the mapping was designed in such a way that the lowest feature value is transformed to the number one after taking the third root. This approach ensures that all the features' logarithmic values in base 10 remain positive. The drawback of negative values in the logarithm function arises when the feature value is close to zero. In such cases, the logarithm produces a significantly large negative number based on 10, which diminishes its effectiveness in representing and constraining different features in the class input. Upon completion of the mapping stage, the features are prepared for utilization in the classifier, marking the beginning of the classification phase. Figure 13 shows illustrates the normalization of the feature values after mapping to display their constrained values comprehensively within the Table 2.

Figure 13. Feature values for post-mapping state for a healthy and infected leaf sample tissue.

Table 2. Correct percentage of test and train data.

Data classification: Once the features have been extracted from the image, it becomes imperative to classify them into distinct classes to distinguish between infected and healthy leaves. This classification enables the identification and separation of the leaves based on their characteristics. In this project, SVM classifiers with various kernels have been employed and ultimately, the most optimal kernel has been chosen. In cases where the SVM classifier proves to be insufficient in effectively separating the samples, alternative methods such as neural networks and boosting techniques can also be utilized.

Validation: To ensure the reliability of results obtained from learning-based methods such as neural networks, SVM, AdaBoost, and others, it is crucial to account for the random nature of the test points during the learning process. Utilizing different methods is necessary to avoid ambiguity in the validity of the results. One commonly employed approach in this field is the k-fold cross-validation method. Given its widespread use in current literature, the 10-fold cross-validation has been used in the current study. The k-fold cross-validation algorithm divides the data into k equal parts. One part is used for training while another part is reserved for testing and evaluating the algorithm. The training process is repeated k times, and the system's performance is determined based on most correct answers under the given assumptions. Essentially, the k-fold cross-validation method averages the test results eliminating random states' influence. This approach ensures a more robust evaluation of the system's performance in terms of test percentage, thereby enhancing the reliability of the results (Table 3).

Table 3. Verification of correct percentages of test and train data.

CONCLUSION

After conducting tests on the results of the proposed method, the output images focusing on the four most prevalent pests that have caused significant damage to the product specifically in the leaf parts were reviewed. This study aims to detect pests on tea leaves using image processing methods. Given the absence of a suitable background in processing techniques and a suitable database for this task, medical articles were used for guidance. Various methods for detecting complications in color medical images were explored, and among the available options, those deemed most likely to provide better results were identified. The collected database comprised diverse images captured at different times during the season, showing leaves affected by various pests. In addition to this curated database, supplementary internet images were also utilized to augment the capabilities of the database and enhance its comprehensiveness. Once the database was collected using the sample program, the images underwent dimensioning and the areas affected by pests were labeled. Rectangular windows were employed for labeling, defining the top-right and bottom-left coordinates of the rectangle to indicate the specific pest and encompass its region. Following the database completion in the research process, feature extraction steps were conducted utilizing various testing methods. Subsequently, the best indicator was selected from the histogram operator, image energy and wavelet operator across all pest types. The wavelet transform was defined, along with the appropriate number of levels for the mother wavelet function, considering minimal computational load and maximum accuracy. Different states were examined to achieve this and ultimately, output images of the wavelet transform were generated utilizing suitable statistical operators. Considering the extensive range of features and their variations, a suitable non-linear mapping technique was employed to transform the numerical values of the features into an appropriate range for input into the classification process. This mapping ensures that the features are appropriately scaled and aligned with the requirements of the classification task. The accuracy of the classifier is greatly influenced by the design of an appropriate mapping. In this study, the SVM classifier was employed and tested with various kernels. The exceptionally high accuracy percentage achieved during the train and test phases rendered the use of other classification methods unnecessary. To demonstrate the validity of the trained classifier and its independence from the specific train and test data, the k-fold cross-validation method was employed. This approach ensures that the obtained accuracy percentages hold sufficient validity and are not solely dependent on the specific dataset used. We are aiming to continue this research on various pests of plant using tiny CNN methods.