Classification of clove types using convolution neural network algorithm with optimizing hyperparamters

ABSTRACT


INTRODUCTION
Based on the ISO 2254-2004 standard, cloves are divided into three types: whole, headless, and mother.The mother part of the clove is usually left to suckle until the nursery is carried out, while for whole cloves and headless cloves, the clove farmers dry the cloves until they are scorched and then sell them to buyers or clove entrepreneurs.The dried cloves are then processed into various products, such as cosmetics, herbal medicines, and food flavoring ingredients [1].
Currently, digital image processing has been implemented on various objects, such as that implemented on clove images.Several researchers then implemented or classified cloves based on digital images [2] used convolution neural network (CNN) for clove quality classification.However, the data did not meet ISO 2254-2004 standards.Furthermore, the lowest accuracy is 65.25%, and the highest is 87.75%.In this study, the CNN parameter tested was only the number of epochs, but other parameters, such as changes in the learning rate, batch size, and use of optimizer types, were not carried out.
Chalik and Maki [3] classified cloves using the CNN method.Color feature extraction research on cloves.Clove classes classified are good cloves, good cloves without petals, cloves with dead seeds, and cloves with dead seeds without petals.In this study, the method used is the CNN method, but the feature extraction process is not involved in the CNN method but is extracted separately using color features.The experimental process is implemented only in the layer size test; the other parameters in CNN have not been applied.Several studies on cloves in deep learning or machine learning have also been applied [4]- [6].However, these studies did not use image data to recognize or classify cloves.Different from what will be done, namely using image data, and will be classified using deep learning methods.This research will apply the CNN method.The application of CNN has been carried out by several previous researchers and in various kinds of objects, as was done by [7]- [9] on health data.Winiarti et al. [10] conducted pre-training using CNN and classification with SVM in the tanning leather image case.Likewise, Shambulinga [11] performing feature extraction with CNN and classification using a support vector machine.
This research applies the CNN method and utilizes transfer learning techniques that exist in CNN, such as VGG16, Resnet50, MobileNetV2, InceptionV3, DenseNet151, and modification of VGG16.In addition, this research also looks for optimal hyperparameters in the classification of clove types according to ISO 2254-2004 standards.Several other researchers have implemented this type of transfer learning, as was done by [12] on the classification of wood species, where the highest accuracy results when applying Resnet50.Atole and Park [13] carried out a transfer learning on diseases in rice.Abdulla and Marhoon [14] compared several types of transfer learning for disease classification in tomato leaves.Some of these studies indicate that the system's accuracy affects not only the model that is applied but also the dataset used and the parameters that are applied.For this reason, it is proposed that this research will apply the CNN model and compare it with several types of transfer learning and modification of VGG16.It will also look for the best parameters in classifying clove species according to ISO 2254-2004 standards.

RELATED WORK
Currently, digital image processing has been implemented on various agricultural commodity objects.Various research results have also been published and are very easy to find.However, clove flowers are still challenging to find.Based on searches on international databases such as Scopus, Springer, and ScienceDirect, only some manuscripts related to cloves exist in contrast to other agricultural commodities such as coffee and soybeans.Prayogi et al. [2] classified cloves using the CNN method.The features used are extracted from CNN, with the highest accuracy produced, namely 87.75%.Of course, this accuracy can still be improved by making parameter changes to CNN, such as using the optimizer, initializing the learning rate, and using transfer learning models in deep learning, such as VGG16 and Resnet50, as was done by [15].
Chalik and Maki [3] classified the quality of clove flowers into four classes; this is certainly different from the ISO 2254-2004 standard, which only has three classes in the clove type: whole clove, headless clove, and mother clove.This study uses the CNN method for the classification process, but color features are used.Not using the extracted feature from CNN.If seen from the data tested, the shape and texture features need to be accommodated in this study; this is because visually, there are differences in shape between each class of cloves, good cloves, good cloves without petals, cloves with dead seeds, and cloves with dead seeds without petals as was done by [16] on the classification of asparagus.
Several other researchers have carried out several studies related to agricultural commodities such as coffee, soybeans, corn, and rice by conducting digital image processing.For example, coffee was carried out by [17]- [20] with various research objectives, such as the classification of coffee maturity levels, quality classification, and disease detection on coffee leaves.Likewise, with soybeans [21]- [24], there are various types of datasets on the tested soybeans.Then rice has also been carried out by several researchers [25]- [29].In these studies, several researchers have compared transfer learning models as done by [17], [23], but finding the optimizer that suits the dataset applied has yet to be done on transfer learning.For this reason, the research will classify the types of cloves according to the ISO 2254-2004 standard using the CNN method; transfer learning looks for the best parameters in the model and modifies VGG16 to improve accuracy.

