You are on page 1of 10

Comput Geosci (2010) 14:301310 DOI 10.

1007/s10596-009-9154-x

ORIGINAL PAPER

Textural identication of basaltic rock mass using image processing and neural network
Naresh Singh T. N. Singh Avyaktanand Tiwary Kripa M. Sarkar

Received: 25 December 2008 / Accepted: 17 August 2009 / Published online: 9 September 2009 Springer Science + Business Media B.V. 2009

Abstract A new approach to identify the texture based on image processing of thin sections of different basalt rock samples is proposed here. This methodology uses RGB or grayscale image of thin section of rock sample as an input and extracts 27 numerical parameters. A multilayer perceptron neural network takes as input these parameters and provides, as output, the estimated class of texture of rock. For this purpose, we have use 300 different thin sections and extract 27 parameters from each one to train the neural network, which identies the texture of input image according to previously dened classication. To test the methodology, 90 images (30 in each section) from different thin sections of different areas are used. This methodology has shown 92.22% accuracy to automatically identify the textures of basaltic rock using digitized image of thin sections of 140 rock samples. Therefore, present technique is further promising in geosciences and can be used to identify the texture of rock fast and accurate. Keywords Image processing Multilayer perceptron neural network Rock texture RGB or grayscale images

1 Introduction Texture refers to the degree of crystallinity, grain size, and fabric (geometrical relationships) among the constituents of a rock. Textural features are probably the most important aspect of rock because they are necessary aid in understanding the conditions under which rock crystallized (e.g., cooling and nucleation rates and order of crystallization) that in turn depend on initial composition, temperature, pressure, gaseous contents, and the viscosity of the source rock. A texture is identied by visual estimation in the eld with a hand lens (approximately 10) as well as under microscope. Basaltic rock is chosen for the study. Basalt mainly contains plagioclase, pyroxene, glass, and groundmass. It shows porphyritic, intergranular, intersertal, ophitic, and subophitic textures [1]. In ophitic and subophitic textures, plagioclase laths are enclosed by pyroxene or olivine or ferromagnesian minerals. In porphyritic texture, phenocrysts (large crystals) are surrounded by the groundmass. The groundmass has domains of intersertal texture (glass occupies the wedge-shaped interstices between Plag laths), intergranular texture (the spaces between plagioclase laths are occupied by one or more grains of pyroxene), and ophitic texture. This paper concerns the most common textures of basaltic rock mainly porphyritic, intergranular, ophitic textures. An application of soft computing at this stage of study in geosciences has been discussed by Tagliaferri et al. [2]. This technique has also been used for texture identication of carbonate rocks by Marmoa et al. [3]. Singh and Mohan Rao [4] have been using this approach to classify the ores for ferromanganese metallurgical plant feed. Ore texture identication using

N. Singh (B) A. Tiwary Department of Mining Engineering, Institute of Technology, Banaras Hindu University, Varanasi, India e-mail: nareshsingh.paper@gmail.com T. N. Singh K. M. Sarkar Department of Earth Sciences, Indian Institute of Technology, Bombay, India

302

Comput Geosci (2010) 14:301310

image-processing technique has been used by Petersen et al. [5], Henley [6], Jones and Horton [7], and Barbery and Leroux [8]. The methodology presented in this paper is useful to identify most common textures of basalt rock without much problem. For this purpose, 390 thin sections of basalt rocks from different areas were prepared in laboratory [9].

2.2 Image dimension reduction In this step, digital image from previous step is reduced to dimension 280 391 pixels so that the program can be generalised for thin section image of all sizes (greater than 280 391 pixels size) and magnication. Reducing the size of an image can introduce artifacts, such as aliasing, in the output image because information is always lost when we reduce the size of an image. To minimize the artifacts, bicubic interpolation method is used [10]. Resulting reduced RGB image is converted into grayscale image having intensity varying from 0 to 255. 2.3 Image ltration A median lter and a neighbor of 3 3 pixels are used to remove small distortions without reducing the sharpness of image [3]. It is a nonlinear lter, which replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel (the original value of the pixel is included in the computation of the median). It provides excellent noise-reduction capabilities, with considerably less blurring than linear smoothing lters of similar size [10]. 2.4 Feature extraction In this step, we perform number of operations on image resulting from the previous steps to measure various features of image and objects. These features have a numerical value, which will further be used as input for neural network. These features are determined by performing several tests on images having different textures (Figs. 1 and 2). Every feature determines the comparative properties of image and objects. These features are categorised mainly in three parts: Statistical features Image features Region features.

