You are on page 1of 63

DEVELOPMENT OF A FULLY-AUTOMATED BACTERIAL COLONY

COUNTER FOR Staphylococcus aureus USING IMAGE PROCESSING


TECHNIQUES

A Thesis Manuscript
Presented to the Faculty of the
Department of Computer Science and Technology
College of Engineering
Visayas State University
Visca, Baybay City, Leyte

In Partial Fulfillment of the


Requirements for the Degree of
BACHELOR OF SCIENCE IN COMPUTER SCIENCE

MICHAEL JAMES PORMANES ROJAS


JUNE 2019
TABLE OF CONTENTS
TITLE PAGE Title Page
LIST OF FIGURES

Figure No. Title Page

LIST OF TABLES

Table No. Title Page


2

DEVELOPMENT OF A FULLY-AUTOMATED BACTERIAL COLONY


COUNTER FOR Staphylococcus aureus USING IMAGE PROCESSING
TECHNIQUES

Michael James P. Rojas, June 2019


Visayas State University, Baybay City, Leyte, Philippines 6521-A

Michael Anthony Jay B. Regis, Adviser

Abstract

This study

Keywords:
2

DEVELOPMENT OF A FULLY-AUTOMATED BACTERIAL COLONY


COUNTER FOR Staphylococcus aureus USING IMAGE PROCESSING
TECHNIQUES

CHAPTER I

INTRODUCTION

Nature and Importance of the Study

Aba

Abaca fiber is considered as one of the strongest among natural fibers, which

is three times the lack of instruments for an objective measurement of fiber quality,

grading and classification have to be done by visual inspection, which is time-

consuming and costly.

Philippine Fiber Industry Development Authority (PhilFIDA) is a government

agency tasked to grade d

In a study by Sinon (2013), the grade of the abaca fiber image in the bundle

was predicted by

The study by Sinon (2013) did not determine the grade of the abaca fiber

based on its texture, which is

Tobias et. al. (2018) stated that CNN has achieved human-like performance in several

recognition tasks such

Convolutional Neural these layers can create a particular CNN architecture.

First, the convolution layer image/feature maps compare to other supervised

learning that learn


3

Statement of the Problem

The current abaca fiber grading procedure is done manually by visual

inspection. Hence, the lack of instrument in grading abaca fiber makes the manual

process not reliable, subjective, time-consuming and costly. In a previous study, abaca

fiber grade classifier system made by (Sinon, 2013) is only based on color using

abaca fiber colorimeter. This new study will find a new method in grading abaca fiber

by acquiring its raw input pixel values and the learnable filters will be applied.

Objectives of the Study

The study aims to develop an Abaca Fiber Grade Classification System that

can recognize the grade of abaca fiber based on its color and texture from a digital

image.

The specific objectives are to:

1. Implement a small version of VGGNet-16 convolutional neural network

architecture to be applied in the system as the classifier for the abaca fiber

grade bundle;

2. Make a photo box used for image acquisition of the bundled abaca fiber;

3. Design and develop an easy to use graphical user interface for the abaca fiber

grade classifier; and

4. Evaluate the performance of the classifier using accuracy and Cohen's kappa

statistic.

Significance of the Study

The method applied in the developed system can be used as an objective

measurement in the automation of abaca fiber bundle grading. The automated abaca
4

fiber grade classifier system would aid both the abaca producers and traders to fairly

grade the abaca produce.

Scope and Limitations of the Study

This study covers from counting of colonies in a petri dish that are circular in

shape, separation

Time and Place of the Study

The sample data gathered were from Ching bee Trading Corporation at Brgy.

Hilapnitan, Baybay City, Leyte. Images were taken in dark room at Brgy. Patag,

Baybay City, Leyte. The development and testing of the system were conducted at the

Department of Computer Science and Technology, Visayas State University from

February 2019 to May 2019.


5

CHAPTER II

REVIEW OF RELATED LITERATURE

Convolutional Neural Network

In the history of neural network, coming up with convolutional neural network

(CNN) is a

Furthermore, Rosebrock (2017) well explained the difference between feature-

based and CNN supervised learning methods. He mentioned that traditional feature-

based approach involves

Murugan (2017) stated that a CNN is a state-of-the-art machine learning

algorithm that reduces the number of parameters without compromising the

computational power of its

Convolutional Layer

This layer has two mechanisms that perform element-wise multiplication and

add up to bias:

Activation function

After convolutional

Pooling Layer

The most important information. Rosebrock, (2017) stated that this layer

operates in two
6

Fully Connected Layer

In this layer

VGG Very Deep 16 CNN Architecture

Zisserman & Simonyan (2015) are the creators of the VGGNet-16 architecture

shown in Fig. 3 above

Image classification of color texture

In image classif

Moreover, in a recent study by Cusano et al., (2016) they ensembled the hand-

crafted image

Classification using Different Neural Networks

In a study by (Sinon, 2013) the grade of the abaca fiber image in bundle was

predicted by two
7

CHAPTER III

MATERIALS AND METHODS

Materials and Requirements Elicitation

The abaca fiber samples (see Appendix A for the images) were obtained

