New Approach to Rock Classification Based on Sparse Representations ()
1. Introduction
Rock classification is a key issue for the geology industry and all fields of activity. Traditionally, rock classification and characterization is done visually following a long process by geologists and mineralogists with many years’ experience and/or through laboratory tests [1] . This classification so-called manual, slow and subjective classification is subject to errors. Automatic classification, by means of dictionary computation and machine learning, a sub-field of artificial intelligence (AI) in which computers learn without being explicitly programmed [2] , appears as an alternative, a consistent response to this problem.
Several fields of activity are covered (biomedical [3] , facial recognition [4] and fingerprints, etc.). Machine learning has been successfully applied to the analysis of natural phenomena such as potential earthquakes [5] , volcanic eruptions [6] , classification of seabed mud volcanoes [7] and mining prospects [8] . However, only a few research projects using computer vision and image processing are concerned with rock classification [1] [9] [10] [11] [12] [13] . In [14] , Galdames et al. performed a lithological classification with SVM based on textural and colorimetric analysis coupled with 3D laser features to determine the approximate mineralogical composition of rocks. Spectral classification and supervised learning techniques such as neural network methods have been used to extract features from the spectral data of rock minerals, enabling faster and more objective identification [10] . However, these methods are often tied to manually extracted rock features, which limit their adaptability to a wide variety of characteristics. The authors of [15] proposed a lightweight convolutional neural network (ShuffleNet) in deep learning, combined with the transfer learning method from images obtained with a smartphone, to perform rock image classification. However, the study carried out by these authors, which is a smartphone application, although it solves the problem of time in the recognition process and the terrain-related hazards faced by geologists, remains limited in the face of a multi-sample dataset.
This is mainly due to the great complexity of rocks, making them difficult to classify. To the best of our knowledge, however, there are as yet no works in which dictionaries containing rock signatures are estimated by highlighting reconstruction error as a discriminating factor, and where dictionary updating is done to adapt rock characteristics. Rock classification using Machine Learning systems and algorithms yielded promising results in 2005 with Lëpisto [16] . In his study, he used Gabor filters for texture feature analysis and extraction, followed by classifiers for rock classification. Good classification is always preceded by discriminative texture/color feature extraction methods robust to noise, rotation and illumination change. For more accurate classification, [17] has proposed texture/color feature extraction methods named D_ALBPCSF and G_ALBPCSF obtained by combining statistical and frequency descriptors on direct view images of magmatic and metamorphic rocks.
This is mainly due to the great complexity of the rocks, making them difficult to classify. But to our knowledge, there is no works yet in which dictionaries containing rock signatures are estimated by highlighting reconstruction error as a discriminating factor and where dictionary updating is done to adapt rock characteristics. Rock classification using Machine Learning systems and algorithms yielded promising results in 2005 with Lëpisto [16] . In his study, he used Gabor filters for texture feature analysis and extraction, followed by classifiers for rock classification. Good classification is always preceded by discriminative texture/color feature extraction methods robust to noise, rotation and illumination change. For more precise classification, [17] proposed methods for extracting color texture features named D_ALBPCSF and G_ALBPCSF obtained by combining statistical and frequency descriptors on direct view images of magmatic and metamorphic rocks. For other classification and indexing algorithms such as, boosting algorithms (LPBoosting) [18] , K-nearest neighbors (K-NN) [19] , K-means [20] and neural networks [10] , features are derived from the measurement of attributes such as energy, entropy, contrast, etc. More repetitively, feature extraction methods are based on three forms of visual attribute analysis: spectral analysis, radiometric analysis and textural analysis in the joint or separate use of color and texture. In [21] , Ishikawa and Virginia in 2013, based on these visual attributes (texture and color) and Raman spectroscopy, were able to differentiate minerals from igneous rocks through analysis of the minerals’ spectral signature using neural networks. However, even if mineral classification has been largely successful, it is difficult to apply the same methods to all rocks, as spectra may present a combination of competing signatures. In [22] , Blake et al. (2012), using X-ray diffraction, required rock samples to be collected and pulverized prior to chemical analysis. However, this method is destructive and, in my view, should not be popularized. In [23] , the authors evaluated several methods obtained with a convolutional neural network and Deep Learning with an accuracy of over 95% in the classification of plutonic rocks.
The authors of [24] and [25] use convolutional neural network models to classify rocks containing a background. The limitations of these methods are linked to the influence of background disturbances, background interference and the selection of sampling points. Despite much work in these areas, the problem remains unresolved. A number of segmentation and dictionary learning strategies have been developed in the literature. Suggested methods include: Artificial Neural Networks (ANNs) [13] , SVM [25] [26] , decision trees [24] [26] , K-nearest neighbor (K-NN) [19] [26] [27] , K-means [20] , boosting algorithms [18] , Maximum Likelihood (ML), etc. These methods, for the most part, are combined in a single algorithm. Most of these methods are combined with dimension reduction methods such as principal component analysis (PCA) or genetic algorithms (GA). These combinations help in classification. However, in some cases, these dimension reduction methods introduce noise into the classification process. Some of the algorithms used for classification are like black boxes, where it is difficult to control intermediate processes or even guarantee a good decision with a high number of color texture descriptors and redundant sample data. In an attempt to solve these problems, we explore parsimonious representations by determining learned dictionaries.
In this paper, rock classification through the implemented methods shows the effectiveness of Machine Learning (ML) with machine learning and dictionary estimation. The proposed rock recognition method is based on dictionary estimation with K-SVD [28] [29] applied to the color LBP combination and frequency transforms [17] , considering the reconstruction error (lower error), allowing correlation between learned dictionaries, as a discriminating factor.
In Session II, the materials and methods used are analyzed. Section III presents the simulation results and discussion, while Section IV concludes this study and announces future work.
2. Materials and Methods
2.1. Magmatic and Metamorphic Rocks
Our study concerns igneous rocks and metamorphic rocks. Indeed, igneous rocks result from the crystallization of magma at depth (intrusive rock) and on the surface of the earth (extrusive rock). The intrusive igneous rocks that we want to recognize by image processing have a more pronounced granularity than those of extrusive igneous rocks. However, metamorphic rocks, with even less grainy textures, are the result of the transformation of igneous or sedimentary rocks under the influence of heating, increased pressure.
2.2. Organization of Images
The experimental study was conducted with a data set comprising eight (8) classes of direct-view digital images of magmatic (granite, granodiorite, gabbro) and metamorphic (schist, cipolin, migmatite, eclogite, hornfels) rocks, totalling eighty (80) images. This grouping into eight (8) classes was made by an expert geologist, taking into account certain objective characteristics of textures and colors. Each rock image in “jpg” format is cropped to a size of 256 * 256 pixels, and a sample of each image class is shown in Figure 1.
Table 1 shows the number of images used per class for training and model validation.
Table 1. Number of images for training and testing.
Figure 1. Examples of the eight (8) different classes of rock images.
The experiment was carried out using the MATLAB programming language on an HP Notebook computer and processor: Intel (R) Core (TM) i5-7200U CPU @ 2.50 GHz, 2701 MHz, 2 core(s), 4 logic processor(s).
2.3. Colors Texture Descriptors
LBP descriptors and its variants have shown that they can describe textural patterns in images quite well [26] . Studies carried out in 2019 by [17] made it possible to take into account, in addition to texture and color features, the directionality present in rock images by proposing new extraction methods such as D_ALBPCSF and G_ALBPCSF. This testifies to the robustness and capability of local binary patterns.
2.4. Dictionary and Reconstruction Error Estimation
Dictionary construction is the first step in a parsimonious representation. Dictionary learning is an essential step in obtaining a quality dictionary for a particular type of data [28] [29] . The dictionary learns the patterns present in an image and provides a basis for parsimonious decomposition. It will enable the characteristic elements of a rock image to be grouped together and used as a learning base. The main idea is for the dictionary to provide a base in which the associated rock is better represented than the others. During classification, we look for the dictionary that minimizes the reconstruction error for an imposed parsimony constraint. The smaller the error, the more suitable the dictionary. In our approach, coefficients are obtained by decomposing the signal on the basis of elementary signals called “atoms”. Four types of dictionary (Gabor, DCT, G-ALBPCSF and D-ALBPCSF) have been estimated, giving rise to four methods: K-DCT, K-Gabor, KG-ALBPCSF and KD-ALBPCSF.
The proposed approaches are summarized in the flow chart in Figure 2.
Algorithm 1 translates the principle of the classification method presented in the flowchart in Figure 2.
2.5. Parameters Influencing Dictionary Learning and Error Estimation
Dictionary learning is one of the most important steps in the efficient representation of image atoms. However, it can be optimized for greater efficiency. Certain parameters influence this optimization:
Figure 2. Flowchart of the proposed rock classification method.
Algorithm 1. KSVD_DCT_Gabor_ALBPCSF.
- The stopping criterion or number of iterations, set at 500 in this study.
- As the number of atoms K increases (K = 75 atoms here) while keeping the parsimony (or constraint) L at 3, the reconstruction error increases and the algorithm does not converge. As a result, there is no dictionary stability. However, when the parameter K is decreased (K = 25 atoms, for example), the algorithms converge and the reconstruction error is lower.
- Increasing or decreasing the size of the dictionary results in an efficient determination of the number of atoms in the dictionary. The size of the rock dictionary influences dictionary estimation, i.e. the larger the image size, the greater the error.
2.6. Multi-Algorithm Systems
Feature vector fusion can be performed in several ways [27] [28] . The one we are interested in here is multi-algorithm fusion. This is the most classical type of system used by many approaches. Signatures are extracted via different algorithms and then merged to give a single feature vector, providing higher accuracies than a single algorithm in rock image classification [27] .
3. Experimentation and Simulation Results
Our method consists of learning the model on 2N observations and then validating the model on N observations. Rock classification is obtained by searching for proximity between the reconstruction errors the Euclidean distance (Equation (1)), which we found to be simple and better than the Manhattan and Minkowski distances.
(1)
where ai represents the coordinates of A (or query vector of the current rock to be identified) and bik the coordinates of Bk (reference vectors of the k rock classes in the database). To estimate the class of a rock image I to be classified, our method consists of taking into account the reconstruction errors of the rocks of the different classes. Indeed, the Euclidean distance between two (2) signature vectors A and Bk of size N, noted d(A, Bk) where k describes rock classes from 1 to 8. For classification, we retain the class which has the minimum distance with image I. Let X be a vector matrix that groups on each row the reconstruction errors for each rock sample obtained over 10 trials for the 80 rock samples, i.e. a total of 800 values. Note that the error for each trial is obtained after 500 iterations. Let Y be a vector that groups together the average of the reconstruction errors for each sample after 10 trials on each line.
Y = Fk represents the signature of each K-SVD variant. Yref contains the signature of each rock class. Note that Yref has a total of 8 values. This experiment involved 640 crosses of rock reconstruction errors.
Model performance is evaluated and compared in terms of correct classification rates: the measures of accuracy, specificity, sensitivity and error rate, based on the reconstruction errors calculated when estimating the various dictionaries of the different rocks used and learned. These performance measures defined in [17] are presented for the four methods in Table 2.
The results of the experimental activity presented above show that our dictionary estimation approaches for the classification of igneous and metamorphic rocks with the proposed combinations of methods, i.e. KD-ALBPCSF and KG-ALBPCSF, improve on the results obtained with K-DCT and K-Gabor taken individually. These results reveal once again that rock classification is a demanding and very difficult task.
Table 2. Performance indicators of the four methods for the different classes.
In order to better discriminate between rocks, we concatenated the rock characteristics from the different variants used for the different experiments already carried out on 120 images from the training and test bases.
- Learning step:
In the learning step, the signatures of the different rocks class are generated: X, F and Yref.
X is the matrix of reconstruction errors for all 8 rock classes, and for the 4 variants, we have: X1, X2, X3, X4. Each row of this matrix contains the reconstruction errors for each rock class; each of these 10 columns represents the reconstruction errors for each trial after 500 iterations.
F = [F1, F2, F3, F4] represents the concatenation of the characteristic parameters of each rock from the 4 variants of K-SVD for the learning step where F1, F2, F3 and F4 each represent the average of the reconstruction errors of each variant.
Yref is the reference or signature of each rock class and Xk designates the matrix of all reconstruction errors of the 8 rock classes for each method. These different parameters are presented below.
For our experiment, the Yref matrix contains 8 rows, 4 columns, presented as follows:
However, Xk matrices are matrices of 80 rows and 10 columns. An overview of these matrices, in the same dimensions as the Yref matrix, for example X1 corresponding to one of the variants of K-SVD, is defined as follows:
The experiment involved comparing the reconstruction error calculated for a given rock class with all the Yref representing rock signatures, and retaining the smallest distance value from the Euclidean distance formula; this indicates the class to which the query rock belongs. Table 3 gives the values of the performance indicators calculated to verify the performance of this combination of variants carried out on the learning phase of a set of eighty (80) rock images, each of whose eight (8) classes contains ten (10) rock images. These indicators, defined in [17] , are calculated from Equations (2)-(5).
(2);
(3);
(4);
(5);
- Test step:
Following the same principle as the learning phase, we calculate X (X11, X22, X33, X44) for each query rock and compare these values with the Yref values. For this testing experiment, 40 rock images were used. Here, the X matrix contains 40 rows and 10 columns. An overview of one of these matrices is shown below in the form of X11 for the first K-SVD variant:
Table 3. Performance indicators of the combination of the 4 variants of K-SVD.
Table 4. Rock images used for testing.
Table 5. Confusion matrix with our method.
Figure 3. Average values of variant combination performance indicators.
For the other variants, we can have, for example, as a matrix the characteristics of the various other variants X22, X33 and X44 which are not presented here.
Table 4 shows some of the rock images of the different classes used for testing.
To validate our approach, a validation test is used to evaluate the combination of the four (4) K-SVD variants we propose. The results provide us with a confusion matrix for this evaluation. This confusion matrix was developed for a set of 40 rock images including 5 of each class (see Table 5) and Figure 3 gives the performance indicators for verifying the suitability of the proposed method.
The results in Table 5 show that the proposed method gives good classification performance, with an overall correct classification rate of 93.13%. However, the method classifies magmatic rocks better with a rate of 95.83%, compared to 91.5% for metamorphic rocks. The combination of methods makes up for shortfall observed with individual methods. Figure 3 shows the average values of the various performance indicators achieved.
4. Conclusions and Future Prospects
We have proposed new classification methods that have been used in the context of the automatic classification of igneous and metamorphic rocks. The performance of these methods was evaluated through confusion matrices which resulted in classification rates. It should be noted that dictionary learning is a complex problem. Simulation shows that results are not always excellent. It is difficult to obtain the same error after two (2) trials. However, the dictionaries learned are closer to the characteristic data of the rock. Our two (2) approaches nevertheless improve the rate of correct classification by up to 50%. The concatenation of the four (4) K-SVD variants considerably improves the classification rate to 93.13% overall, with specific classification rates of 95.83% for magmatic rocks, and 91.5% for metamorphic rocks.
Looking ahead, we plan to improve the performance of our recognition method by using statistical moments as rock characteristics. We also plan to associate data obtained from signal sensors, i.e. the waves measured by these sensors, with rock recognition.