The Use of Contrast and Gradient Features to Categorize Texture Images

Image texture is an important part of many types of images, for example medical images. Texture Analysis is the technique that uses measurable features to categorize complex textures. The main goal is to extract discriminative features that are used in different pattern recognition applications and texture categorization. This paper investigates the extraction of most discriminative features for different texture images from the “Colored Brodatz” dataset using two types of image contrast measures, as well as using the statistical moments on five bands (red, green, blue, grey, and black). The Euclidean distance measure is used in the matching step to check the similarity degree. The proposed method was tested on 112 classes of textures. The achieved results showed that the proposed method is accurate and fast concerning classification accuracy with low computational complexity. The achieved Recognition Rate (RR) was 100%.


Introduction
In the field of computer vision and pattern recognition, texture analysis has been significantly developed for its ability on extracting discriminating features [1].Texture classification is a vital problem in computer vision because of its various applications, including examining irregularities on aircraft surfaces, steel, wood, fruits, and ceramics [1] [2].
The texture of objects varies greatly based on viewing angle, illuminance, scale, and rotation.Thus, texture classification remains a challenge.The extraction of colored texture features to categorize patterns and decrease the dimensionality of features with low computational complexity requirements is the main challenge in texture classification [3] [4].Couto et.al. (2017) proposed a descriptor using statistics from a complex network-inspired texture transformation.The descriptor works by applying a deterministic walks algorithm to the image transformation, focusing on the shape representation of the walks to produce the feature vector.The first step of the proposed approach concerns constructing a complex network from the image and using the values of the network of node degrees to perform walks.The proposed method derives shape information from a walk direction histogram.The experiments were conducted by applying the method to several public data sets and showed improvement in the correct classification rates [5].Kanaparthi et.al. (2020) proposed the use of Saturation, congruence on Hue, and Intensity for inter-channel voting.They employed Gray Level Co-occurrence Matrix (GLCM) to extract image texture features.Additionally, Congruence and GLCM were used to check the similarity between two images.Lastly, Average Normalized Modified Retrieval Rank (ANMRR), Average Recall Rate (ARR), Average Precision Rate (APR), and F-measure were utilized to evaluate the performance.The findings showed considerable improvement [6].
Navarro and Perez (2019) presented a pattern recognition method based on color and texture information.In their system each image is partitioned into global and local samples, they use a Haralick statistics and binary quaternion-moment-preserving scheme to extract features.The Support Vector Machine (SVM) is suggested for the classification step.The proposed system was applied to four widely used databases in color-texture categorization: The Outex, Brodatz, KTH-TIPS2b, and VisTex databases getting correct classification rates of 90.78%, 97.63%, 92.90%, and 97.13% respectively.The use of the post-processing stage improved those results to 98.97%, 99.88%, 95.75%, and 100% respectively [7].Kapela (2020) presented a texture recognition system based on deep learning.Their proposed methodology was designed in a bottom-up approach.It means they scroll a moving window through the image to recognize if a specified region fits one of the classes in the training stage.This classification is performed based on the Deep Neural Network (DNN) of a fixed manner.The training process is fully mechanized concerning the preparation of training data, exploration of the best training algorithm, and its hyper-parameters.Their proposed system was applied on a road surface images database where its task was to classify image areas to a different road group (e.g., curb, road surface damage, etc.) and is classified with 90% and above accuracy [8].Jin et.al. (2020) introduced a new texture system for color images based on Completed Extremely Nonnegative Duchenne Muscular Dystrophy (CEN-DMD).First, they used DMD to model features of intra-channel and color texture images inter-channel.In a non-negative difference patch, the highest value refers to a major variation, so they built the EN-DMD by combining the maximum values of the intra-channel features and inter-channel features, and additionally built CEN-DMD by combining EN-DMDs at five levels and the global features of the color texture images.As a final point, CEN-DMD was encoded using the Fisher Vector to get a color texture descriptor.Five common published color texture datasets (VisTex, Colored Brodatz, CUReT, USPTex, and KTH-TIPS) were used in this study and showed that CEN-DMD is functional when compared to previous works [9].
In this paper, new contrast measures are used to extract a discriminative feature to classify colored texture images with low computational complexity.
The following is the outline of this paper; Section 2 includes the proposed compression system.While the results and a comparison with previous works are discussed in Section 3. Finally, Section 4 contains the conclusion and future suggestions concerning the research area.

The Proposed Texture Classification System
In this paper, a colored texture categorization method is proposed.The proposed method works through two main stages: (1) The enrollment and (2) The classification stage.In the enrollment stage, the classification system is trained for each class using its texture discriminating features.In the classification stage, the system operates to distinguish and classify the input texture samples.The outline of the proposed system is shown in Figure 1.
The system consists of (i) Pre-processing step (ii) Feature extraction (iii) Features analysis and combination step (iv) Matching step.In the pre-processing step, the input image is decomposed into red, green, blue, grey, and black sub-bands.While the feature extraction step uses contrast and gradient measures to extract features.In the feature analysis step, the most discriminative features are selected, and finally, the matching step obtains the Recognition Rates (RR) using some distance measures.
Where (R, G, B, and K) are the Red, Green, Blue, and key (black) respectively.Each band represents only one color component, and Min is used to retrieve the minimum value of (C, M, and Y).

Feature Extraction Stage
For the feature extraction stage, the Gradient Measure (GM) and Contrast Measure (CM) are proposed to obtain gradient and contrast information for each image.After that, the histogram of the gradient and contrast array is calculated, and a set of statistical moments is applied to the histogram to get the feature vector.