through a letter request to the Ching bee Trading Corporation (see Appendix C.A) and

the actual grading of abaca fiber sample was done by Mr. Ariel C. Cinco (see Appendix

C.B). Twenty sample images of abaca fiber for each of the seven abaca fiber grades

were segregated for image acquisition. The ten sample images of each grade were used

for training and testing phase. A 16.0-megapixel phone camera Samsung S6 was used

to capture the abaca fiber images. And a photo box was created in acquiring abaca fiber

images (see Appendix B for design and bill of materials).

System Architecture Design

Shown in Fig. 5 below is the system architecture of the study. The abaca fiber

grade classifier
8

Figure 5. System Architecture of the Abaca Fiber Grade Classifier

Image Acquisition

The different viewpoint and illumination of the acquired digital image will

greatly affect the classification


9

a. b.
Figure 6. a. Location and b. Set-up in acquiring abaca fiber images
10

Figure 7. Proposed SmallVGGNet CNN Architecture Design


11

Training Phase:

Small VGGNet-16 CNN Architecture

The

Convolutional Layer

Convolution layer are set of parallel feature maps shown in Fig.8, formed after

sliding different

M −1 N −1 C
F=( I∗K )ij = ∑ ∑ ∑ Ii +m , j+n , c∗K p=cm,, q=0
n
+b i, j Eq. 1
m =0 n=0 c=0

Where:

F=( I∗K ) = feature map output after convolution

i = ith pixel in height of the feature map

j = jth
i,j
b = bias parameter

p,q
C =σ ¿ Eq. 2
m,n

Where:

M&N=

p ,q
b

Dim c
12

Where:

Figure 8. Left: learnable K kernels. Middle: Image. Right: After convolution the output,
called feature map.

Rectified Linear Unit

The weighted

Pooling Layer

The mechanism
13

Figure 9. An example of max pooling

Fully Connected Layer

After the poo

Initialization. From the

l−1 p ,q
a i =f (P ) Eqn. 7

Where:

Forward Propagation. All random weights values are set during this mechanism

and bias values is set 1 to make it the classification layer using in fully connected layers

that produces an estimate of the probability for each abaca grades as shown in Eqn. 12.
n
z =∑ wlij al−1
l
j
l
j +b j Eqn.8.1
i=1

l l
a j=σ (z j ) Eqn.8.2

Where:
14

z = linearly transformed net inputs of fully connected layer

l = first layers in the fully connected layer

j = single neuron in the l

l T
a =σ ( ( W ) a
l l−1 l
+b ) Eqn. 9

Where:

a =σ ( ( W ) a + b )
L L L−1TL
Eqn. 10

Where:

L=

Where:

Backward Propagation. After forward run, the output to the weights adjust from

its initial random value of weights and biases. During the update, the loss function of

final layer with respect to the parameters is computed first where the gradient of first

convolutional layer is computed last. And then, this process used a partial derivative of
15

one layer being reused in computation of partial derivative of another layers using chain

rule. In effect the loss function will decrease and the performance of the model increases.

This algorithm called backpropagation by updating its parameters to its best in order to

minimize the loss function. The nomenclature of every equation shown below:

Nomenclature of below formulas:

X = image/convolve feature maps

α = learning rate

σ = ReLU activation function

n = total number of training sample

L+ 1
ŷ i = predicted output value

y = matrix of actual labelled value of training set

y i = actual value from labelled training set

z = linearly transformed net inputs of fully connected layer

Loss function formula of ith neuron as the classification layer (L+1) with respect to the

predicted values ŷ iL+ 1:

∂ L ( ŷ L+1 , yi ) 1
i−n
yi 1− y i
= ∑ L+1
i
+ Eqn.14
∂ yi
L+1
n 1 ŷi L+1
1− ŷ i

Loss function formula with respect to weight w Li ,i−1 of ith neuron in the final layer L:
16

∂ L ( ŷ L+1 , yi ) 1
n
− y i 1− y i
i

∂ wiL,i−1
= ∑ ( L+ 1 +
n i=1 ŷ i 1− ŷ L+1
¿ )¿ ¿ Eqn.15
i

Loss function formula with respect to weights of every neuron in Lth layer:

[ ]
∂ L ( ŷ1 , y1 )
L+1

L
∂ L( ŷi
L+1
, y) ∂ w 1 ,i−1
L
= ⋮ =¿ Eqn.16
∂W
∂L(ŷ )
L+1
i ,y
i
L
∂w i ,i−1

Loss function formula with respect to bias b li in ith neuron in Lth layer:

∂ L ( ŷ L+1 , yi ) 1
n
∂ L ( ŷ iL+1 , y i ) ∂ ŷ iL+1
= ∑ =σ ( z L+1
i − yi )
i
Eqn.17
∂ bLi n i=1 ∂ ŷi L+1
∂ bi L

Loss function formula with respect to bias of every neurons at Lth layer:

[ ]
∂ L ( ŷ1 , y1 )
L+1

