Journal of Intelligent Systems and Internet of Things

TRIP-CID: Transformer and ResNet Improved Pest Classification and Identification Detection Model for Pesticide Management in Precision Agriculture

R. Kiruthika, B. Arun kumar
Volume 17, Issue 1, pp. 27-38 (2025)
DOI: https://doi.org/10.54216/JISIoT.170103
Online: https://www.americaspg.com/journal/18/article/3775

Abstract

In these modern agriculture system crop pests causes major social, economic and environmental issues worldwide. Each pest necessitates an alternative method of control and precise detection has become a very important challenge in agriculture. Deep learning technique shows remarkable results in image identification. Standard pest detection framework might struggle with accuracy due to complicated algorithms and lack of data, and result in incorrect detection, which leads to harm the crop environment. To end this, we developed a novel framework named Transformer and ResNet Improved Pest Classification and Identification Detection (TRIP-CID) for crop pest classification and identification. At first, the pest images are obtained through the benchmark dataset for pre-processing. The Pre-processed images are immediately delivered to the Improved ResNet (IR-Net) and Pyramidal Vision Transformer (PVT) for multi-scale spatial, channel and contextual feature maps extraction within three stages. The extraction feature maps in the two modules are combined to produce a superior feature map. Then refined feature maps was fed to the three distinct Machine Learning (ML) classifiers offered pest detection outcomes. For accurate results, we employ ensemble-voting technique, which outputs effective pest detection result that is vastly used for particle suggestion. Finally, we utilized presented technique for detecting and identify crop pest in 10-pest class for instance larva of laspeyresia pomonella, Euproctis pseudoconspersa strand, Locusta migratoria, acrida cinerea, empoasca flavescens, spodoptera exigue, parasa lepida, chrysochus chinensi, L.pomonella types of insects pests and larva of S. exigua. Additionally, the suggested methodology has shown to provide experts and farmers with quick, efficient assistance in identifying pests, saving money and preventing losses in agricultural output.

Keywords: Deep learning; Pest detection framework; TRIP-CID; Ensemble voting technique; Feature extraction

1. Introduction

Precision agriculture is a present-day farming process, which optimizes agricultural processes over the usage of technology and data analytics. When increasing crop yields it pursuit for to diminish the amount of input resources including water, fertilizer, and pesticides. This tactic differs from conventional farming methods that normally hang on applying resources consistently concluded perfect fields, irrespective of variations in crop health, soil fertility, or moisture conditions [1-2]. The volume of precision agriculture to simplify site-specific management techniques is one of the main recompenses. Farmers can aim specific areas and times while they are most needed instead of applying inputs evenly through a field. For occasion, farmers will adapt planting, irrigation, and fertilizer application rates according to regional conditions by implementing automated systems and GPS-guided equipment [3-4].

Additionally, the increasing resource efficiency and this lessens the impact on the environment by decreasing overflow and chemical leakage into waterways. Moreover, precision agriculture facilitates data-driven decision-making throughout the farming cycle. Predictive analytics and machine learning algorithms can anticipate yields by employing historical data analysis and detect early disease symptoms or nutritional deficits to regulate the best times to harvest [5-7]. Farmers may reduce risks, increase profits, and preserve workable farming techniques by being proactive. When lowering hazards to the environment and public health pesticide management is a revolutionary strategy meant to maximize pesticide application for effective crop protection inside the situation of precision agriculture. Precision agriculture utilizes cutting-edge technologies such as remote sensing, GPS-guided equipment and data analytics to qualify site-specific pesticide application, in divergence to traditional methods, which be contingent on uniform application through entire fields [8-9]. Farmers will diminish pesticide consumption and lessen environmental consequence by accurately targeting regions with insect infestations or crop stress by employing real-time data from sensors, drones, and satellite photography [10-12]. Moreover, precision farming provisions sustainability over decreasing pesticide leaching and runoff, maintaining healthy soil and securing water quality. Upcoming expansions in biological control integration, predictive modelling, and smart monitoring systems offer promise for cumulative pesticide management procedures in precision agriculture and assuring robust and maintainable food production systems worldwide as technology continues to development [13-14].

