0% found this document useful (0 votes)
128 views

Wood Classification With Transfer Learning Method and Bottleneck Features - ICOIACT 2019 PDF

This document discusses using deep convolutional neural networks (D-CNN) with transfer learning and bottleneck features for wood classification. It begins by explaining that wood industries need to carefully classify wood quality but current manual methods only achieve 55% accuracy. The document then introduces CNN and D-CNN models for image classification and discusses using pre-trained CNN models via transfer learning and bottleneck features to improve classification accuracy for small wood datasets. It aims to classify 5 wood classes and achieves 95.69% accuracy using these techniques.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
128 views

Wood Classification With Transfer Learning Method and Bottleneck Features - ICOIACT 2019 PDF

This document discusses using deep convolutional neural networks (D-CNN) with transfer learning and bottleneck features for wood classification. It begins by explaining that wood industries need to carefully classify wood quality but current manual methods only achieve 55% accuracy. The document then introduces CNN and D-CNN models for image classification and discusses using pre-trained CNN models via transfer learning and bottleneck features to improve classification accuracy for small wood datasets. It aims to classify 5 wood classes and achieves 95.69% accuracy using these techniques.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Wood Classification with Transfer Learning

Method and Bottleneck Features


Vajrayudha Ristiawanto, Budhi Irawan, Casi Setianingsih
Electrical Engineering Faculty
Telkom University
Bandung, Indonesia
[email protected], [email protected], [email protected]

