Abstract
AInsectID Version 1.1 1, is a GUI operable open-source insect species identification, color processing 2 and image analysis soft-
ware. The software has a current database of 150 insects and integrates Artificial Intelligence (AI) approaches to streamline
the process of species identification, with a focus on addressing the prediction challenges posed by insect mimics. This paper
presents the methods of algorithmic development, coupled to rigorous machine training used to enable high levels of vali-
dation accuracy. Our work integrates the transfer learning of prominent convolutional neural network (CNN) architectures,
including VGG16, GoogLeNet, InceptionV3, MobileNetV2, ResNet50, and ResNet101. Here, we employ both fine tuning and
hyperparameter optimization approaches to improve prediction performance. After extensive computational experimenta-
tion, ResNet101 is evidenced as being the most effective CNN model, achieving a validation accuracy of 99.65%. The dataset
utilized for training AInsectID is sourced from the National Museum of Scotland (NMS), the Natural History Museum (NHM)
London and open source insect species datasets from Zenodo (CERN’s Data Center), ensuring a diverse and comprehensive
collection of insect species.
Introduction
There are several ways in which insect species can be identified. These include methods based on observed morphological char-
acteristics 3, which in turn might require microscopy 4, direct comparison against insect collections and reference specimens 5, the
identification of unique anatomical features through dissection 6, observation of specific behavioral characteristics 7, chemical analy-
sis methods 8, geographic distribution data 9 and DNA barcoding 10. Each method can be used either individually, or, in parallel with
other identification methods to reduce uncertainty levels. These techniques often require a high level of expertise to ensure that iden-
tification is accurate. This is especially true when identifying insects with intra-class variations, which are generally more challenging
to identify as they may exhibit several similar morphological traits, and may even share similar geographical locations. In the absence
of experts or trained personnel, insect identification can be challenging 11, especially if instant identification is required during field-
work expeditions, or if resources are limited. Collaborative efforts alongside the use of advanced techniques like DNA barcoding 10
can be useful to improve the precision in identification, which is a further testimony to that the process of insect identification can
be laborious, time-consuming, resource-extensive, and often also requires communication with experts on specific types of insect.
The rapid growth of artificial intelligence (AI) provides opportunities for advancements in this area 12, and if built accurately, may en-
able the rapid identification of insect species without the need for specialty resources or skills. Common AI models employ machine
learning (ML), or deep learning (DL) algorithms, which are themselves subdivided into different techniques. We focus on two specific
techniques in this paper to develop insect identification algorithms. These include convolutional neural networks (CNN) and transfer
learning (TL), and we will discuss each of these in more detail in the following two sections, with reference to previous work where
these techniques have been used for species identification.
Convolutional Neural Networks and Species Identification
CNNs are popular deep learning architectures 13 well-suited for insect identification as they automatically learn complex, hierarchical
representations from images and effectively handle object detection and classification tasks 14 15. There are numerous examples
of CNN based models that have recently been developed for species identification purposes. CNN-based object detection models
for example, such as Faster R-CNN and YOLO, can locate and identify nine dominant insect species across more than two million
images with a 93.80% accuracy within video streams 16. The DL cloud-based platform, Deep Automated Bee Identification System
(DeepABIS), consists of 9942 images, 166 genera, and 881 species. These are used to identify bees showing a 93.95% accuracy 17.
Motta et al. 18 trained CNN to automate the morphological classification of mosquitoes, collecting a dataset of 4056 mosquito images
of three species: Aedes aegypti, Aedes albopictus, and Culex quinquefasciatus, and evaluated the images against three different
neural network architectures, LeNet, AlexNet, and GoogleNet, achieving 57.5%, 74.7% and 83.9% levels of accuracy, respectively. Their
work shows us that network architecture selection is a critical part of the process, if high performance models are to be developed
for species identification. Hoyal et al. 19 focused on quantifying phenotypic similarity by calculating (Euclidean) phenotypic distances
between interspecies co-mimics using deep convolutional neural networks (DCNN), achieving an 86% accuracy from a dataset of
2468 butterfly images covering 38 subspecies of Heliconius erato and Heliconius melpomene.
Achieving high accuracy in identifying intra-class insect variants is challenging for CNN models. While DL algorithms perform
well in species classification, training is complex due to the need for high-resolution, detailed, and labeled datasets. Insect datasets
often face class imbalances, with limited data available for rare or newly discovered species, complicating CNN training. Additionally,
insects photographed in natural environments introduce further challenges due to intricate backgrounds and details. Insects may
be photographed from various angles and postures, with wings and limbs in different positions. Additionally, variations in color and
texture caused by lighting fluctuations complicate feature extraction 20 21. To address challenges in deep learning, researchers have
been exploring techniques such as transfer learning, few-shot learning, and data augmentation to enhance the data efficiency and
adaptability of algorithms for various tasks and scenarios22. The following section focuses on transfer learning as it is of direct relevance
to how we have developed prediction algorithms in AInsectID Version 1.1.
Transfer Learning and Species Identification
TL in DCNN is a way of leveraging knowledge gained while training a model on one task, and subsequently applying the knowledge
to a different but related task 22 23. The idea is to transfer the learned representations of features from one domain to another, usually
from a pre-trained model on a large dataset (such as ImageNet Dataset) to a new, small, and different but related dataset, Figure 1.
Fine-tuned TL is especially beneficial when dealing with small datasets or when retraining from scratch is impractical due to compu-
tational or time constraints. This approach involves further training a pre-trained model on new data by unfreezing selected layers,
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
allo
wing updates based on the new dataset. Careful consideration of pre-trained CNN model selection, the extent of fine-tuning, data
augmentation strategies, and the evaluation of model performance on a new dataset is essential 24. When fine-tuning only a subset
of layers, the layers excluded from the process are said to be "frozen." This technique enables the refinement of higher-level feature
representations within the base model. Recent studies have introduced diverse methods with distinct strategies to enhance con-
ventional fine-tuning 25 23. Commonly employed strategies following this approach involve either fine-tuning all layers of the neural
network, as detailed in 26, or selectively fine-tuning only the last few layers, as demonstrated in 27 28. Hyperparameter optimization is
important as it involves the systematic exploration of optimal hyperparameter sets to enhance model performance. Both fine-tuning
and hyperparameter optimization are important in achieving optimal performance in DL models 29 30 31 32 .
Deep Learning
Artificial Intelligence
Machine Learning
Transfer
Learning
AI creates intelligent
machines that mimic the
human brain
Algorithms to perform
tasks without being
explicitly programmed
Uses neural networks
with many layers to
model complex patterns
in data
Techniques for using pre-
trained models to
perform new tasks
CNN Models New Model
Knowledge
Source Domain
Target Domain
Large amount
labeled data
Small amount
labeled data
Transfer Learning
Figur
e 1: (Left) Visual Representation of Relationship between Artificial Intelligence, Machine Learning, Deep Learning, and Transfer Learning.
(Right) Illustration of Transfer Learning
Examples of both fine tuning and hyperparameter optimization have been tasked with species identification. ResNet for example
has been used to classify forest insects, using a pre-trained model and fine-tuning for 30 insect species, achieving a 94% classifi-
cation accuracy 33. Using TL to reduce training time is an effective strategy in deep learning, especially when dealing with limited
computational resources or small datasets. Fathimathul et al. 34 for example, trained various CNN models including VGG16, VGG19,
MobileNet, Xception, ResNet50, and InceptionV3 by TL to identify butterfly species. They collected 10035 images from 75 different
species of butterflies using the Kaggle website and report that the InceptionV3 architecture outperformed all other architectures,
achieving an accuracy of 94.66%. Yasmin et al. 35 developed an android application to classify 10 individual butterfly species consist-
ing of 832 images empploying three different methodologies including, principal components analysis (PCA) with a support vector
machine (SVM), DL by 4-Conv CNN model, and TL using a pre-trained VGG19 architecture. The most successful of these was through
TL using a pre-trained VGG19 model achieving a 96.5% accuracy. Shamim et al. 36 identified vector and non-vector mosquito species
at an accuracy of 97.02% comparing DCNN models VGG-16, Inception V3, and MobileNetV2 assisted by TL. Agarwal et al. 37 identi-
fied 102 pest species by collecting a data set consisting of 12956 total images including 80 species of 12 genera. They trained five
DCNN models (VGG-19, ResNet-34, ResNet-50, ResNet-101, and DenseNet-121, DenseNet-169, MobileNetV2, ResNet50), the pre-
trained VGG-19 showing significant success with a 93.47% accuracy. Soni et al. 38 designed crop pest detection mobile applications
by training four DCNN models (Xception, MobileNet, MobileNetV2, and EfficientNetB7), the highest accuracy of which was delivered
by EfficientNetB7 at 95.6%. There are several apps that help to identify insect species typically using image recognition technology to
match an image of the insect with a database of known species. These include: iNaturalist, a community-driven using crowd sourced
identification and expert verification 39, similar in essence to BugGuide.net 40, PlantSnap , which is primarily designed for identifying
toxic plants but can also identify many insects 41, and a forest insect classification app developed by Lim et al. 42 to classify 30 forest in-
sects using ResNet with an accuracy of 94%. While these apps can be very useful their outputs often require cross-referencing against
additional sources and expert opinions, also generally requiring high quality input images to enable identification accuracy 43. Fun-
damentally, the implementation of TL comes with its challenges 23, which have gained increased attention in recent times 44 45 46 .
To effectively customize a pre-trained model for a new task, certain components (layers) require retraining, while others must remain
unaltered. Deciding which layers should be activated for training (fine-tuning) and which ones should remain frozen, is a necessary
challenge in the adaptation process. Moreover, high dimensionality, computational cost, non-convexity, limited domain knowledge,
interactions, data sensitivity, black-box nature, noisy evaluation, and the risk of overfitting to validation sets pose additional challenges
in hyperparameter optimization 47.
Insect Mimicry - an Additional Complexity
More than 50% of the Earth’s biological diversity are represented by insects 48, with over 1.02 million species having been described
to date and an estimated 80% yet to be discovered 49. Within single species, insects can exhibit considerable intra-species diversity 50,
which can increase the challenges associated with insect identification. Differentiating between insects at higher taxonomic levels
(order and family) is generally more straightforward than at lower taxonomic levels (genus and species). Morphological distinctiveness
is wide ranging at higher taxonomic levels and features at this level are often easier to identify, making it possible to position insects
into broader categories. Insect identification becomes more challenging when descending the taxonomic hierarchy. This is due to
increased variability and complexity among closely related species at the lower taxonomic levels. Moreover, many insect species have
intra-class variations that reflects insect adaptation broad ranging ecological conditions such as geographical location, habitat, food
source, environmental conditions, and evolutionary history 51 16 33 . A fascinating adaptation strategy in the insect world is mimicry.
Insect mimics have evolved to resemble other species in their environment. This serves various purposes from protection to resource
security, Figure 2. Insect mimicry includes visual appearance, behavior, and sometimes even chemical cues 51.
In this paper, we use VGGNet, GoogLeNet, InceptionV3, MobileNetv2, ResNet50, and ResNet101, models to train species datasets
with the primary goal of achieving high prediction accuracy. Our focus is to enable precise differentiation between mimic species
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
Figur
e 2: (A) Danaus-Hypolimnas mimicry ring illustrates a rare example where both the Batesian model and the mimic are polymorphic, fe-
male forms of the Batesian mimic H. missipus mimicking D. chrysippus in a form-specific manner. (B) P. dardanus, and (C) P. polytes, multiple
female forms mimic distinct species of models, the male and male-like female forms are nonmimetic, which in P. polytes also represents the an-
cestral phenotype, represent the degree to which natural selectionthrough predationmay drive nearly perfect and polymorphic wing pattern
resemblance between Batesian models and mimics. (D) and (E) are two mimicry rings are driven by the aposematic species, B. philenor of North
America and Euploea of S. Asia respectively, which are mimicked by multiple Batesian mimics. Figures reused from 52 with the permission of Wi-
ley Periodicals, Inc.
and their mimicked counterparts, ensuring the models can effectively distinguish subtle species-specific features. We choose these
models as baselines, since each has reported evidence of high image-based prediction accuracy rates. In terms of insect dataset clas-
sification through transfer learning, this work will investigate the impact of various optimization algorithms on selected pre-trained
CNN architectures. We will explore transfer learning scenarios in conjunction with four optimization algorithms: SGD, SGD with mo-
mentum, RMSProp, and ADAM, to identify the optimal hyperparameters. Data augmentation techniques will finally be employed to
address any challenges related to both class imbalance and limited data (in the cases of certain rare species).
Methods
Data Collection and Preprocessing
Deep learning models can automatically learn to distinguish relevant features in image datasets during training. With a large and di-
verse dataset, these models uncover complex patterns, enhancing identification accuracy and model generalization while reducing
the risk of overfitting. 53. Taking these points into consideration, here, a total of 40,000 images from 150 insect species (butter-
flies, moths, bees, and dragonflies) including mimics were collected to form the datasets. Our datasets comprised 22,000 images
with white backgrounds and 18,000 images with complex/colored backgrounds. The dataset containing images with a white back-
ground was collected from the National Museum of Scotland (NMS), Edinburgh, Scotland, and the Natural History Museum (NHM),
London 54. The dataset containing images with a colored background was collected from the open-source dataset of insect species
from Zenodo 55, an open science repository hosted by CERN’s Data Center. The datasets were properly labeled by creating individual
repositories for each insect species, with each repository assigned a unique class label following the form, "Species_name". Images
were then organized within these species-specific folders. Our dataset includes five mimics ofDanaus plexippus, two mimics of Delias
belisama, and two mimics of Battus philenor. Our training process of the Deep Convoluted Neural Networks (DCNNs) developed in
this work is outlined in Figure 3.
Data Augmentation
Data augmentation is the process of artificially generating new data from an existing dataset, effectively increasing the available
training data and improving performance in image classification tasks53 56 57 . A challenge we faced was that training data for many of
the rarer insect species were sparse, time-consuming, and resource-intensive. We applied data augmentation techniques including
random rotations, scaling, flipping, shearing, translating, cropping, and brightness adjustments. We initially cropped each image
into four sections, after which we applied other data augmentation techniques such as scaling and flipping the cropped images. The
process of image cropping results in a 4-fold increase in training data. Additionally, horizontal and vertical flipping was used alongside
random scaling, shearing, and translation processes, to further augment the training for species where the datasets were limited. We
finally applied the shuffling technique, in which the order of images is randomly rearranged within the dataset to increase further
variability during training, thereby preventing the model from learning spurious patterns based on the order of the data.
As shown in Figure 4, the outcome of the distinct augmentation method to the original images, thereby increasing dataset vari-
ability and diversity. Images were translated images along the x and y Cartesian axes, while brightness adjustments were made to
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
Data Collection
Data Pre-
processing
Data
Augmentation
Data Splitting
Training 70%
Validation 15%
Testing 15%
Pretrained
CNN Models
ResNet101
VGG16
ResNet50
GoogLeNet
MobileNetV2
InceptionV3
Performance
Comparison of Models
Initialize Best fit
model
Fine Tunning &
Hyperparameters
Optimization
Training & Validation
Training &
Validation
Loss
Decline
Update
Hyperparameters
Train up to
maximum iterations
Model DeploymentModel Testing
Accuracy
close to
100%
No
Yes
No
Yes
Figur
e 3: Flowchart outlining the training process of Deep Convolutional Neural Networks (DCNNs) for insect species identification. The chart
begins with data collection and preprocessing, followed by data augmentation to enhance diversity. The dataset is then split into training, vali-
dation, and testing sets. Several pre-trained models (VGGNet, GoogLeNet, InceptionV3, MobileNetV2, ResNet50, and ResNet101) are evaluated
for accuracy, and the top-performing model is selected for further training. This model undergoes an iterative fine-tuning process, with continu-
ous parameter adjustments to enhance performance until the desired accuracy is reached, facilitating the precise differentiation between mimic
species and their mimicked counterparts.
enable model adaptation to the varying lighting conditions often encountered during fieldwork. Furthermore, randomly rotated
images, aid the model in learning diverse orientations, which is crucial when dealing with species in diverse habitats. Cropping is es-
sential for eliminating irrelevant background noise, particularly beneficial for species with intricate features. Flipped images enhance
the model’s ability to recognize invariant features across orientations, while sheared images add variability. By incorporating these
augmentation techniques, We increased our dataset from 42,000 samples to 610,000 samples, thus significantly enhancing the
diversity and robustness of the dataset. To maintain consistency, we implemented specific pre-processing steps to resize the input
images in the dataset to 224 × 224, aligning with the input size requirements of the DL model. The dataset was split into three subsets:
70% training, 15% validation, and 15% testing for training DCNNs. Each adapted DCNN model was trained on the training dataset
with validation on a validation dataset, and model performance was evaluated on the test dataset. The test dataset is not seen by the
model during training, ensuring an unbiased evaluation of its performance on new, unseen data.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
A B C D E F
Original Image
Augmented Images
Figur
e 4: The figure shows the outcomes of applying various data augmentation techniques to images, including (A) Translation, (B) Brightness
Adjustment, (C) Random Rotation, (D) Cropping, (E) Flipping, and (F) Shearing.
Optimal DCNN Model Selection via Transfer Learning
TL was employed for DCNN model selection from renowned DCNN architectures, namely VGG16, GoogLeNet, InceptionV3, Mo-
bileNetV2, ResNet50, and ResNet101. We introduced additional layers on top of the pre-trained models with all existing layers frozen
as shown in Figure 5. CNN architectures are originally designed to classify 1000 classes of ImageNet dataset, we replaced the clas-
sification layers, including the output layer, to align with the 150 classes in the insect species dataset and froze all the convolutional
layers to retain the pre-trained feature extraction while fine-tuning only the newly adopted layers. In CNN layer architectures, the layers
can be divided into feature extraction layers and classification layers. Feature extraction layers include convolutional layers, activation
layers (ReLU), and pooling layers. They are responsible for capturing and extracting complex features from the input images 15 12.
Convolutional layers perform a mathematical operation known as convolution, where a small filter (also referred to as a kernel) is sys-
tematically applied across the input image to extract features. Each filter is essentially a small matrix of numbers (typically 3x3 or 5x5),
and these numbers are the weights. For example, if the filter size is 3x3, it will have 9 weights. During forward propagation, the filter
slides over the input image and performs element-wise multiplication between the filters weights and the corresponding pixels of
the image. The sum of these multiplications produces a feature map. The process of computing the output Y of a ith convolutional
layer is represented by Equation 1, where X denotes input feature map, W (i) is the set of filters, and b(i) represents the bias vector as-
sociated with the ith convolutional layer that adjusts the output of each neuron, enabling the model to capture complex relationships
in the data effectively.
Y (i) = Conv(X, W (i)) + b(i) (1)
The activation layers introduce non-linearity, enabling network learning of complex patterns. The pooling layers downsample the
feature maps, reducing their spatial dimensions while preserving relevant information. Low-level features including edges, textures,
and shapes were presented by initial layers, while higher layers captured more abstract and complex features. High-level features
are often the primary focus of fine-tuning, low-level features can still be relevant and can be adjusted 58. Once features are extracted,
they are passed to the classification layers. Fully connected (dense) layers are frequently used for classification tasks. These take the
flattened feature maps and map them to the output classes, using techniques such as softmax activation to produce probability
scores for each class, indicating hence, the likelihood of the input’s association with each category 15 12 16 17 . .
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
c
Figur
e 5: Illustration of our transfer learning pipeline that adapts ImageNet pre-trained Convolutional Neural Networks (CNNs) for insect species
classification. The original CNN models are trained on 1,000 categories, enabling them to learn robust features. In this pipeline, new layers are
added to classify 150 insect species while keeping the feature extraction layers of the pre-trained model frozen. This preserves the learned fea-
tures from ImageNet, allowing the model to adapt to the specific characteristics of insect species. The training focuses on fine-tuning only the
new layers, optimizing performance for accurate insect classification.
After processing through preceding layers, the output layer generates logits for each class, which are then converted into proba-
bilities using the softmax function for multi-class classification as shown in Equation 2, where z_c are the raw output scores for each
class and C is the number of classes.
ˆyc = ezc
∑C
j=1 ezj
(2)
Aft
er obtaining the predicted probabilities, the categorical cross-entropy loss is computed by using Equation 3, where yc is the true
output label and ˆyc predicted output label.
L(y, ˆy) = −
C∑
c=1
yc log(ˆyc) (3)
Backpropagation is used to compute the gradients of the loss function to each weight in the network as in Equation 4. This involves
applying the chain rule to propagate gradients backward through the network layers. where ∂L
∂
W represents the gradient of the loss
L concerning the weight W , ∂L
∂ ˆy denot
es the gradient of the loss for the predicted output ˆy, ∂ ˆy
∂
Z represents how the predicted output
changes for the pre-activation value Z, and represents how the pre-activation value Z changes for the weights W .
∂L
∂
W = ∂L
∂ ˆy · ∂ ˆy
∂
Z · ∂Z
∂
W (4)
In the context of fine-tuning and unfreezing convolutional layers, this allows the model to update the weights and biases of the
convolutional layers while keeping the weights of other layers frozen, as shown in Equation5 and 6, where α representing the learning
rate, is a small positive value, which controls the step size where the model parameters (weights and biases) are updated during
training using gradient descent-based optimization algorithms . Stochastic Gradient Descent (SGD), SGDM (Stochastic Gradient
Descent with Momentum), Adam, and RMSprop are optimization algorithms that were tested individually, at different learning rates
ranging from 0.00001 to 0.01. ∇W and ∇b represent the gradients of the loss function L with respect to the weights and biases of
the ith convolutional layer, respectively.
W (i)
new = W (i)
old − α∇W (i) L (5)
b(i)
new = b(i)
old − α∇b(i) L (6)
At each iteration t, the parameters θ are updated as defined by Equation 7. Here, ∇θL(θt) is the gradient of the objective function
of L(θ) with respect to the parameters θ evaluated at θt.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
θt+1 = θt − α∇θL(θt) (7)
The
optimization algorithm with momentum is based on Equation 8 and 9, where β is the momentum coefficient known as
the decay factor that lies between 0 and 1, controlling the contribution of the previous momentum to the current update. The
momentum term vt accumulates the gradients over time with β.
vt+1 = βvt + (1 − β)∇θL(θt) (8)
θt+1 = θt − αvt+1 (9)
This experimentation aimed to identify the most suitable configuration that enhances the performance of the DCNN models on the
insect dataset, and contributes valuable insights into selecting the best-fit pre-trained CNN model. By comparing the performance
of all selected DCNN models, we identified the optimal pre-trained model to focus on fine-tuning and hyperparameter optimization
to refine the selected DCNN model and push its performance closer to achieving 100% accuracy.
Advancing Optimal DCNN Model via Fine-Tuning and Hyperparameter Optimization
After the completion of transfer learning, one of these DCNN models that showed higher accuracy underwent further refinements
through both fine-tuning and hyperparameter optimization 59. These refinements were made to maximize precision, to reach a
prediction accuracy of as close to 100% as possible. Fine-tuning and hyperparameter optimization are iterative processes and several
rounds of experimentation were required to achieve the best results for insect species identification, (cf. Figure 3 ). Our approach
was to gradually unfreeze the last few layers of the best CNN model (that demonstrated the highest accuracy) while keeping the
earlier layers frozen, Figure 6. This strategic adjustment fine-tuned the model towards learning specific features while retaining the
pre-learned general representations.
Figur
e 6: Layer Unfreezing Strategies in Fine-Tuning ResNet101: showing four strategies, progressively unfreezing the last convolutional layers.
This approach helps deeper layers adapt to the new task while preserving earlier pre-trained features for effective fine-tuning.
In this work, four fine-tuning scenarios were explored to assess the impact of different configurations on model performance and
adaptation to the species dataset, while also mitigating the risk of overfitting. Overfitting occurs when the model learns to perform
well on the training set but fails to generalize to new, unseen data. To address this, we use validation accuracy and cross-entropy loss
as shown in Equation 15 and Equation 3 respectively to ensure the model does not overfit. For model fitting, we used optimization al-
gorithms to minimize loss as mentioned in the previous section. We progressively unfroze layers of the model based on performances
observed in a separate validation dataset in the following sequence: the weights of the last 10 convolutional layers were first unfrozen,
followed by the weights of the last 20 convolutional layers, the last 30 convolutional layers, and finally, the weights of the last 40 con-
volutional layers. This process involved an iterative evaluation of model performance as additional layers were unfrozen, allowing us
to determine the optimal depth at which the model achieves the best performance using the insect species image dataset. During
hyperparameter optimization, we systematically searched for the optimal values of hyperparameters including learning rate, batch
size, dropout rate, weight decay and optimzation algorithms. These control the architecture, and training process. Hyperparameters
were adjusted such that the training and validation loss would be declined when additional improvements were needed, reiterating
the process to achieve these improvements. Regularly monitoring model performance on a validation set separate from the training
data was conducted to ensure the accurate prediction of new, unseen data, as opposed to the mere memorization of the training set.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
W
e used batch normalization to improve the training stability and speed of DCNN. In neural networks, the input to each layer
varies significantly during training due to changes in the parameters of the preceding layers. These variations slow down training and
make it more challenging to optimize the network 23. Batch normalization addresses the issue of input variance by normalizing the
inputs to a layer within mini-batches. For each mini-batch {x1, x2, . . . , xm} of data is processed during training. Batch normalization
computes the mean, µB, and variance, σ2
B, of the inputs for that mini-batch, where m is the batch size, as shown in Equations 10 and
11.
µB = 1
m
m∑
i=1
xi (10)
σ2
B = 1
m
m∑
i=1
(xi − µB)2 (11)
Aft
er calculating µB and σ2
B, normalized activation is performed based on Equation 12, where ϵ is a small constant added to the
variance to prevent division by zero, and ˆxi represents the normalized activation.
ˆxi = xi − µB√
σ2
B + ϵ
(12)
Aft
er normalization, the activation is scaled and shifted using learnable parameters γ and β as shown in Equation 13, γ and β are
initialized to 1 and 0 respectively, where yi represents the final normalized and transformed activation.
yi = γ ˆxi + β (13)
Training performance was monitored using different mini-batch sizes (8, 16, 32, and 64) with different epochs (50, 100, 150, 200).
The training process minimized the loss function, L, by iteratively adjusting the mini-batch and epochs. Dropout is a regularization
technique, that involves randomly deactivating a fraction of neurons during each forward and backward pass, thereby preventing
over-reliance on specific neurons and promoting a more robust network 25. In this study, dropout rates ranging from 0.2 to 0.5 were
systematically tested during the training process in pursuit of mitigating overfitting in the training process. Weight decay is an other
regularization technique used to discourage large weights by adding a penalty term to the loss function 23, thereby preventing over-
fitting as shown in Equation 14. Where λ denotes the weight decay rate, controls the strength of penalty, and N represents the total
number of parameters in the model.
Lregularized(θ) = L(θ) + λ
2
N∑
i=1
θ2
i (14)
This
study explored various weight decay rates ranging from 0.0001 to 0.01, to identify the optimal set of parameters. During the
fine-tuning process, hyperparameters were iteratively updated to achieve optimal model performance. The objective was converge
towards 100% identification accuracy, while simultaneously observing a decline in both training and validation loss. This iterative
refinement of hyperparameters was important in tailoring the DL model to the specific characteristics of the insect species dataset,
ensuring that it generalized effectively, prevented overfitting, promoted the convergence of training and validation accuracy, and
achieved peak performance. After achieving optimal performance, the trained DL model underwent testing to evaluate its accuracy
and robustness. The model was subsequently deployed as AInsectID Version 1.1 open source software, providing a user-friendly
interface for insect species identification 1.
Evaluation Methods
We considered accuracy the primary measure for evaluating results. The validation accuracy and loss for CNN models were assessed
as shown in Equations 15 and 3, respectively. Here, T P, T N, F P, and F N indicate correctly predicted positive samples, correctly
predicted negative samples, incorrectly predicted positive samples, and incorrectly predicted negative samples, respectively.
Accuracy = T P + T N
T
P + T N + F P + F N × 100% (15)
Gradient-weighted class activation mapping (Grad-CAM) identifies the specific regions of the insect mimics that contribute most
significantly to the model predictions. It calculates the weights αk of the feature map using global average pooling as shown in
Equation 17, where, z is the total number of spatial locations in the feature map. This weight represents the importance of each
feature map channel for predicting class k. The Grad-CAM heatmap Lk is generated by taking a weighted sum of the feature maps
as shown in Equation 16. The ReLU function ensures that only positive influences contribute to the final heatmap, highlighting the
areas most relevant to the prediction of class k.
Lk = ReLU
( ∑
i
αk
i Wi
)
(16)
αk = 1
z
∑
i
∑
j
∂
L
∂
Wi,j
(17)
Software Setup
MATLAB (2023a) software was used to train our CNN model. The flexibility and user-friendly nature of MATLAB facilitated seamless
experimentation, enabling us to focus on model architecture and hyperparameter tuning. To harness the computational efficiency
required for training large-scale CNN, we leveraged a high-performance computing environment equipped with a state-of-the-art
NVIDIA GPU. The AInsectID Version 1.1 GUI software 1 was developed using the MATLAB App Designer Toolbox.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
RESUL
TS AND DISCUSSION
Feature Representation Dynamics during Transfer Learning
Figure 7 presents the least significant and most significant feature maps across different layers of the various deep learning models,
VGG16, GoogLeNet, MobileNetV2, InceptionNetV2, ResNet50, and ResNet101, that have been used for insect identification. In each
model, the least significant feature maps correspond to regions where the network assigns minimal importance, often reflecting non-
discriminative areas such as background or parts of the insect that are less relevant for classification. These maps are characterized by
low activation values and weak gradient responses during backpropagation, indicating their limited contribution to the prediction.
Conversely, the most significant feature maps highlight the areas that the networks focus on to make accurate predictions. These
maps show strong activations and higher gradient responses, signifying their critical role in the classification process.
The most significant feature maps in deeper architectures like ResNet101, observably capture more abstract and detailed features,
while VGG16 architectures focus on simpler patterns within earlier layers. GoogLeNet, MobileNetV2, and inceptionV3 strike a balance
between efficiency and depth, showing clear differences in how they handle low- and high-level features. ResNet50 and ResNet101,
with their deeper residual connections, exhibit more refined feature maps in higher layers, capturing the complex textures and subtle
distinctions of insect morphology
Initial layers Middle layers Final layers
VGG16
GoogLeNet
ResNet50
ResNet101
MobileNetV2
InceptionV3
Input
Most significant feature maps Least significant feature maps
Initial layers Middle layersFinal layers
High
Low
Figur
e 7: Comparison of least significant and most significant feature maps across different convolutional layers (low, middle, and high) for mul-
tiple CNN networks. The images demonstrate how feature map activations evolve, highlighting differences in the focus of the networks at differ-
ent depths
Transfer Learning Results with and without Data Augmentation
As shown in Table 1, The use of data augmentation leads to significant improvements in the validation accuracy of all CNN mod-
els tested. For example, the accuracy of VGG16 increased from 30% to 45%, while deeper models like ResNet50 and ResNet101
saw substantial gains, improving from 78% to 88% and 85% to 92%, respectively. These results demonstrate the effectiveness of
data augmentation in enhancing model performance, particularly in more complex architectures. Overall, data augmentation im-
proves validation accuracy, helping the models generalize more effectively whilst mitigating overfitting. The dataset without data
augmentation consists of 40,000 samples, while with data augmentation, the sample size increases to 61,000. The extensive depth
of ResNet101, featuring 101 layers with a total 347 layers, contributes to its capacity for the learning of intricate hierarchical repre-
sentations. However, this depth also requires a more extensive parameter space and increased computational demands during the
training process. As a result, the training time for ResNet101 was higher that the other CNN architectures.
Figure 8 illustrates the validation accuracies and corresponding losses achieved using different learning rates, while employing
various optimizers SGD, SGDm, Adam, and RMSprop. VGG16 recorded the lowest validation accuracy at 45%, likely due to its simpler
architecture struggling with the complex visual patterns of the dataset. GoogleNet showed improvement with a validation accuracy
of 76%, attributed to its inception modules capturing information at various scales. InceptionV3, an evolution of GoogleNet, further
increased the accuracy to 78% through more efficient convolution factorizations. MobileNetV2 achieved a validation accuracy of 82%.
Notably, ResNet50 achieved the validation accuracy at 88%, benefitting from its deep residual learning framework that effectively
mitigates the vanishing gradient problem, enabling better performance in detailed and variable visual data recognition. However
ResNet101 emerged as the most effective model, outperforming other well-known architectures. The depth of ResNet101, which
includes 101 layers, proved crucial in capturing the detailed and subtle features needed for accurately classifying diverse insect species
with 92% accuracy. The achieved 92 % validation accuracy not only signifies the model’s robustness but also positions ResNet101 as
a potent candidate for fine-tuning, where precision and accuracy are paramount.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
T
able 1: Effectiveness of data augmentation in enhancing model performance across different CNN architectures by comparing the validation
accuracy and validation loss with and without data augmentation. The pre-augmentation phase consists of 410,000 images, while the post-
augmentation phase contains 61,000 samples. We also present a training time comparison between CPU and GPU implementations for the
same CNN models, highlighting differences in computational efficiency. The optimal results in each column are emboldened.
CNN
Model P
re Augmentation P
ost Augmentation
V
alidation V
alidation T
raining time T
raining time V
alidation V
alidation T
raining time T
raining time
A
ccuracy(%) L
oss (%) CP
U(hr) GP
U(hr) A
ccuracy(%) L
oss (%) CP
U(hr) GP
U(hr)
V
GG16 30 87 6 4.5 45 80 8 6.2
GoogL
eNet 60 35 7.5 5.3 76 25 9.2 7
Inc
eptionV3 72 24 8.5 6.5 78 18 10.5 8.2
ResNet50 78 18 11 8.5 88 11 13.5 11.2
MobileNetV2 76 22 12 9.2 82 15 14 12.5
ResNet101 85 12 19 17.5 92 8 27 24
/uni00000039/uni0000002a/uni0000002a/uni00000014/uni00000019
/uni0000002a/uni00000052/uni00000052/uni0000004a/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000048/uni00000053/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000039/uni00000016/uni00000030/uni00000052/uni00000045/uni0000004c/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni00000039/uni00000015
/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000018/uni00000013/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000014/uni00000013/uni00000014
0
20
40
60
80
100/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c/uni0000000b/uni00000008/uni0000000c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni00000013/uni00000011/uni00000013/uni00000013/uni00000013/uni00000013/uni00000014SGD
SGDM
Adam
RMSpop
/uni00000039/uni0000002a/uni0000002a/uni00000014/uni00000019
/uni0000002a/uni00000052/uni00000052/uni0000004a/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000048/uni00000053/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000039/uni00000016/uni00000030/uni00000052/uni00000045/uni0000004c/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni00000039/uni00000015
/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000018/uni00000013/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000014/uni00000013/uni00000014
0
20
40
60
80
100/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c/uni0000000b/uni00000008/uni0000000c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni00000013/uni00000011/uni00000013/uni00000013/uni00000014SGD
SGDM
Adam
RMSpop
/uni00000039/uni0000002a/uni0000002a/uni00000014/uni00000019
/uni0000002a/uni00000052/uni00000052/uni0000004a/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000048/uni00000053/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000039/uni00000016/uni00000030/uni00000052/uni00000045/uni0000004c/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni00000039/uni00000015
/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000018/uni00000013/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000014/uni00000013/uni00000014
0
20
40
60
80
100/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c/uni0000000b/uni00000008/uni0000000c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni00000013/uni00000011/uni00000013/uni00000013/uni00000013/uni00000014SGD
SGDM
Adam
RMSpop
/uni00000039/uni0000002a/uni0000002a/uni00000014/uni00000019
/uni0000002a/uni00000052/uni00000052/uni0000004a/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni0000002c/uni00000051/uni00000046/uni00000048/uni00000053/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000039/uni00000016/uni00000030/uni00000052/uni00000045/uni0000004c/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni00000039/uni00000015
/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000018/uni00000013/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000014/uni00000013/uni00000014
0
20
40
60
80
100/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c/uni0000000b/uni00000008/uni0000000c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni00000013/uni00000011/uni00000013/uni00000014SGD
SGDM
Adam
RMSpop
Figur
e 8: Comparison of optimization algorithms’ accuracy illustrates the performance comparison of SGD, SGDM, Adam, and RMSProp opti-
mization algorithms in terms of accuracy across CNN models to evaluate how each optimizer affects the overall accuracy of the models.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
0.00001 0.0001 0.001 0.01
Learning Rate
16
32
64 Batch Size
43.00 39.00 42.00 36.00
44.50 40.00 45.00 38.00
42.50 43.50 44.50 39.00
VGG16
0.00001 0.0001 0.001 0.01
Learning Rate
16
32
64 Batch Size
73.00 69.00 72.00 60.00
74.00 76.00 75.00 70.00
72.00 72.50 74.50 70.00
GoogleNet
0.00001 0.0001 0.001 0.01
Learning Rate
16
32
64 Batch Size
75.00 73.00 74.00 70.00
76.00 77.00 78.00 73.00
75.50 75.50 76.00 74.00
InceptionV3
0.00001 0.0001 0.001 0.01
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048
16
32
64 /uni00000025/uni00000044/uni00000057/uni00000046/uni0000004b/uni00000003/uni00000036/uni0000004c/uni0000005d/uni00000048
80.00 79.00 81.50 74.00
81.00 80.00 82.00 75.00
79.00 81.00 80.00 74.50
/uni00000030/uni00000052/uni00000045/uni0000004c/uni0000004f/uni00000048/uni00000031/uni00000048/uni00000057/uni00000039/uni00000015
0.00001 0.0001 0.001 0.01
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048
16
32
64 /uni00000025/uni00000044/uni00000057/uni00000046/uni0000004b/uni00000003/uni00000036/uni0000004c/uni0000005d/uni00000048
82.50 83.00 85.00 79.00
85.50 86.00 85.50 82.00
85.00 86.00 88.00 81.50
/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000018/uni00000013
0.00001 0.0001 0.001 0.01
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048
16
32
64 /uni00000025/uni00000044/uni00000057/uni00000046/uni0000004b/uni00000003/uni00000036/uni0000004c/uni0000005d/uni00000048
89.00 83.00 87.00 82.00
89.50 91.00 92.00 85.00
88.50 89.00 90.00 84.50
/uni00000035/uni00000048/uni00000056/uni00000031/uni00000048/uni00000057/uni00000014/uni00000013/uni00000014
40
45
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
60
70
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
70
75
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
75
80
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
80
85
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
85
90
Accuracy
Figur
e 9: The choropleth maps illustrate the impact of batch size and learning rate on the performance of various CNN architectures, visualizing
how changes in these hyperparameters influence model accuracy and efficiency
As shown in Figure 8, minor differences were observed among the accuracies of SGD, SGDM, Adam, and RMSprop optimizers
with different learning rates. However SGDM demonstrated slightly higher accuracy of 92% with a learning rate of 0.001 as compare
to others. This suggests that the incorporation of momentum in the optimization process contributed to improved performance,
albeit marginally, compared to other commonly used optimizers. In Figure 9, we investigate the impact of varying batch sizes across
different learning rates on the performance of CNN models. A batch size of 32 emerges as the optimal choice across all CNN models,
consistently demonstrating the highest accuracy across different learning rates in our study. For ResNet101, the combination of a
batch size of 32 with a learning rate of 0.001 resulted in the highest accuracy compared to other configurations. In this study, each
architecture was trained for a maximum of 150 epochs, we observed that the training process encountered local minima, where
the loss does not improve significantly, resulting in a steady accuracy level beyond 100 iterations as shown in Figure 10 . Despite
continuing the training process, further improvements in accuracy were not achieved, suggesting that the models had reached a
plateau in learning capability within 100 iterations.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000013/uni00000013/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni0000002f/uni00000052/uni00000056/uni00000056
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000013/uni00000013/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000013/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni0000002f/uni00000052/uni00000056/uni00000056
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000013/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni0000002f/uni00000052/uni00000056/uni00000056
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
0 20 40 60 80 100
/uni0000002c/uni00000057/uni00000048/uni00000055/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000056/uni0000003f/uni00000028/uni00000053/uni00000052/uni00000046/uni0000004b/uni00000056
0
10
20
30
40
50
60
70
80
90
100/uni00000039/uni00000044/uni0000004f/uni0000004c/uni00000047/uni00000044/uni00000057/uni0000004c/uni00000052/uni00000051/uni00000003/uni0000002f/uni00000052/uni00000056/uni00000056
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048/uni00000003/uni0000004f/uni00000055/uni00000020/uni00000013/uni00000011/uni00000013/uni00000014
VGG16
GoogLeNet
InceptionV3
MobileNetV2
ResNet50
ResNet101
Figur
e 10: Comparison of Highest Accuracy and Loss Across CNN architectures with different Learning Rates showcasing the highest achieved
accuracy and corresponding loss metrics across the CNN architectures. Each architecture was trained for a maximum of 150 epochs, with results
indicating the epoch at which local minima were reached.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
Hyper
parameter Optimization and Fine Tuning of ResNet101
Based on the transfer learning results, the decision to focus on ResNet101 for fine-tuning was made due to its exceptional perfor-
mance compared to the other models considered such as VGG16, GoogLeNet, ResNet50, MobileNetV2, and InceptionV3. In our
experimentation with fine-tuning a ResNet-101 model by systematically varying the number of unfrozen layers to investigate its
impact on model performance as shown in Table 2. The results demonstrate the impact of gradually unfreezing layers during the
fine-tuning process. Starting with a conservative approach of unfreezing only 10 layers, the model achieves moderate improvements
in both training and validation accuracy compared to the initial frozen model. This gradual unfreezing strategy allows the model to
adapt to the specific features of the dataset while minimizing the risk of overfitting. Continuing to unfreeze additional layers in in-
crements of 10 (Unfreeze 20 Layers, Unfreeze 30 Layers) results in further enhancements in accuracy, culminating in a remarkable
training accuracy of 100% and a validation accuracy of 99.65% after unfreezing 30 layers. This progressive unfreezing approach en-
ables the model to leverage deeper layers to learn more intricate features in the data, leading to improved performance. Nevertheless,
after unfreezing more than 30 layers (to a maximum of 40 Layers), the accuracy begins to decline. This decline may be attributable
to the increasing complexity of the model and the risk of overfitting. Moreover the results reveal a notable relationship between the
number of trainable parameters and the processing time required for training the model. An increase in the number of trainable
parameters augments model complexity, the cost for which is computational time.
Table 2: The effect of gradually unfreezing layers on model performance, showing improvements in validation accuracy and reductions in vali-
dation loss as more layers are fine-tuned, while also highlighting reductions in training time when utilizing GPU acceleration compared to CPU.
Superior values in training accuracy, validation accuracy and validation loss are emboldened.
Numbers
of T
raining V
alidation V
alidation T
rainable CP
U Time GP
U Time
Fin
e Tune Layers A
ccuracy A
ccuracy L
oss P
arameters (Hours) (Hour
)
Unfr
eeze 10 Layers 96% 94.60% 0.28% 4465664 38.50 26.20
Unfr
eeze 20 Layers 98% 97.20% 0.16% 8931328 40.25 27.50
Unfr
eeze 30 Layers 100% 99.65% 0.03% 14450176 44.20 29.50
Unfr
eeze 40 Layers 99% 98% 0.09% 15831308 46.30 31.40
The
choropleth maps in Figure 11 reveal how accuracy changes as different numbers of layers are unfrozen during training. Each
choropleth map shows a specific set of unfrozen layers, with the range being between 10 and 40, along with different batch sizes and
learning rates. Unfreezing 10 layers shows moderate accuracy improvements, with optimal performance observed at a learning rate
of 0.0001 and a batch size of 32. When 20 layers are unfrozen, further enhancements can be observed, consistently nevertheless,
favoring a learning rate of 0.0001. When 30 layers are unfrozen, significant improvements in accuracy are observed, particularly with
32 batch sizes and at a learning rate of 0.0001. Conversely, the validation loss demonstrates a consistent decrease as the number
of fine-tuned layers is raised. The lowest validation loss of 0.03% is attained when 30 layers are unfrozen. However, with 40 unfrozen
layers, accuracy improvements were notably marginal, indicating diminishing returns as the layer was count increased.
Based on these results the final fine-tuning of ResNet101 involved SGDM optimization with a learning rate of 0.0001, a minibatch
size of 32, and regularization through dropout (0.3) and weight decay (0.001), to prevent overfitting. By unfreezing the last 30 layers,
the model was able to adapt to the specific dataset while retaining the general features learned during pre-training. GPU acceleration
was utilized to expedite the training process, ensuring efficient convergence. This combination of hyperparameters, as shown in
Table 3 resulted in optimal performance, with the model achieving 100% training accuracy and 99.65% validation accuracy with
robust generalizations for insect species dataset including mimics.
Table 3: Optimal hyperparameter settings identified for fine-tuning ResNet101, which resulted in the highest validation accuracy.
Hyper
parameters Options Optimal
Values
Optimization
Algorithms SGDM
L
earning Rate 0.0001
Minib
atch Size 32
Momentum 0.9
Maximum
Epochs 100
Dr
opout Rate 0.3
Dr
opout period 5
W
eight Decay 0.001
E
xecution Environment GP
U
A
s shown in Figure 12, the gradient-weighted class activation map (Grad-CAM) results for the fine-tuned ResNet101 model pro-
vide valuable insights into its interpretation of images of the three mimic models including Danaus plexippus, Delias Belisama, and
Battus philenor. Each choropleth map highlights the regions of the images that the model deemed most significant when classify-
ing them into their respective categories. Areas with higher activation are indicated in red, illustrating the model’s focus on specific
features pertinent to its classification task. This visualization underscores the ability of the model to leverage nuanced details in the
images, revealing the underlying features that influence its predictions. By analyzing these maps, the fine-tuned ResNet101 model
prioritization of certain regions can be discerned, enhancing its decision-making process in a complex classification environment.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
0.00001 0.0001 0.001 0.01
Learning Rate
16
32
64 Batch Size
92.60 93.40 93.30 87.50
93.65 94.10 93.90 89.30
92.50 93.50 92.50 88.75
Unfreeze 10 Layers
0.00001 0.0001 0.001 0.01
Learning Rate
16
32
64 Batch Size
95.40 95.60 95.35 92.25
94.76 96.58 96.20 92.85
96.35 95.45 95.56 93.50
Unfreeze 20 Layers
0.00001 0.0001 0.001 0.01
Learning Rate
16
32
64 Batch Size
98.20 98.70 98.20 95.50
98.60 99.65 99.45 95.70
98.50 98.80 98.55 96.50
Unfreeze 30 Layers
0.00001 0.0001 0.001 0.01
/uni0000002f/uni00000048/uni00000044/uni00000055/uni00000051/uni0000004c/uni00000051/uni0000004a/uni00000003/uni00000035/uni00000044/uni00000057/uni00000048
16
32
64 /uni00000025/uni00000044/uni00000057/uni00000046/uni0000004b/uni00000003/uni00000036/uni0000004c/uni0000005d/uni00000048
96.20 96.50 97.30 95.45
97.50 97.40 97.75 96.10
96.50 97.45 97.50 94.50
/uni00000038/uni00000051/uni00000049/uni00000055/uni00000048/uni00000048/uni0000005d/uni00000048/uni00000003/uni00000017/uni00000013/uni00000003/uni0000002f/uni00000044/uni0000005c/uni00000048/uni00000055/uni00000056
88
89
90
91
92
93
94
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
92.5
93.0
93.5
94.0
94.5
95.0
95.5
96.0
96.5
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
95.5
96.0
96.5
97.0
97.5
98.0
98.5
99.0
99.5
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
94.5
95.0
95.5
96.0
96.5
97.0
97.5
/uni00000024/uni00000046/uni00000046/uni00000058/uni00000055/uni00000044/uni00000046/uni0000005c
Figur
e 11: The choropleth maps illustrate the impact of batch size and learning rate on the fine-tuning results after progressively unfreezing
layers of ResNet101
Figur
e 12: Results of the fine-tuned ResNet101 gradient-weighted class activation map (Grad-CAM). These provide insights into how the fine-
tuned ResNet101 model interprets images from each of the three mimic models. These choropleth maps show the regions of the images that
were most important for model classification of images into respective categories.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
In Figur
e 13, box-and-whisker plots are used to show the accuracies of the fine-tuned ResNet101 model across the three different
mimic datasets, with 25 test images used for each species. A one-way ANOVA test was used to evaluate the levels of statistical differ-
ence in terms of predictive performance across the three mimic models. Using an α value of 0.05, we find that all the p-values from
the one-way ANOVA test are above 0.05. This indicates that there are no statistical differences in predictive accuracy of the ResNet101
model across the three mimic datasets. This means that the fine-tuned ResNet101 model performs similarly across all three mimic
species (Danaus plexippus , Delias belisama, and Battus philenor). The higher p-values suggest that any observed differences in ac-
curacy between the datasets are likely due to random variation, rather than any meaningful difference in model performance. This
further implies that the model is consistently able to classify images across the different mimic models.
Figur
e 13: Box-and-whisker plots showing the accuracies of the ResNet101 model across three different mimics models, with 25 test images
used for each species in the representation (n = 25). The whiskers extend to the minimum and maximum accuracy values, excluding outliers. A
one-way ANOVA test using α = 0 .05 was conducted to evaluate the statistical significance of the differences in fine-tuned ResNet101 model
performance across the datasets. A resulting p-value < 0.005 indicates a statistically significant difference among accuracies, and p ≥ 0.05 indi-
cates there is no statistically significant difference. In every case, we find p ≥ 0.05.
Disscusion
The research presented here, is concerned with the identification of insect mimics utilizing a suite of advanced deep learning archi-
tectures including VGG16, GoogLeNet, InceptionV3, MobileNetV2, ResNet50, and ResNet101. The integration of dataset augmen-
tation techniques further enhances model generalization across various types of insect mimicry. Among these models, ResNet101
has emerged as the most effective, demonstrating the highest accuracy in identifying insect mimics after the application of transfer
learning techniques. Our analyses present the nuanced impacts of different optimization algorithms and hyperparameters on model
performance. Subtle variations in accuracy among optimizers like SGD, SGDM, Adam, and RMSprop, particularly at different learn-
ing rates, are notable. SGDM stands out marginally, showcasing the influence of momentum incorporation. The momentum of the
SGDM component aided in smoother convergence through the accumulation of velocity across iterations (cf. Figure 8), which were
important for navigating complex optimization landscapes. Finding the appropriate learning rate was crucial. If the learning rate was
too high (0.01), the optimization process diverged, leading to unstable training or overshooting the optimal solution (cf. Figure 9).
When fine tuning of Resnet101, the training and validation accuracies exhibited a discernible pattern (cf. Table 2), each generally
improving, and reaching a peak of 100% training accuracy and 99.65% validation accuracy on unfreezing 30 layers.Table 4 compares
this study against other recent works on insect mimic identification. Specifically, the table compares the accuracy, learning rate,
otpimizer used, batch size and CNN model in each case. With an accuracy of 99.65%, our results outperform the limited number
of published studies on insect mimic identification, highlighting the effectiveness of the proposed approach in a relatively under-
researched area.
Conversely, the validation loss demonstrates a consistent decreasing trend as the number of fine-tuned layers increases. The lowest
validation loss of 0.03% is attained when 30 layers are unfrozen. This indicates that deeper fine-tuning allows the model to capture
finer details and nuances in insect images, leading to improved generalization performance and more accurate species identification.
Notably, our experiments revealed that while varying batch sizes influenced model performance across the insect dataset, the most
optimal results were consistently achieved with a batch size of 32 with learning rate 0.0001.
Our comprehensive tuning strategy proved the best fit to strike a delicate balance between model complexity and robustness, ulti-
mately seeking improved accuracy and generalization, leveraging the parallel processing capabilities of a GPU environment. Gradually
unfreezing layers effectively improved the performance of the model, indicating a successful fine-tuning strategy, such that the model
learned intricate features within the insect dataset without sacrificing its ability to generalize to unseen examples.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
T
able 4: Comparison of accuracy results from recent published works for insect mimic identification. The table lists the accuracy, learning rate,
optimizer, batch size, CNN models, and fine tuning approaches for each referenced publication.
Publication Y
ear A
ccuracy L
earning rate Optimiz
er Bat
ch size CNN
model Fin
e tuning method
W
ang et al. 60 2022 96% 0.0001 A
dam 64 S
-ResNet Residual
structure
K
alaiarasi et al. 61 2023 88.56% 0.0001 Nadam 32 Inc
eptionV3 Softmax
layer
Do
an et al. 62 2023 72.31% 0.001 A
dam 32 Ef
ficientNet P
ower Mean SVM
Hassan
et al. 63 2024 88.48% 0.001 A
dam 32 ResNet101-
SA Self
attention layers
Ong
et al. 64 2024 89% 0.00001 A
dam 79.5 X
ception C
onvolutional blocks
Mat
tins et al. 65 2024 98.20% 0.001 SGD 64 Ef
fi-CNN-3 C
onvolutional blocks
Hasan
et al. 66 2024 97% 0.0001 SGD 32 ResNet152V2 Unfr
eeze all layers
Spiesman
et al. 67 2024 94.9% 0.001 A
dam 32 Ef
ficientNetV2 L F
reeze all layers
Manc
handa et al. 68 2024 83.99% 0.001 A
dam 32 X
ception Unfr
eeze all layers
Sauer
et al. 69 2024 91% 0.0001 A
dam 32 ResNet101 Unfr
eeze all layers
This
study 2024 99.65% 0.0001 SGDM 32 ResNet101 Unfr
eeze last 30 layers
T
able 4 provides a comparative overview of CNN-based models for insect species identification, revealing a range of accuracies
reported in recently published articles. Models like ResNet variants, EfficientNet, InceptionV3, and custom architectures (e.g., Effi-
CNN-3) exhibit varying levels of success, with ResNet-based models proving to be consistently high in performance, this being due
to features like self-attention and residual structures. Fine-tuning strategies differ widely. Some studies, such as Wang et al. 60, use
residual layer modifications, while others (e.g., Manchanda et al. 68) unfreeze all layers, impacting the prediction accuracy. Our study
selectively unfreezes the last 30 layers of ResNet101, and combined with SGDM optimization at a learning rate of 0.0001, achieves
the highest prediction accuracy compared to any other recent study at 99.65%. This suggests that targeted fine-tuning to preserve
feature quality, while concurrently enhancing specificity, is an effective approach. Adam has been a preferred optimizer in the majority
of recent studies, though SGDM as used in our study, has proved beneficial for achieving precise training outcomes. Variations in
batch size, optimizer, and learning rate are noteed to affect model performance, which depend to a great extent on finely tuned
hyperparameters and careful architectural adjustments, highlighting our success in selective tuning and optimization to enhance
classification accuracy.
Conclusions
AInsectID v1.1 open source software represents an advancement in the field of insect identification, achieving an accuracy rate of
99.65%, and outperforming the accuracy rates from previous studies. This study addresses challenges related to the identification
of insect species using Deep Convolutional Neural Networks (DCNNs), with a focus on leveraging advanced transfer learning and
fine-tuning strategies to enhance identification performance. Our research problem was primarily concerned with achieving high
accuracy in distinguishing between insect species, and testing the prediction accuracy against insect mimics. By evaluating several
CNN models and comparing their accuracies, fine-tuning approaches, and performances across key parameters, we provide a com-
prehensive exploration highlighting the potential of CNN in insect species classification. The main contributions of our work are in the
identification of optimal model structures and hyperparameters for insects mimics. After rigorous testing, we found that ResNet101,
together with the selective unfreezing of the last 30 layers, offers a high level of balance between generalization and specificity, achiev-
ing a peak accuracy of 99.65%. Using a selective fine-tuning approach, coupled with SGDM optimization and an appropriate learning
rate, was found to significantly enhance model performance, without the computational burden of training from scratch. When com-
paring against other published studies using different CNN models and fine-tuning strategies, our approach demonstrates that by
preserving essential feature extraction layers while adjusting recent layers, we are able to optimally leverage transfer learning through
challenging classification tasks. Beyond model selection and hyperparameter tuning, our research elucidates the broader applicabil-
ity of fine-tuned CNNs in detailed species identification tasks. By achieving nearly perfect classification accuracy, AInsectID v1.1 offers
promising implications for expanding DCNN use in biodiversity and conservation fields. Additionally, our work shows that CNNs can
handle complex visual tasks, such as the differentiation of mimic species from their mimicked counterparts, an accomplishment that
could extend to identifying subtle phenotypic differences in other taxa as well. There remain nevertheless several avenues for future
directions for this work. Expanding the dataset to include more mimic species could be used to test model robustness, as well as its
ability to generalize to unfamiliar species. Research into automated data augmentation, using generative models, might also yield
richer training data, further boosting classification accuracy.
DATA AVAILABILITY
AInsectID v1.1 is available as an open source package from https://doi.org/10.7488/ds/7801. The package includes all Matlab codes,
as well as the Graphical User Interfaces for the software. The training datasets used in this work are owned and stored by the National
Museum of Scotland, Edinburgh, and the Natural History Museum, London. The Zenodo (CERN Data Center) open source dataset is
available at: https://doi.org/10.5281/zenodo.3549369
ACKNOWLEDGMENTS
The authors wish to thank Dr. Marcelo Dias from The University of Edinburgh for his helpful advice and productive comments. H.S.
wishes to express appreciation to the Higher Education Commission (HEC) of Pakistan for providing a fully funded Ph.D. scholarship.
All authors are grateful to the National Museum of Scotland and the Natural History Museum, London, for generously providing the
insect species datasets used in this study.
AUTHOR CONTRIBUTIONS
Conceptualization: P.A. Methodology: H.S. and P.A. Investigation: H.S. and P.A. Visualization: H.S. Writing: H.S. Editing: P.A. Funding
Acquisition: H.S. Supervision: P.A.
AUTHOR COMPETING INTERESTS
The authors declare no competing interests.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
References
[1] Haleema Sadia and Parvez Alam. AInsectID Version 1.1 - a free to use species identification, image analysis and colour mapping software [software]. Edinburgh DataShare,
2024.
[2] Haleema Sadia and Parvez Alam. Enhanced k-means color clustering based on slic superpixels merging incorporated within the entomology software: Ainsectid. In 2024
IEEE International Conference on Evolving and Adaptive Intelligent Systems (EAIS) , pages 1–9, 2024.
[3] Marc Desquesnes, Denphum Wongthangsiri, Sathaporn Jittapalapong, and Theeraphap Chareonviriyaphap. Guidelines for user-friendly iconographic description of
hematophagous flies’ external morphology; application to the identification of tabanus rubidus (wiedemann, 1821)(diptera: Tabanidae). Journal of Asia-Pacific Entomology,
21(3):807–822, 2018.
[4] Vivek Kumar, Dakshina R Seal, Lance S Osborne, and Cindy L McKenzie. Coupling scanning electron microscopy with dna bar coding: a novel approach for thrips identification.
Applied entomology and zoology, 49:403–409, 2014.
[5] Timothy J Gibb and Christian Oseto. Insect collection and identification: techniques for the field and laboratory . Academic Press, 2019.
[6] Sonja Knölke, Andreas Segerer, Michael Miller, Axel Hausmann, and Sven Erlacher. A procedure for combined genitalia dissection and dna extraction in lepidoptera. Insect
systematics & evolution, 35(4):401–409, 2004.
[7] Lawrence I Gilbert. Lipid metabolism and function in insects. In Advances in insect physiology, volume 4, pages 69–211. Elsevier, 1967.
[8] KOK Popoola and A Otalekor. Analysis of aquatic insects communities of awba reservoir and its physico-chemical properties. 2011.
[9] Michael Kosztarab et al. Scale insects of northeastern North America: identification, biology, and distribution. Virginia Museum of Natural History, 1996.
[10] Shelley L Ball and Karen F Armstrong. Rapid, one-step dna extraction for insect pest identification by using dna barcodes. Journal of economic entomology, 101(2):523–532,
2014.
[11] Reshma Ramesh Babu. Imageomics Approach to Understanding Visual Biological Trait Similarities using Butterfly Mimicry as a Model System . PhD thesis, The Ohio State
University, 2023.
[12] D Saranyaraj, M Manikandan, and S Maheswari. A deep convolutional neural network for the early detection of breast carcinoma with respect to hyper-parameter tuning.
Multimedia Tools and Applications, 79(15-16):11013–11038, 2020.
[13] Gabrielis Cerniauskas, Haleema Sadia, and Parvez Alam. Machine intelligence in metamaterials design: a review. Oxford Open Materials Science, 4(1):itae001, 2024.
[14] Ana Cláudia Teixeira, José Ribeiro, Raul Morais, Joaquim J Sousa, and António Cunha. A systematic review on automatic insect detection using deep learning. Agriculture,
13(3):713, 2023.
[15] Madhuri Devi Chodey and C Noorullah Shariff. Pest detection via hybrid classification model with fuzzy c-means segmentation and proposed texture feature. Biomedical
Signal Processing and Control, 84:104710, 2023.
[16] Kim Bjerge, Jamie Alison, Mads Dyrmann, Carsten Eie Frigaard, Hjalte MR Mann, and Toke Thomas Høye. Accurate detection and identification of insects from camera trap
images with deep learning. PLOS Sustainability and Transformation, 2(3):e0000051, 2023.
[17] Keanu Buschbacher, Dirk Ahrens, Marianne Espeland, and Volker Steinhage. Image-based species identification of wild bees using convolutional neural networks. Ecological
Informatics, 55:101017, 2020.
[18] Daniel Motta, Alex Álisson Bandeira Santos, Ingrid Winkler, Bruna Aparecida Souza Machado, Daniel André Dias Imperial Pereira, Alexandre Morais Cavalcanti, Eduardo
Oyama Lins Fonseca, Frank Kirchner, and Roberto Badaró. Application of convolutional neural networks for classification of adult mosquitoes in the field. PloS one ,
14(1):e0210829, 2019.
[19] Jennifer F Hoyal Cuthill, Nicholas Guttenberg, Sophie Ledger, Robyn Crowther, and Blanca Huertas. Deep learning on butterfly phenotypes tests evolutions oldest mathe-
matical model. Science advances, 5(8):eaaw4967, 2019.
[20] Denis O Kiobia, Canicius J Mwitta, Kadeghe G Fue, Jason M Schmidt, David G Riley, and Glen C Rains. A review of successes and impeding challenges of iot-based insect
pest detection systems for estimating agroecosystem health and productivity of cotton. Sensors, 23(8):4127, 2023.
[21] Satinder Bal Gupta, RajKumar Yadav, Fatemeh Bovand, Pankaj Kumar Tyagi, et al. Developing precision agriculture using data augmentation framework for automatic
identification of castor insect pests. Frontiers in Plant Science, 14:1101943, 2023.
[22] Md Sakib Ullah Sourav and Huidong Wang. Intelligent identification of jute pests based on transfer learning and deep convolutional neural networks. Neural Processing
Letters, 55(3):2193–2210, 2023.
[23] Alberto Testolin. Can neural networks do arithmetic? a survey on the elementary numerical skills of state-of-the-art deep learning models. Applied Sciences, 14(2):744,
2024.
[24] Peng Yan, Ahmed Abdulkadir, Paul-Philipp Luley, Matthias Rosenthal, Gerrit A Schatte, Benjamin F Grewe, and Thilo Stadelmann. A comprehensive survey of deep transfer
learning for anomaly detection in industrial time series: Methods, applications, and directions. IEEE Access, 2024.
[25] Ehsan Latif and Xiaoming Zhai. Fine-tuning chatgpt for automatic scoring. Computers and Education: Artificial Intelligence, page 100210, 2024.
[26] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE
conference on computer vision and pattern recognition, pages 580–587, 2014.
[27] Grega Vrbancic, Milan Zorman, and Vili Podgorelec. Transfer learning tuning utilizing grey wolf optimizer for identification of brain hemorrhage from head ct images. In
StuCoSReC: proceedings of the 2019 6th student computer science research conference, pages 61–66, 2019.
[28] Ashnil Kumar, Jinman Kim, David Lyndon, Michael Fulham, and Dagan Feng. An ensemble of fine-tuned convolutional neural networks for medical image classification.
IEEE journal of biomedical and health informatics, 21(1):31–40, 2016.
[29] Mohammed Aljebreen, Hanan Abdullah Mengash, Fadoua Kouki, and Abdelwahed Motwakel. Improved artificial ecosystem optimizer with deep-learning-based insect
detection and classification for agricultural sector. Sustainability, 15(20):14770, 2023.
[30] T Saranya, C Deisy, S Sridevi, Kalaiarasi Sonai Muthu, and MKA Ahamed Khan. Performance analysis of first order optimizers for plant pest detection using deep learning. In
International Conference on Machine Learning, Image Processing, Network Security and Data Sciences, pages 37–52. Springer, 2022.
[31] Telmo De Cesaro Júnior and Rafael Rieder. Automatic identification of insects from digital images: A survey. Computers and Electronics in Agriculture, 178:105784, 2020.
[32] Tianbao Yang. Advancing non-convex and constrained learning: Challenges and opportunities. AI Matters, 5(3):29–39, 2019.
[33] Suchang Lim, Seunghyun Kim, Sungwook Park, and Doyeon Kim. Development of application for forest insect classification using cnn. In 2018 15th International Confer-
ence on Control, Automation, Robotics and Vision (ICARCV) , pages 1128–1131. IEEE, 2018.
[34] Fathimathul Rajeena PP, Rasha Orban, Kogilavani Shanmuga Vadivel, Malliga Subramanian, Suresh Muthusamy, Diaa Salam Abd Elminaam, Ayman Nabil, Laith Abulaigh,
Mohsen Ahmadi, and Mona AS Ali. A novel method for the classification of butterfly species using pre-trained cnn models. Electronics, 11(13):2016, 2022.
[35] Rumana Yasmin, Aparna Das, Liton Jude Rozario, and Md Ezharul Islam. Butterfly detection and classification techniques: A review. Intelligent Systems with Applications,
page 200214, 2023.
[36] Md. Abedur Rahman Shamim, A.B.M Anas, and Md. Erfan. Identification of vector and non-vector mosquito species using deep convolutional neural networks with ensemble
model. In 2022 International Conference on Advancement in Electrical and Electronic Engineering (ICAEEE), pages 1–6, 2022.
[37] Nikita Agarwal, Tina Kalita, and Ashwani Kumar Dubey. Classification of insect pest species using cnn based models. In 2023 International Conference on Computational
Intelligence and Sustainable Engineering Solutions (CISES) , pages 862–866, 2023.
[38] Ascharya Soni, Anuraag Khare, P S Darshan Balaji, Sachin Verma, K P Asha Rani, and S Gowrishankar. Pest identification and control using deep learning and augmented
reality. In 2022 International Conference on Edge Computing and Applications (ICECAA), pages 1–7, 2022.
[39] Rusby G Contreras-Díaz, Javier Nori, Xavier Chiappa-Carrara, A Townsend Peterson, Jorge Soberón, and Luis Osorio-Olvera. Well-intentioned initiatives hinder understanding
biodiversity conservation: Cloaked inaturalist information for threatened species. Biological Conservation, 282:110042, 2023.
[40] Troy Bartlett. Bugguide. net: Identification, images, & information for insects, spiders & their kin for the united states & canada, 2003.
[41] Jenna Otter, Stephanie Mayer, and Christian A Tomaszewski. Swipe right: a comparison of accuracy of plant identification apps for toxic plants. Journal of Medical Toxicology,
17:42–47, 2021.
[42] Suchang Lim, Seunghyun Kim, Sungwook Park, and Doyeon Kim. Development of application for forest insect classification using cnn. In 2018 15th International Confer-
ence on Control, Automation, Robotics and Vision (ICARCV) , 2018.
[43] Morgan Manderfield. Seek, picture insect, google lens: An analysis of popular insect identification apps using photos of realistic quality. 2022.
[44] Celal Öztürk, Murat Taşyürek, and Mehmet Uğur Türkdamar. Transfer learning and fine-tuned transfer learning methods’ effectiveness analyse in the cnn-based deep
learning models. Concurrency and Computation: Practice and Experience, 35(4):e7542, 2023.
[45] Muhammad Rehan, Muhammad Shahid Iqbal Malik, and Mona Mamdouh Jamjoom. Fine-tuning transformer models using transfer learning for multilingual threatening
text identification. IEEE Access, 2023.
[46] Hoang-Tu Vo, Tran Ngoc Hoang, and Luyl-Da Quach. An approach to hyperparameter tuning in transfer learning for driver drowsiness detection based on bayesian opti-
mization and random search. International Journal of Advanced Computer Science and Applications, 14(4), 2023.
[47] Zehui Zhao, Laith Alzubaidi, Jinglan Zhang, Ye Duan, and Yuantong Gu. A comparison review of transfer learning and self-supervised learning: Definitions, applications,
advantages and limitations. Expert Systems with Applications, page 122807, 2023.
[48] P.J. Gullan and P.S. Cranston. The Insects: An Outline of Entomology. Wiley, 2010.
[49] Nigel E. Stork. How many species of insects and other terrestrial arthropods are there on earth? Annual Review of Entomology , 63(Volume 63, 2018):31–45, 2018.
[50] Shawan Chowdhury, Myron P Zalucki, Jeffrey O Hanson, Sarin Tiatragul, David Green, James EM Watson, and Richard A Fuller. Three-quarters of insect species are insuffi-
ciently represented by protected areas. One Earth, 6(2):139–146, 2023.
[51] Paul Chatelain, Marianne Elias, Colin Fontaine, Claire Villemant, Isabelle Dajoz, and Adrien Perrard. Müllerian mimicry among bees and wasps: a review of current knowledge
and future avenues of research. Biological Reviews, 2023.
[52] A. Gandhimathi Muktai Kuwalekar Krushnamegh Kunte Riddhi Deshmukh, Saurav Baral. Mimicry in butterflies: co-option and a bag of magnificent developmental genetic
tricks. WIREs Developmental Biology, 7(1), 2018.
[53] Phillip Chlap, Hang Min, Nym Vandenberg, Jason Dowling, Lois Holloway, and Annette Haworth. A review of medical image data augmentation techniques for deep learning
applications. Journal of Medical Imaging and Radiation Oncology, 65(5):545–563, 2021.
[54] Natural History Museum. Natural history museum data portal, 2023.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
[55] Osk
ar Liset Pryds Hansen, J-C Svenning, Kent Olsen, Steen Dupont, Beulhah H Garner, Alexandros Iosifidis, Benjamin W Price, and Toke Thomas Høye. Image data used for
publication" species-level image classification with convolutional neural network enable insect identification from habitus images [data set]". Zenodo (CERN Data Center),
2019.
[56] Nour Eldeen Khalifa, Mohamed Loey, and Seyedali Mirjalili. A comprehensive survey of recent trends in deep learning for digital images augmentation. Artificial Intelligence
Review, pages 1–27, 2022.
[57] Suorong Yang, Weikang Xiao, Mengcheng Zhang, Suhan Guo, Jian Zhao, and Furao Shen. Image data augmentation for deep learning: A survey. arXiv preprint
arXiv:2204.08610, 2022.
[58] Ana Cláudia Teixeira, José Ribeiro, Raul Morais, Joaquim J Sousa, and António Cunha. A systematic review on automatic insect detection using deep learning. Agriculture,
13(3):713, 2023.
[59] Thomas N Sherratt and Amanda Stefan. Capture tolerance: A neglected third component of aposematism? Evolutionary Ecology, pages 1–19, 2024.
[60] Pei Wang, Fan Luo, Lihong Wang, Chengsong Li, Qi Niu, and Hui Li. S-resnet: An improved resnet neural model capable of the identification of small insects. Frontiers in
Plant Science, 13:1066115, 2022.
[61] G Kalaiarasi, G Nirmala, P Saravanan, T Vignesh, V Makashkumar, et al. Transforming agriculture with ai: Automated crop insect identification using inceptionv3 transfer
learning. In 2023 First International Conference on Advances in Electrical, Electronics and Computational Intelligence (ICAEECI) , pages 1–6. IEEE, 2023.
[62] Thanh-Nghi Doan. Large-scale insect pest image classification. Journal of Advances in Information Technology , 14(2):328–341, 2023.
[63] Sk Mahmudul Hassan and Arnab Kumar Maji. Pest identification based on fusion of self-attention with resnet. IEEE Access, 2024.
[64] Song-Quan Ong, Gomesh Nair, Umi Kalsom Yusof, and Hamdan Ahmad. Community-based mosquito surveillance: an automatic mosquito-on-human-skin recognition
system with a deep learning algorithm. Pest Management Science, 78(10):4092–4104, 2022.
[65] R Faerie Mattins, M Vergin Raja Sarobin, Azrina Abd Aziz, and S Srivarshan. Object detection and classification of butterflies using efficient cnn and pre-trained deep convo-
lutional neural networks. Multimedia Tools and Applications , 83(16):48457–48482, 2024.
[66] Md Mahmudul Hasan, SM Shaqib, Ms Sharmin Akter, Rabiul Alam, Afraz Ul Haque, et al. Unleashing the power of transfer learning model for sophisticated insect detection:
Revolutionizing insect classification. arXiv preprint arXiv:2406.07716, 2024.
[67] Brian J Spiesman, Claudio Gratton, Elena Gratton, and Heather Hines. Deep learning for identifying bee species from images of wings and pinned specimens. Plos one,
19(5):e0303383, 2024.
[68] Mahesh Manchanda, Vineet Kukreti, Aman Kumar, Aayush Katiyar, and Yash Nikhurpa. Optimizing farm insect image classification: A transfer learning approach with model
selection. In 2024 International Conference on Inventive Computation Technologies (ICICT), pages 657–662. IEEE, 2024.
[69] Felix G Sauer, Moritz Werny, Kristopher Nolte, Carmen Villacañas de Castro, Norbert Becker, Ellen Kiel, and Renke Lühken. A convolutional neural network to identify mosquito
species (diptera: Culicidae) of the genus aedes by wing images. Scientific Reports, 14(1):3094, 2024.
.CC-BY-NC 4.0 International licenseavailable under a
(which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made
The copyright holder for this preprintthis version posted November 3, 2024. ; https://doi.org/10.1101/2024.11.01.621497doi: bioRxiv preprint
Text is read by the "Ask this paper" AI Q&A widget below.
Extraction quality varies by source — PMC NXML preserves structure
cleanly, OA-HTML may include some navigation residue, and OA-PDF can
have broken hyphenation. The publisher copy
(via DOI)
is the canonical version.