Beruflich Dokumente
Kultur Dokumente
.
(2)
For hidden layer, the relation are shown as Eq.(3) and Eq.(4).
Method for Image Shape Recognition with Neural Network 549
( ), 1, 2,...,
k k
o f net k l = = .
(3)
0
, 1, 2,...,
m
k jk i
j
net w y k l
=
= =
.
(4)
In Eq.(1) and Eq.(3), the transfer function ( ) f x is single polarity Sigmoid function
as Eq.(5).
1
( )
1
x
f x
e
=
+
.
(5)
2.2 Basic Idea of BP Neural Network
The learning process of BP neural network algorithm is composed with forward
propagation of input signal and backward propagation of error. In forward
propagation, input samples are introduced from input layer and are transferred to
output layer after being processed by each hidden layer. If the actual output is
inconsistent with expected output, the back propagation of error would begin. In
backward propagation, error would be transferred to input layer through hidden
layers. The error would be apportioned to all of neurons, which would correct weight
of each neuron.
The forward propagation and backward propagation would be repeated, which
would adjust the weight of each neuron. This is the process of learning and training of
BP neural network. The process would loop until that output error is reduced to an
acceptable level or the preset number of learning is achieved.
3 Features of Image Shape
In the paper, twelve features of image shape is extracted, which include seven
invariant moments, circularity degree, rectangle degree, sphericity degree, concavity
degree and flat degree [4].
3.1 Invariant Moments
Invariant moments describe geometrical characteristic of a shape, which would not
alter for size, rotation and translation of images. According to the research of Hu.m.K,
we can obtain seven invariant moments[5-7].
3.2 Circularity Degree
Circularity degree also is referred as shape factor, which is defined as the ratio of
square of the perimeter and the area.
550 W. Lu
3.3 Rectangle Degree
Rectangle degree also is referred as rectangle fitting factor, which is defined as the ratio
of the area of the shape and the area of minimum enclosing rectangle of the shape.
3.4 Sphericity Degree
Sphericity degree is defined as the ratio of the radius of internally tangent circle of the
shape and the radius of circumcircle of the shape.
3.5 Concavity Degree
Concavity degree also is defined with Eq.(6).
0
1
r
s
y
s
= .
(6)
In which,
0
s is the area of approximation polygon of the shape and
r
s is the area of
minimum external convex.
3.6 Flat Degree
Flat degree is defined as the ratio of long axis and short axis, which reflects the degree
of narrow and flat. For example, flat degree of square is 1, flat degree of rectangle is
its aspect ratio.
4 Experiment
In the paper, based on the twelve shape features, we propose to utilize BP neural
network to recognize image shape, which is provided in Matlab. Seven invariant
moments, circularity degree, rectangle degree, sphericity degree, concavity degree
and flat degree are sent to neural network as its input vector. The transfer function of
hidden layer is logarithm Sigmoid function. The transfer function of output layer is
Purelin function. Trainlm function is selected to train neural network on sample
dataset[8, 9].
We have manually built an experimental dataset respectively for triangle,
parallelogram, ellipse and arch. For each kind of shape, there are 80 images as
training samples and 60 image for testing samples.
Precision and Recall is used to evaluate the effectiveness of the method.
Precision is computed as the percentage of correct answers given by the neural
network, as Eq.(7).
# correct answers provided
# answers provided
P = .
(7)
Recall is computed as the ratio of correct answers given by neural network over the
total number of answers to be given, as Eq.(8).
Method for Image Shape Recognition with Neural Network 551
# correct answers provided
# total answers to provide
R = .
(8)
The detailed experimental result is shown in Table.1.
Table 1. Detailed experimental result
Precision Recall
Triangle 85% 83.33%
Parallelogram 81.67% 78.33%
Ellipse 80% 85%
Arch 76.67% 75%
5 Conclusions and Future Work
The paper proposes a method for image shape recognition with neural network, in
which seven invariant moments, circularity degree, rectangle degree, sphericity
degree, concavity degree and flat degree are selected as shape features and BP neural
network are utilized to recognize image shape.
In the paper, the quantity and quality of training samples have great impact on
neural network. In order to get better effectiveness, it is necessary to strengthen the
construction of sample database, which is a time-consuming work. In the field of
pattern recognition, neural network has shown some advantages. But, with the increase
of pattern categories, the effectiveness of neural network would decline sharply. The
recognition of complex shape needs the further development of neural network.
References
1. Ying, L., Dengsheng, Z., Guojun, L., Wei-Ying, M.: A survey of content-based image
retrieval with high-level semantics. Pattern Recognition 40, 262282 (2007)
2. Bayramoglu, N., Aydin Alatan, A.: Shape Index SIFT: Range Image Recognition Using
Local Features. In: International Conference on Pattern Recognition, ICPR 2010, pp. 352
355. IEEE Press, New York (2010)
3. Haykin, S. (ed.): Neural Networks and Learning Machines. Prentice Hall, New Jersey
(2009)
4. Gonzalez, R.C., Woods, R.E., Eddins, S.L. (eds.): Digital Image Processing Using
MATLAB. Press of Electrical Industry, Beijing (2009)
5. Hu, M.K.: Visual Pattern Recognition by Moment Invariants. IRE Transaction of
Information Theory IT-8 (1962)
6. Flusser, J.: On the Independence of Rotation Moment Invariants. Pattern Recognition 33,
14051410 (2000)
7. Flusser, J., Suk, T.: Rotation Moment Invariants for Recognition of Symmetric Objects.
IEEE Transactions on Image Processing 15, 37843790 (2006)
8. Zhou, K., Kang, Y. (eds.): Neural Network Model and Simulation Program Design in
Matlab. Press of Tsinghua University, Beijing (2005)
9. Zhu, K., Wang, Z. (eds.): Master Neural Networks in Matlab. Publishing House of
Electronics Industry, Beijing (2010)