[ ]
σ ( z 1 ¿− y 1)
L L+1
∂ L( ŷi
L+1
, y) ∂b 1
L
= ⋮ = ⋮ Eqn.18
∂b
∂L(ŷ , yi ) σ (z ¿− y i)
L+1 L+ 1
i i
L
∂b i

Loss function formula with respect to weight of ith neuron at first layer l in fully

connected layer:

∂ L ( ŷ L+1
i , yi ) ∂ L ( ŷ iL+ 1 , y i ) ∂ ŷ L+1
i
l
y i−z i
= = Eqn.19
z i ( 1−z i )
l L+1 l l l
∂ wi ,i−1 ∂ ŷi ∂ w i ,i−1
17

Then, the loss function formula with respect to weight of all neuron at lth layer shown

below,

[ ][ ]
l
∂ L ( ŷ1 , y1 )
L+1
y1 −z1
z 1 ( 1−z 1 )
l l l
∂ L( ŷi
L+1
, y) ∂ w1 , o
l
= ⋮ = ⋮ Eqn.20
∂W l
∂L(ŷ )
L+1
i ,y
i
y i −z i

z ( 1−z i )
l l l
∂w i ,i−1 i

Loss function formula with respect to bias of ith neuron at lth layer l in fully connected

∂ L ( ŷ L+1
i , yi ) ∂ L ( ŷ iL+ 1 , y i ) ∂ ŷ L+1
i
l
= L+1 l
=z l−1
i − y i Eqn.21
∂b i ∂ŷ i ∂b i

Then, the loss function formula with respect to bias at the layer l shown below,

[ ]
∂ L ( ŷ1 , y1 )
L+1

[ ]
∂ L( ŷi
L+1
, y) ∂ b1
l
z l−1
1 − y1

l
= ⋮ = ⋮ Eqn.22
∂b l−1
∂L(ŷ , yi ) − yi
L+1
i
z i
l
∂b i

In performing the learning of CNN, it is necessary to update the learnable filters

and bias values in convolutional layers. But from the first layer in the fully connected

layer, the single long vectors from the pooled feature maps must be updated first. Below

is the loss function formula with respect to all input value:

∂ L ( ŷ L+1
n , yn ) ∂ L ( ŷ nL+1 , y n ) ∂ y nL+1
= Eqn.23
∂ ali ∂ y L+1
n ∂ al−1
i
18

After the single long vector updated, the reshaping of the long vector take place in

the pooling layer in Eqn. 24. Then, there are no parameters to be updated in this layer so

the up-sampling mechanism in Eqn. 25.

∂ L ( ŷn , yn)
L+1
p, q −1
P =f ( l
) Eqn. 24
∂ ai

∂ L ( ŷ L+1
i , yt )
p, q
=P p , q Eqn. 25
∂C m ,n

Then, the loss function formula with respect to the convolutional learnable filter
p ,q
k u ,v can be computed as shown in Eqn.26. Then, updated values of learnable filter k p ,q in

Eqn. 27.

∂ L ( ŷ L+1 , yi ) M −1 N−1
∂ L ( ŷ iL+1 , y n )
=∑ ∑
i
X m−u , n−v Eqn. 26
∂ k up,, vq m=0 n ∂C mp ,, qn

p ,q
°∗∂ L ( ŷ iL+1 , y n )
k =rot 180 Eqn. 27
∂ Cmp ,, qn

Finally, the loss function formula with respect to the bias b p ,q of the convolutional

learnable filter can be computed in Eqn.28.

∂ L ( ŷi , yi ) ∂ L( ŷi , yn )
L+ 1 M −1 N −1 L+1

b p ,q
= p ,q
=∑ ∑ p ,q
Eqn.28
∂b m=0 n ∂C m ,n
19

Model Optimizer and Training Regularization

In this part, the optimization techniques are developed for the model in order to

minimize the loss function in every update of the learning parameters such as WL+1, bL+1,

WL, bl, kp,q and bp,q at each iteration process on the basis of gradient descent. One of this is

the stochastic gradient descent optimization. The weight and bias update of fully

connected layer in classification layer L+1 in Eqn. 29.a & 29.b.

L+1 L+1
∂ L ( ŷ iL+1 , y )
W =W −α L
Eqn. 29.a
∂W

L+1 L+1
∂ L ( ŷ iL+1 , y )
b =b −α Eqn. 29.b
∂ bL

Where:

∂ L ( ŷ L+1
i , y)
L
= shown in Eqn.16
∂W

∂ L ( ŷ L+1
i , y)
= shown in Eqn.18
∂ bL

Then, the weight and bias update of fully connected layer in first layer l in Eqn.

30.a & 30.b.

l l
∂ L ( ŷ iL+1 , y )
W =W −α Eqn. 30.a
∂Wl

l l
∂ L ( ŷ L+1
i , y)
b =b −α Eqn. 30.b
∂ bl
20

Where:

∂ L( ŷi , y)
L+1

l
= shown in Eqn. 20
∂W

∂ L ( ŷ L+1
i , y)
= shown in Eqn. 22
∂ bl

Finally, the weight/pixel values and bias update of learnable filter in Eqn. 31.a &

31.b.