Abstract – Wood is one of the raw materials that is classify the wood with manual method such as
important for helping human needs such as home classifying with eyesight of human however it just
appliance like chair, table, and the other things made produces about 55% of correct classification rate
from wood. Wood industries require wood for produce [1]. Furthermore, industry revolution 4.0 comes to
their product that made from wood. There are several
classes of wood must be classified before entering the
all country including the developing country.
process stage in wood industries. The class of wood is Texture classification is a problem that requires
indicated the quality of the wood itself. So, wood certain techniques to achieve high accuracy. Various
industries must classify carefully for increase the methods have been developed by researchers, for
productivity. Wood industries usually classify the example Gray Level Co-Occurrence Matrices
wood with manual method such as classifying with (GLCM) and Gabor Filter methods by Jing Yi et al
eyesight of human however it just produces about 55% [2]. There is also the Local Binary Pattern (LBP)
of correct classification rate. Convolutional Neural method using the k-Nearest Neighbors (k-NN)
Network (CNN) is a development from Artificial feature extraction algorithm by Khalid et al.
Neural Network (ANN) to classify the image, image
segmentation, and object recognition with high
However, those algorithms still require human
accuracy and high performance. Wood classification is intervention to tuning the parameters of algorithms
one of the texture classifications because the wood can and augmenting datasets to achieve high accuracy.
be classified depend on texture of the wood fiber itself. Deep learning comes to solve this wood
So, Convolutional Neural Network (CNN) comes to classification problem with texture classification.
solve this problem. Deep Convolutional Neural Deep learning is an automatic algorithm that process
Network (D-CNN) is developed to improve the the input data with mathematical computation and
accuracy and performance from many deep layers of have many processing layers. Artificial Neural
Convolutional Neural Network (CNN) model and is Network (ANN) is one of the deep learning
designed for classify image with small dataset. This
paper investigates the usage of Deep Convolutional
algorithms like human neuron to solving the
Neural Network (D-CNN) with transfer learning problem such as classification, clustering,
method and bottleneck features for wood classification optimization, and prediction. Nowadays,
with small dataset. There are five different classes of researchers have focused on deep earning rather than
wood classifications in this paper such as class I, class machine learning so that deep learning has been
II, class III, class IV, and class V. The best quality of improved every time. Deep learning only requires
this wood is class I and the worst quality in this wood raw data and is able to do feature extraction
is class V. Transfer learning method and bottleneck automatically. Le Cun succeeded to make
features can increase the accuracy of Deep Handwritten Digit with Back-Propagation Network
Convolutional Neural Network (D-CNN). In this
paper, we achieve 95.69% of accuracy with transfer
and has 1% error rate [3].
learning method and bottleneck features. Convolutional Neural Network (CNN) is one of
the development algorithms from Artificial Neural
Keyword – Convolutional Neural Network, CNN, Deep Network (ANN) which is used for classify image
Convolutional Neural Network, D-CNN, Wood and object detection with high accuracy. Le Cun
Classification, Transfer Learning Method, Bottleneck introduced Convolutional Neural Network (CNN)
Features on 1998 [4]. There are several applications using
I. INTRODUCTION Convolutional Neural Network (CNN) such as
medical image classification by Qing Li et al. [5],
Wood is one of the basic ingredients to fulfil traffic sign recognition by Kaoutar et al. [6], and
secondary needs for humans being. It should need animal recognition by Hung Nguyen et al [7].
different quality of wood to create different wood Many researches try to develop the
product such as table, chair, etc. before entering the Convolutional Neural Network (CNN) model. Deep
process stage in wood industries. So, wood Convolutional Neural Network (D-CNN) is a
industries must classify the quality of wood developed Convolutional Neural Network (CNN)
carefully so as not to mistakenly process the wood model with many deep layers and were trained in
for make their product. The wood itself consist of large dataset like ImageNet datasets and achieve
several quality such as excellent, good, bad, very high accuracy [8]. Deep Convolutional Neural
bad, etc. The quality of wood can be classified based Network (D-CNN) were trained for ImageNet Large
on wood fiber itself. However, it can be classified Scale Visual Recognition Challenge (ILSVRC) with
only by wood expert. Wood industries usually more than thousand classes and more than thousands
of labelled images. There are famous Deep
Convolutional Neural Network (D-CNN) model that
usually is used by researchers like VGG16, ResNet,
Inception, and the newest model is Xception.
Furthermore, there is bottleneck features to
improve the accuracy drastically. Bottleneck
features is a method that obtain the information from
feature extractor in the last layer before fully-
connected layer. This layer retains the information
useful for classification in the resulting low
dimensional features extracted. Bottleneck features
is very useful for small dataset. Figure 1. Three main layers in Convolutional
Neural Network (CNN).
II. METHODOLOGY
Convolutional Neural Network (CNN) is a deep B. Transfer learning Method
learning algorithm which is developed for image Transfer learning method is used to solve the
classification and object detection [9]. Many people target task with training with different task for
are interesting to use because of the accuracy and obtain the information, feature vector, and weights
performance. We just provide the raw image for from the Convolutional Neural Network (CNN)
input and Convolutional Neural Network (CNN) architecture [11]. This method improves the
extracts the features automatically. We can easily accuracy and performance of Convolutional Neural
improve the performance and accuracy of Network (CNN). There are some pre-trained model
Convolutional Neural Network (CNN) with tuning Convolutional Neural Network (CNN) that usually
the parameter of Convolutional Neural Network are used by researchers such as VGG16, ResNet,
(CNN). Like Artificial Neural Network (ANN), Inception, and the newest is Xception. These pre-
Convolutional Neural Network (CNN) has many trained models were trained with thousands of
deep layers to process the pixel of the image. images and thousands of different classes and
Convolutional Neural Network (CNN) has three achieve high accuracy. In this experiment, we just
main layer such as convolution layer, pooling layer, train the features vector in new modified fully-
and fully-connected layer. In this section, we connected layer with transfer learning method.
describe about Convolutional Neural Network Figure 2 shows about transfer learning method for
(CNN) architecture, transfer learning method, and new classifier.
bottleneck features.
A. Layers of Convolutional Neural Network (CNN)
Convolutional Neural Network (CNN) has three
main layer such as convolution layer, pooling layer,
and fully-connected layer. These layers have an own
purpose which are processing the pixel of the image.
Input layer is always in the Neural Network model.
However, it is not a main layer of Convolutional
Neural Network (CNN). The input layer just
initializes the size of the input image. Convolution
layer has local connections and weights of features
[9]. This layer extracts the features of the image with
convolving between filter and image. Pooling layer
is used for reduce the complexity dimension of the Figure 2. Old Classifier is replaced by new
features from convolution layer [10]. The pooling classifier in transfer learning.
layer can increase the robustness of feature
extraction. Fully-connected layer is the last layer of C. Xception Model
Convolutional Neural Network (CNN). It Xception model is Deep Convolutional Neural
concatenates the last node with the previous nodes Network (D-CNN) model designed by Francois
to take a conclusion [10]. This layer can be a vector Chollet and developed from Deep Convolutional
shape depend on the number of class. Figure 1 Neural Network (D-CNN) model named Inception
shows the architecture of Convolutional Neural V3 [12]. Xception was trained with 350 million
Network (CNN). images and 17000 classes. Because Xception is the
development of Inception V3, Xception has module
that are sourced from Inception V3. There are three
blocks in Xception architecture.
1. First block is the entry flow that processes the
input image with depthwise convolutions and
pointwise convolutions. Figure 3 shows the entry
flow in Xception architecture.