2 Presenting image-processing methodology Image of thin section of basaltic rock is processed using image-processing toolbox of Matlab. In this toolbox, image is considered as a matrix in which element is called pixel and its value is called pixel value or intensity. RGB image is considered as three-dimensional matrix, and a grayscale image is considered as twodimensional matrix. Each pixel shows its own value, but it cannot classify texture of image, so we need numerical parameters that can distinguish the texture of images. These parameters are extracted from an image using image-processing techniques and expressed as numerical values to differentiate the class of image from another one. Neural networks rst train the extracted data set or part of them and classify the textural image. Each output of neural network is the probability to classify an image texture discussed previously. The following steps were followed during analysis: Image acquisition Image dimension reduction Image ltration Feature extraction Feature normalization Input dimension reduction Neural network.

Image-processing technique is applied to acquisition of images, dimensional reduction, ltration, and feature extraction, whereas its normalization and input dimension reduction have been done by neural network. A program is developed, which has very fast identication under normal computational system. 2.1 Image acquisition Image acquisition is the process of mapping an image into digital representation, which is further operated for feature extraction. This program requires a RGB image (JPEG type) of thin section of dimension bigger than 280 391 acquired by a digital camera having 5 magnication.

Every category has its own parameters. Image features determine the various qualities of image (Fig. 3). Region features determine the parameters related to region selected from image (Fig. 8), and statistical features determine the statistical properties of image intensity histogram (Fig. 4). Table 1 shows the parameters consisting each feature. Every feature is described in the following sections.

Comput Geosci (2010) 14:301310


RGB Image

303

Image acquisition

Image dimension reduction

Image filtration

Fig. 2 Porphyritic texture of basalt thin section. Size is 311 506 pixels. Pl plagioclase, Ol olivine, Px pyroxene
Feature extraction

Statistical features

Image features

Region features

where zi is a random variable indicating intensity, p(zi ) is the histogram of the intensity levels, and L is number of possible intensity levels. Standard deviation The value of this parameter is measure of average contrast of image (Fig. 3). It is written as

Feature normalization

SD = 2 (z)

(2)

where 2 is the second moment that is equal to the variance ( 2 ).


Neural network

Smoothness This parameter measures the relative smoothness of the intensity in a region. Smoothness = 1 1 1 + 2 (3)

Fig. 1 Flow chart of the program

2.4.1 Statistical features These features are descriptors of intensity histogram of image (Fig. 3) [10]. An image histogram is a plot that shows the number of gray tones of particular intensity. This plot has 20 equally spaced bins each representing intensity range. Mean intensity This parameter measures the average or means intensity of image. Expression for this parameter is
L1

m=
i =0

zi p (zi )

(1)
Fig. 3 A grayscale resized digital image

304 Fig. 4 A narrower image histogram of porphyritic texture image

Comput Geosci (2010) 14:301310

1200 1000 800 600 400 200 0 0 50 100 150 200 250

Smoothness is zero for a region of constant intensity, i.e., intertwining grains (pyroxene granules in angular interstices between feldspars) in intergranular texture and phenocrysts in porphyritic texture and 1 for regions with large excursions in the values of its intensity levels, i.e., ophitic texture. Third moment This parameter measures the skewness of a histogram.
L1

As in ophitic and subophitic texture plagioclase laths are enclosed by pyroxene or olivine or ferromagnesian minerals so the textures have very low uniformity. Porphyritic texture having only one phenocryst has maximum uniformity. Intergranular texture has also high uniformity. Entropy This parameter measures the randomness of intensity levels in image (Fig. 3).
L1