B1. Gradient Measure (GM)
The gradient at a particular pixel in an image is the rate of the variance between the gray levels of its nearby pixels (i.e., neighboring pixels), either in the vertical (GY), horizontal (GX), or diagonal (GD) direction.The gradient values are in the path of the fastest increase in the intensity of the pixel and its neighborhood, the neighborhood is often considered 3×3 pixels or 7×7pixels.Figure 2 shows the neighborhood values of pixels.The gradient measure of an image (I) is calculated by taking the discrete derivative (∂), as shown in the following equations (4, 5, and 6) [11]:

B2. Contrast Measure (CM)
Contrast is defined as the variance in visual characteristics that makes an object distinct from other objects and the background in a specific image.In the real world, the contrast is specified by the variance in the color and brightness of different objects within the same field of view in visual perception [13].
It is the variance between the darkest and the lightest pixels of an image, a large value indicates high contrast, while low value indicates low contrast [14].For this paper, two methods were used to find the CM.In the first method, CM1 was calculated as the division of Standard Deviation (STD) by the mean of 7x7 pixels as shown in Eq.( 7).In the second method CM2 was the difference between the maximum and minimum of the neighborhood values of 3x3 pixels (see Figure 2) divided by their sum as shown in Eq.( 8).

Figure 2:
The Neighborhood pixels of 3x3 Pixels in an image Where STD(v) and Mean(v) are the standard deviations and the average of surrounding pixels.

B3. Statistical Moments
In this work, a set of Statistical Moments are proposed to extract the main features from the histogram array of the contrast and gradient.The set of moments are Mean, Median, Variance, Standard Deviation, Skewness, and Kurtosis, which were calculated using the following equations: The first moment is the mean, usually symbolized by µ and implemented using Eq. ( 9) [15].
The second central moment is the variance and is denoted by (V) and implemented by Eq. ( 10).The square root of the variance gives the standard deviation that is denoted by () as shown by Eq. ( 11) [15]. = (() − ) 2 (10)  = √ (11) The third moment is the normalized central moment and is called the skewness, denoted by γ as shown by Eq. ( 12) [16].
The fourth moment is the kurtosis, and it is also a central moment and denoted by (ⱪ) [16] as shown in Eq. ( 13): Another set of moments with low power is also used to extract more discriminated features; the power taken is (1, 0.5, 0.75).

B4. Features Scaling
Due to the third and fourth power terms in Skewness and Kurtosis, the values of these moments can be large, especially when compared with low power moments.For this reason, feature scaling is vital to prevent feature-dominant problems.In this work, features standardization is proposed as implemented using Eq. ( 14), where X ́ is the new-scaled value of X.In this scaling method, the values are centered around the mean with a unit standard deviation.See equations (9 and 11).

B5. Features Combination and Selection
In this step, the features analysis and combination is vital to select the most discriminated features with the lowest intra-distance and highest inter-distance and then combine the best set of features that led to the best recognition rate [17] [18].Linear Discriminative Analysis (LDA) is based on conventional statistical methods used in this work for feature combination and selection.

B6. Matching Stage
In this stage, the similarity degree between the input sample and stored templates database is calculated.Euclidean distance measures are proposed for this paper to check the similarity degree.This distance measure is the normalized Mean Square Difference (nMSD) (as in Eq. 15) [19]: #

𝑘=1
Where    the sample of i th class, Tj is the template of the j th class and   ()is the standard deviation of the j th template.

Experimental Results
The proposed system was applied on 112 classes of textures belonging to the Colored Brodatz dataset (see Figure 2) [20], to test the system's performance.The number of samples tested was (9,16,25) for each class.The contrast and gradient features were examined, each set of contrast and gradient features were extracted from a single band.The best-achieved system Recognition Rate was (100%).The Recognition Rate is described by Eq. ( 16): Tables 1,2, and 3 show the features combination and selection results and the corresponding RR for (9,16, and 25 samples) respectively.The best RR was achieved in the case of 9 samples for each class.Figure 3 shows the comparison between the 3 cases of samples number.

Conclusion and Future Works
In this paper, it was found that the pre-processing step represented by the image decomposition to the color compounds (Red, Green, Blue, Gray, and black) is necessary for increasing texture feature separation and improving the classification accuracy.The type and method of selecting features is also vital for texture data classification.It is necessary to assess the discriminatory ability of the selected features based on the inter-class and intra-class scatter ratios.Another type of feature can be proposed and tested to increase the discrimination of features and test a large number of classes from other datasets.

Figure 1 :
Figure 1: The block diagram of the proposed texture classification system

6 )
(, ) ≈ ( + 1,  + 1) − (, ) (The minimum and maximum values of the three types are calculated and then two histogram arrays are calculated, and the statistical moments are applied to the two histogram arrays (Min and Max) to produce the feature vector.

Figure 2 :
Figure 2: A Set of Samples taken from the Colored Brodatz dataset.

Figure 3 :
Figure 3: The RR curves for the tested number of samples for each class

Table 1 :
The test of selected features extracted from Gradient and Contrast matrices and the corresponding recognition rate, in case of 3 samples per class.

Table 2 :
The test of selected features extracted from Gradient and Contrast matrices and the corresponding recognition rate, in the case of 4 samples per class.

Table 3 :
The test of selected features extracted from Gradient and Contrast matrices and the corresponding recognition rate, in the case of 5 samples per class.

Table 4
shows comparisons with previously published studies in terms of Classification Rate and the number of classes.

Table 4 :
The comparison with some published works.