Recent progresses in deep learning have transformed computer vision, especially with the Transformer and Residual Network (ResNet) architectures that will allows for prominent gains in responsibilities such as object detection and image classification. These developments are currently being employed to innovative and important fields including identification and classification of pests. All-inclusive, pests characterize serious risks to ecosystem health, food security, and agricultural output. Conventional tactics to pest identification regularly hang on labour-intensive, time-consuming, and human error-prone manual examination or simple image processing procedures [15-16]. Moreover, these procedures have trouble to appropriately identifying pests in a variety of environmental settings and with complex antiquities. Deep learning models offer intriguing answers to these problems including Transformers and ResNet. Transformers have established to be operative at capturing contextual information and long-range dependencies [17-18]. Transformers are outstanding in capturing spatial relationships among various picture components while applied to image data. Numerous goals are projected to be proficient by participating Transformer and ResNet models into pest detection frameworks. These models will improve accuracy rates in distinguishing among pest species and developmental phases. Furthermore, they offer improved scalability, empowering the employment of automated monitoring systems through extensive agricultural regions or natural environments [19-20].

Precision agriculture can assistance from enhanced crop pest identification and detection over the use of deep learning. These arrangements have the potential to greatly improve pest management techniques that will raise agricultural yields and promote more sustainable farming practices. They organize this by implementing large volumes of image data and cultured neural network architectures. To overcome from the mentioned issues, we recommend a new approach called Transformer and ResNet Improved Pest Classification and Identification Detection (TRIP-CID). We flinch our method by locating pest images from benchmark datasets that are cautiously pre-processed. Following that, the pre-processed images are concurrently directed into two different modules such as the Pyramidal Vision Transformer (PVT) and the Improved ResNet (IR-Net). These modules extract multi-scale spatial, channel, and contextual feature maps over the three processing stages. Formerly, the feature maps, which were occupied from PVT and IR-Net, are merged to generate improved feature maps that encompass comprehensive information about pests. The improved feature maps are formerly placed into three different machine learning (ML) classifiers to harvest reliable pest identification. Every classifier independently developments the feature maps to yield preliminary pest detection results. Then, we employ an ensemble voting approach to assurance accuracy and reliability, which masses the ML classifier outputs. This ensemble approach enhances the ability of model to appropriately detect pests diagonally a range of environmental circumstances by uniting different viewpoints from the classifiers. Our TRIP-CID model's final output is critical for suggesting targeted pesticide application techniques to supporting with accurate pest detection. Our model pursues to simplify and optimize pest control decisions in precision agriculture settings by fusing cutting-edge deep learning procedures with ensemble learning procedures. At last, this investigates advances the supportable farming procedures by dropping pesticide use and growing crop protection and productivity. The contribution of our work is detailed explained below:

Integration of Improved ResNet and Pyramidal Vision Transformer for Enhanced Feature Extraction: The TRIP-CID model shapes on the strengths of enhanced ResNet (IR-Net) and Pyramidal Vision Transformer (PVT) to harvest stronger multi-scale feature extraction abilities. IR-Net enhances spatial and channel feature extraction in classic ResNet, while PVT effectively gathers multiscale contextual data by implementing transformer-based designs. The TRIP-CID approach signifies pest images more holistically and precisely by the integration of feature maps from IR-Net and PVT. This fusion enhances accuracy for tasks like detection and classification by manipulating the wide-ranging spatial, channel and contextual information recovered from the dual models. Ensemble of Machine Learning Classifiers for Robust Pest Detection: The TRIP-CID method utilizes three separate Machine Learning (ML) classifiers using modified feature maps to achieve pest identification results. The model captures numerous features of the data that individual classifiers may overlook by applying several classifiers and resulting in a more thorough analysis. The ensemble voting technique is then utilized to merge the outputs of these classifiers, resulting in finished and exact pest detection findings. This ensemble technique considerably improves the robustness and reliability of the results while reducing the possibility of false positives and negatives. Application of Ensemble Voting Method for Pesticide Recommendation: The final addition of the TRIP-CID approach is the use of the ensemble voting approach to acquire reliable pest detection findings. This approach merges the results of numerous classifiers to engender a final judgment and employing the strengths of every classifier. This method is important for practical applications like pesticide recommendations since it guarantees which pest detection findings are precise and dependable. The ensemble voting mechanism promises which the findings are not only accurate but also actionable and subsequent in enhanced pest control tactics and pesticide use.