Figure 5. The exit flow in Xception architecture.

The new design of Xception is different


separable convolution from Inception V3. Separable
convolution consists of depthwise convolution and
pointwise convolution. In Xception, pointwise
convolution first then depthwise convolution [12].
Separable convolution in Xception usually called an
“extreme” version of separable convolution from
Inception V3.

a. Depthwise convolution is convoluting as number


of channel and 𝑛𝑥𝑛 spatial convolution and
Figure 3. The entry flow in Xception architecture. concatenate the results of the convolution into
one.
2. Second block is the middle flow that processes b. Pointwise convolution is actually convoluting
the output features vector from the entry flow between the result of depthwise convolution with
and looping eight times to obtain residual 1𝑥1 filter. Figure 6 shows depthwise convolution
information features vector. Figure 4 shows the and pointwise convolution in Xception.
middle flow in the Xception architecture.

Figure 6. Pointwise convolution and depthwise


convolution process with concatenate in Xception
architecture.

D. Bottleneck Features
Bottleneck Features is used to obtain the features
Figure 4. The middle flow in the Xception’s vector from the pre-trained Convolutional Neural
architecture. Network (CNN) model. It extracts the features from
the last layer before fully-connected layer. This
3. Third block is the exit flow that processes the layer is often called as “Image Feature Vector” [13].
final features vector and produces the classifier This layer has been trained to obtain information or
in fully-connected layer. With transfer learning set values for the new classifier from the before
method, we replace the old classifier in this third classifier. This layer is useful because it obtains the
block with new classifier. Figure 5 shows the information from old classifier to the new classifier.
exit flow in Xception architecture.
III. PROPOSED METHOD image cut shifts as far as 299 on the X axis and
moves as far as 299 on the Y axis so that each class
This section, we tell about the proposed method produces 196 images except Class IV because we
that we used for wood classification. We use the just have 16 high-resolution images of Class IV.
transfer learning method with the Xception Class IV produces 144 images. We extract the
architecture. We use Xception because Xception patches because the patches contain a detailed
achieves highest accuracy in Top-1 Accuracy with texture. Figure 8 displays one of the samples on the
0.79 compared to VGG16, ResNet, and Inception results patches in each class. The total of dataset is
with ImageNet datasets [12]. Xception is used 928 images. Our datasets are divided into training
because it has a less parameters in its architecture. data, validation data, and test data with a percentage
So, it has smaller weight size and model size of 80%,10%, and 10%.
compared to VGG16, ResNet, and Inception. The
steps to classify wood are as follows: Class I has a fiber texture surface in the form of
a thin line that dense between other fibers. Class II
1. Pre-processing dataset. has a fiber texture on the wood surface which is
2. Extracting bottleneck features vector rather tenuous between one fiber and another fiber
3. Rebuilding a fully-connected layer and conduct compared to the texture of the fiber on the wood
training in the new fully-connected layer. surface of class I. Class III has a texture surface of
wood fiber in the form of lines thicker than fibers in
A. Pre-processing dataset Class I and Class II which are stretched between
Cedar is a wood species that used for our other fibers. Class IV has a fiber texture on the
datasets. There are two categories Cedar that we surface of the wood that is tenuous between one
obtain them from wood industries in Indonesia. fiber and another compared to the texture of the fiber
There are Premium and Non-Premium. In this in the Class I, Class II, and Class III and the slightly
experiment, we just classify five classes wood of curved fiber texture that looks clearer. Class V has a
Cedar Premium. We classify the wood because to texture surface that is shaped like a tree trunk like
determine the quality the wood. Our wood datasets Class IV.
consist of five classes, such as class I, class II, Class
III, Class IV, and class V. The best quality for
furniture is Class I. The lower the class, the worst
quality it has. So, the worst quality for furniture is
Class V. Five classes of Cedar Premium that we
obtain are fresh cut with 19 𝑐𝑚 𝑥 6.5 𝑐𝑚 size. Then,
we obtain the images of five classes wood surfaces
with scanner to get high-resolution image. Each
class has a high-resolution image (672𝑥2111) with
22 images in JPG format except Class IV. We just
have 16 high-resolution images (672𝑥2111) of Class
IV in JPG format. Each image in each class shows
wood surfaces with different textures. Figure 7
displays an example of the surface of wood grain
texture in each class. Figure 8. Patches from high resolution of wood
images from each class.
B. Extracting bottleneck features vector
After pre-processing the dataset, we load the
Xception model. Because Xception is a Deep
Convolutional Neural Network (D-CNN) that has
been trained before, the Xception model already has
a weighted value that has been stored. So, we also
have to load the weight value in the Xception model.
This weight value is the value of information for
classifying wood from the transfer learning process.
Then, we remove the fully-connected layer / old
classifier and freeze of the Xception's layers. So, we
Figure 7. Each wood image from Class I, Class II, make a new modified Xception model without fully-
Class III, Class IV, and Class V. connected layer. To prevent overfitting, data
augmentation is carried out with a high-level
We extract the patches from the high-resolution Application Programming Interfaces (API) of deep
image where patches of the images are 299𝑥299 learning library named Keras and Tensorflow
from (0,0) of X coordinates and Y coordinates. The backend with the following steps:
1. Generalization model fully-connected layer. The optimizer method
Convert a pixel value from 0-255 to float value used to improve the weight value is the RMSProp.
between 0 and 1 so that the pixel value in each image
doesn’t produce a large pixel value when IV. EXPERIMENTAL RESULT
multiplication matrices.
A. Validation Accuracy and Validation Loss
2. Padding / Filling From experiments using transfer learning
Perform filling method on the image after the method and bottleneck features, we achieve a
convolution process using the 'replicate' method. 96.77% of validation accuracy and 0.1767 of
This method is chosen because the border on the validation loss. Figure 10 shows plots of accuracy
image can disappear so that important information and loss values during training with 100 epochs. At
can be lost as well and filled with the replicate the 30th epoch, changes in the value of accuracy and
method so that information is not lost and loss tend to change but are not significant and the
information statistic from the image can be restored. value of accuracy has touched 90%. This proves that
the bottleneck features and transfer learning
3. Horizontal Flip methods are very influential to improve
Add a dataset to each class by copying the image performance from the value of accuracy without
of each class and flip it horizontally. having to design a Convolutional Neural Network
(CNN) layer from scratch and can avoid overfitting.
Data augmentation method was applied to the
training data in new modified Xception model. After
that, we can extract bottleneck features from it. The
dimension of bottleneck features vector is
10𝑥10𝑥2048 and we save it in a multi dimensions
matrices named Numpy array format. We divided
bottleneck features into two categories. Bottleneck
features for training data and bottleneck features for
validation data.
C. Rebuilding a fully-connected layer and conduct
training in the new fully-connected layer.
In this stage, we rebuilding a fully-connected layer
that was removed before and add the new classifier Figure 10. Plotting score of Accuracy and Loss
or dense layer with five neurons. First, we make a
new model of fully-connected layer. We build an B. Confusion Matrix
input layer with 10𝑥10𝑥2048 size because the output After training the model and get the validation
of bottleneck features is 10𝑥10𝑥2048. Then, we add accuracy, we build the confusion matrix for measure
global average pooling layer and dense layer with the real accuracy and test the performance of the
five neurons because we classifying five classes of model. With this confusion matrix is presented in
wood. Figure 9 shows about the full Xception Table 1, we measure the overall accuracy and
structure with our fully-connected layer. measure the precision of each class. We measure the
overall accuracy with 93 of test data.

