Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Available online at www.sciencedirect.

com

ScienceDirect
Available online at www.sciencedirect.com
Procedia Computer Science 00 (2022) 000–000
www.elsevier.com/locate/procedia
ScienceDirect
Procedia Computer Science 204 (2022) 395–402

International Conference on Industry Sciences and Computer Science Innovation

Essential Oil Plants Image Classification Using Xception Model


Jeremy Onesimus Carnagiea, Aditya Rio Prabowoa,*, Eko Prasetya Budianaa,
Ivan Kristianto Singgihb
a
Department
Department of Mechanical Engineering, Universitas Sebelas Maret, Surakarta 57126, Indonesia
b
School of Industrial Management Engineering, Korea University, Seoul 02841, South Korea

Abstract

Machine learning-based technology has now been widely applied in various fields. In recent times, image classification is a machine
learning-based technology that has very diverse uses, since its effectiveness for performing classification of images can really be
helpful for many kinds of work such as sorting or detecting. In this work, we have created a customized Convolutional Neural
Network (CNN) using Transfer Learning methods of the Xception Model to classify images of essential oil plants. Our
Convolutional Neural Network is able to identify and classify images of essential oil plants with a good degree of accuracy, which
will be concluded in a confusion matrix table. The same usage concept of CNN can also be generalized to perform other plants
image classifications tasks.
© 2022 The Authors. Published by Elsevier B.V.
© 2022 The Authors. Published by ELSEVIER B.V.
This is an open access article under the CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0)
This is an open access article under the CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0)
Peer-review under responsibility of the scientific committee of the International Conference on Industry Sciences and Computer
Peer-review under responsibility of the scientific committee of the International Conference on Industry Sciences and Computer
Sciences Innovation
Sciences Innovation
Keywords: Image Classification; Convolutional Neural Network (CNN); Essential Oil Plants; Xception

1. Introduction

Image classification technology which is a branch of computer vision has provided many new conveniences for
many people. Its diverse utilization potential has also led many companies to adopt the use of image classification
technology as one of the main features and supporting features [1], [2]. New studies that discuss the use of this
technology have also emerged in recent times [3], [4], [5]. Image classification has great potential as a new technology
that can increase people's productivity and quality of life.

* Corresponding author. Tel.: +62 271 632 163; fax: +62 271 632 163.
E-mail address: aditya@ft.uns.ac.id

1877-0509 © 2022 The Authors. Published by ELSEVIER B.V.


This is an open access article under the CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0)
Peer-review under responsibility of the scientific committee of the International Conference on Industry Sciences and Computer Sciences
Innovation

1877-0509 © 2022 The Authors. Published by Elsevier B.V.


