Hyperparameter Optimization in CNN Algorithm for Chili
Leaf Disease Classification
Rizal Amegia Saputra
1
, Diah Puspitasari
2
, Adi Supriyatna
2
, Dede Firmansyah Saefudin
1
,
Rachmat Adi Purnama
2
and Kresna Ramanda
2
1
Universitas Bina Sarana, Sukabumi, Indonesia
2
Universitas Bina Sarana Informatika, Jakarta, Indonesia
kresna.kra@bsi.ac.id
Keywords:
Hyperparameter Optimization, CNN Algorithm, Chili Leaf Disease.
Abstract:
Diseases of a plant will greatly affect the yield. Chilli plants are one of the most frequently used food ingre-
dients in various dishes in Indonesia. Leaves on chili plants are often affected by the disease, if the condition
is not treated immediately, the disease can damage plants and result in crop failure, early detection of chili
plant diseases is very important to do, to reduce the risk of crop failure. Technological developments and the
application of deep learning algorithms can monitor chili plants automatically using a computer system. Using
this algorithm, the system will analyze and identify diseases that can be seen and recorded by the camera. In
this study, the proposed method uses the CNN algorithm by optimizing hyperparameters. The optimizers used
are Adam, Nadam, SGD, RMSProp, and Adadelta with Epoch 50 and 100, Learning Rate 0.1, and Batch Size
8, 16, and 32. From the Optimizer used, the Nadam optimizer at epoch 100, batch size 16, learning rate 0.1
gives the most optimal results with 86% accuracy, 86% precision, 84% recall, and 84% f1-score. It is proven
that the CNN algorithm and the Nadam architecture are well capable of classifying data according to its class.
1 INTRODUCTION
Indonesia is the fourth largest producer of chilli
plants, nationally the chilli plants with the highest
production rates (Zikra et al., 2021). Chilli plants are
not a staple food crop, but become a complementary
spice to Indonesian cuisine, with prices that are al-
ways fluctuating making chilli a contributor to infla-
tion for the Indonesian economy (Rosalina and Wi-
jaya, 2020), one of the things that make chilli a con-
tributor to inflation because chilli prices often soar,
and the causative factor is crop failure.
There are several factors that cause crop failure in
chilli plants such as pests and diseases (L et al., 2018),
pests and diseases become a serious threat to farmers
because they can result in a decrease in the quality
or quantity of the crop (Islam et al., 2020). In chilli
plants, there are several types of pests and diseases
that are often infected such as leaf curl, leaf spots,
whitefly, and yellowish (Meilin and Tanaman Cabai
Serta Pengendaliannya, 2014). Identifying the disease
can be done by looking at the shape of the leaves and
colour, but the shape of the leaves and the colour have
similarities so it is difficult to do, especially for young
farmers (Simalango et al., 2020). For this reason, it
is necessary to handle early identification of types of
pests and diseases, in order to reduce the risk of crop
failure.
Deep learning is a computational model that is
currently widely used in various fields, especially in
agriculture (Saputra et al., 2022). There are sev-
eral algorithms in the deep learning model, one of
which is the Convolutional Neural Network (CNN)
(Sekaran et al., 2020). The CNN algorithm has ad-
vantages compared to other algorithms (Anton et al.,
2021), in the CNN algorithm there are Hyperparam-
eters that we can optimize to get the maximum accu-
racy value (Gulcu and Kus, 2020). Hyperparameter is
a network structure in the CNN algorithm that can be
trained and optimized manually (Raziani and Azim-
bagirad, 2022; Zhu, 2018), Hyperparameter optimiza-
tion in the CNN algorithm is a problem that many re-
searchers and practitioners have found, to make hy-
perparameters more effective, experts need to deter-
mine some hyperparameters manually, the best results
of this manual configuration are modelled and imple-
mented on the CNN algorithm (Zhu, 2018).
In this paper, we propose a method to improve
Saputra, R., Puspitasari, D., Supriyatna, A., Saefudin, D., Purnama, R. and Ramanda, K.
Hyperparameter Optimization in CNN Algorithm for Chili Leaf Disease Classification.
DOI: 10.5220/0012445000003848
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 3rd International Conference on Advanced Information Scientific Development (ICAISD 2023), pages 139-142
ISBN: 978-989-758-678-1
Proceedings Copyright © 2024 by SCITEPRESS – Science and Technology Publications, Lda.
139
CNN performance by adjusting hyperparameters at
the CNN feature extraction step. Research to de-
tect chilli disease has been widely carried out such
as research (Rozlan and Hanafi, 2022) using deep
learning algorithms, namely CNN with the VGG16,
InceptionV3, and EfficientNetB0 architectures, ob-
tained InceptionV3 has the best accuracy of 98.83%.
Research (Tsany and Dzaky, 2021) using CNN al-
gorithms with AlexNet architecture, the accuracy of
which is 90%. Research (Rosalina and Wijaya, 2020)
used deep learning algorithms, with datasets collected
personally, built applications and obtained an accu-
racy value of 68.8%. Research (Nuanmeesri and Sri-
urai, 2021) using the Multi-Layer Perceptron Neural
Network (MLPNN) algorithm, obtained an accuracy
value of 98.91%. Research (Sari et al., 2021) using
SVM and GLCM algorithms, obtained an accuracy
value of 88%. Research (Das et al., 2019) used ma-
chine learning with an accuracy result of 61.49%. Re-
search (Zikra et al., 2021) using SVM and GLCM al-
gorithms, the parameters used were three characteris-
tics including contrast, correlation, and energy, while
the characteristics using four which included contrast,
correlation, energy, and homogeneity, obtained an ac-
curacy rate of 95%. Research (Wahab et al., 2019)
using the K-Means algorithm for Segmented and Sup-
port Vector Machine for classification, obtained ac-
curacy results of 90.9% and Research (Muslim and
Arnie, 2015) using the Bayes theorem algorithm in
the application of the chilli pest and disease diagno-
sis expert system, obtained the results of pretest tests
and posttests the accuracy results were 100%. Based
on some of the research above, the research that will
be carried out is to apply the CNN algorithm with
the MobileNet architecture, and apply hyperparame-
ter tuning to epoch, batch size, learning rate and opti-
mizer (Adam, Nadam, SGD, RMSProp and Adadelta)
during the Model training process. The model will be
evaluated using a confusion matrix to see the level of
accuracy, precision, recall and f1-score produced by
the model.
2 METHODS
At this stage, explaining the stages of the method to be
proposed, namely first collecting image datasets from
data published on the Kaggle, the total data collected
is 400 image images, consisting of 80 healthy images,
80 leaf curl images, 80 leaf spot images, 80 whitefly
images, 80 yellowish images. Furthermore, the sec-
ond stage is the preprocessing stage, at this stage, the
image dataset is labelled consisting of ve chilli leaf
diseases, namely healthy, leaf curl, leaf spot, white-
fly, and yellowish. Image data is divided into two
parts, namely 80% training data and 20% testing data.
In the third stage, we implemented the CNN model
with MobileNet architecture with hyperparameter op-
timization, namely Epoch 50 and 100, Learning Rate
0.1, Batch Size 8, 16 and 32, with the Optimizer used,
namely Adm, Nadam, SGD, RMSProp and Adadelta.
And the last stage is to compare the accuracy, pre-
cision, recall and f1-score results of each Optimizer.
Here’s a picture of the proposed method:
Figure 1: Proposed Methodology.
3 RESULT AND DISCUSSION
The experiment was conducted by training data train-
ing and data validation using the CNN MobileNetV2
architecture. In the training stage, the model will be
carried out with several scenarios that aim to optimize
the model in classifying chilli leaf disease. There
were 4 optimization scenarios of the CNN model used
in this study. The first scenario was tested on the
number of epochs, the second scenario was tested for
the influence of batch size, and the third scenario was
tested for the influence of the optimal optimizer type,
of the three scenarios using a learning rate of 0.1, with
the aim of finding the best performance in each exper-
iment. Furthermore, the model will be tested using
training data consisting of 400 images of chilli leaf
disease.
1. Influence Optimizer Testing
The first scenario was tested on the use of epoch
amounts 50 and 100 at the time of model training,
this was done to find the number of epochs that
Table 1: Test Results With Epoch 50.
Batch Size 8 16 32
Acc Loss Acc Loss Acc Loss
Adam 0.72 0.69 0.80 0.59 0.82 0.71
Nadam 0.82 0.54 0.80 0.54 0.80 0.55
SGD 0.82 0.51 0.80 0.55 0.78 90.47
RMSProp 0.80 0.56 0.82 0.45 0.70 1.39
Adadelta 0.24 1.82 0.18 1.89 0.24 1.83
ICAISD 2023 - International Conference on Advanced Information Scientific Development
140
had the best performance.
In the table above, it can be seen that from all
types of optimizers tested, there is the same high
accuracy result between optimizers, which is 0.82
even though the loss level is different, for that the
RMSProp optimizer is the best because it has a
small loss value compared to the other three opti-
mizers.
Table 2: Test Results With Epoch 100.
Batch Size 8 16 32
Acc Loss Acc Loss Acc Loss
Adam 0.80 0.48 0.80 0.57 0.82 0.48
Nadam 0.84 0.49 0.86 0.51 0.84 0.67
SGD 0.78 0.59 0.76 0.51 0.80 0.59
RMSProp 0.80 0.61 0.75 0.66 0.81 0.58
Adadelta 0.23 1.68 0.22 1.61 0.21 1.55
Based on Table 2 above, you can see the test re-
sults of various types of optimizers with an epoch
of 100, and Nadam optimizers with batch size 16,
resulting in the best accuracy value of 86% with
the lowest loss value of 0.45. As for the SGD,
Nadam RMSProp and Adadelta optimizers, the
accuracy and loss values are not too different, but
for the Adam optimizer, although it gets an ac-
curacy of 82%, the performance is still below the
Nadam optimizer tested. Graphs of accuracy and
loss during CNN model training using the Nadam
optimizer can be seen in Figure 2.
2. Model Evaluation
To find out more about the performance of the
CNN model used, an evaluation will be carried
out using a confusion matrix in the training data
(Gorunescu, 2011). The CNN model is evaluated
to obtain accuracy, precision, recall and f1-score
values. The results of the confusion matrix can
be seen in Figure 3. Based on Figure 3 above, it
was found that out of 80% of the images in the
Healthy class, but there were 20% of the images
were mispredicted, for the leaf curl class all im-
ages were successfully predicted correctly with-
out any errors. In the leaf curl disease class, there
is no correctly predicted imagery, in leaf spot im-
agery there is 90% of the image is predicted cor-
rectly while 10% is predicted incorrectly, while in
whitefly imagery 100% is predicted correctly, and
in yellowish imagery, 80% is predicted correctly
and 20% is predicted incorrectly. From the results
of the confusion matrix, accuracy, precision, re-
call, and f1-score values are obtained as seen in
Table 3.
Table 3: Confusion Matrix Results.
Accuracy Precission Recall F1-Score
86% 86% 84% 84%
Figure 2: AUC Graph Optimzer Nadam With Epoch 100
and Batch Size 16.
Figure 3: AUC Graph CNN Model With Optimzer Nadam
and Epoch 100, and Batch Size 16.
Based on Table 3, it can be seen that the CNN
MobileNet-V2 architecture used in this study by do-
ing several hyper-parameter optimizations such as
epoch, batch size, learning rate and optimizer can pro-
vide excellent results. This is proven from a series of
experiments conducted so as to get an accuracy value
of 86%, precision 86%, recall 84% and f1-score 84%.
4 CONCLUSIONS
This study optimized the CNN model using several
hyperparameters such as epoch, batch size, learning
rate and optimizers to classify rice diseases in Indone-
sia. The purpose of this study was to obtain optimal
hyperparameters to achieve good performance on the
CNN model. This study used CNN’s MobileNet-V2
architecture as a training model. Based on the exper-
iments that have been carried out, the determination
of hyperparameters greatly affects the performance of
the model. Hyperparameters with an epoch count of
100, batch size of 16, learning rate of 0.1 and Nadam
optimizer provide the most optimal results with an
accuracy value of 86%, precision of 86%, recall of
84% and f1-score 84% in the training data used. This
shows that the model is able to properly classify data
according to its class. This study only focuses on
Hyperparameter Optimization in CNN Algorithm for Chili Leaf Disease Classification
141
the classification of chilli leaf disease, it is hoped
that in the next study, it can classify the diseases that
attack chilli leaves. Need to do a comparison with
other CNN architectures like DenseNet, Resnet and
Alexnet to get better accuracy.
ACKNOWLEDGEMENTS
The author would like to thank all parties who have
supported the completion of this research process, as
well as those who have contributed both in the form
of time and thoughts.
REFERENCES
Anton, A., Nissa, N., Janiati, A., Cahya, N., and Astuti, P.
(2021). Application of deep learning using convolu-
tional neural network (cnn) method for women’s skin
classification. Sci. J. Informatics, 8(1):144–153,.
Das, S., Silva, C., Malemath, V., and Sundaram, K.
(2019). Disease identification in chilli leaves using
machine learning techniques. Int. J. Eng. Adv. Tech-
nol, 9(1S3):325–329,.
Gorunescu, F. (2011). Data Mining, 12.
Gulcu, A. and Kus, Z. (2020). Hyper-parameter se-
lection in convolutional neural networks using mi-
crocanonical optimization algorithm. IEEE Access,
8:52528–52540,.
Islam, A., Schreinemachers, P., and Kumar, S. (2020).
Farmers’ knowledge, perceptions and management of
chili pepper anthracnose disease in bangladesh. Crop
Prot, 133(February):105139,.
L, K., VK, K., NG, T., and D, N. (2018). Effects of cli-
mate change on growth and development of chilli.
Agrotechnology, 07(02):2–5,.
Meilin, A. and Tanaman Cabai Serta Pengendaliannya, H.
(2014). volume 16. Balai Pengkajian Teknologi Per-
tanian Jambi, Jambi.
Muslim, A. and Arnie, R. (2015). Sistem pakar diag-
nosa hama dan penyakit cabai berbasis teorema bayes.
Jutisi, 04(3):797–876,.
Nuanmeesri, S. and Sriurai, W. (2021). Multi-layer per-
ceptron neural network model development for chili
pepper disease diagnosis using filter and wrapper fea-
ture selection methods. Eng. Technol. Appl. Sci. Res,
11(5):7714–7719,.
Raziani, S. and Azimbagirad, M. (2022). Deep cnn hyper-
parameter optimization algorithms for sensor-based
human activity recognition. Neurosci. Informatics,
2(3):100078,.
Rosalina, R. and Wijaya, A. (2020). Pendeteksian penyakit
pada daun cabai dengan menggunakan metode deep
learning. J. Tek. Inform. dan Sist.Inf, 6(3):452–461,.
Rozlan, S. and Hanafi, M. (2022). Efficacy of chili plant
diseases classification using deep learning: A prelim-
inary study. Indones. J. Electr. Eng. Comput. Sci,
25(3):1442–1449,.
Saputra, R., Puspitasari, D., and Baidawi, T. (2022). De-
teksi kematangan buah melon dengan algoritma sup-
port vector machine berbasis ekstraksi fitur glcm. J.
Infortech, 2(2):2,. doi:.
Sari, Y., Baskara, A., and Wahyuni, R. (2021). Classifi-
cation of chili leaf disease using the gray level co-
occurrence matrix (glcm) and the support vector ma-
chine (svm) methods. In 2021 6th Int. Conf. Informat-
ics Comput. ICIC 2021.
Sekaran, K., Chandana, P., Krishna, N., and Kadry, S.
(2020). Deep learning convolutional neural net-
work (cnn) with gaussian mixture model for pre-
dicting pancreatic cancer. Multimed. Tools Appl,
79(15):10233–10247,.
Simalango, Y., Pane, D., and Calam, A. (2020). Sistem
pakar untuk mengidentifikasi hama dan penyakit pada
tanaman apel menggunakan metode dempster shafer.
J. CyberTech, 3(3):426,.
Tsany, A. and Dzaky, R. (2021). Deteksi penyakit tanaman
cabai menggunakan metode convolutional neural net-
work. e-Proceeding Eng, 8(2):3039–3055,.
Wahab, A. A., Zahari, R., and Lim, T. (2019). Detecting dis-
eases in chilli plants using k-means segmented support
vector machine,”2019 3rd int. Conf. Imaging, Signal
Process. Commun. ICISPC, pages 57–61,.
Zhu, Y. (2018). Gp-cnas: Convolutional neural network
architecture search with genetic programming. arXiv,.
Zikra, F., Usman, K., Patmasari, R., and Semin (2021).
Deteksi penyakit cabai berdasarkan citra daun meng-
gunakan metode gray level co-occurence matrix dan
support vector machine. Has. Penelit. dan Pengabdi.
Masy, l(N: 2598, no. E-ISSN):2598–0238, 105,.
ICAISD 2023 - International Conference on Advanced Information Scientific Development
142