PROPOSED METHOD 3.1. Research and step
The research aims to classify clove types using CNN algorithm and compare several transfer learning models, namely VGG16, Resnet50, DenseNet151, MobileNetV2, InceptionV3, and modified VGG16 architecture.The research began with an independent image acquisition process, and this is because data related to cloves has yet to be publicly available.The data that has been collected is then carried out preprocessing.Then, an algorithm or transfer learning model will be selected.The selected model then undergoes a training and evaluation process.The steps of this research are illustrated in Figure 1.

Convolution neural network algorithm
A CNN is one of the algorithms in deep learning.The high level of accuracy in the classification process in digital image processing causes it to be widely used in the classification or identification process of digital images.The CNN method has feature extraction and a classification process, as shown in Figure 2. The computational process on CNN is in the convolution layer, so it is often called the core of the CNN application in the convolution layer.Because the first layer on CNN is the convolution layer, in this layer, the convolution process is carried out by shifting the filter matrix over the entire image surface.This convolution process results in a feature map, a matrix containing information from the convoluted image.An additional convolutional layer or a pooling layer can follow a convolutional layer.In each convolutional layer, rectified linear unit (ReLU) activation will be observed to select which neuron will be active [27].
In the CNN architecture, there is also what is called the pooling layer.This pooling layer reduces the dimensions and feature maps of the previous layer, helps reduce complexity, increases efficiency, and limits overfitting.The pooling layer consists of max pooling, which takes the highest value from image data, and average pooling, which takes the average value of image data [27].
After the average value has been obtained, the following process for image classification builds upon the information obtained in the previous layer.This layer is called the fully connected layer.In this Bulletin of Electr Eng & Inf ISSN: 2302-9285  Classification of clove types using convolution neural network algorithm with … (Firman Tempola) 447 fully connected layer, a transformation will be carried out on the data dimensions, which were previously multidimensional into linear, by performing a flatten or reshape process so that all neurons in the previous layer will be directly connected and become inputs to this layer.Because the data in this study is multiclass, the next step is to use the softmax activation function to obtain a probability value from 0 to 1, where the class determination is based on the highest probability value.

Modified VGG16
VGG16 is a pre-trained network model.VGG 16 [30] has 16 layers, namely 13 convolution layers, two fully connected layers, and one classification layer.This study added the proposed VGG16 model with three convolution layers.The proposed VGG16 modification architecture is shown in Figure 3.

Performance evaluation
Algorithm performance measurement is fundamental to know.The goal is to distinguish the performance of each method or algorithm specified.There are various ways to measure the performance of the classification process, such as calculating accuracy, precision, recall, and F1 score.However, in research to measure the performance of the clove-type classification algorithm using the deep learning method, the calculation of the accuracy value is used.To get the accuracy value, that is by comparing the total number of data tested correctly with the total number of data tested.As shown in (1), to get the accuracy value:

RESULTS AND DISCUSSION
The initial stage of this research is to collect datasets.The dataset in this study is primary data.Where the data collection process uses a smartphone camera.The amount of data is 1,715 data.The information consists of 3 classes: i) whole clove with as much as 695 data; ii) headless clove with as much as 796 data; and iii) mother clove with as much as 229 data.The data obtained is then carried out in the preprocessing stage according to the research stages.Then the preprocessing step continued with the distribution of data and their respective amounts, namely training data, as much as 837 data.Validation data, as much as 208 data, and testing data, as much as 670 data.

CNN impelementation result
This research focuses on several essential parameters in model training: learning rate, number of epochs, and batch size.The learning rate controls how many steps the optimization algorithm takes in updating the model weights during training.The number of epochs determines how often the model will process the entire dataset, while the batch size refers to how many samples are used in one training iteration.The results of applying CNN can be shown in Table 1 In this research, we used a learning rate of 0.001, 50 epochs, and 16 batch sizes, achieving the highest system accuracy of 84% compared to other parameters.This accuracy describes how well the model can classify data correctly.At a learning rate of 0.001, the model uses a relatively small step in changing its weight when optimizing.A learning rate that is too large can cause the model to skip the local minimum or even diverge, while a learning rate that is too small can slow down the training process.In this case, a learning rate of 0.001 was chosen, producing good results with a system accuracy of 84%.
Next is the number of epochs.The correct number of epochs will ensure the model has seen enough datasets to learn the patterns.However, too many epochs can lead to overfitting, in which the model disproportionately learns from the training data and cannot generalize well to new data.In this case, using 50 epochs gives optimal results with the highest system accuracy of 84%.As for the batch size, a batch size that is too large can require more memory and computation time, while a batch size that is too small can result in an unstable gradient estimate.Choosing the right batch size can help the model achieve better convergence.In this case, batch size 16 gives good results with the highest system accuracy of 84%.