This is an open access article under the CC BY-NC-ND license (https://creativecommons.org/licenses/by-nc-nd/4.0)
Peer-review under responsibility of the scientific committee of the International Conference on Industry Sciences and Computer Sciences
Innovation
10.1016/j.procs.2022.08.048
396 Jeremy Onesimus Carnagie et al. / Procedia Computer Science 204 (2022) 395–402
2 Carnagie et al. / Procedia Computer Science 00 (2022) 000–000

In practice, image classification is closely related to the science of Convolutional Neural Network (CNN) as part
of machine learning (ML). Convolutional Neural Network is a class of Artificial Neural Network (ANN) that is
generally intended to perform visual analysis on computers. Apart from image classification, CNN also has some
applications in natural language processing, image and video recognition, time series, etc. The working principle of
the Convolutional Neural Network is inspired by the biological learning and decision-making processes in the brains
of living beings [6], [7]. Making customized CNNs has also emerged, there is even a special website that allows users
to directly simulate their own CNNs and then learn about them [8].
Our aim in this paper is to adopt and apply the working principle of image classification through the Convolutional
Neural Network to study images of essential oil plants, in order to obtain a model that is able to analyze and draw
conclusions on the classification of one of these essential oil plant types. The images obtained are compiled into a
dataset for the computer to study, which consists of a training dataset, a validation dataset, and a test dataset. There
are 10 main types of plants capable of producing useful essential oils that will be classified by the CNN, those are
Bergamot fruit, Chamomile flower, Jasmine flower, Lavender, etc. (which all will be mentioned in the next section).
This plant commodity that is capable of producing essential oils has the potential to have a high selling value, since
every oil is purported to have particular benefits for physical and mental health [9]. Thus, the main problem that is
highlighted in this paper is how the CNN model that we created is able to classify images of essential oil plants with
precise accuracy. The accuracy assessment will be displayed in a confusion matrix table on the results page.
In this work, we propose a customized CNN network by connecting with the open-source Neural Network (NN)
from Keras library named Xception to perform image recognition and classification, where Xception itself already has
36 convolutional layers, which are expected to provide high-quality machine training for our essential oil plant datasets
[10]. The need for a neural network that has a strong and ideal convolution performance as in Xception is expected to
give a much better classification accuracy result when compared to compiling the neural network and all its nodes
manually. By providing the right parameter configuration to the NN, we designed a suitable CNN to properly classify
the ten types of essential oil plants. The algorithm applied in this work is a supervised learning algorithm on machine
learning principles, which is the working principle that prioritizes the involvement of 'supervisors' in labeling and
determining which datasets will be given to the computer for study [11].

2. Methods

The use of CNN as the main method in solving image recognition and computer vision problems has been proven
through various studies and applications by technology companies in the world [12], [13], [14], [15], [16]. Researches
based on CNN has also emerged to improve image recognition performance on well-known datasets, such as the
MNIST database, Iris Flower Dataset, NORB database, and CIFAR10 dataset [12]. For example, in simple practice,
CNN is very reliable to overcome the problem of recognizing the shape of letters or numbers of the alphabet by
handwriting. Even some time ago CNN's performance has also been researched and tested to recognize the shape of
Chinese letters/characters [17]. Recenty, the use of CNN to perform image classification tasks has penetrated into
various fields, such as medical fields, agrotechnology, transportation systems, and autonomous vehicles (self-driving).
In this study, we propose the application of CNN in combination with Xception NN to produce a model capable of
classifying images of essential oil plants.
2.1. Dataset
The dataset that we have is an image dataset that is taken from Google Image with the method of collecting it by
downloading it automatically. After downloading the images, the images will be arranged in each class in separate
folders, then divided into 3 main folders, namely train, validation, and test. In this work, the total images obtained and
used as datasets are written in Table 1. Some pictures of the image dataset are shown in Figure 1.
Jeremy Onesimus
Carnagie Carnagie
et al. et al.
/ Procedia / Procedia
Computer Computer
Science Science
00 (2022) 204 (2022) 395–402
000–000 3973

Table 1. Number of Dataset Essential Oil Plants Images


Validation
Essential Oil Plants (class) Train Dataset Test Dataset
Dataset
Bergamot 284 64 16
Chamomile 270 76 30
Eucalyptus 279 82 21
Jasmine 278 47 22
Lavender 279 37 21
Lemon 183 48 19
Peppermint 277 77 22
Rosemary 279 38 21
Sandalwood 168 59 21
Tea Tree 158 28 21
TOTAL 2455 556 214

a b c d

Fig 1. Some examples of dataset: (a) Bergamot, (b) Chamomile, (c) Lavender, and (d) Lemon

2.2. Data Pre-processing


Data pre-processing is done by doing the methods of image augmentation on each image in the dataset. By using
the Image Data Generator method available in the Keras library, we set the augmentation parameters on the existing
training image data as follows: rescale = 1/255, rotation range = 2, width shift range = 0.2, height shift range = 0.2,
zoom range = 0.3, and horizontal flip set to True. As for the validation and test datasets, image augmentation was
not performed. This is because only the train dataset that requires shape variations and transformations for CNN to
study the patterns in the image. Then, to generate the data from the folder to CNN later, the Flow From Directory
method is used which is also found in the Keras library. The parameters configured in this method are the target size
of (299, 299) and the class mode of 'categorical'. This generator parameter applies to train, validation, and test
datasets.
2.3. Xception CNN
Xception is an open-source Convolutional Neural Networks (CNN) researched and developed by Google [10].
The name Xception itself is an abbreviation of Extreme version of Inception, where Inception itself is a version of
the previous generation CNN created by Google as well. Xception has a convolution layer that combines pointwise
convolution which is then followed by depthwise convolution [10]. That combination was then proved to give better
accuracy in performing image classification of a dataset. The Xception NN layer architecture has 36 convolution
layers that form the basis of the feature extraction network. The 36 convolutional layers are organized into 14
modules, all of which have linear residual connections around them, except for the first and last modules. Xception
398 Jeremy Onesimus Carnagie et al. / Procedia Computer Science 204 (2022) 395–402
4 Carnagie et al. / Procedia Computer Science 00 (2022) 000–000

also has an architecture that makes it easy for users to make modifications to its parameters. A complete description
of the Xception network specification is depicted in Figure 2.

Fig 2. The Xception Architecture

2.4. Merging with additional layers


After installing the Xception CNN as the base model, then at the end of the Xception will be given an output,
namely the connection of an additional layer with the 'Dense' programming method from the Keras library, as many
as 256 neurons to connect from the previous layer, and then 10 neurons as the outer neurons which will become the
pathway classification of the ten classes that have been determined. Dense Layer is a layer of neurons where each
neuron receives input from all neurons from the previous layer. Dense Layer is used to classify images based on the
output of the convolutional layer.
2.5. Optimizer
In this work, we use the Adam optimizer (adaptive moment estimation). The Adam optimizer was chosen because
of its efficient stochastic optimization method which only requires first-order gradients with little memory
requirements [18]. In most cases, Adam is also known to be relatively easy to configure where the researchers who
have developed this optimizer claim that its default configuration parameters can work well on most problems. Some
of the configuration parameters contained in the Adam optimizer include alpha / α (referred to as the learning rate or
step size), beta1 / β1 (The exponential decay rate for the first moment estimates), beta2 / β2 (The exponential decay
rate for the second-moment estimates), and epsilon / ϵ (a very small number to prevent any division by zero in the
implementation). In this work, we use the settings for each parameter of: α = 0.001, β1 = 0.9, β2 = 0.999, and ϵ at
the default setting on the method.
Jeremy Onesimus Carnagie et al. / Procedia Computer Science 204 (2022) 395–402 399
Carnagie et al. / Procedia Computer Science 00 (2022) 000–000 5

2.6. Compiling
Compilation defines the loss function (i.e., a function that calculates the distance between the current algorithm's
output and the expected output), an optimizer, and metrics. After creating and configuring the convolutional neural
network and optimizer, we will compile the entire CNN and optimizer as a machine learning model for the image
classification task to be performed. Things that will be compiled with our CNN model include the optimizer (Adam),
the loss function 'categorical crossentropy' which is the loss function used in multi-class classification tasks, and the
metrics in the form of 'accuracy' where the function calculates how often the prediction equals the label.
2.7. Fitting
At this step, the model is ready to be trained with the existing image dataset. The model training will use the 'fit'
method. As the name implies, fit means that the model will be fitted with the dataset. As for our work, we chose to
do training on the lower layer (ie the layer after the Xception layer) first, and not include Xception (frozen). Freezing
the layer prevents its weight from being modified. This technique is often used in transfer learning methods, where
the base model (trained on some other dataset) is frozen. The training with freezing layer is done for 3 repetitions,
or epochs = 3. And after the first training is finished, then all NN will be recompiled and trained together as a whole.
We use a total of 5 epochs or epochs = 5.

3. Results and Discussion

After the training process is complete, a model is obtained which is expected to be able to classify images of
essential oil plants. The model will be saved in program format .h5. The program format is a CNN model format that
has been trained on a dataset, so that later it can be installed/configured in an application/software. There are 4 training
parameters observed during the process of fitting the dataset with CNN, namely Training Accuracy, Training Loss,
Validation Accuracy, and Validation Loss. Figures on the results of the training and validation processes are depicted
in Figure 3. The four training parameters analyzed are the results of training on the entire model (ie after the layer
freezing process).

a 1
0.8
Accuracy

0.6
0.4
0.2
0
1 2 3 4 5
training 0.7605 0.8599 0.8986 0.9092 0.9336
validation 0.723 0.7644 0.7446 0.786 0.7716

Epochs

training validation
400 Jeremy Onesimus Carnagie et al. / Procedia Computer Science 204 (2022) 395–402
6 Carnagie et al. / Procedia Computer Science 00 (2022) 000–000

b
1.6 1.4254

1.2 0.9132 0.9295


0.8566 0.8554
Loss Score
0.7328
0.8
0.4157
0.2924 0.2633
0.4 0.1857

0
1 2 3 4 5
Epochs

training validation

Fig 3. Graph of Training and Validation: (a) Accuracy and (b) Loss

3.1. Accuracy
Based on the numbers obtained after 5 epoch processes, the value of training accuracy is quite good, with an
accuracy in the last epoch of 0.9336 for training, and 0.7716 for validation. This figure shows good progress, where
there is a fact that the accuracy value between training accuracy and validation accuracy in the last epoch has a gap.
This means that the model has studied the dataset fairly without any indication of severe overfitting. (overfitting is
a phenomenon where the model studies the dataset so much that it is unable to distinguish when there is new data
that the model has never seen at all / direct testing using a new image).
3.2. Loss
Based on the numbers obtained after 5 epoch processes, the loss scores for each aspect are classified as good.
With the gap between the final value of the training loss and the validation loss, this indicates that there is no
overfitting in the model. However, it should also be noted that the gap obtained in the training loss and validation
loss should not be too small, because a gap that is too small (the values of the two losses are close together) will
indicate that the model is in an underfitting condition. (underfitting is a phenomenon where the training model is
not able to describe/model the training data or new data, so it will consistently produce a very high error value). It
can also be seen that when the number of validation loss starts to increase, the training process ends (ends in the
fifth epoch). This is done to prevent the model from studying the dataset further but with deteriorating quality. (P.S.:
the previous training was conducted using 10 epochs, and the results of the training and validation loss were very
unsatisfactory where the gap between the two was too large and the validation loss rate was increasing).
3.3. Testing and Confusion Matrix Result
One other surefire way to test the accuracy of the model in classifying is to use a test of the test dataset and then
describe the test results in a confusion matrix. Some direct testing are also performed to the model, where as depicted
in Figure 4. A confusion matrix is a technique for summarizing the performance of a classification algorithm.
Calculating a confusion matrix can give you a better idea of what your classification model is getting right and what
types of errors it is making. Confusion matrices are used to visualize important predictive analytics like recall,
specificity, accuracy, and precision. The confusion matrix from the test results using the test dataset in our model is
depicted in Figure 5. As shown in the confusion matrix, the results show that the model is able to classify the types
of essential oil plants well, which is indicated by the accuracy of the values between True label (y-axis) and
Predicted label (x-axis). For example, for Bergamot: an accuracy of 0.81 between true and predicted is obtained,
and the remainder appears at 0.12 for Lemons and 0.06 for Sandalwood plants. From this example, we can
understand together that there is a similarity between Bergamot and Lemons (especially after being peeled) makes
the model think that Bergamot is a Lemon, but only 0.12. It can also be seen that the model is most capable of
providing the best predictive results on the Rosemary plant dataset. This is thought to be due to the large number of
Rosemary datasets, as well as the shape and color of this Rosemary plant which does not resemble the shape of
Jeremy Onesimus Carnagie et al. / Procedia Computer Science 204 (2022) 395–402 401
Carnagie et al. / Procedia Computer Science 00 (2022) 000–000 7

other plants in the dataset. The same analysis process can be applied to other types of plants that can be seen in the
confusion matrix.

Fig 4. Direct testing of the trained model with: (a) Bergamot fruit image, (b) Jasmine flower image, and (c) Lemon image

Fig 5. Confusion Matrix from image classification model testing on essential oil plant dataset
402 Jeremy Onesimus Carnagie et al. / Procedia Computer Science 204 (2022) 395–402
8 Carnagie et al. / Procedia Computer Science 00 (2022) 000–000

4. Conclusions

In this work, we have proposed a customized Convolutional Neural Network based on the transfer learning method
using the Xception convolutional neural network to classify images of 10 essential oil plants. The neural network
arrangement and parameter settings that we have done are proven to be able to provide classification results with good
accuracy without data overfitting or underfitting. The results are shown in the confusion matrix also show that our
method of adopting and then reconfiguring some parameters on CNN can serve as an example for conducting other
research and modeling using other datasets. On the other hand, there are also imperfect gaps that affect the accuracy
of image classification by the model, especially in the Lemon and Tea Tree plant classes, where it is indicated that
there are similarities between Lemon plants and Bergamot, and also Tea Trees with Jasmine, Rosemary, and
Peppermint. This will of course be a material for evaluation and consideration for future improvements. As for the
future work recommendations, we suggest for this method to be applied in some sectors of industry, especially the
industry that requires a process of sorting goods based on product appearance as part of the quality control process.
However, through this work, we also really hope that the same method can be generalized to help or inspire another
research on other images/datasets.

References

[1] Heather Kelly. (2015) “Elon Musk and tech heavies invest 1 billion in artificial intelligence.” [Online]. https://money.cnn.com/2015/
12/12/technology/openai-elon-musk/
[2] Ben Dickson. (2021) “Tesla AI chief explains why self-driving cars don't need LiDAR.” [Online]. https://venturebeat.com/2021/07/03/tesla-
ai-chief-explains-why-self-driving-cars-dont-need-lidar/
[3] A. Vailaya, M.A.T. Figueiredo, A.K. Jain, Hong-Jiang Zhang. (2001) "Image classification for content-based indexing." IEEE transactions
on image processing 10 (1): 117-130.
[4] J. Qin, W. Pan, X. Xiang, Yun Tan, G. Hou. (2020) “A biological image classification method based on improved CNN.” Ecological
Informatics 58 (4): 101093.
[5] Ritesh Maurya, Vinay K. Pathak, Malay K. Dutta. (2021) “Deep learning based microscopic cell images classification framework using multi-
level ensemble”, Computer Methods and Programs in Biomedicine 211 (10): 106445.
[6] David H., and Torsten N. Wiesel. (1968) "Receptive fields and functional architecture of monkey striate cortex." The Journal of physiology
195 (1): 215-243.
[7] Yann LeCun, and Yoshua Bengio. (1995) "Convolutional networks for images, speech, and time series." The handbook of brain theory and
neural networks: 225-258.
[8] Jay Wang, Robert T., Omar S., H. Park, N. Das, Fred H., et al. (2020) “CNN Explainer Learn Convolutional Neural Network (CNN) in your
browser.” https://poloclub.github.io/cnn-explainer/, Georgia Tech, Oregon State.
[9] Usha Muller. (2020) “10 Most Important Plants With Essential Oils.” [Online]. https://www.stadlerform.com/en-
ch/health/aromatherapy/essential-oils-the-10-most-important-plants
[10] François Chollet. (2017) "Xception: Deep learning with depthwise separable convolutions." 2017 IEEE Conference on Computer Vision and
Pattern Recognition (CVPR): 1800-1807.
[11] Mohssen Mohammed, Muhammad Badruddin Khan, and Eihab B. Mohammed (2016) “Machine Learning: Algorithms And Applications”,
1st ed, Florida, CRC Press
[12] Qing Li, W. Cai, X. Wang, Y. Zhou, David D. Feng, and M. Chen. (2014) "Medical image classification with convolutional neural network."
2014 13th International Conference on Control Automation Robotics & Vision (ICARCV): 844-848.
[13] Jiang Wang, Yi Jang, Junhua Mao, Zhiheng Huang, Chang Huang, W. Xu. (2016) "CNN-RNN: A unified framework for multi-label image
classification." 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).
[14] Mahbub H, Jordan JB, and Diego RF. A study on CNN transfer learning for image classification. In: UK Workshop on computational
Intelligence. Advances in Computational Intelligence Systems (1st ed). Cham: Springer; 2018, p. 191-202.
[15] Yanan Sun, Bing Xue, Mengjie Zhang, Gary Yen, and Jiancheng L. (2020) "Automatically designing CNN architectures using the genetic
algorithm for image classification." IEEE transactions on cybernetics: 1-15.
[16] Nilesh Barla. (2021) “Self-Driving Cars With Convolutional Neural Networks (CNN).” [Online]. https://neptune.ai/blog/self-driving-cars-
with-convolutional-neural-networks-cnn
[17] Pavlo Melnyk, Zhiqiang You, and Keqin Li. (2020) "A high-performance CNN method for offline handwritten Chinese character recognition
and visualization." Soft Computing 24 (8): 7977-7987.
[18] Diederik P. Kingma, and Jimmy Ba. (2014) "Adam: a method for stochastic optimization." 3rd International Conference for Learning
Representations 1214 (6980): 1-10.

You might also like