3 =
i =0

(zi m)3 p (zi )

(4)

E=
i =0

p (zi ) log2 p (zi )

(6)

Value of this parameter is zero for symmetric histogram, positive for histogram skewed to right, and negative for histogram skewed to left. Value of this parameter for ophitic texture is positive and for intergranular and porphyritic texture is negative. Uniformity This parameter measures the uniformity of image. Its value is maximum when all gray levels are equal and decreases from there.
L1

Ophitic has highest entropy because plagioclase is randomly distributed in the groundmass and surrounded by pyroxene or olivine, which increases the randomness. Intergranular and porphyritic texture shows less randomness. 2.4.2 Image features These features are descriptors of image (Fig. 3) [3].

U=
i =0

p2 (zi )

(5)

Table 1 Features and their parameters Statistical features Mean intensity Image features Region features Area of object Extent Solidity Convex deciency Percentage of most frequent gray tones Standard deviation Number of edge pixels in the gray areas Smoothness Number of perimeter pixels Third moment Number of white areas Uniformity Number of pixels of white areas Entropy

Percentage of most frequent gray tone The value of this parameter is the percentage of gray tones that appear most frequently in image. This feature can visualize in image histogram. An image of ophitic texture has broader histogram because of its randomly distributed plagioclase, so the value of this parameter for ophitic texture is more than the image of intergranular, porphyritic texture, which has narrower and higher histogram. Number of edge pixels in the gray areas A grayscale image is operated by a Canny operator, which detect all weak and strong edges in image. Edge in an image is dened as the place where a sharp change in intensity occurs. Canny operator nds edges by determining local

Comput Geosci (2010) 14:301310

305

maxima of the gradient of intensity function. Resulting image after this operation is a binary image in which white pixels correspond to edges. The value of this parameter is the number of white pixels in this binary image. Binary image of intergranular texture image has maximum number of edge because it is composed of large number of crystals, but in others, there is less number of crystals present in image so they have less number of white pixels (Fig. 5). Number of perimeter pixels Grayscale image is converted into binary image, which contains pixels of pixel value 0 and 1. The value of this parameter is number of perimeter pixels present in binary image. A pixel is considered as perimeter pixel if it satises both of these criteria: (a) The pixel is on. (b) One (or more) of the pixels in its neighborhood is off. A pixel is on when its pixel value is 1 and off when pixel value is zero [10]. On converting the binary image into image having perimeter pixels, obtained image has white pixels as perimeter pixels, and black pixels shows the larger crystals or phenocrysts in porphyritic texture and pyroxene granules and angular feldspar in intergranular texture (Fig. 6). Number of white areas The value of this parameter is the number of objects in binary image, which is obtained after converting grayscale image into binary. This parameter is determined by converting the binary image matrix into label matrix of same size in which objects are labeled. This gives the number of white areas (objects) in binary image. Image of intergranular

Fig. 6 Perimeter pixels related to image shown in Fig. 3

texture has maximum number of white areas, while image of ophitic texture has the least number of objects (Fig. 7). Number of pixels of white areas The value of this parameter is the total number of white pixels in the binary image used in the previous parameter. The image of intergranular texture has maximum number of white pixels, while image of ophitic texture has least (Fig. 8). 2.4.3 Region features Four biggest white areas are chosen from binary image obtained from previous features. The following parameters are determined from image having one object at a time. Area of object This parameter determines the total number of white pixels in binary image having one object (white area). The image of ophitic texture has large

Fig. 5 Resulting image of Canny operator related to image shown in Fig. 3

Fig. 7 A label matrix showing the white areas

306

Comput Geosci (2010) 14:301310