Ullah N et.al [21] suggested a radical end-to-end DeepPestNet architecture for the classification and recognition of pests. Eleven learnable layer’s structure the presented approach which consisting of three fully connected and eight convolutional layers. He also implemented image rotation and augmentation methods to enlarge the related dataset and measure the DeepPestNet generalizability of the method. Then, he assessed the presented approach structure by employing the well-known crop dataset of Deng. At last, crops pests were detected and classified into 10 classes by utilizing the presented approach. Wang B et.al [22] suggested a crop disease and pest detection approach related on DL from the viewpoint of biological and ecological guard to report the issues of abundant types of crop diseases and pests, dissolute dispersal speed and lengthy physical detection times. Initially, field sampling is employed to gather crops images to generate a dataset. Then, nearest neighbour interpolation is implemented to appearance the image pre-processing. Moreover, the Alex Net network structure is improved. Experimental parameters and different neuron nodes are set by optimizing the entire connection layer. Finally, agricultural disease and pests are detected by employing the Alex net approach. Li W et.al [23] utilized three innovative deep convolutional Neural Network (DCNN) approaches such as Yolov5, mask-RCNN and faster RCNN. Moreover, he formed two of his own coco datasets by implementing the IP102 and Baidu AI insect detection datasets. In addition, he employed the two coco datasets to equivalence these three innovative deep learning approaches. Yolov5 is highly endorsed for the insect pest detection along with the provisional results related on the simple background of the Baidu AI insect detection dataset. Lin S et.al [24] presented a fine-grained pest identification method based on a GPA-Net to maximize the production of agricultural efficacy. Additionally, a multilevel pyramid structure was intended to acquire multiscale spatial features and graphic relations for improving capacity to identify pests and diseases.

Zhang W et.al [25] suggested the lightweight AgriPest-YOLO pest detection approach that targets to accomplish well-balanced model size, accuracy and efficacy for pest identification. Initially, he offered a CLA approach to minimize noise interference and harvest smoother and richer insect features and especially for complexly backgrounded pests. Then, a unique GSPPF is developed that advances the multi scale representation of pest features. Soft NMS is lastly augmented to the forecast layer to increase the concluding predictions of overlying pests. He also assessed his efficiency of approach with retaining a large-scale multi pest image dataset on 25K images and 24 classifications. Khalid S et.al [26] suggested an approach for early pest detection, which creates use of CNN and DL. A dataset comprising images on citrus psylla, red beetles, and thistle caterpillars is exposed to object detection. The input dataset contains 9876 images of each bug in different lighting situations. They were all selected based on these models accomplished in object detection. An android application, which identifies the pests in real time, also integrates the Yolov8 perception. In his learning, he employs new deep learning approaches, analytical techniques, and a workflow for pest detection to efficiently achieve pests in crops. Rodríguez-García M. A et.al [27] presented a preliminary version of a fully functional, semantically improved IPM decision assistance system. The eventual unbiased is to generate a comprehensive agricultural knowledge base by accumulating data from numerous and heterogeneous sources to generate a system which will support farmers to make decisions around handling diseases and pests. Subsequently evaluation in a simulated setting, the pest classifier background yielded a cumulative high accuracy.

Chen J et.al [28] presented the attention mechanism together with a CAM were combined in his planning for acquiring the important pest data of input images to enhance knowledge ability for pest images with muddled circumstances and also the MobileNet-V2 pre-trained on ImageNet is selected. Moreover, two-stage transfer learning and an optimized loss function were employed training process. This category of advanced learning maximizes the detection accuracy of plant pest images by primary supporting model acquire around large-scale features and then progressively turning its emphasis to finer facts. Zheng Z et.al [29] presented electronic noses related on metal oxide semiconductor sensors to identify insect pests and crop diseases. Electronic nose (E-nose) technology has advanced rapidly, imitating the olfactory senses of animals and provided that early disease and pest warnings. Among its many advantages are its non-damage detection, cheap cost, high sensitivity, real-time analysis, ease of use, and portability. When pests give the impression, crops will release either Volatile Organic Compounds (VOCs) to avoid the bugs or publication VOCs to draw in the pests' natural enemies as a defence mechanism. The development of MOS electronic nose technology and its use in the detection of agricultural illnesses and insect pests is predictable to yield important information for crop disease and insect pest prevention. MacDougall S et.al [30] focused on different gas-sensing technologies have been practical over the last ten years to better effectively identify plant illnesses and pests. Among these is the utilization of various gas-sensing technologies to take advantage of volatile organic chemicals emitted by stressed plants. These techniques regularly satisfy these criteria, but they have a number of drawbacks as well, such as the enormous number of variables that can influence the profile of volatile organic compounds released, such as sensor drift and sensitivity to environmental factors and soil nutrient or water availability.

