Keywords

1 Introduction

Textures are complex visual patterns, composed of spatially organized entities that have characteristic brightness, color, shape, and size. Texture is a description of the spatial arrangement of color or intensities in an image or selected region of an image. Image texture is a function of spatial variation of pixel intensities. Texture is homogenous for human visual system. Some texture descriptions are mainly used in many real-time applications; these features are contrast, brightness, likeness, regularity, roughness etc., Texture involves spatial distribution of gray-level image, different levels of resolutions, usually extracted form single band. Texture features from different bands (multiple bands) of the image are generally different and have capability of discriminating different land use and land cover types. Image segmentation using texture features is partitioning an image into regions that have homogenous properties with respect to texture. Image classification using texture features is assigning a label to an unknown sample image or a portion of image with a known texture class. Texture synthesis is building a model of image texture, which can be used for generating the texture.

2 Literature Survey

2.1 Statistical Approaches

Images with varying textures have certain characteristics that can be extracted statistically. Generally, statistical approaches have four prevalent methods like Gray-Level Co-occurrence Matrix (GLCM), Histogram Method, Auto-Correlation Method, and Morphological operation. These four methods have both advantages and disadvantages. Out of these four methods, this chapter adopts Gray-level co-occurrence matrix (GLCM) from which ten different features are extracted. These features are elaborated in the next section, and the literature on statistical approaches is shown in Table 1.

Table 1 Strength and weakness of statistical approach methods for texture image classifications

2.2 GLCM

The Gray-Level Co-occurrence Matrix method—likewise often named as the Spatial Gray-Level Dependence Matrix (SGLDM) Method. This method is based on the intensity values of the image. The features when fed to the machine learning algorithm perform the classification effectively [1, 2].

The second-order statistics are attained by considering a set of pixels related to each other in positive three dimensions. The Gray-Level Co-occurrence matrices provide rare mathematical statistics on the texture. Texture feature calculation uses the content of the GLCM to give a measure of the variation in intensity at the pixel of interest. GLCM matrix is a square matrix that has the same number of rows and same number of columns. GLCM matrix is N × N matrix, where N denotes the number of possible gray levels in an image. For example, a three-bit image will have a GLCM matrix of size 8 × 8. The rows and columns are the gray values (0–7). GLCM matrix of image depends on the direction and offset values. The direction can be anyone among the eight possible directions as shown in Fig. 1. The offset represents distance between pixels.

Fig. 1
figure 1

Co-occurrence matrix

This chapter utilizes ten different features that are computed from GLCM Matrix [13]. These ten features are elaborated as follows.

2.2.1 Entropy

Entropy measures the disorder or complexity of an image. If the entropy is large when the image is not texturally uniform and if the texture is complex, then entropy becomes high. Energy and entropy are inversely proportional to each other; it means if entropy is high, energy will be low and vice versa. Entropy can be calculated for image f(x, y) using the following equation:

$$ \mathrm{Entropy}\left(\mathrm{ENT}\right)=\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}f\left(x,y\right)\ast \log \left(f\left(x,y\right)\right) $$

2.2.2 Contrast

Contrast measures the spatial frequency of an image and different moment of GLCM. It is the difference between the highest and the lowest values of a contiguous set of pixels. Contrast can be calculated for image f(x, y) using the following equation:

$$ \mathrm{Contrast}=\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}{\left(x-y\right)}^2{f}_{xy} $$

2.2.3 Mean

Mean is the normal value of the whole amount of data. Mathematically,

$$ \mathrm{Mean}\ \left(\mu i\right)=\frac{\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}f\left(x,y\right)}{MxN} $$

2.2.4 Standard Deviation

The standard deviation is the square root of variance divided by the entire.

number of samples. Mathematically, it is expressed as

$$ SD=\sqrt{\frac{\sum {\left|x-\mu \right|}^2}{N}} $$

2.2.5 Variance

This statistic measures the heterogeneity, and it is strongly correlated with first-order statistical variable such as standard deviation. Variance can be calculated for image f(x, y) using the following equation:

$$ \mathrm{Variance}=\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}{\left(i-\mu \right)}^2{f}_{xy} $$

where ‘μ is the mean of an input image.

2.2.6 Homogeneity

Homogeneity is the consistency in the arrangement of an input image f(x, y). If the arrangement of an input image follows a regular pattern, then it is said to be homogenous. Mathematically, it can be expressed by the following equation:

$$ \mathrm{Homogenous}\ f\left(x,y\right)=\kern0.5em \sum_{x=0}^{N-1}\sum_{y=0}^{N-1}\frac{f_{xy}}{1+{\left|x-y\right|}^2}\Big) $$

2.2.7 RMS Contrast

Root Mean Square (RMS) measures the standard deviation of the pixel intensities. It does not depend upon any angular frequency or spatial distribution of contrast of an input image. Mathematically, it can be expressed as

$$ \mathrm{RMS}\ \mathrm{Contrast}=\sqrt{\frac{1}{MN}\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}{\left({I}_{ij}-\overline{I}\ \right)}^2} $$

where  I is the normalized pixel intensity values between 0 and 1.

2.2.8 Smoothness

If the input image f(x, y) is highly correlated between the adjacent pixels, then we can say the image is autocorrelated (the autocorrelation of input data with itself after shifting one pixel). The autocorrection of input image can be calculated by the following equation:

$$ \mathrm{autocorrelation}\ f\left(x,y\right)=\iint f\left(x,y\right)\ast \Big(f\left(x+\overline{x\ }\right)\left(y+\overline{y}\right) dx\ dy $$

2.2.9 Inverse Difference Moment (IDM)

IDM measures the local similarity between of an image. It has the feature of measuring the closeness and distribution of the GLCM elements with respect to GLCM diagonal. It also has the property to determine the texture of the image. The frequency of co-occurrence of set of pixels is improved when their values of gray level are close enough, and this increases the IDM value.

$$ \mathrm{Inverse}\ \mathrm{Difference}\ \mathrm{Moment}\ \left(\mathrm{IDM}\right)=\sum_{x=0}^{N-1}\sum_{y=0}^{N-1}\frac{f_{xy}}{1+{\left|x-y\right|}^2} $$

3 Proposed Method

Texture features of an image are calculated considering only one band at a time. Channel information can be consolidated using PCA before calculating texture features. Texture features of an image can be used for both supervised and unsupervised image classification. In this chapter, we have used support vector machine (SVM) for texture image classification. This method falls under the category of supervised machine learning [10]. Support vector machine was introduced in 1992 as a supervised machine leaning algorithm. This algorithm gained its popularity because of its higher accuracy rate and minimum error rate. SVM is one of the best example for “Kernel Method’ which is the key area of machine learning that is shown in Fig. 2. The idea behind SVM is to make use of nonlinear mapping function φ, that transforms data in input space to data in feature space in such way that it becomes a linearly separable [3]. The SVMs then automatically discover the optimal separating hyperplane, which is nothing but a complex decision surface. The equation of hyperplane is derived from a line equation y = ax + b. However, even though hyperplane is a line, its equation is shown below [11, 12], where “w and x” are the vectors, and it can be computed by dot matrix of these two vectors [5].

$$ w\hat{\mkern6mu} T\ x=0 $$
Fig. 2
figure 2

Separating hyperplane in SVM

Any hyperplane can be written as the set of points, x satisfying the equation w. x + b = 0. A optimum hyperplane separates the data points with minimum loss function. Two such hyperplanes are chosen and based on the values obtained; they are classified as class 1 and class 2 as given below.

$$ w.x+b\ge 1\ \mathrm{for}\ x\mbox{\_}i\kern0.5em \mathrm{having}\ \mathrm{class}\ 1 $$
$$ w.x+b\le -1\ \mathrm{for}\ x\mbox{\_}i\kern0.5em \mathrm{having}\ \mathrm{class}\ 2 $$

Here, optimizing problem may occur because the goal is to maximize the margin among all the possible hyperplanes meeting the constraints. The hyperplane with the small ‖w|| is chosen because of the biggest margin it provides. The pseudo codes for optimizing problem are given below:

$$ \operatorname{Minimize}\ in\left(w,b\right),\left\Vert w\right\Vert, \mathrm{subject}\ to\ y\mbox{\_}i\ \left(w.x+b\right)\ge 1 $$

The solution to the above equation is computing the values of (w, b),with minimum possible margin. The equation that satisfies the constraints will be considered as the equation of the optimal hyperplane [14, 15].

3.1 Dataset Description

The dataset from center for image analysis in Swedish university of agriculture sciences [4], Uppsala University has been used in this chapter. Totally, 4480 images of 28 different texture classes were taken using Canon EOS 550d DSLR camera, which is shown in Fig. 3. Each texture class has around 160 images, in that 112 images are used for training and 48 images are used for testing which is shown in table [2]. Fig. 4 shows the complete flow chart of the proposed method for texture image classifications using GLCM features. First step, the segmented image is resized to [576 x 576] (Table 2).

Fig. 3
figure 3

Sample images from 28 different texture images

Fig. 4
figure 4

Flow chart for produced texture image classifications

Table 2 Dataset descriptions

The performance of the proposed system is measured in terms of sensitivity, specificity, accuracy, precision, false positive rate and false negative rate, which is shown in Fig. 5. The sensitivity and specificity are important measures in classification. The accuracy of the system represents the exactness of the system with respect to classification. The precision indicates the ability of the system to produce the same result when tested at different measurements. The overall classification accuracy of the proposed system is around 99.4% with the precision of 92.4% . The false negative rate and false positive rate is very minimum in the range of 0.003 and 0.085, respectively. The sensitivity and specificity of the system is around 91.5% and 99.7%.The texture classes 2,4,5,7,9,12, and 19 have been classified with good accuracy and precision when compared to other classes.

Fig. 5
figure 5

Prediction using support vector machine

The GUI of the proposed system is shown in Fig. 6 (Table 3).

Fig. 6
figure 6

Performance metrics evaluation for texture image classification

Table 3 Confusion matrix for 28 classes

4 Conclusion

Texture of an image is a description of the spatial arrangement of color or intensities in the image. Texture of image can be used to categorize the image into several classes. Ample number of texture features can be computed mathematically and used for image analysis. The method proposed in this chapter combines the texture features computed from GLCM matrix with that of the standard machine learning algorithm for image classification. The overall classification accuracy of the proposed system is around 99.4% with the precision of 92.4%. The classification accuracy of the system can be further improved by increasing the size of the dataset.