the area of convex hull and white area is more due to crystalline and sharp edge structure of plagioclase. Image of porphyritic texture has rounded phenocrysts, so convex hull will be less and so convex deciency. Extent It is equal to the number of pixels in the bounding box that are also in the object. Bounding box is the smallest rectangle containing the object. Value of this parameter is area of image divided by area of bounding box [10]. Solidity This parameter corresponds to the proportion of pixels in the convex hull that are also in the object. It is computed as area of image divided by convex area [10].
Fig. 8 Four biggest white areas in an image of porphyritic texture

3 Feature normalization Before using the input data in neural network, it is often useful to scale the data within a specied range. A linear transformation is performed to scale the inputs in the range [1 to 1]. This is known as feature normalization. Normalization of inputs prevents singular features from dominating the others and obtains values in ranges that are easily comparable. This normalized data is used to train the neural network.

size of plagioclase, which corresponds to the bigger area of object. Image of intergranular texture has smaller pyroxene granules in between feldspar crystals that give smaller area of object (Fig. 9). Convex deciency Convex deciency of object is determined as CD = H S (7)

where H is called convex hull (smallest convex set containing S) and S is the area of object (determined in previous section) [10]. The image of ophitic texture has higher convex deciency, as the difference between

4 Input dimension reduction To reduce the input dimension principal component analysis (PCA) is used, which is an effective procedure.

Fig. 9 a Biggest white area in porphyritic texture image. b Convex hull of image in a

Comput Geosci (2010) 14:301310


Inputs P1 P2 P3 Weights W1, 1 Summing node Transfer function Output

307

b (BIAS) W1, R

a = f (Wp + b)

PR

Fig. 10 Structure of a typical neuron

PCA performs this operation in the following three steps. It orthogonalizes the components of the input vectors (so that they are uncorrelated with each other). It then orders the resulting orthogonal components (principal components) so that those with the largest variation come rst. Finally, it eliminates those components that contribute the least to the variation in the data set. In PCA, the largest eigenvectors of the covariance matrix of the feature set is computed [11]. PCA approximates the feature set space by a linear subspace by selecting the most expressive features related to eigenvectors with the largest eigenvalues [3]. In this case, we perform PCA so that nally the dimension of input vector is reduced from 27 to 19.

lar networks that are able to acquire, store, and utilize experiential knowledge related to network capabilities and performances. They consist of neurons or nodes, which are interconnected through weights (numerical values represent connection strength). Neurons perform as summing and nonlinear mapping junctions. Network computation is performed by this dense mesh of computing neurons and interconnections. They operate collectively and simultaneously on most or all data and inputs [12]. The structure of a typical neuron is illustrated in Fig. 10. The problem in this case is of pattern classication. Use of neural network is most suited in this case, as there are no available algorithms for solving this problem. Moreover, we have considerable input output data, which can be used for training as well as testing purpose. The network is trained with input patterns that have associated predened classes assigned to them. After training, the network should have the ability to assign any pattern a particular category by comparing the features of that object with previously learnt associations. It is a sort of mapping from a feature space to a class space, using a nonlinear mapping function [3]. 5.1 Network architecture and its properties A multilayer perceptron neural network (MLP) with back-propagation training is used in this case to develop the pattern association model. MLP used here is a fourlayer feed-forward network. A feed-forward network consists of nodes arranged in layers. The rst layer is an input layer, the second layer is a hidden layer, and the last layer is an output layer. Here, we have used two hidden layers. After applying PCA, 19 input

5 Articial neural network Neural networks can be classied as synthetic networks that emulate the biological neural networks found in living organisms. They can be dened as physical cellu-

Fig. 11 The network architecture

INPUT LAYER 19

HIDDEN LAYER II 20 HIDDEN LAYER I 15

OUTPUT LAYER 3 INTER-GRANULAR

PORPHYRITIC

OOPHITIC

308

Comput Geosci (2010) 14:301310

