universiti putra malaysia backpropagation …psasir.upm.edu.my/12083/1/fk_2002_49_a.pdf(computer)....
TRANSCRIPT
UNIVERSITI PUTRA MALAYSIA
BACKPROPAGATION NEURAL NETWORK FOR COLOUR RECOGNITION
ABDUL AZIZ HUSSIEN AL-NAQEEB
FK 2002 49
BACKPROPAGATION NEURAL NETWORK FOR COLOUR RECOGNITION
By
ABDUL AZIZ HUSSIEN AL-NAQEEB
Thesis Submitted to the School of Graduate Studies, Universiti Putra Malaysia, in Fulfilment of the Requirement for the Degree of Master of Science
March 2002
Dedication
To the soul of my Father
2
Abstract of thesis presented to the senate of university Putra Malaysia in fulfilment of the requirement for the degree of Master of Science
BACKPROPAGATION NEURAL NETWORK FOR RGB COLOUR RECOGNITION
By
ABDUL AZIZ HUSSIEN AL-NAQEEB
March 2002
Chairman: Abdul Rahman Ramli, Ph.D.
Faculty: Engineering
Colour Image Processing (CIP) is useful for inspection system and Automatic
Packing Lines Systems. CIP usually needs expensive and special hardware as well as
software to extract colour from image. Most of CIP software use statistical methods to
extract colours and some system use Neural Network such as Counter-Propagation and
Back-Propagation .
Some researchers had used Neural Network methods to recognize colour of
Commission Intemationale de L'Ec1airage (CIE) Models either L *u *v or L *a *b.
CIE colour components need special and expensive devices to extract their
values from an image. However, this project will use RED, GREEN, BLUE (RGB)
colour components, which can be read from an image.
3
In this research, RGB values are used to represent the colour. RGB values are
used in two forms. The first form is the actual values that are used in PPM File Format
within (0,255) and the second form is normalized RGB values within (0, I ). Back
Propagation Neural Network is used to recognize colour in RGB values.
It is found that RGB is useful when used with Neural Network and the Normalized
RGB value is faster in the learning of neural network.
4
Abstrak tesis yang dikemukakan kepada Senat Universiti Putra Malaysia sebagai memenuhi untuk ijazah Master Sains
RANGAIAN NEURAL BACKPROPAGATION UNTUK PENGECAMAN W ARNA RGB
Oleh
ABDUL AZIZ HUSSIEN AHMED AL-NAQEEB Mac 2002
Pengerusi: Abdul Rahman Ramli, Ph.D.
Faculti: Kejuruteraan
Pemproses Imej Warna (eIP) sangat berguna untuk sistem pemeriksa dan Sistem
Pembungkusan Automatik. elP selalunya memerlukan perkakasan khusus yang mahal
serta perisian untuk menyarikan warn a daripada imej. Kebanyakan perisian elP
menggunakan kaedah statistik. Terdapat juga yang mengggunakan algoritma rangkaian
neural seperti Perambatan-Berlawanan dan Perambatan-Kebelakang.
Beberapa orang penyelidik meggunakan kaedah rangkaian neural untuk mengenalpasti
warna untuk model Commission Internationale de L'Ec1airage (CIE) samaada L *u *v
or L *a *b.
Komponen warn a CIE memerIukan peranti khusus yang mahal untuk menyarikan
n i lai-nilai daripada imej . Projek ini menggunakan pendekatan yang lain iaitu dengan
menggunakan komponen warn a merah, hijau, biru (RGB), yang boleh ditentukan
dengnn bantuan komputer peribadi biasa.
Ni lai RGB digunakan untuk menyesarkan warn a daripada imej dan seterusnya
dilaksanakan a dalam dua format, iaitu Format Fai l PPM antara (0,255) dan format n i lai
5
RGB dinonnalkan an tara (0, I), setcrusnya Rangkaian Neural Perambatan-Kebelakang
diguna untuk mengenalpasti warna yang diwakili. Oi dapati RGB sangat berguna jika
digunakan bersama Rangkaian Neural dan nilai RGB yang dinonnalkan adalah lebih
cepat dalam proses pembelajarannya.
6
ACKNOWLEDGEMENTS
I would like to begin my acknowledgement by first thanking ALLAH who
creates me. I would l ike to express my thanks to Dr. Abdul Rahman Ramli who
introduced me to Colour Image processing and Neural Network and guided me in all
stages of this work; without him this work will not be here. This was followed by
inspiration from Dr. Ramlan Mahmod to further my knowledge in neural network and
apply it in the real world, also my appreciation to Mr. Razali Yaakob for his assistance.
A special thank and appreciation for Prof. Dato Dr. Shiekh Omar Abdul Rahman
for his support during my study.
A deepest thank goes to my wife and family to support me, and a big thank to my
brother Ahmed who stands behind me in my home country and takes care of my family
during my study. My special thank goes to my dearest friend Ahmed Al-jerwy for his
appreciated support.
Lastly my deepest appreciation to all those who in one way or another have
contributed to the success of my project and eventually completion of thesis.
7
I certify that an Examination committee met on 2Sll\ March 2002 to conduct the final Examination of Abdul Aziz Hussein AI-Naqeeb on his Master of Science thesis entitled "Backpropagation Neural Network for RGB Color Recognition" in accordance with Universiti Pertanian Malaysia (Higher Degree) Act 1980 and Universiti Pertanian Malaysia (Higher Degree) Regulation 198 1 . The Committee recommends that candidate be awarded relevant degree. Members for the Examination Committee are as follows
Veeraraghavan Prakash, Ph.D. Faculty of Engineering Universiti Putra Malaysia (Chainnan)
Abdul Rahman Ramli, Ph.D. Faculty of Engineering Universiti Putra Malaysia (Member) Ramlan Mahmood, Ph.D. Faculty of Computer and Infonnation Technology Universiti Putra Malaysia (Member)
RazaH Yaakob, Faculty of Computer and Infonnation Technology Universiti Putra Malaysia (Member)
SHAMS HER MOHAMAD RAMADILI, Ph.D. Professor! Deputy Dean, School of Graduate Studies Universiti Putra Malaysia
Date: 0 8 MAY 2002
8
This thesis submitted to the Senate of Universiti Putra Malaysia has been accepted as fulfillment of the requirement for the degree of Master of Science.
9
AINI IDERIS, Ph.D. Professorl Dean School of Graduate Studies Universiti Putra Malaysia
Date:
DECLARA TION
I hereby declare that the thesis is based on my original work except for quotations and citations which have been duly acknowledged. ( also declare that it has not been previously or concurrently submitted for any other degree at UPM or other institutions.
Date: 0 8 MAY 2002
10
TABLE OF CONTENTS
Page
DEDICATION 2
ABSTRACT 3
ABSTRAK 5
ACKNOWLEDGMENTS 7
APPROVAL SHEET 8
DEC LARA TION FORM 9
LIST OF TABLES 13
LIST OF FIGURES 14
CHAPTER
I INTRODUCTION 16
General Overview 1 6
Colour Pattern Recognition 17
Artificial Neural Network 19
Statement of problem 21
Thesis Objective 21
Summary of Thesis 22
II LITERTURE REVIEW 23
COLOUR IMAGE PROCESSING REVIEW 30
Introduction 30
Colour Fundamental 31
Colour Image Coding 37
Colour Models 38
ARTIFICIAL NEURAL NETWORK REVIEW 49 Introduction 49
Definition of Artificial Neural Network (ANN) 50
Basic Concepts of ANN 51
I I
Back-Propagation 64
Summary 69
III METHODOLOGY 70
Introduction 70
The Colour Image Processing Module 73
The Neural network Module 80
Back-Propagation Algorithm 83
Summary 87
IV RESULTS AND DISCUSSION 88
Introduction 88
Image processing module 89
Back-Propagation Network Module 91
The Learning Stage 91
Difficulties During the Learning 101
The Recognition Stage 103
Comparison Study 114
Summary 117
V CONCLUSION 118
Summary 118
Achievements 118
Suggestions 119
BIBLIOGRAPHY 120
APPENDICES 124
BIODATA OF THE AUTHOR 140
12
LIST OF TABLES
Table Page
3.1 RGB components in two formats: Integer and Decimal 79
3.2 The Value of Output layer nodes representing 8 colours 82
4.1 The Learning patterns and their own desired output (the integer 95 form)
4.2 The Learning patterns and their own desired output (the decimal 96 form)
4 .3 Comparison among 13 states of Learning Rate 99
4.4 The Results of recognizing eight colours 109
4.5 Comparison between researches in term of color recognition using 116 neural network
13
LIST OF FIGURES
FIGURE Page
2.1 Perceptual representation of the colour space 32
2.2 RGB Colour Cube 40
2.3 CIE Colour Triangle Space 43
2.4 Basic Colour Space in Red- Green and Yellow-Blue Model 45
2.5 A colour gamut in CIELAB appears as follows 46
2.6 (a) The node of a neural network and (b) a biological Neuron. 52
2.7 The sigmoid function 55
2.8 The Processing Element PE 56
2.9 Examples of activation functions 56
2.10 Common models of neuron with synaptic connections a hard- 57 limiting neuron (a) hard-limiting neuron (binary perceptron) and soft-limiting neuron (continuos perceptron)
2.11 Examples of Network Topology 60
2.12 Multi-layer Neural Network 63
2.13 A biased neuron 67
3.1 The Project workflow 72
3.2 RGB values as represented in PPM file format 75
3.3 Red Colour Image IN PPM format and its RGB values 76
3.4 Figure 3.4: a: Region Of Interested, b: original image and PPM 78 file which represent ROJ.
4.1 An original image with a background 92
4.2 A preprocessed image after its background is subtracted 92
4.3 The Main Menu of the BPNN Module 92
4.4 Entering BPNN Architecture file name 93
4.5 Entering number of nodes in Input, Hidden and Output Layers 94
4.6 Entering Learning Pattern 94
4.7 Entering of desired output patterns 95
4.8 Data loaded to initialize the network 97
14
4.9 Changing the Learning rate 98
4.10 Result of learning the network for decimal value 98
4.11 Testing the network with value 102
4.12 Consulting the network with RGB Components Colour 103
4.13 Consulting the Network with RGB Component 104
4.14 A verage of error within a successful learning 104
4.15 Successful learning within 26.97 seconds 108
4.16 Result of Color Recognition for RGB Components 109
4.17 Result of Green Color Recognition for RGB Components 110
4.18 Result of Red Color Recognition for RGB Components 110
4.19 Result of Cyan Color Recognition for RGB Components III
4.20 Result of White Color Recognition for RGB Components III
15
CHAPTER I
INTRODUCTION
General Overview
Since early years for industrial revolution in nineteenth century, researchers have
been looking for the best method to automate the production lines. In the middle of
twentieth century the production lines became more automated than manual but they
still need human inspector to supervise and inspect the lines. At this point, they need the
vision and intelligence, which can be only provided by human or intelligent machine
(computer). During that time the computer was under research and development, and
was very expensive to use in inspection system. In the 70's, the inspection system was
automated completely with intelligent inspection machine (computers) and robots, but
still very expensive. Eventually the cost of all technologies equipment decrease and
building an inspection system is still costly especially for small enterprises. The other
problem in vision is the colour; the inspection system in production line should consider
the colour, to get devices to work with and furthermore analysis of colour really requires
high cost devices (Brown and Dana, 1982).
From this point, the research is involved in building a cheap inspection system
using IBM-Compatible personnel computer without any additional devices apart from
1 6
IBM-Compatible PC and a video camera. The aim is to build a software module and
integrate it with cheap hardware to provide colour inspection system.
Colour recognition usually requires special hardware and complex software. In
this research the colour recognition system is presented using normal personal computer
hardware with simple and powerful software using neural network.
ROB components are used as input for the neural network. Previous research in this
field, do not use ROB components even though it is cheap, simple to extract and
validated to represent colour, so ROB is used in this research and it is found that it is
suitable for the recognition systems. (Soriano et al.,( 2001), Razali (1999), Vlad,
(1999))
Back-Propagation Neural Network (BPNN) is used to recognize colour. Even
though there are some problems in BPNN that need to be solved, but it is a very
powerful tool to recognize and classify patterns.
Colour Pattern Recognition
Pattern Recognition is part of image processing, and the image process
techniques are used to identify object of interests among images. The object of interest is
usually extracted by using statistical methods to identify the object shape and to measure
the object size. It was only for a few years ago that the colour became considered as a
17
feature to recognize the object. Most of researchers use statistical method such as
histogram to extract the main colour of an object. The histogram method is quite slow
and complex, since the histogram algorithm needs to be implemented for each image
( frame) of the on-line steam (Brown and Dana, 1982).
A colour is very important feature of an object to be identified, so a colour can be
used as stand alone feature to recognize object especially when other vectors are fixed
(constant).
Colour Science has many standards/space/module and theorems that are adopted
by organizations such as Commission Intemationale de L'Eclairage (CIE) and its sub
organization CIELAB, which adopted CIE XYZ Standards, L u* v* and L a* b*. These
standards are usually used to represents colour in electronic and electromagnetic devices
such as TV, Video, Printers, Colour Industry, and some IT devices (Poynton, 1997).
The RGB module which is well known and standardized is used in computer to
represents colours. In fact, all computers systems represent colour in their memories
using the RGB module. The RGB module is a module that represents colour using the
three main colours, namely Red, Green and Blue. It is a reflection for actual colours in
the life. Even the human's eye retina uses three nerves to catch the three main colours
and then transfer the electro-chemical pulse to human brain where there are special
neurons cells to recognize the colours (Brown and Dana, 1982). This study attempts to
stimulate this mechanism.
18
ROB Colour model is the common used model. ROB values can be extracted
from images using personnel computer, but other Colour models such as L u* v* values
need special and expensive devices to be extracted (Poynton, 1997).
Artificial Neural Network
Artificial Neural Network (ANN) is part of Artificial Intelligence (AI), which is
developed as a simulation for human brain neural network. ANN is a network of many
simple processors (units), each possible of having a small amount of local memory. The
units are connected by communication channels ("connections"), which usually carry
numeric (as opposed to symbolic) data, encoded by any various means. The units
operate only on their local data and on the inputs they receive via the connections. The
restriction to local operation is often relaxed during training (Freeman, 1991).
ANN has so many modules of network that were developed by many researchers
and groups since the middle of last century. Some ANNs are modules of biological
neural network and some are not, but historically, most of the inspiration for the ANNs
fields came from the desire to produce an artificial system capable of carrying out
sophisticated models, perhaps "intelligent"(Freeman, 1991).
The Back-Propagation Neural Network (BPNN) which is a multi layer network
is used. BPNN has three layers, namely the input layer, hidden layer and output layer.
Each layer may have one or more nodes/units. The numbers of nodes in each layer is
19
subject to be changed from one application to another. In others words, the number of
nodes in each layer could be determined regarding to application requirements. In this
research, the colour in term of three colour components RGB need to be recognized. For
this purpose, BPNN architecture should have three unites/nodes in the input layer. For
hidden layer, number of units/nodes should be around the number of learning patterns.
For output layer, the number of units/nodes depends on the desired output. If the BPNN
recognize one colour so the output nodes will be one only, if the output" 1" the output is
desired colour, if "0" the output is not desired colour. But if BBNN recognizes 4
colours, number of nodes in output layer should be at least 2 nodes. For 8 colours, 3
output nodes are used to represent 8 colours in binary digit.
The BPNN is a powerful tool to recognize and classify objects and it sometimes
provides good result. Even though there are problems that need to be solved such as
uncontrolled behavior of Learning Rate, never learned situation during the learning
process (never reached successful learning). These problems of learning will be
presented and discussed in Chapter Four.
20
Statement of Problem
Colour object inspection system is complex and expensive. In this research a
method can be used in inspection system using IBM-Compatible PC and Video camera
is developed without any special hardware. Back-Propagation Neural network is used as
tool to recognize colours based on Red Green Blue (RGB) color space.
Studies and researches that applied neural network to recognize color have not
use standard RGB components as feeding data for neural network, some of them use
RGB histogram, Soriano et al. (2001). Some researcher used CIE models, (Razali Bin
Yaakob, 1999, Cardei, 1999, Cai.and and Goshtasby, 1999, and Chen et aI., 1997). CIE
model can be extracted from color object by special and expensive devices. It can also
be founded by converting RGB values into CIE L a * b * model through xyz model using
complicated and long mathematical model which will effect the speed of recognition.
Thesis Objective
To develop a method to classify colour using back propagation neural network as
classification tool and RGB colour model to represent the colours.
2 1
Summary of Thesis
The following is a brief description of the contents of each chapter. The next chapter
reviews literature of previous related work in the area of colour image and neural
network. It presents colour concepts, colour models and colour image representation,
then presents neural network concepts; the Perceptron, multi-layer networks, back
propagation and historical overview.
Chapter Three focuses on methodology, first it traces an introduction about our
research and tools used then presents a model diagram for the whole system. This
chapter also describes the method and file format, which the system uses to extract ROB
components, in neural network model, the Algorithm of BPNN is presented in details.
Chapter Four is dedicated to presenting the results of the development and
running the program. All vectors that affect the speed of processing (learning) are
discussed and their solutions are presented.
The thesis is concluded with a brief recap of the entire project in Chapter Five.
The main objectives are presented and its respective achievements are discussed. This
chapter is concluded with various suggestions for improvement and further study for
future researches.
22
CHAPTER II
LITERATURE REVIEW
Soriano et ai., (2001 ) used the supervised Back-Propagation Neural Network
(BPNN) to classify coloured fluorescent image and they used the ROB colours
histogram as inputs for BPNN. They used two techniques for the major color search:
cluster mean (CM) and Kohonen's self-organizing feature map (SOFM). Classification
with SOFM-generated histograms as inputs to the classifier NN achieved the best
recognition rate (90%) for cases of normal, scaled, defocused, photobleached, and
combined images of AMCA (7-Amino-4- Methylcoumarin-3-Acetic Acid) and FITC
(Fluorescein Isothiocynate )-stained microspheres.
Razali Bin Yaakob, (1999) used Multi-layer neural network method to
recognize the colours automatically. The data that represent the colours are scanned
using Minolta Chroma Meter which is capable in changing colour into values. It offers
five different colour systems for measuring absolute chromaticity, that is, CIE Yxy,
L*a*b*, L*C*Ho, Hunter Lab and XYZ. In this study, only L*a*b* is used. Two types
of neural network were used in the early stage of study, i.e. backpropagation (BP) and
counterpropagation network (ePN), where 100 data were used as a testing data. The
results show that CPN recognized 100% of trained data and untrained data however BP
can only recognized 49% of trained data and 48% of untrained data. When the number
23
of data is increased to 808, training process required a large size memory, learning time
consuming and low percentage of recognization. To solve this problems, two combined
CPNs model were proposed. The results are much improved compared to the previous
study, whereby the percentage for trained data and untrained data are 99%.
VI ad, (1999) explores the possibility of recovering a lost color channel from an
ROB image, based on the information present in the remaining two color channels, as
well as on a priori knowledge about the statistics of sensor responses in a given
environment. Different regression and neural network recovery methods are compared
and the results show that even simple linear techniques suffice to obtain a good
approximation of the original color channel. He represents data in two method the
standard ROB and The CIE Lab coordinate. The camera provides the standard ROB, and
then ROB is converted to xyz then CIE lab, the recovery methods applied for the both
color data. Result has shown that the best is Standard ROB with Polynomial Regression.
Cai and Ooshtasby, (1999) developed a method for detecting human faces in
color images, which is described that first separates skin regions from nonskin regions
and then locates faces within skin regions. A chroma chart is prepared via a training
process that contains the likelihoods of different colors representing the skin. Using the
chroma chart, a color image is transformed into a gray scale image in such a way that the
gray value at a pixel shows the likelihood of the pixel representing the skin. An obtained
gray scale image is then segmented to skin and nonskin regions, and model faces
representing front- and side-view faces are used in a template-matching process to detect
24