Backbone Module

Figure 1. Illustration of TRIP-CID Model
Figure 1. Illustration of TRIP-CID Model

3. Methodology

3.1 TRIP-CID Model

The Deep leaning has become most popular method for image processing and computer science. In this research, we proposed a Transformer and ResNet Improved Pest Classification and Identification Detection (TRIP-CID) method for accurate crop pest’s detection and categorization. By utilizing the (Deng.et.al) dataset, we created a 10-class crop pest’s classification. The proposed TRIP-CID contains of four fundamental phases, which include data augmentation and image rotations, dataset resizing, image resizing, model training and testing, as shown in figure 1. This model is further evaluated to classify our method performance; we developed a nine-class classification by implementing the proposed TRIP-CID framework utilizing the traditional Kaggle “pest dataset” to demonstrate the model effectiveness. In addition, this proposed framework consists of 11 learnt layers including 8 convolutional layers and 3 FC layers. The particulars of presented model were detailed below.

A. Pre-Processing

(i) Data augmentations

Lack on huge quantity of information for training the deep learning technique is one of the major issues while attempting to utilize DL methods to categorization difficulties and pest identification. Most of the crop pest data is hard and costly to obtain the materials and time. The data augmentation extents the amount of obtainable data with no need of obtaining new data through employing numerous methods to present data, has been proven beneficial in classifying images. Due to the low amount of images dataset, we employ the data augmentation and image rotations method in this research. Furthermore, we also rotated all the image datasets in 90 degrees multiple times. Researcher haphazardly adjust photos within 0.9 and 1.1 to create another image. This technique vigorously creates augmented images between every phase training. The number of images within the training set were drastically increased by utilizing data augmentation technique. By increasing, the amount of training images enhances the efficiency of our deep learning model. Moreover, only the real images in the dataset were utilized for testing which ensure the augmented images was solely for training purposes.

(ii) Image resizing:

In the dataset, the input images are in various sizes, which guarantee consistency and increase the speed of processing. Then, we implemented a specific pre-processing to resize the image input to 226 × 226 pixels related on image input necessities of our method.

Locusta Migratoria

Parasa Lepids

Chrysochus Chinensis

Spodoptera Exigua Larva

Atractomorpha Sinensis

Empoasca Falvescens

Laspeyresia Pomonella

Gypsy Moth Larva

Laspeyresia Pomonella Larva (iii) Dataset partitioning:

For every experimentation, the dataset was divided into training and testing sets. More accurately, almost 95% of the dataset was utilized to train the model and 5% was utilized to test the model.

3.2 Pyramidal Vision Transformer (PVT)

We delivered the PRim input to the Pyramid Vision Transformer (PVT). The PVT contains distinctive aspects of transformer and CNN, which could be utilized as direct substitution for the backbones of CNN. The illustration of the PVT architecture is showed in figure 2. In order to achieve higher output resolution, the method can only train on densely partitions images nonetheless; it uses the progressive shrinking pyramid to decrease the calculations of huge feature maps. Moreover, it also implements a Dimensionality-reduction attention (DRA) for additional resource consumption reduction while learning high-resolution features. The detailed equations are provided below:

SRA(R, L, W) = Con (head0, … headMj) Xp (1)
R , SRA(L)Xm L , SRA(W) Xm W) (2) headm = Att (RXm
SRA(y) = N(Res (y, Rej)Xt) (3) RL
RL √ehead) W (4) Att(R, L, W) = Softmax (
R ∈ ReDj∗ehead, Xi L ∈ReDj∗ehead, Xi

W ∈ ReDj∗ehead, and Xp ∈ ReDj∗Dj denotes the parameters for linear projection. The SRA(.) can reduce the geospatial complexity for the sequence input for instance L or W. The Reshape operation (y, Rej) includes reshaping the sequence input x in the size sequence

2Dj)∗Dj represents the liner projection which decreases the sequence’s dimension to Dj. N (.) represents the normalization of layer.

1(1) Fea2

Figure 2. Illustration of Pyramidal Vision Transformer (PVT)
Figure 2. Illustration of Pyramidal Vision Transformer (PVT)

C. Improved ResNet

The pre-processed image PrIm is provided as an input to the backbone module (IR-Net) for multi scale feature extraction. To be clearer, the Pr(1)

Im ∈R3×He×We is fed as input to the IR-Net which produce three feature maps Feaj

(3) with varied scales from the backbone. The designed backbone composed of five blocks, which also composed of 5 × 5 convolutional layers, and four residual blocks. The blocks are denoted as Con1, Res2, Res3, Res4, and Res5 respectively. With the stride 2, the Res3 and Res4 perform down sampling operation. Overall, the three feature maps Feaj