parameters are left, so there are 19 neurons in the input layer, while three neurons representing three different textures, intergranular, porphyritic and ophitic, are used in the output layer. The number of neurons in the hidden layers is determined by training the network with different number of neurons in both the hidden layers and then measuring the error value for each network. The network that resulted in minimum mean square error is used for testing. Here, 15 neurons are used in the rst hidden layer, while 20 neurons are used in the second hidden layer because this conguration results in minimum error. The network used is shown in Fig. 11. Sigmoid transfer functionlogsig is used in the input layer and the rst hidden layer, while purelin function is used in the second hidden layer. 5.2 Development of articial neural network code Computer code is developed and implemented in Matlab using the neural network toolbox of Matlab. Generalized delta learning rule for MLP neural networks is used. Learning is done in supervised mode. In this mode of learning, input and the corresponding output is known beforehand, which is then used as a training set to make the network learn at an optimum rate. This mode of learning is very pervasive and is used in many situations of natural learning. The training algorithm used is called error backpropagation training algorithm. This algorithm allows experiential acquisition of inputoutput mapping knowledge within multilayer networks. Here, the input patterns are submitted sequentially during the training. Training was performed in the program using trainrp as the training function, as it results in faster training and provides good result. This is a modied form of basic back-propagation algorithm and is known as resilient back-propagation [12]. 5.3 Division of dataset While developing the program early stopping method is used for generalization of the network. The entire dataset is divided into two subsetstraining set and validation set. The training set is used for computing the gradient and updating weights and biases of the network until training is complete. The error on the validation set is monitored during the training process. The validation error and training set error normally decrease during the initial phase of training. However, when the network begins to over-t the data, the error on the validation set begins to rise. When the validation

error increases for a specied number of iterations, the training is stopped, and the weights and biases at the minimum of the validation error are returned. 5.4 Training and testing The feed-forward back-propagation neural network discussed above is used for designing the prediction model. The available dataset of 300 thin section images of basalt is used for training and validation purpose. The dataset is divided into two subsets representing

4 Training 3.5 Validation

Squared Error

2.5

1.5

0.5

10

15

Epoch

Fig. 12 a Graph obtained during training. b Graph obtained during training

Comput Geosci (2010) 14:301310

309

training set and validation set. The division is done keeping, in mind that each subset should be representative of all possible variations in the data. Training

was then performed, which stopped at a mean square error of 0.0201. Figure 12 represents the graph obtained during training process. After the training was over, another dataset containing fresh images of 90 samples is used to test the performance of the network.

Best Linear Fit: A = (0.933) T + (-1.62e-016)


1.2
R = 0.935 Data Points Best Linear Fit A=T

1 0.8 0.6

6 Analysis of test results The test set is composed of images that have been used neither for training nor for validation. This helps in evaluating the nal classication performance of the MLP. The test set is divided into three sets each consisting of 30 images. These three sets are then applied individually to evaluate the test performance. The trained network classied 92.22% images correctly and only 7.78% images erroneously. Figure 13 shows the correlation graphs obtained from the test set for each of the textures- intergranular (subpanel a), porphyritic (subpanel b) and ophitic (subpanel c). It shows perfect correlation for ophitic texture while a slight variation for the other two textures due to error in classication of one of the images. Figure 14 represents graphically the texture classication for one of the test sets. It classied 29 images correctly and only one image erroneously. The percentage error for this test set was 3.34%. It classied a texture of intergranular as porphyritic. Both subpanels a and b in Fig. 12 are graphs representing training progress.

A
0.4 0.2 0 -0.2 0

0.2

0.4

0.6

0.8

Best Linear Fit: A = (0.957) T + (0.0435)


1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.2 0.4 0.6
Data Points Best Linear Fit A=T R = 0.915

Comparison of measured and predicted Textures 4


Actual Texture

Texture NUmber 1- Inter-granular 2- Porphyritic 3- Oophitic

0.8

3.5 3 2.5 2 1.5 1 0.5 0 0

Predicted Texture

1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0

Best Linear Fit: A = (1) T + (2.43e-016)


R=1

Data Points Best Linear Fit A=T

10

15 Sample number

20

25

30

0.2

0.4

0.6

0.8