Result of the implementation of transfer learning
Tests using transfer learning VGG16, Resnet50, DenseNet121, MobileNet, and modified VGG16 were repeated by looking for the best parameters to classify clove species.The goal is to find the best accuracy of each test scenario.The amount of data applied to the research is the same as that applied to CNN and the distribution of data Table 2 test results.
Based on experiments from the VGG16, Resnet50, MobileNetV2, InceptionV3, and DenseNet151 transfer learning models and the VGG16 modification, there are differences in system accuracy.The experimental process is initializing the number of epochs and learning rate and using the optimizer.The number of epochs given is 10, 50, and 100.The best accuracy results from all transfer learning models get the best accuracy when the number of epochs initialized is 100, except for the VGG16 modification where when the layer is added, the accuracy increases even though the number of epochs given is only 10 epochs as shown in Figure 4 (see appendix).
Figure 4(a) is a confusion matrix with a size of 3×3; the row section is the actual data, which consists of 3 classes, namely headless clove, mother clove, and whole clove, as well as in the column section, there are three classes, the figure indicates that there is data that is rare in the headless clove class classified as whole clove as much as 0.03%, data that are in the whole clove class as headless clove are as much as 0.01%.While for mother clove, 100% is classified correctly.Details of the confusion matrix modified VGG16 results with 10 epochs are shown in Figure 4(a).The overall accuracy for 10 epochs is 98.37%.Next, in Figure 4(c), with several epochs of 100, there is 0.01% of the headless clove class known as whole clove and vice versa.As much as 0.01%, the whole clove class is known as headless clove, while it is known as 100% correct for mother clove.An illustration of the confusion matrix modified VGG16 with 100 epochs is shown in Figure 4(c).Overall, the results of testing data with 100 epochs obtained an accuracy of 99.11%.

Comparison and before research
Based on the literature study that has been done, research related to clove classification still needs to be done.As found in international databases, only two studies have discussed the classification of clove types.Prayogi et al. [2] classified the quality of cloves into four classes: quality 1, quality 2, quality 3, and quality 4. The accuracy obtained was 87.75% without any hyperparameter initialization process on CNN.Research by Chalik and Maki [3], the red, green, blue (RGB), hue, saturation, intensity (HSV), and luminance, chromaticity blue, chromaticity red (YCbCr) color feature extraction process was carried out.The system accuracy obtained reaches 96%.These two studies are different from our study.In our research, clove data was tested according to the ISO 2254-2004 standard, where there are three classes, namely whole cloves, cloves without heads, and main cloves.Our research applied the CNN algorithm and compared it with the VGG16, Resnet50, DenseNet151, MobileNetV2, InceptionV3, and Modified VGG16 transfer learning methods.Then we also look for the most optimal hyperparameter, as mentioned in Tables 1 and 2.

CONCLUSION
Classification of clove types by applying the CNN method can identify clove types well.The highest accuracy was obtained, namely 84%, based on the test results.The learning rate applied is 0.001, 50 epochs, and 16 batch sizes.For experiments using several transfer learning models such as VGG16, Resnet50, DenseNet151, MobileNetV2, InceptionV3, and modified VGG16 architecture, each model's accuracy differs.However, the highest accuracy was obtained when the VGG16 architecture was modified, namely 99.11%.Modifying the VGG16 architecture is very influential in classification, especially on clove data.The next step for the research plan is to collect clove quality data by SNI standards and train the model with more, and then optimization is carried out to find the best model.In addition, it will be applied to mobile so that later it can help farmers to maintain the quality of cloves during the procession.


Figure 1.Research steps

Figures 4
Figures 4(b) and (d) have two axes, the x and y axes, where the x-axis or horizontal line represents the number of epochs or iterations carried out during training.In contrast, the y-axis or vertical line represents the resulting accuracy.There are two color lines, namely blue and orange.The blue line is for training accuracy, and the orange line is for accuracy validation.Figure 4(b) with 10 epochs, both training and validation accuracies are still not stable; in contrast to Figure 4(d) with 100 epochs, the accuracy of training has looked stable since the 40 th epoch.Adam Optimizer is very good for experiments using the optimizer of all the transfer learning models tested compared to Adadelta and Adagrad.Meanwhile, implementing VGG16 architecture modifications has increased accuracy in all optimizers.

Table 2 .
Result of transfer learning