Table 1. Confusion Matrix of the Model

Predicted Class
I II III IV V
I 19 0 0 0 0
Actual II 0 19 0 0 0
Class III 1 0 18 0 0
IV 0 0 3 14 0
V 0 0 0 0 19

Figure 9. Replacing with the new fully- 1. Accuracy


connected layer. We measure the overall accuracy with the
following equation:
After rebuilding the model, we load two
bottleneck features that were stored in Numpy array 𝑇𝑃𝐼 + 𝑇𝑃𝐼𝐼 + 𝑇𝑃𝐼𝐼𝐼 + 𝑇𝑃𝐼𝑉 + 𝑇𝑃𝑉
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 =
format before. Then, we can train them in new 𝑁
19 + 19 + 18 + 14 + 19 [3] Y. Le Cun, B. Boser, and J.S. Denker, D.
𝐴𝑐𝑐𝑢𝑟𝑎𝑐𝑦 = = 0.9569
19 + 19 + 19 + 17 + 19 Henderson, R.E. Howard, W. Hubbard, and L.D.
With TPi is number of true positives of Class-i Jackel, “Handwritten Digit Recognition with a
and N is the total of data. We achieve 95.69% of Back-Propagation Network”, International
accuracy in this model. Conference on Neural Information Processing
Systems (NIPS), January 1989.
2. Precision [4] Y. Le Cun, L. Bottou, Y. Bengio, and P.
We measure the precision of each class with the Haffner, “Gradient-based learning applied to
following equation: document recognition”, Proceedings of the IEEE,
November 1998.
𝑇𝑃𝐼 19 [5] Qing Li, Weidong Cai, Xiaogang Wang, Yun
𝑃𝑟𝑒𝑐𝐼 = = = 0.95 Zhou, David Dagan Feng and Mei Chen, “Medical
𝑇𝑃𝐼 + ∑ 𝐹𝑃𝐼 19 + (0 + 1 + 0 + 0)
Image Classification with Convolutional Neural
𝑇𝑃𝐼𝐼 19
𝑃𝑟𝑒𝑐𝐼𝐼 = = =1 Network”, International Conference on Control,
𝑇𝑃𝐼𝐼 + ∑ 𝐹𝑃𝐼𝐼 19 + (0 + 0 + 0 + 0)
Automation, Robotics & Vision (ICARCV),
𝑇𝑃𝐼𝐼𝐼 18 December 2014.
𝑃𝑟𝑒𝑐𝐼𝐼𝐼 = =
𝑇𝑃𝐼𝐼𝐼 + ∑ 𝐹𝑃𝐼𝐼𝐼 18 + (0 + 0 + 3 + 0) [6] Kaoutar Sefrioui Boujemaa, Afaf Bouhoute,
𝑃𝑟𝑒𝑐𝐼𝐼𝐼 = 0.8571 Karim Boubouh, and Ismail Berrada, “Traffic sign
recognition using convolutional neural networks”,
𝑇𝑃𝐼𝑉 14
𝑃𝑟𝑒𝑐𝐼𝑉 = = =1 International Conference on Wireless Networks and
𝑇𝑃𝐼𝑉 + ∑ 𝐹𝑃𝐼𝑉 14 + (0 + 0 + 0 + 0) Mobile Communications (WINCOM), November
𝑇𝑃𝑉 19 2017.
𝑃𝑟𝑒𝑐𝑉 = = =1
𝑇𝑃𝑉 + ∑ 𝐹𝑃𝑉 19 + (0 + 0 + 0 + 0) [7] Hung Nguyen, Sarah J. Maclagan, Tu Dinh
Nguyen, Thin Nguyen, Paul Flemons, Kylie
With Preci is the precision of Class-i, TPi is Andrews, Euan G. Ritchie, and Dinh Phung,
number of true positives of Class-i, and FPi is “Animal Recognition and Identification with Deep
number of false positives of Class-i. We achieve the Convolutional Neural Networks for Automated
precision of each class with the following results: Wildlife Monitoring”, International Conference on
a. Precision of Class I is 95% Data Science and Advanced Analytics (DSAA),
b. Precision of Class II is 100% October 2017.
c. Precision of Class III is 85.71% [8] Jia Deng, Wei Dong, Richard Socher, Li-Jia
d. Precision of Class IV is 100% Li, Kai Li and Li Fei-Fei, “ImageNet: A Large-Scale
e. Precision of Class V is 100% Hierarchical Image Database”, IEEE Conference on
Computer Vision and Pattern Recognition, June
V. CONCLUSION 2009.
[9] Tianmei Guo, Jiwen Dong, Henjian Li,
In this paper, we use transfer learning method Yunxing Gao. “Simple Convolutional Neural
with Xception model and bottleneck features to Network on Image Classification”. International
classify class of wood. We use high-resolution Conference on Big Data Analysis (ICBDA 2017).
image with five different classes of Cedar Premium. March 2017.
The experiment achieves 95.69% of accuracy. The [10] Jiudong Yang and Jianping Li, “Application of
experimental result demonstrates that transfer Deep Convolution Neural Network”, International
learning method and bottleneck features can Computer Conference on Wavelet Active Media
improve accuracy drastically without having to Technology and Information Processing
think about designing the Convolutional Neural (ICCWAMTIP), December 2017.
Network (CNN) layer from scratch. We use these [11] Luiz G. Hafemann, Luiz S. Oliveira, Paulo R.
methods to avoid problems such as overfitting and Cavalin, and Robert Sabourin, “Transfer Learning
underfitting. With these methods, we can train with between Texture Classification Tasks using
small dataset and it provides best performance and Convolutional Neural Networks”, International
high accuracy. Joint Conference on Neural Networks (IJCNN), July
VI. REFERENCES 2015.
[12] Francois Chollet, “Xception: Deep Learning
[1] W.Pölzleitner and G.Schwingshakl, “Real- with Depthwise Separable Convolutions”, IEEE
time surface grading of profiled wooden boards”, Conference on Computer Vision and Pattern
Joanneum Research, vol 2, pp 283-298, May 1992. Recognition (CVPR), July 2017.
[2] Jing Yi Tou, Yong Haur Tay, and Phooi Yee [13] Rongfeng Su, Xunying Liu and Lan Wang,
Lau, “Gabor Filters as Feature Images for “Convolutional Neural Network Bottleneck
Covariance Matrix on Texture Classification Features for bi-directional Generalized Variable
Problem”, International Conference on Neural Parameter HMMs”, International Conference on
Information Processing (ICONIP), November 2008. Information and Automation (ICIA), August 2016.

You might also like