(3) are extracted from Res2, Res3, and Res5 respectively. The extracted features are provided to the Spatial Attention Module (SAM). The SAM intelligently process the important information in the feature map. To be clearer, the element wise multiplication is performed on every channel of Feaj i(1)) ∈RHe×We. Features that are more important are provided with higher weights based on its position. By this way, the SAM robustly highlights the crucial pest information by diminishing the irrelevant regions in the pest image. In order to attain spatial attention Ns(Feaj operations in the axes of channel and amalgamate the pooling results to generate Ns(Feaj i(1) can be formulated as, with respect to Feaj

IjXj Rej 2 ∗(Rej 2Dj). Thus Rej
(1), Feaj (2), and Feaj
(1), Feaj (2), and Feaj
i(1) using 2D spatial attention Ns(Feaj

Thus Con (.) represents the concatenation operation in Xi represents the layer attention phase j decrease ratio. Xt ∈Re(Rej

Fea2

2(1) Fea2

3(1) i(1)), we introduce maxpooling and average pooling i(1)). The formulation of spatial attention

i(1)) = σ(f([APool(Feaj i(1)); Mpool(Feaj i(1))]) (5) Ns(Feaj

From the above equation, sigmoid function is denoted as σ, APool and Mpool denotes the average and maxpooling operations respectively, and f(. ) denotes the convolution operation. So that, the obtained feature map from SAM can be denoted as follows,

i(2) = Feaj i(1) ⊗Ns(Feaj i(1)) (6) Feaj

From the above equation, element wise multiplication can be denoted as ⊗. For every feature map channel, this research lime lights the weight matric of the Ns in the dimension of channel during element wise multiplication.

The extracted features maps are provided for feature exchange to resolve the temporal and domain gap issues. Let us consider the feature maps Fea1

i(1) and Fea2

i(1) in the spatial dimension can be formulated as,

i(1)(ba, ch, he, wi), H(ba, ch, he, wi) = 1 Fea1 i(1)(ba, ch, he, wi) = { Fea1 (7) i(1) (ba, ch, he, wi), H(ba, ch, he, wi) = 0 Fea22−j

From the above equation, channel, width, height, and batch of the dimensions are denoted by ch, wi, he, and ba respectively. The feature exchange decision operation to perform feature exchange at the specific position can be denoted as H. More distinctively, the feature exchange is performed among Fea1

1(1) & Fea2 1(1), Fea1 2(1) & Fea2 2(1), and Fea1 3(1) & Fea2 3(1). We perform both the channel and spatial feature exchange for the large- and small-scale features with higher spatial resolution.

j(2) was merged by another two features of image Aj within various scales sequentially through selection to create the fused

Feai feature Feai

j(4). This transformer modal uses an encoder and decoder blocks. The proposed CD network utilizes several self-configuring transformer modules. This work utilizes the SAM and transformer framework to represent both spatial and global context data. This CAM method transmit the context data through highlighting the transmits correlated to the variations. We define the CAM in a detailed manner below: the numerous features provide similar channel attention Nd for image Yj. In order to determine the channel attention, initially we combine the feature maps of similar scale of multiple branches through employing element-wise summation and apply max pooling together with the spatial dimension of the combined results. Furthermore, we implement an element-wise summation once again to combine the multiscale outcomes of the max-pooling operation and permits the combination outcomes by a multilayer perception (MLP) to acquire the attention channel Yj. This MLP contains a full convolution layer with a sigmoid activation function and a full convolution layer with a ReLU activation function. The detailed process is formulated in the following. Let U(Feai j(3). Furthermore, the fused feature feed to the transformer module and CAM to create the feature map Feai j(3) within the transformer method. The max pooling result of the combined feature of U(Fea1 j(3)) represent the feature map gathered through transmitting Feai

j(3)) and U(Fea2

j(3)) can be denoted as:

j(3)) ⊕U(Fea2 j(3))), (8) Ni = MaxP( U(Fea1

Thus ⊕ represents element-wise summation, s represents the radio reduction channels. The attention map channels are:

Ni = noq(N1 + N2 + N3) (9)
= α(X2(ReLU(X1(X1 + X2 + X3)))), (10)

j(4) is attained by the CAM as follows:

Thus, X1 ∈𝒮d/s×d and X2 ∈𝒮d×d/s. And, the feature map Feai j(4) = UFeai j(3)⨂ Nd. (11) Feai

4. Result and Analysis

We suggest an entire instantaneous of the data from several experiments assumed to evaluate the efficiency of our TRIP-CID model. The sector too delivers supplementary data on the database applied in this learning. Deng 1018 is implemented for calculating an effectiveness of method. We appraised its performance against the publicly accessible ''Pest Dataset'' to guarantee which our model is generalizable. Table 1 designates the hyper-parameters, which were selected. We qualified our TRIP-CID model by employing SGD. The background is qualified on 80 epochs to distinguish and categorize pests that taking into contemplation over-fitting.

Table 1. Hyper-parameters
Table 1. Hyper-parameters

We used the dataset published to calculate the effectiveness of the presented TRIP-CID architecture. It entails of 10 dispersed pest types, which are most commonly realized in tea plants and other plants through Europe and Central Asia. More surely, the dataset's 10 pest images comprise Euproctis pseudoconspersa strand, Locusta migratoria, acrida cinerea, empoasca flavescens, larva of laspeyresia pomonella, spodoptera exigue, parasa lepida, chrysochus chinensi, L.pomonella. Figure 3 illustrations an illustrative depiction of every pest kind. The Deng data encompasses 562 pest pictures. Every type of pests has 40 to 70 images. Figure 4 presentations instance images subsequent rotations. Each by 90 degrees we exchanged the dataset images twice. Table 2 also embraces the number of images for every pest group subsequent rotation. The pest photographs in the collection, which included photos shot with an SLR camera, were gathered from Mendeley and other online sources. The remaining photos were from Dave's Garden, IPM Images, Insert Images, and other sources. The collection includes RGB images at varying resolutions. The example photographs' backgrounds, lighting, posture, and size differ greatly from one another.

Images from Pest Dataset (a) Locus Migratoria, (b) Parasa Lepida, (c) Gypsy Moth Larva, (d) Empoasca Falvscens, Exigua, (e) Spodoptera Exigua, (f)

Chrysochus Chinensis, (g) Laspeyresia Pomonella Larva, (h) Spodoptera Exigua Larva, (i) Atractomorpha Sinensis, (j) Laspeyresia Pomonella

Figure 4. Illustration of Resized Data from Pest Dataset
Figure 4. Illustration of Resized Data from Pest Dataset
Figure 3. Glimpse of Pest dataset
Table 2. Pest category in pest datasets

Pests’ category Without rotations After rotation

Parasa lepida 60 179

Atractomorpha sinesis 64 188

Locusta migratoria 74 217

Chrysochus chinesis 51 152

Spodopetra exigua larva 58 169

Empoasca flavescens 41 122

Gypsy moth larva 41 122

Laspetresia pomonella 66 197

Spodopetra exigua 70 203

Laspetresia pomonella larva 52 152

Total No ‘of images 577 1701

Figure

0 10 20 30 40 50 60 70 80 90 100

200 400 600 800 1000

Iterations

Figure 5. Comparison of accuracy and loss
Figure 5. Comparison of accuracy and loss

200 400 600 800 1000

Iterations

Accuracy%

Loss The method is suggested presentation is evaluated using the following metrics: F1_score (Fs), sensitivity (recall) (Spy), specificity (Spy), accuracy (Acc), precision (Pn), and specificity (Spy). The ratio of the total number of positive photos detected (either correctly or wrongly) by the method to the number of correctly detected or categorized images defines the recommended accuracy model. Specificity is determined by comparing the number of negative photos that are correctly identified (normal) to the total number of negative images in the collection. Lastly, F1_score aggregates recall and accuracy to get a weighted average. The following methods are used to estimate the measures:

Acc = (TNE + TPE)/TSs (12) TPE
TPE TPE+FPE (13) Pn = TPE
TPE TPE+FNE (14) Ssy = TNE
TNE TNE+FPE (15) Spy =
Pn x Ssy Pn+ Ssy (16) Fs = 2.

Here, TPE, TNE FPE, FNE, FPE and TSs signifies True positive, True negative, False positive, False Negative and Total samples. Utilizing a machine equipped with an Intel (R) Core (TM) i4-5100U CPU and 6GB of RAM, the suggested methodology is examined and verified. The hardware and software requirements for the TRIP-CID technique that is being discussed are shown in Table 3. Images are downsized to accommodate the down sampled input images required by the models. 10% of the photos were used for testing, while 90% of them were used for training. To train and test the suggested TRIP-CID technique and develop modern models, all studies use training and testing sets with the same experimental circumstances for pest detection and classification as those above. Presentation of the proposed TRIP-CID background for multiclass pest classification is evaluated through a series of studies.

Table 3. Software and Hardware resource
Table 3. Software and Hardware resource

Comparing the proposed TRIP-CID method for pest detection and classification to other available DL models is the main objective of this investigation. We evaluated the TRIP-CID framework's classification performance against three pre-trained deep learning models, including Inception Net, VGG-19, and DenseNet. Using a TL configuration, the frameworks are trained on a vast number of images from the ImageNet database. All pre-trained networks are capable of classifying images into a thousand distinct categories. To fine-tune the models, we used the same experimental setup as the TRIP-CID model that was previously described. After rotating the original photos, we used all 1686 crop pest photographs from Deng et al. for our investigation. Additionally, 168 pest photos are used for model testing and 1518 pest images are used for model training. The total number of pest photos utilized for training and validation in each category is then shown. Table 4 shows that Inception Net, VGG-19, and DenseNet performed the worst across all performance procedures when compared to the TRIP-CID model that was provided. The fact that Inception Net, VGG-19, and DenseNet formed the same classification scores for every performance criterion is noteworthy. We discovered that the recommended TRIP-CID framework performed better than the other DL frameworks based on the responses. While the RAF assesses each convolutional layer in the Inception Net, VGG-19, and DenseNet models, their accuracy is lower than that of the recommended model. The Relu function sets all neurons' negative values (x < 0) to zero. It is not certain that every neuron contributing to the dying Relu will be active at all times. In this case, the optimization strategy fails, and the model does not acquire. The reason the fading ReLU problem is problematic is that it leads to a significant percentage of the network becoming idle over time. The proposed TRIP-CID model reports the dying relu issue by using the LR activation function instead of the RAF. Consequently, the TRIP-CID model retains all neurons engaged even when proposed with negative values. Moreover, the proposed model applies BN following each convolutional layer. Even if some qualities are more significant numerically than others, their importance is reserved. Importantly, the proposed model will be much unbiased (with respect to higher-value features). Furthermore, when compared to a framework that rejects BN, this approach allows for faster training and higher accuracy.

Table 4. Comparison of Proposed Deep learning Model with Existing Model
Table 4. Comparison of Proposed Deep learning Model with Existing Model

Moreover, we tested presented TRIP-CID compared to remaining advanced pest appreciation and organization approaches to guarantee the suggested superiority of model. We appraised the suggested method to the most recent DL frameworks and providing our results in Table 5. The expressions about the comparison of other existing works with our presented TRIP-CID approach. DL models were implemented to categorize eight distinct species of tomato pests. The composed pest characteristics are united with three ML classifiers based on DL models such as DA, SVM and the KNN approach. Bayesian optimization was implemented to routinely regulate the hyper-parameters. The VGG16 approach outclassed the other models and achieving high accuracy after image augmentation. In CNN + ML models, the ResNet50 with DA framework obtained classification. This comparison also validates the achievement of the suggested TRIP-CID paradigm while compared to other techniques. It is worth revealing which these approaches are more computationally exclusive than the presented approach since they necessitate more multifaceted frameworks that can necessarily lead to overfitting. These data validate the suggested technique's efficacy as well as its extra assistances including enhanced computer efficiency. The suggested TRIP-CID approach only comprises 11 layers, shadowed by BN and the LR activation function, therefore all CNN levels' biases are inactive. Therefore, we can accomplish which the suggested TRIP-CID technique is more efficient and effective for finding and categorizing pest images.

Table 5. Comparison of Other Existing Works with Proposed Model for Accuracy
Table 5. Comparison of Other Existing Works with Proposed Model for Accuracy

We assessed it by implementing the Pest Dataset, which is a typical freely accessible Kaggle dataset to additional examine and estimate the effectiveness and generalizability of the presented TRIP-CID system. The numbers embrace five agricultural pests such as Armyworm, Grasshopper, Bollworm, Mosquito and Stem borer. The dataset is well adjusted and encompasses sufficient images for model training, and we did not conduct any rotations. However, we employed information augmentation for testing the generalizability of the suggested model. The assortment comprises 350 images of every pest class such as Armyworm, Bollworm, Grasshopper, Mosquito, and Stem borer pests. Moreover, an automated script is implemented to produce pest images from Google by utilizing Selenium and Chrome Driver. In this experimentation, we implemented all 3150 crop pest images from the ''Pest Dataset'' dataset without rotating the original images and 2520 for model training and the remaining 630 for model testing. The presented framework trained for pest classification in 1380 minutes and 12 seconds by employing the ''Pest Dataset'' dataset. This time is comparative to the highest number of epochs and iterations per epoch. The total number of iterations in training stage of TRIP-CID is 1760 (22 iterations per epoch) with 80 epochs. We achieved average accuracy, precision, recall, and F1-scores. The accuracy validates the efficacy and generalizability of the presented TRIP-CID model for pest detection and categorization. We directed an experiment to regulate the effectiveness of the suggested approach in classifying every agricultural pest. Table 6 illustrations the accuracy, recall, and F1-score performance of the presented approach for class-wise agricultural pest categorization. Additionally, the conclusions establish that the presented model misclassifies just one pest. We operated a 3x3 filter to extract detailed characteristics. The BN method is implemented in the proposed model's feature map standardizes the inputs to every minibatch, delivers regularization and decreases generalization error. Correspondingly, the dropout approach is employed in the proposed model's classification unit that permits for regularization by deleting a percentage of the outputs of previous layer, avoiding overfitting and encouraging simplification. These results exemplify the efficiency of suggested pest recognition and classification process.

Table 6. Analysis of performance metrics on 5 pest classes
Table 6. Analysis of performance metrics on 5 pest classes

5. Conclusion

Crop pest has become most challenging problem in modern agriculture. To enhance identification accuracy, we develop a TRIPCID technique, which utilizes pest images from benchmark datasets for pre-processing. Then the pre-processed images are fed to the Improved ResNet (IR-Net) and Pyramidal vision transformer modules for multi-scale spatial, channel and contextual feature extraction. These extracted features are fused in a higher feature map and it was analysed through a distinct ML classifier. In addition, an ensemble-voting framework guarantees precise pest detection. Our modules precisely detect and classifies pest across ten dataset images such as Euproctis pseudoconspersa strand, Locusta migratoria, acrida cinerea, empoasca flavescens, larva of laspeyresia pomonella, spodoptera exigue, parasa lepida, chrysochus chinensi, L.pomonella. The TRIP-CID technique shows promising results in assisting experts and farmers in saving costs and preventing crop losses.

Figure
Figure