Fig. 13 ac Correlation graphs for three different textures intergranular, porphyritic, and ophitic respectively

Fig. 14 Comparison of predicted and actual textures for a test sample of 30 images. On y-axis, 1 indicates intergranular, 2 porphyritic, and 3 ophitic. Here, only one image was classied erroneously

310

Comput Geosci (2010) 14:301310

Result of validation set


Sample no 1 2 3 4 5 Intergranular 1 0 1 1 0 Porphyritic 0 1 0 0 1 Ophitic 0 0 0 0 0

Results obtained are encouraging and indicate that a good choice of features and a specic neural network can make more accurate automatic textural classication. Moreover, in the future, it appears possible to expand the number of textural classes like for intersertal, subophitic also, so that the tested methodology could be carried out on all types of rocks.

The texture of the rock sample is INTERGRANULAR(1) The texture of the rock sample is PORPHYRITIC(2) The texture of the rock sample is INTERGRANULAR(1) The texture of the rock sample is PORPHYRITIC(2) The texture of the rock sample is PORPHYRITIC(2)

References
1. Winter, J.D.: An Introduction to Igneous and Metamorphic Petrology. Prentice Hall, Englewood Cliffs (2001) 2. Tagliaferri, R., Longo, G., DArgenio, B., Incoronato, A.: Neural network: analysis of complex scientic data. Neural Netw. 16(34), 295517 (2003) 3. Marmoa, R., Amodiob, S., Tagliaferrid, C.R., Ferrerib, E.V., Longo, G.: Textural identication of carbonate rocks by image processing and neural network: methodology proposal and examples. Comput. Geosci. 31, 649659 (2005) 4. Singh, V., Mohan Rao, S.: Application of image processing and radial basis neural network techniques for ore sorting and ore classication. Miner. Eng. 18, 14121420 (2005) 5. Petersen, K., Aldrich, C., Vandeventer, J.S.J.: Analysis of ore particles based on textural pattern recognition. Miner. Eng. 11(10), 959977 (1998) 6. Henley, I.C.J.: Ore-dressing mineralogya review of techniques, applications and recent developments. Spec. Publ. Geo. Soc. S. Afr. 7, 175200 (1983) 7. Jones, M., Horton, R.: Recent developments in the stereological assessment of composite (middlings) particles by linear measurements. In: Jones, M.J. (ed.) Proc. XIth Commonwealth Mining and Metallurgical Cong., pp. 113122. IMM, London (1979) 8. Barbery, G., Leroux, D.: Prediction of particle composition distribution after fragmentation of heterogeneous minerals; inuence of texture. In: Hagni, R.D. (ed.) Process Mineralogy VI, pp. 415427. The Metallurgical Society, Warrendale (1986) 9. How to make a thin section? http://almandine.geol.wwu. edu/dave/other/thinsections/ 10. Gonzalez, R.C.: Digital Image Analysis Using MATLAB. Prentice-Hall, Upper Saddle River (2004) 11. Bishop, C.M.: Neural Networks for Pattern Recognition. Clarendon, Oxford (2005) 12. Zurada, J.M.: Introduction to Articial Neural Systems. PWS, Boston (1992)

Images with more complexity have more chances to be classied erroneously. As thin section images of basalt contain complex arrangement of crystals, so there is more probability of error in classication. In this paper, results show that 7.78% images are classied erroneously, which is less compared with the error found in the identication of carbonate rocks by Marmoa [6]. 7 Conclusion A numerical and computational approach based on image-processing and multi-layer perceptron neural network that allows user to classify the texture of basalt rocks by gray-level images digitized from thin sections is proposed here. This technique predicts the type of texture from the digitized images of thin sections with 92.2% accuracy. As out of 30 tested results, only one result shows disagreement, this indicates usefulness of image analysis and articial neural network. In the future, larger training and test sets on different basalt rocks could provide more condent results. Moreover, at present, there is no standard system for image processing of thin sections because there are some difculties that may be circumvented using higher resolution and/or magnication during the image acquisition.

You might also like