Development of an Artificial Neural Network for vehicle recognition

sciencediscussionAI and Robotics

Oct 20, 2013 (3 years and 9 months ago)

135 views

Project ID
:
PT07_
32



Development of an Artificial Neural Network for vehicle recognition





by

So Wai Kiu




Progress report


Bachelor of Engineering (Honours)

in

Electrical Engineering

of the

Hong Kong Polytechnic University








Supervisor
:

Y.F. Fung










Date
:
4
-
6
-
2008


AIMS


Based on my supervisor Dr. Y.F. Fung


Parallel Image Processing
Application in Toll Collection


report, the system set a
camera

to capture
wheels photos from different types of
vehicles
.


Then used Hough Transform for detect
ing circles to generate a set of
parameters form these photos.
There will have different sets of parameters
transform by Hough transform. The graph
s

can plot out based on these sets of
parameters, different types of vehicles had different graph
ical

pattern
.



This project objective was use these different graphical pattern form these
sets of
parameters

to
determine

the wheel numbers of the
vehicle
, thus can
classify the vehicle types.

Below is the overall system:





Wheel no. and
vehicle

types

Hough Transform


Neural Network

pattern
recognition




The ideas, system design and the block diagram of the system, plus
some brief descriptions on the theory


At starting stage, because
there are different pattern of data set of
different types of vehicles. When the vehicles type is the same, the pattern of
the data will be very
similar
, so I will
create

some
virtual

data set which is
similar

to the real data set after Hough Transform fir
st.


Then I will put these data sets to the Neural Network in the Matlab to
develop and train up the classify functions. After trained up the classify function,
I will put other pattern data set to test the function work or not.


If the function works corr
ectly, I will use Hough Transform to transform
some vehicles photos to generate different data sets which is real
parameters
.

Then put these real data set to the classify function to test.




Works have been carried up to the date


I
choose

to use
Neural

N
etworks
to do this project because it can

trained
to perform
the
complex functions in
many

application includ
e

pattern
recognition
.

Neural Network in Matlab
has

a toolbox called

Graphical User
Interface


which is a

graphical user interface.

This interfa
ce
can let user to
:




Import data from the command line workspace to the GUI



Create networks



Initialize, train, and simulate networks



Enter data into the GUI



Export the training results from the GUI to the command line workspace


GUI

is
had
a window called

“GUI Network/Data Manager” window. This
window has its own work
ing
area, separate from the command line workspace.

U
ser
might export the GUI results to the command line

workspace

or
import
results from the command line workspace to the GUI
,

Once the Netwo
rk/Data Manager is
create

and running,
user

can create a
network, view it, train it, simulate it and export the final results to the

workspace.

I used Microsoft Excel to create 5 sets data which 2 of them had a
similar

pattern(two peaks pattern), 1 is all

0

, 1 is one peak pattern and last one is
random

pattern which show in below table.


100

905

0

100

600

120

1025

0

120

500

40

452

0

40

506

180

1712

0

180

603

140

1338

0

140

552

142

1255

0

142

548

136

1423

0

136

568

125

1224

0

125

601

142

1428

0

142

589

137

1401

0

137

577

108

1004

0

108

524

43

373

0

115

566


After created these data, then import this excel file to Matlab

and plot t
hem out.

[n,p] = size(Sheet1)


n =


18


p =


1

t = 1:n;




>> plot(t,Sheet1
)

>>
plot(t,Sheet2)

>>
plot(t,Sheet
3
)

>>
plot(t,Sheet
4)

>>
plot(t,Sheet
5
)
















200

19
07

0

105

566

109

1303

0

109

533

120

1425

0

120

515

90

607

0

90

547

147

1337

0

147

566

125

1443

0

125

521








Import Sheet1 as Input d
ata




T
ype

nntool


to o
pen the


Network/Data Manager





Import Sheet2 as Target data





Open

Create Network or data


window,

there were many types of

Network Type


but I have tried

all of them using Sheet1

and Sheet2 data, only some of them can

be trained.

So I choose
“Perception”

to train.

Set Sheet1 as

Input data


Set Sheet2 as

Target data







After created the network, open the network

window for training. At the Train
menu
,

Set Sheet1 as

Input data


Set Sheet2 as

Target data


Then click

Train Network














After training, we click

Performance


to view the training performance.





There are 2 outputs:

network1_outputs

network1_errors

W
e can view the value fr
om these

2 outputs.






After I trained the network, I tried to put other pattern data set to test this
network. But the result is the same, because different data set will give out
different results if the network was work, so I think that this network
had some
problems.


Then I
edited

the network

again
, but the network also didn

t work correctly.









Up
-
to
-
date progress

I tried to read the online
menu

of the GUI again, I found that there was a
new
function called

Recognizing Patterns

,

which was
in

the Neural Network
Toolbox 6.0

of Matlab
7.6

released at March 2008
.
Because my Neural
Network Toolbox is old version 4.0, so I did
n’
t have this function.

Now I found Matlab
7.6

and tried to
learn how to
use this

Recognizing
Patterns


function to develop

the network again.



Type

nprtool


at the command

window
to open

Pattern

Recognition


tool window










Set Sheet1 as Input

Set Sheet3 as Target









Validation and test data sets set

to 15% of the original data.







Set 20 to number of hi
dden neurons.

This number can change if the

network does not perform as well as

expect






This window show that how many

samples for

Training

,

Validation


and

Testing



Click

Train







After training, we can check the result

B
y click the

Confus
ion


in the Neural

Network Toolbox pattern Recognition

Tool



The diagonal cells in each table show the

number of cases that were correctly

classified, and the
un
classified cases.


The
blue

cell
shows the

total percent
age

of

correct

classified cases (
gree
n
) and the total percent
age

of
un
classified cases
(
red
).


Then save the result and tried to test.




At this
moment
, I read the menu to learn how to test this network by using
different pattern data sets. If this network works, I will use real data set to
train
and test again.


Difficulties encountered and

the measures taken to solve it

The difficulty at the starting stage in this project was the function of the
Neural Network, and how to develop the network. Because the Matlab menu
only had the example to
show how to use Neural Network, but didn

t show
which applications used which training methods was the suitable.

I needed to try and error to tried which one was suitable for pattern
recognition function.


Proposed time table for the rest of the work up to

the end of the project

July

Finished the network developing

August

Use real
data

to test

September

If the real data works with the
network, try to develop another
network for other type of
vehicles



Difficultie
s expected in the coming period

T
here may

be some error because the classify function is use the virtual
data to
develop

and train, so there may be have some error when it work with
real data set.