p ,q p, q
∂ L ( ŷ L+1
i , y)
k =k −α Eqn. 31.a
∂ k up,, vq

p .q
∂ L ( ŷ iL+1 , y )
b =α Eqn. 31.b
∂ k up,,qv

Where:

∂ L ( ŷ L+1
i , y)
= shown in Eqn. 26
∂ k up,v,q

∂ L ( ŷ L+1
i , y)
= shown in Eqn. 28
∂ k up,v,q

Importantly, a reminder for the overfitting when too many parameters of the

model can cause by having too few samples to learn in training process. Then, the

regularization techniques in training process such as data augmentation, dropout

regularization and batch normalization help to fight overfitting. Data augmentation


21

mechanism is to generate more training data from existing sample images, “augmenting”

the training data via a number of random transformations.

Dropout is one of the most effective and commonly used regularization

techniques. It works when applied after to a particular layer by simple consist of

randomly “dropping out” (i.e. setting the value to zeroed out if the value is less than or

equal to the initialize probability value). Then, the output values of a particular layer

break up the patterns that are not significant.

Batch normalization techniques is straightforward just centering the data in 0 by

subtracting the mean from the data and then giving the unit standard deviation by

dividing the data by its standard deviation. In result, the data follows a normal

distribution in which centered and scaled to unit variance. The advantage of this

technique is effective at reducing the number of epochs and large variety of learning rates

in every parameter in the network. But the drawback of this technique is the

computational time.

Implementation

The programming language used in this study was Python version 3.6 under

Spyder 3.3.3 integrated development environment within Anaconda distribution. Keras a

python deep learning library in python was used whose backend is Tensorflow API.

Additionally, Qt designer was used for the graphical user interface (GUI) and some

packages of python installed such as pyqt5, sklearn, imutils, matplotlib, numpy, pickle,
22

opencv, random, os and many more. Then, in evaluating the performance of the system

was done manually.

User Interface Design

The user interface

Figure 10. Use Case Diagram of the Abaca Fiber Classifier System

System Testing and Evaluation

The generated model and label files after several experiments will be subject for

testing in which uses a feed forward propagation. Ten sample abaca fibers per grade were

used as testing data to determine the performance of the system using kohen kappa

statistic and accuracy.by gathering the predicted output of the system and actual abaca

fiber grade based on the grading of PhilFIDA Inspector Mr. Ariel Cinco.

The evaluation of the system testing are follows:


23

1. Total False Prediction (TFP) – total false prediction in each grade of abaca

fiber when the system predicts.

2. Total True Prediction (TTP) - total true prediction in each grade of abaca fiber

when the system predicts


24

Table 1. Performance Evaluation using Confusion Matrix

Actual Abaca Fiber Grade based on PhilFIDA Inspector Mr. Ariel Cinco Total
Actual: S2 Actual: S3 Actual: I Actual: G Actual: H Actual: JK Actual: M1
Predicted: S2 (TTP) (TFP) (TFP) (TFP) (TFP) (TFP) (TFP) P:S2total
System Predicted: S3 (TFP) (TTP) (TFP) (TFP) (TFP) (TFP) (TFP) P:S3total
Predicted Predicted: I (TFP) (TFP) (TTP) (TFP) (TFP) (TFP) (TFP) P:Itotal
Grade Predicted: G (TFP) (TFP) (TFP) (TTP) (TFP) (TFP) (TFP) P:Gtotal
Predicted: H (TFP) (TFP) (TFP) (TFP) (TTP) (TFP) (TFP) P:Htotal
Predicted: JK (TFP) (TFP) (TFP) (TFP) (TFP) (TTP) (TFP) P:JKtotal
Predicted: M1 (TFP) (TFP) (TFP) (TFP) (TFP) (TFP) (TTP) P:M1total
Total A:S2total A:S3total A:Itotal A:Gtotal A:Htotal A:JKtotal A:M1total (Grand
Total)
25

To evaluate the performance, the computations formulae was conducted as follows:

1. Cohen’s kappa statistic – measures the precision between prediction of the system

and actual grading of abaca fiber. The kappa statistic value is calculated using

equation 4 and in table 3 shows an equivalent value.


i
TTP
∑ Pii= Grand total
Total
Eqn. 32
i=1

Where:

TTPtotal is the grand total of the Total True Prediction (TTP)

Grand Total is the total number of the test data.

