Image Classification Based on Textural Features using
Artificial Neural Network (ANN)
Prof S K Shah, Fellow
V Gandhi, Non-member
Image classification plays an important part in the fields of Remote sensing, Image analysis and Pattern recognition.
Digital image classification is the process of sorting all the pixels in an image into a finite number of individual classes.
The conventional statistical approaches for land cover classification use only the gray values. However, they lead to
misclassification due to strictly convex boundaries. Textural features can be included for better classification but are
inconvenient for conventional methods. Artificial neural networks can handle non-convex decisions. The uses of textural
features help to resolve misclassification. This paper describes the design and development of a hierarchical network by
incorporating textural features. The effect of inclusion of textual features on classification is also studied.
Keywords: Gray values; Neural classifier; Supervised classifier; Textural features
IMAGE CLASSIFICATION Supervised learning is a process of training a neural network
Digital image consists of discrete picture elements called pixels with examples of the task to learn, ie, learning with a teacher.
which are associated with a digital number represented as DN Unsupervised learning is a process when the network is able to
that depicts the average radiance of relatively small area within discover statistical regularities in its input space and automa-
a scene. The range of DN values is normally 0 to 255. Digital tically develops different modes of behaviour to represent
image processing is a collection of techniques for the different classes of inputs.
manipulation of digital images by computers.
Classification generally comprises four steps: NETWORK ARCHITECTURE
Texture is characterized by the spatial distribution of gray levels
l Pre-processing eg, atmospheric correction, noise
in a neighbourhood. Since, texture shows its characteristics by both
suppression, and finding the band ratio, principal
pixel co-ordinates and pixel values, there are many approaches
component analysis, etc.
used for texture classification. The gray-level co-occurrence
l Training selection of the particular feature which matrix seems to be a well-known statistical technique for
best describes the pattern. feature extraction.
l Decision choice of suitable method for comparing In texture classification the goal is to assign an unknown sample
the image patterns with the target patterns. image to one of a set of known texture classes.
l Assessing the accuracy of the classification. Textural features can be either scalar numbers, discrete histo-
The informational data are classified into supervised and grams or empirical distributions. They characterize the textural
unsupervised systems. properties of the images, such as spatial structure, contrast,
roughness, orientation, etc and have some correlation with the
ARTIFICIAL NEURAL NETWORK (ANN) desired output.
ANN according to Haykin is a massively parallel distributed There are fourteen textural features. The design considers four
processor that has a natural propensity for storing experiential features namely angular second moment (ASM), contrast,
knowledge and making it available for use. ANNs can correlation, variance. However, it can be extended by inclusion
provide suitable solutions for problems, which are generally of all features. The system architecture of the combined
characterized by non-linearities, high dimensionality noisy, approach using both gray values and textural features is shown
complex, imprecise, imperfect or error prone sensor data, and in Figure 1.
lack of a clearly stated mathematical solution or algorithm. A
key benefit of neural networks is that a model of the system or Architecture using Gray Values Only
subject can be built just from the data. The authors have considered a four layer ANN comprising
Prof S K Shah and V Gandhi are with the Department of Electrical three inputs, seven first layer hidden nodes, eleven second layer
Engineering, M S University of Baroda, Kalabhavan, Baroda. hidden nodes and five output nodes. Figure 2 shows the archi-
This paper (modified) was received on August 18, 2003. Written discussion tecture of this network. Training of the network is done using
on the paper will be entertained till March 31, 2004. standard BKP.
72 IE (I) JournalET
levels in a neighbourhood. In order to capture the spatial
Back-propagation
dependence of gray-level values, which contribute to the
neural network
perception of texture, a two dimensional dependence, texture
analysis matrix is considered. Since, texture shows its
characteristics by both pixel and pixel values, there are many
approaches used for texture classification. The gray-tone co-
occurrence matrix is used for feature extraction. It is a two
dimensional matrix of joint probabilities Pd, r (i, j) between
4 statistical features 3 gray values
pairs of pixels, separated by a distance, d in a given direction r1.
from co-occurrence (One for each
matrix channel) l For finding textural features for every pixel in the
image every pixel is considered as a centre and
Figure 1 System architecture of combined approach followed by a 5 × 5 window about that centre pixel.
Using Gray Values and Textural Features l The gray-one matrix for that particular window is
Combining both gray values and textural features form a four calculated and normalized.
layer artificial neural network comprising seven inputs, eleven
first layer hidden nodes, fifteen second layer hidden nodes and l The gray level co-occurrence matrix namely, Ph, Pv,
five output nodes. Figure 3 shows the architecture of this Prd and Pld for each pixel is then obtained. Here, Ph,
network. Pv, Prd and Pld are respectively the 0o , 90o , 45 o and
Input Layer 1st Hidden Layer 2nd Hidden Layer Output Layer
135o nearest neighbours to a particular resolution cell.
(3 nodes) (7 Hidden nodes) (11 Hidden nodes) (5 nodes)
Class 1 l Standard deviation and mean are now obtained for
Red
Class 2
each of these matrices and are used later to calculate
Green the textural features.
IR Class 3
Class 4 l Now the particular entry in a normalized gray tone
Class 5
spatial dependence matrix is calculated for further
reference, ie, P (i, j), Px (i), Py ( j ), Px + y (k) and
Figure 2 Architecture of NN with only gray values Px y (k).
The number of bands and classes determine the number of l Using the formulas of the textural features, the angular
input and the output nodes, respectively. second moment, contrast, correlation and variance are
calculated (Appendix A).
ALGORITHM
Feature Extraction Training the Combined Network using BKP
Texture and tone bear an inextricable relationship to one another. The following assumes the sigmoid function f (x)
Tone and texture are always present in an image, although at
times one property can dominate the other. For example, when 1
f(x) =
a small area patch of an image has little variation of features of 1 + e− x
discrete gray tone, then tone is the dominant property.
Important property of tone texture is the spatial pattern of The popular BKP algorithm1,2 is implemented using following
resolution cells composing each discrete tonal feature. When steps:
there is no spatial pattern and the gray tone variation between
features is wide, a fine textural image results. Step 1: Initialize weights to small random values.
Texture is one of the most important defining characteristics of Step 2: Feed input vectors X0, X1, . . . . . . . . . . , X6 through the
an image. It is characterized by the spatial distribution of gray network and compute the weighting sum coming into the unit
and then apply the sigmoid function. Also, set all desired
Input Layer 1st Hidden Layer 2nd Hidden Layer Output Layer outputs d0, d1 . . . . . d5 typically to zero except for that
(7 nodes)
Red
(11 Hidden nodes) (15 Hidden nodes) (5 nodes) corresponding to the class the input is from.
Class 1
Green
Class 2
Step 3: Calculate error term for each output unit as
IR
Textural
Class 3
Class 4
d
δj = yj 1 − yj idd j − yj i
Features
Class 5
Figure 3 Architecture on NN with combined gray value and textural
where d j is the desired output of node j ; and y j is the actual
features output.
Vol 84, January 2004 73
Step 4: Calculate the error term of each of the hidden units as
d
δ j = xj 1 − xj i∑ δ
k k w jk
where k is over all nodes in the layers above node j ; and j is an
internal hidden node.
Step 5: Add the weight deltas to each of
b g
W y t + 1 = W y ( t ) + η δ j xi
All the steps excepting step 1 are repeated till the error is within
reasonable limits and then the adjusted weights are stored for
reference to the Recognition Algorithm.
Illustration
As an application the image Figure 4(a) is considered from Figure 5(a) [Left] with only gray values
which a portion Figure 4(b) has been extracted which needs to
be classified into five different classes considering both gray
values and textural features. The pixels selected for training
have been taken from the whole image except the portion,
which is extracted for classification. For evaluating the
accuracy of the classification, pixels of known class have been
used.
Figure 5(b) [Right] : including textural features
TRAINING PIXELS:
Land Cover Type No of Pixels
Barren (B) Class 1 20
Sand (S) Class 2 20
Urban (U) Class 3 20
Figure 4(a) Original image Vagetation (V) Class 4 20
Water (W) Class 5 20
Total 100
RESULTS AND DISCUSSION
With Combined Features
Land Cover Type
Classes B S U V W Overall Average
Class 1 19 0 1 0 0 95%
Class 2 0 20 0 0 0 100%
Class 3 3 0 17 0 0 85% 91%
Class 4 0 0 0 20 0 100%
Class 5 1 0 0 4 15 75%
Figure 4(b) Segmented image Total 23 20 18 24 15
74 IE (I) JournalET
6(a) CLASS 1 : BARREN 6(d) CLASS 1 : BARREN
6(b) CLASS 4 : VEGETATION 6(e) CLASS 4 : VEGETATION
6(c) CLASS 5 : WATER 6(f) CLASS 5 : WATER
Figures 6(a)-6(c) are individual class with gray values only; Figures 6(d)-6(f) are individual class gray and textural features
Figure 6 Classified images showing individual classes
With Gray Values Only Figure 5(a) shows the classified image using only gray values
Land Cover Type and Figure 5(b) shows the classified image using both gray
Classes B S U V W Overall Average values and textural features. Figures 6(a)-6(f) shows the three
individual classes for both approaches thereby allowing for
Class 1 20 0 0 0 0 100%
comparison.
Class 2 0 16 0 0 4 80%
Class 3 0 10 0 0 10 50% 46% CONCLUSION
Class 4 20 0 0 0 0 0% It is clear from Figures 6(a)-6(f) that adoption of combined
Class 5 20 0 0 0 0 0% approach increases the classification accuracy. As a result the
Total 60 26 0 0 14 misclassification is reduced. The finer information from the
Vol 84, January 2004 75
image can be extracted which is visible in Figures 5(a)-5(b) when APPENDIX
compared with the original image in Figure 4(b).
Flowchart to Obtain Textural Features
ACKNOWLEDGEMENT
Authors are thankful to Dr B Kartikeyan, Scientist SF, ISRO,
SAC, Ahmedabad for his guidance and technical help for
successful completion of the work.
REFERENCES
1. J M Zurada. Introduction to Artificial Neural Networks System. Jaico
Publishing House.
2. Freeman. Artificial Neural Network Algorithm. Applications and
Programming, Comp and Neural Systems Series, 1990.
3. A Kulkarni. Artificial Neural Network for Image Understanding.
Van Nostrand Reinhold, New York, 1994.
4. Balaguruswamy. Programming in ANSI C.
5. E Hall. Computer Image Processing and Recognition.
6. Gonzalez and Woods. Digital Image Processing.
7. J Anderson. An Introduction to Neural Network.
8. J Jensen. Introductory Digital Image Processing a Remote Sensing
Perspective.
9. J S R Jang, C T Sun and E Mizutani. Neuro Fuzzy and Soft Computing.
10. R Haralick and L Shapiro. Computer and Robot Vision. vol 1.
11. S Haykin. Neural Network a Comprehensive Foundation; a
Computational Approach to Learning and Machine Intelligence.
Macmillan, NY, 1994.
12. T Jackson. Neural Computing An Introduction.
13. L Thomas. Remote Sensing and Image Interpretation.
14. V V Rao. Artificial Neural Network Concepts and Control
Computation of Co-occurrence Matrix
Applications, Los Alamitos, CA:IEEE Computer Society, 1992.
P (i, j ) is (i, j )th entry in a normalized gray tone spatial dependence matrix.
15. B Tian, M A Shaikh, M R Azimi-Sadajadi, T H Vonder Haar and D
Reinke. A Study of Cloud Classification with Neural Networks using The gray level co-occurrence matrix is given by:
Spectral and Textural Features. IEEE Transactions on Neural Network, vol 10,
January 1999. b g b g
Pd , r i , j = P i, j / R
16. Satellite Sensor Image Classification using Cascaded Architecture of px (i ) is the (i )th entry in the marginal probability matrix obtained by
Neuro Fuzzy Network Geoscience and Remote Sensing. January 2000, summing the rows of p (i, j )
p 1033.
17. P P Raghu and B Yegnanarayan. Supervised Texture Classification
Ng
px (i ) = ∑
j =1
b g
p i, j
using PNN and Constraint Satisfaction Modes. IEEE Transactions on Neural
Network, vol 9, 1998, p 516. Ng: is the number of distinct gray levels in the quantized image.
b g
18. Segmentation of Color Textures, Pattern Analysis and Machine Ng
Intelligence. February 2000, p 142. py (i) = ∑ p i, j
j =1
19. Haralick and Shanmugan. Textural Features for Image Classification.
IEEE Transactions on Systems, Man and Cybernatics, vol SMC 3, no 6,
November 1973, p 610.
Ng Ng
px + y ( k ) = ∑ ∑
j =1 j =1
b g
p i, j
76 IE (I) JournalET
and k = 2, 3, . . . , 2 Ng Contrast
i+j=k
Ng − 1
2 RS
Ng Ng
b gUV
T W
f = ∑ n ∑ ∑ p i, j
b g
Ng Ng 2
i i =1 j =1
px − y ( k ) = ∑ ∑ p i, j
j =1 j =1 The contrast feature is a difference moment of the P matrix and is a
standard measurement of the amount of local variations presented in an
and k = 0, 1, . . . . . . , 2 Ng 1 image. The higher the values of contrast are, the sharper the structural
variations in the image are.
Computation of Textural Features
Correlation
From the co-occurrence matrix the textural features are defined as follows:
o b g b g t
f 3 = ∑i ∑ j i , j . p i , j − µ x µ y / σ x . σ x
Angular Second Moment (ASM)
Variance
b g
f 1 = ∑i ∑ j p i , j
2
{ e
f 4 = ∑i ∑ j i − µ
2
j . p bi, j g}
Angular second moment gives a strong measurement of uniformity. Higher Variance is a measure of how spread out a distribution is. Numerically,
non-uniformity values provide evidence of higher structural variations. variance equals the average of several squared deviations from the mean.
Vol 84, January 2004 77