[( )( )( )(
P : S 2total P :S 3 total P : I total P :Gtotal
i ∗A :S 2total ∗A : S 3total ∗A : I total
Grand Total Grand Total Grand Total Grand Total
∑ Pi +¿ P +i
=
Grand Total
+
Grand Total
+
Grand Total
+
Grand T
i=1

Eqn. 33

Where:

* = denotes S2, S3, I, G, H, JK & M1 grade

A:*total = grand total of each grade in the actual

P:*total = grand total of each grade

Grand Total = total number of the test data.


26

i ∑ Pi +¿P +i

κ=∑ Pii − i=1


i
¿ Eqn.
1−∑ Pi +¿ P ¿
i=1
+i
i=1

33

Where:

∑ Pii is the total proportion of main diagonal


i=1

∑ Pi +¿ P +i
¿ is the total proportion of marginal in the confusion matrix
i=1

Table 2. Cohen’s Kappa Equivalent Value

Value of Level of Percentage of Data that


Kappa Agreement are Reliable
0-.20 None 0-4%
0.21–0.39 Minimal 4-15%
0.40–0.59 Weak 15-35%
0.60–0.79 Moderate 35-63%
0.80–0.90 Strong 64-81%
Above .90 Almost Perfect 82-100%

2. Accuracy – measures on how the system corrects the prediction.

TTPtotal
accuracy= x 100 Eqn. 34
Grand Total

Where:

TTPtotal is the total number of correct identifications


27

Grand Total is the total number of test data

CHAPTER IV

RESULTS AND DISCUSSIONS

Building Virtual Environment

Before the actual implementation of the system, Anaconda Python distribution

which is open source and free must be installed. After installation set-up, virtual

environment must be

Keras is a one

Listing 1. Configuring keras.json file

{
"floatx": "float32",
"epsilon": 1e-07,
"backend": "tensorflow",
"image_data_format": "channels_last"
}

Importing Different Libraries

After the keras.json file configure, different libraries imported to one python file

only for the sake of simplicity in the throimplementation and to minimize its processing

time in accessing the classes and modules of different libraries.


28

Building Graphical User Interface Design

In the phase of implementation, Qt designer was used for the Graphical User

Interface (GUI) of the system. Then, the generated .ui file of the application is subjected

to conversion into python file using anaconda prompt as shown in Listing 2. The quoted

texts are subject to change. The generated python file for the GUI of the system was

imported to implementation of the system.

Listing 2. .ui file conversion to .py file


activate ‘createdVirtualEnvironment’
cd ‘directoryLocationOfTheUIFile’
python -m PyQt5.uic.pyuic -x ‘fileName’.ui -o ‘fileName’.py

Training Phase

Small VGGNet16 Architecture Implementation


The proposed architecture of the study was shown in Fig.7 in the methods section,

and the implementation is shown in Listing 3. Moreover, GUI design for the training

phase is shown in Fig. 10.

Listing 3. Small VGGNet16 Architecture Implementation

def smallVggModel(width, height, nChannels, abacaGrades):


genModel = Sequential()
inputShape = (height, width, nChannels)
changeDime = -1

genModel.add(Conv2D(32, (3, 3), padding="same",


input_shape=inputShape))
genModel.add(Activation("relu"))
genModel.add(BatchNormalization(axis=changeDime))
genModel.add(MaxPooling2D(pool_size=(3, 3)))
genModel.add(Dropout(0.25))

genModel.add(Conv2D(64, (3, 3), padding="same"))


29

genModel.add(Activation("relu"))
genModel.add(BatchNormalization(axis=changeDime))
genModel.add(Conv2D(64, (3, 3), padding="same"))
genModel.add(Activation("relu"))
genModel.add(BatchNormalization(axis=changeDime))
genModel.add(MaxPooling2D(pool_size=(2, 2)))
genModel.add(Dropout(0.25))

genModel.add(Conv2D(128, (3, 3), padding="same"))


genModel.add(Activation("relu"))
genModel.add(BatchNormalization(axis=changeDime))
genModel.add(Conv2D(128, (3, 3), padding="same"))
genModel.add(Activation("relu"))
genModel.add(BatchNormalization(axis=changeDime))
genModel.add(MaxPooling2D(pool_size=(2, 2)))
genModel.add(Dropout(0.25))

genModel.add(Flatten())
genModel.add(Dense(1024))
genModel.add(Activation("relu"))
genModel.add(BatchNormalization())

genModel.add(Dense(abacaGrades))
genModel.add(Activation("softmax"))

return genModel
30

Figure 11. Training Tab Interface of the system


When the user triggers the Load Image File Directory button a folder dialog is

prompted in order to locate the training dataset of the acquired images for training phase,

as shown in Fig. 11. After the start training button is triggered the training process begins,

as shown in Fig. 12.


31

Figure 12. Folder dialog when Load Image File Directory is triggered

Figure 13. Training process start when training button is triggered


32

If the user clicked the start training button without any file directory for training

dataset, it will prompt a warning sign in shown in Fig. 13 below.

Figure 14. A warning sign prompt when no file directory exists

After several experiments, the generated good model has training parameters of

learning rate set to 0.001, training epochs set to 100, random seed set to 42 and batch size

set to 32. At epoch 57 in the training process, achieved a minimum loss and then the

model is saved automatically using a poweful method called “callbacks” in Keras API.

Testing Phase

The generated model is tested with 70 images and the results are shown in Table

3. Confusion matrix is presented in Table 3 and the summary of performance in shown in

Table 5. Moreover, the interface design of this phase is shown in Fig. 14 below. Fig. 15

on the other hand shows when an image is loaded and the results of the prediction model.
33

Figure 15. Testing Tab Interface of the system

Figure 16. Prediction results of the abaca fiber image


34

While other feature of the system is to generate a model after the show

model button was click shown in Fig. 16and the detailed image shown in Appendix E.

Fig.17 and 18 shown the feature maps and specific feature map at every layer and Fig. -

19 shown the About Tab Interface of this system.

Figure 17. Model Summary of the model


35

Figure 18. Prediction results of the abaca fiber image

Figure 19. Specific feature map of a particular convolutional layer in the model
36

Figure 20. About Tab Interface

Performance Evaluation

Table 3. Results on the Abaca Fiber Grade Classifier System


Sample Actual Predicted Matched
No. Grade Grade Percentage Remarks
1 Current(I) Current(I) 79.99% Correct
2 Current(I) Current(I) 82.04% Correct
3 Current(I) Current(I) 98.36% Correct
4 Current(I) Current(I) 83.78% Correct
5 Current(I) Current(I) 85.67% Correct
6 Current(I) Current(I) 99.70% Correct
7 Current(I) Current(I) 76.89% Correct
8 Current(I) Current(I) 91.06% Correct
9 Current(I) Current(I) 99.80% Correct
10 Current(I) Current(I) 85.26% Correct
11 Medium Brown(M1) Medium Brown(M1) 98.83% Correct
12 Medium Brown(M1) Medium Brown(M1) 100.00% Correct
13 Medium Brown(M1) Medium Brown(M1) 99.99% Correct
37

14 Medium Brown(M1) Medium Brown(M1) 98.92% Correct


15 Medium Brown(M1) Medium Brown(M1) 99.43% Correct
16 Medium Brown(M1) Medium Brown(M1) 93.25% Correct
17 Medium Brown(M1) Medium Brown(M1) 99.94% Correct
18 Medium Brown(M1) Medium Brown(M1) 99.87% Correct
19 Medium Brown(M1) Medium Brown(M1) 100.00% Correct
20 Medium Brown(M1) Medium Brown(M1) 99.67% Correct
21 Seconds(JK) Soft Brown(H) 82.43% Wrong
22 Seconds(JK) Second(JK) 99.99% Correct
23 Seconds(JK) Second(JK) 100.00% Correct
24 Seconds(JK) Second(JK) 100.00% Correct
25 Seconds(JK) Second(JK) 100.00% Correct
26 Seconds(JK) Second(JK) 68.58% Correct
27 Seconds(JK) Second(JK) 99.99% Correct
28 Seconds(JK) Second(JK) 84.65% Correct
29 Seconds(JK) Second(JK) 100.00% Correct
30 Seconds(JK) Second(JK) 99.92% Correct
31 Soft Brown(H) Soft Brown(H) 100.00% Correct
32 Soft Brown(H) Soft Brown(H) 100.00% Correct
33 Soft Brown(H) Soft Brown(H) 100.00% Correct
34 Soft Brown(H) Soft Brown(H) 100.00% Correct
35 Soft Brown(H) Soft Brown(H) 99.80% Correct
36 Soft Brown(H) Soft Brown(H) 100.00% Correct
37 Soft Brown(H) Soft Brown(H) 91.78% Correct
38 Soft Brown(H) Soft Brown(H) 100.00% Correct
39 Soft Brown(H) Soft Brown(H) 100.00% Correct
40 Soft Brown(H) Soft Brown(H) 99.27% Correct
41 Soft Second(G) Medium Brown(M1) 99.02% Wrong
42 Soft Second(G) Current(I) 75.12% Wrong
43 Soft Second(G) Medium Brown(M1) 83.76% Wrong
44 Soft Second(G) Medium Brown(M1) 78.15% Wrong
45 Soft Second(G) Medium Brown(M1) 81.31% Wrong
46 Soft Second(G) Current(I) 64.65% Wrong
47 Soft Second(G) Medium Brown(M1) 87.88% Wrong
48 Soft Second(G) Medium Brown(M1) 94.89% Wrong
49 Soft Second(G) Medium Brown(M1) 97.82% Wrong
50 Soft Second(G) Medium Brown(M1) 81.39% Wrong
51 Streaky Three(S3) Streaky Three(S3) 100.00% Correct
52 Streaky Three(S3) Streaky Three(S3) 92.30% Correct
53 Streaky Three(S3) Streaky Three(S3) 54.14% Correct
38

54 Streaky Three(S3) Streaky Three(S3) 92.83% Correct


55 Streaky Three(S3) Medium Brown(M1) 82.29% Wrong
56 Streaky Three(S3) Streaky Three(S3) 54.14% Correct
57 Streaky Three(S3) Streaky Three(S3) 100.00% Correct
58 Streaky Three(S3) Streaky Three(S3) 54.14% Correct
59 Streaky Three(S3) Streaky Three(S3) 100.00% Correct
60 Streaky Three(S3) Streaky Three(S3) 100.00% Correct
61 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
62 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
63 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
64 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
65 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
66 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
67 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
68 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
69 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
70 Streaky Two(S2) Streaky Two(S2) 100.00% Correct
39

Table 4. Confusion Matrix for the 70 images

Actual Abaca Fiber Grades based on PhilFIDA Inspector Mr. Ariel Cinco Total
Actual: Actual: Actual: Actual: Actual:
Actual: S3 Actual: I
S2 G H JK M1
Predicted: S2 10 0 0 0 0 0 0 10
System Predicted: S3 0 9 0 0 0 0 0 9
Predicted Predicted: I 0 0 10 2 0 0 0 12
Grades Predicted: G 0 0 0 0 0 0 0 0
Predicted: H 0 0 0 0 10 1 0 11
Predicted: JK 0 0 0 0 0 9 0 9
Predicted:M1 0 1 0 8 0 0 10 10
Total 10 10 10 10 10 10 10 70

Table 5. Summary of Performance Evaluation

Performance Measures Values


Accuracy 82.86%
Kappa Value 0.58
40

CHAPTER V

SUMMARY, CONCLUSION AND RECOMMENDATIONS

Summary

Classifying abaca fiber grades done by visual inspection based on its physical

features such as color and texture is difficult even with the aid of the expert. The process

is subjective, not reliable, time-consuming and costly. Thus, this study developed a

software that could be used to objectively augment the human capability in grading the

abaca fiber.

In a previous study, abaca fiber grade classifier system made by (Sinon, 2013) is

only based on color using abaca fiber colorimeter. However, Cusano et al., (2016)

implemented different kinds of image classification methods in raw food texture images

including CNN architectures under different lightning conditions. Results clearly showed

that the VGGNet-16 CNN architecture outperforms other with a high classification

accuracy of 98.21%. They concluded that the datasets taken under no variation in lighting

condition clearly boosts the performance of the different image classification methods.

The Python version 3.6 programming language with the aid of Spyder IDE 3.3.3

within Anaconda Python Distribution was used to develop the system. Specifically, Keras

deep learning library whose computational backend is TensorFlow for saving the trained

model and then pickle library for saving the grade labels of abaca fiber and many more

were installed within anaconda virtual environment.


41

Inspired by Cusano et al., (2016) paper, this study implements a small version of

VGGNet-16 architecture equipped with CPU Intel core i3 processor because the actual

architecture implementation uses high-end PC equipped with NVIDIA Titan GPU

processors. It consists of five convolutional layers followed by a rectified linear unit as

activation function, three pooling layers and 1024 inputs to fully connected layer and 7

outputs for different grades of abaca fiber. Moreover, a photo box is used for controlling

the illumination of the abaca fiber images.

Conclusion

The abaca fiber grade classifier system using a small version of VGGNet-16 CNN

architecture with the aid of photo box for acquisition set-up produce a result of 83%

classification accuracy and Cohen kappa level of agreement is weak. The developed

system was an effective alternative for the manual identification of abaca fiber grades

based on color texture classification provided by (PhilFIDA, 2016).

Recommendation

Based on the results, further study is recommended to build the high effectiveness

of the develop technique in order to improved its classification, through

1. Building an optimum model of the proposed small version of VGGNet-16

CNN architecture by tuning-in its training parameters with the aid of

GridSearchCV technique.
42

2. Actual implementation of VGGNet-16 CNN architecture in high-end PC

equip with GPU processors. Then, the image dimension from the acquisition

should not be large enough in order to retain the quality of the image when

rescaling technique apply.

3. Real-time implementation of the abaca fiber grade classifier system whether

in bundled or per strand.


43

LITERATURE CITED

Bianconi, F. (2011). Theoretical and experimental comparison of different approaches for


color texture classification. Journal of Electronic Imaging, p. 20.
Chollet, F. (2017). Deep Learning with Python. San Diego, USA: Manning Publications.
Cusano, C., Napoletano, P., & Schettini, R. (2016). Combining multiple features for color
texture classification. Journal of Electronic Imaging 25(6), p. 10.
Hakeem, K., Jawaid, R., & Rashid, U. (2014). Biomass and Bioenergy: Applications. In
R. Armecin, F. G. Sinon, & L. O. Moreno, Abaca Fiber: A Renewable Bio-
resource for Industrial Uses and Other Applications (pp. 108-119). Universiti
Putra Malaysia: Selangor , Malaysia: Springer International Publishing.
Ji, M., Liu, L., & Buchroithner, M. (2018). Identifying Collapsed Buildings Using Post-
Earthquake Satellite Imagery and Convolutional Neural Networks. MDPI, 20
pages.
Karpath, & Johnson. (2017). Convolutional Neural Networks. Retrieved 20 2018,
October, from CS231n: Convolutional Neural Networks for Visual Recognition:
http://cs231n.github.io/convolutional-networks/
Lecun, Bottou, Bengio, & Haffner. (1998). Gradient-Based Learning Applied to
Document Recognition. IEEE, 47.
Li, J., Liao, G., Ou, Z., & Jin, J. (2008). Rapeseed Seeds Classification by Machine
Vision. IEEE, pp. 146-149.
Mȁenpȁȁ, T., & Pietikȁnen, M. (2004). Classification with color and texture: jointly or
separately? Pattern Recognition, Pergamon, 12 pages.
Milan, P. P. (2005). Abaca and Rainforestation Farming: A guide to sustainable farming
management. Leyte State University, Baybay, Leyte,: Desktop Publishing.
Murugan, P. (2017). Feed Forward and Backward Run in Deep Convolution Neural
Network. arXiv:1711.03278v1 [cs.CV], 20.
Mussig, J. (2017). Industrial Applications of Natural Fibres: Structure, Properties and
Technical Applications. In F. G. Sinon, W. Muhlbauer, & F. GoltenBoth, Abaca -
Cultavation, Extraction and Processing (pp. 189 - 204). Department of
Biomimetics, Hochschule Bremen - University of Applied Sciences, Bremen,
Germany: A John Wiley and Sons, Ltd., Publication.
44

Naik, S., & Patel, B. (2013). Machine Vision based Fruit Classification and Grading - A
Review. International Journal of Computer Applications (p. 13). Uka Tarsadia
University, Bardoli, Surat, Gujarat, India: IEEE.
PhilFIDA. (2016). Abaca fiber: Grading and Classification – Hand-stripped and Spindle/
Machine stripped. Diliman, Quezon City: Philippine National Standard. Bureau of
Agriculture and Fisheries Standards.
PhilFIDA. (2018). Fiber Statistics. Retrieved October 28, 2018, from Philippine Fiber
Industry Development Authority: http://www.philfida.da.gov.ph/index.php/2016-
11-10-03-32-59/2016-11-11-07-56-39
Rosebrock, A. (2017). Deep Learning for Computer Vision with Python. California,
USA: Pyimagesearch.
Sinon, B. (2013). Development of an Abaca Fiber Grade Recognition System using
Neural Networks. Visayas State University (VSU), Baybay City, Leyte:
Undergraduate Thesis (Department of Computer Science and Technology).
TechSciResearch. (2018, October 28). Retrieved from Philippines Abaca Fiber Market
Forecast and Opportunities: https://www.techsciresearch.com/report/philippines-
abaca-fiber-market-forecast-and-opportunities-2019/390.html
Tobias, L., Ducournau, A., Rousseau, F., Mercier, G., & Fablet, R. (2018). Convolutional
Neural Networks for Object Recognition on Mobile Devices: a Case Study. IEEE,
p. 7.
Zisserman, A., & Simonyan, K. (2015). VERY DEEP CONVOLUTIONAL
NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION. ICLR , 14 pages.
45

APPENDICES
46

APPENDIX A

ABACA FIBER IMAGES

STREAKY TWO (S2)


47

TRAINING SET IMAGES TESTING SET IMAGES

STREAKY THREE(S3)
48

TRAINING SET IMAGES TESTING SET IMAGES


49

CURRENT (I)

TRAINING SET IMAGES TESTING SET IMAGES


50

SECONDS (JK)

TRAINING SET IMAGES TESTING SET IMAGES


51

MEDIUM BROWN (M1)

TRAINING SET IMAGES TESTING SET IMAGES


52

SOFT BROWN (H)

TRAINING SET IMAGES TESTING SET IMAGES


53

SOFT SECOND (G)

TRAINING SET IMAGES TESTING SET IMAGES


54

APPENDIX B

PHOTO BOX DESIGN

Appendix Figure A. CAD Design of the Photo Box


55

Appendix Table B. Bill of Materials of the Photo Box


Quantity Unit Description Unit Cost Total Cost
(₱) (₱)
4 units LED Light 25.00 100.00
1 unit Lock 23.00 23.00
4 units Bisagra 9.00 36.00
3 m Wire 12.00 27.00
1 unit Adapter DC Plug 325.00 325.00
1 pc ½” x 2¾” x 45” lauan lumber 40.00 40.00
1 unit switch 25.00 25.00

Total Material Cost (TMC) 459.00


Labor Cost (35% of TMC) 160.65
TOTAL COST (TPC) 619.65
56

APPENDIX C

LETTER OF REQUEST

A. Gathering of Abaca Fibers

56
57

B. Grading of Abaca Fibers

57
58

APPENDIX D

Table 1. Normal grades of hand stripped abaca fiber

Grade Description
Name Alphanumer Fiber strand Color Stripping Texture
ic code size (in mm)
Mid current EF 0.20 – 0.50 Light ivory to a hue of very light brown to Excellent Soft
very light ochre
Streaky Two S2 0.20 – 0.50 Ivory white, slightly tinged with very light Excellent Soft
brown to red or purple streak
Streaky Three S3 0.20-0.50 Predominant color – light to dark read or Excellent Soft
purple or a shade of dull to dark brown
Current I 0.51-0.99 Very light brown to light brown Good Medium soft
Soft seconds G 0.51-0.99 Dingy white, light green and dull brown Good

Soft Brown H 0.51-0.99 Dark brown Good


Seconds JK 0.51-0.99 Dull brown to dingy light brown or dingy Fair
light yellow, frequently streaked with light
green
Medium brown M1 0.51-0.99 Dark brown to almost black Fair
Source: PhilFIDA. (2016). Abaca fiber: Grading and Classification – Hand-stripped and Spindle/ Machine stripped

58
59

APPENDIX E

59
60

60

You might also like