Skip to content
BY 4.0 license Open Access Published by De Gruyter Open Access February 14, 2023

Carbonate texture identification using multi-layer perceptron neural network

  • Oltion Fociro , Ana Fociro EMAIL logo , Redi Muçi , Klodian Skrame , Jeton Pekmezi and Mario Mezini
From the journal Open Geosciences


This study proposes an approach to identifying carbonate rocks depositional texture utilizing more than 1250 thin-section photos as a data set from shallow-water carbonates of the Kruja zone (Albania). The proposed technique uses a numerical methodology based on digitized images of thin sections. According to the Dunham classification, it permits the user to recognize the carbonate texture automatically. The carbonate rock should not be affected by post-depositional processes. This technique uses as input gray-scale digital images taken from thin sections. Image processing can extract (as output) a set of 22 numerical parameters measured in the entire image, including white areas representing calcite cement. A multi-layer perceptron (MLP) neural network inputs these numerical parameters and produces, as output, the estimated depositional texture. We utilized 654 images of thin sections to evaluate this technique to train the neural network. We used 348 pictures taken from the same data set and 250 from the Burizana section (Kruja zone, Albania) to test the technique. The proposed method has shown 90.5 and 91.3% accuracy in identifying the automatically depositional texture using digitized images on the 348 and 250 test sets. Based on the good results obtained, this technique can be extending not only in identifying carbonate rocks texture but in every type of rock, getting fast and correct results. Python was used as a computer programming language for image processing and displaying images.

1 Introduction

Identification or classification of the rock types is an important part of geological research. This study focuses on the classification of carbonate rock as one of the major types of sedimentary rocks. The texture of rock plays a significant part in sedimentary rocks. It represents the size, shape, arrangement, sorting of the grains and the grain–grain, grain–matrix, or grain–cement relation for sedimentary rocks. The petrophysical properties of a rock, its porosity, and permeability depend essentially on texture [1,2]. The texture is the first step to identifying the lithofacies of the sedimentary rocks and recognizing their original depositional environment. It can be determined visually in the field or under the microscope [3,4]. Petrographic analysis is labor-intensive and requires substantial prior knowledge of different geological disciplines. These limitations are compounded by the potential for bias and subjectivity in the human interpretation and classification of carbonate rocks. Such limiting reproducibility among researchers has been described recently by Lokier and Al-Junaibi [3].

The Dunham classification combined with Embry and Klovan classifications is the most used in sedimentology and sedimentary petrology for carbonate rocks [4,5]. The original Dunham classification system was developed to provide convenient depositional-texture-based class names that focus attention on the textural properties that are most significant for interpreting the depositional environment of the rocks. The three criteria used to define the classes within the Dunham classification are the supporting fabric of the original sediment, the presence or absence of mud (the fraction less than 20 µm in size), and evidence that the sediments were organically bound at the time of deposition. Mud-supported carbonate rocks containing less than 10% grains (based on point counting where intraparticle voids are counted as grains) are termed mudstone. The carbonate lithology is mud-supported, but the number of grains supported by the matrix exceeds 10%. The texture is named a wackestone. Moving to grain-supported fabrics, a grain-supported limestone containing 1% or more mud-grade fraction is a packstone, whilst a grain-supported carbonate rock with <1% mud is a grainstone. Where there is any evidence that carbonate sediments were bound at the time of deposition, they are labeled as boundstone. The last group is not part of our research. The Dunham classification provides a clue to the environmental energy during deposition. Mudstone generally indicates calm water and apparent inhibition of grain-producing organisms (low-energy depositional setting). At the same time, grainstone is typically deposited in moderate- to high-energy environments, but its hydraulic significance can vary.

Texture in the Logarithmic Image Processing is a set of repetitive sub-patterns that follow well-defined placement rules. These sub-patterns themselves are made up of more fundamental units, called primitives. Such characterization of textures is generally applicable mainly to deterministic types of textures, such as line arrays, checkerboards, and hexagonal tiling. A surface is textured if there are enough texels (texture elements); otherwise, it is a set of objects. Textures can vary based on their properties like periodicity, randomness, directionality, and orientation. In this article, by texture, we refer to the space organization of the main constituents of sedimentary rock like framework grains, matrix (depositional components), and cement (post-depositional precipitate in the pore space).

The implementation of neural networks has become increasingly prevalent within geosciences. In recent years, neural networks have often been used within the geosciences to most accurately identify the desired output given a set of inputs, with the interpretation of what the network learns used as a secondary metric to ensure the network is making the right decision for the right reason [6]. Recently, researchers have done studies on the classification of plutonic rock types using thin-section images with deep transfer learning, with an average accuracy of 97.52% and a maximum of 98.19% [7]. Su et al. realized rock classification in petrographic thin-section images based on concatenated convolutional neural networks. The proposed method provided an overall accuracy of 89.97% [8]. An image processing and artificial neural network-based method proposed by Marmo et al. for textural identification of carbonate rocks. They classified the textures of carbonate rocks with an accuracy of 93.5% [9]. Singh et al. studied textural identification of basaltic rock mass using image processing and neural network. They reached 92.22% identification accuracy [10]. Deep convolutional neural networks were used by Xiaokang et al. for the automatic identification of fossils and abiotic grains in carbonate microfacies analysis. They obtained up to 95% of the top one and 99% of the top three test accuracies in the Inception ResNet v2 architecture [11]. Research on intelligent identification of rock types based on the faster R-CNN method was carried out by Xiaobo et al. The experimental verification shows that the system is correct for single-type rock image recognition and the accuracy is more than 96% [12]. In the study conducted by Koeshidayatullah et al., the applicability and performance of DCNN-based object detection and image classification approaches were evaluated in terms of carbonate composition analysis [13]. Cheng and Guo identified the rock granularity using CNN. They classified rocks with 98.5% accuracy [14]. Another study was conducted by Zhang et al. using transfer learning, extracting features from four mineral images (K-feldspar, perthite, plagioclase, and quartz) with Inception-V3 architecture, using machine learning algorithms to identify mineral images [15]. Joseph et al. made a classification of intrusive igneous rock thin-section images using edge detection and color analysis [16]. Tian et al. classified fine-grained rocks into four subgroups, and they obtained 97% classification accuracy [17]. Patel and Chatterjee studied a computer-vision-based rock-type classification using probabilistic neural networks, classifying only seven limestone rock types using nine color histogram features [18].

Młynarczuk et al. made a study for classifying nine different types of rock. They applied four pattern recognition techniques: the nearest neighbor, KNN, nearest mode, and optimal spherical neighborhood algorithms [19]. Transfer learning was applied for microfossil classification, core description, petrographic analysis, and hand specimen identification by Lima et al., and for the classification of cored carbonate rock images by Lima et al. [20,21,22]. To accelerate the time-consuming petrographic analysis and automate the microfacies classification, Lima et al. explored the use of deep CNN as a tool [23]. Chatterjee proposed a vision-based rock-type classification model using a support vector machine algorithm [24]. Baykan and Yılmaz made a study on identification of minerals. Testing the network with previously unseen mineral samples yielded successful results between 80 and 90% [25]. Baraboshkin et al. used several well-known transfer learning architectures (AlexNet, VGG, GoogleNet, ResNet) and made a comparison of their performance for a description of rocks [26].

In Albania, this is the first time where neural networks are applied in geosciences. Taking in count the previous references, we applied the methodology to automatically identify textures of shallow-water marine carbonate rocks in thin sections by image processing and neural networks using Python as a programming language.

2 Methods

The methodology proposed in this article permits automatically to identify carbonate textures (different age and depositional settings) from thin sections, using image processing and neural networks. The primary problem related to carbonate texture is determining the thin section of carbonate grains (allochemical particles) and fine-grained carbonate mud called micrite or coarser-grained calcite crystals formed during diagenesis sparite (sparry calcite cement). Carbonate grains can be of skeletal (whole or fragments organism-derived) or non-skeletal (mostly biochemical precipitates) origin. The main problem is that the unit of information in digital imaging is the pixel, and each pixel has properties of position (x, y) and gray value. In a grayscale image, each pixel has only a single value representing the light value, with zero being black and 255 being white. The knowledge of the position and value of a particular pixel does not generally convey any geological information to recognize the texture. An alternative set of features is needed to prevent any possible problem. Image processing techniques permit an image to be processed and extract a set of numerical features (information). They express the selected object’s coded characteristics and differentiate one class of objects from another. The neural networks can identify a thin-section texture after training on a specific data set using all extracted features or only a part of them. The neural network consists of many neurons where each neuron takes an input, processes it, and gives an output. In this case, each result of the neural network is the probability to classify an input section belonging to a specific Dunham depositional texture class. The input section assigns the depositional texture class associated with the highest value to the output. The methodology includes the following steps that apply to every image obtained from the thin sections:

  1. image acquisition,

  2. image preprocessing,

  3. image segmentation,

  4. feature extraction,

  5. neural network, and

  6. image classification.

This methodology implements Python programming language code deployed in Google Colaboratory notebook (Colab). Colab is a Python development environment that uses Google Cloud to run in the browser. The classification of a digitized image can be completed in a few seconds with the software, using a desktop computer with Windows 11 operating system.

2.1 Image acquisition

Image acquisition is the first step in an image processing system. The general aim of any image acquisition was to transform an optical image into an array of numerical data which can manipulate on a computer. Suitable digital cameras achieved image acquisition. A digital image is a two-dimensional array of pixels, and each pixel characterizes by its (x, y) coordinates and its value. Digital images are characterized by matrix size, pixel depth, and resolution, containing a gray tone compared with real images.

The matrix size is determined from the number of columns (m) and the number of rows (n) of the image matrix (m × n). The acquired images are in jpg images format with 8-bit, 256 linear gray tones, and the size of a matrix selected by us is 680 × 700 pixels, acquired by digital cameras with different dots per inch. The utilized magnification was about ×4–10, which is acceptable for acquiring smaller and larger grains. Since the color variability of the studied thin section isn’t distinctive, all images are converted to grayscale for easy calculations and to get a homogeneous database. The proposed methodology counts only the shape of white and gray areas, considered cement, matrix (micrite), and grains, respectively.

2.2 Image preprocessing

Image preprocessing is done to improve the image’s quality and upgrade the image highlights for further handling. In the gained images, the following image preprocessing techniques in Python are as follows:

  1. grayscale conversion,

  2. normalization,

  3. data augmentation, and

  4. image standardization.

To use this preprocessing technique, we have created a Google Colab account and Google Drive data onto Colab. The next step was importing the data set to Colab. We loaded an image file from the data set and randomly printed it (Figure 1).

Figure 1 
                  Flowchart of the proposed methodology.
Figure 1

Flowchart of the proposed methodology.

2.2.1 Grayscale conversion

Grayscale is converting images from colored to black and white. Since most pictures do not need color to be recognized, we use grayscale, which reduces the number of pixels in an image, thus, reducing the computations required in machine learning algorithms [27]. From executing the code, the image was converted as below (Figure 2).

Figure 2 
                     (a) Printed image of mudstone from the data set; (b) conversion of the original image into grayscale. In both figures, units of X and Y axes represent pixels.
Figure 2

(a) Printed image of mudstone from the data set; (b) conversion of the original image into grayscale. In both figures, units of X and Y axes represent pixels.

2.2.2 Normalization

This process consists of projecting image data pixels (intensity) to a predefined range (usually (0, 1) or (−1, 1)). It is commonly used on different data formats, and we want to normalize all of them to apply the same algorithms to them. Its benefits include fairness across all images and a standard learning rate (Figure 3).

Figure 3 
                     Output image after normalizing our data, units of X and Y axes represent pixels.
Figure 3

Output image after normalizing our data, units of X and Y axes represent pixels.

2.2.3 Image standardization

To have standard images, we used image standardization as a method that scales and preprocesses images to have similar heights and widths. It re-scales data to have a standard deviation of 1 (unit variance) and a mean of 0.

2.3 Image segmentation

Image segmentation helps to get the region of interest (ROI) from the image. This is the process of dividing an image into separate areas. The part where the image is divided is called an image object. This is based on image properties such as similarity and discontinuity. The purpose of image segmentation is to simplify the image for better analysis.

This is the process of assigning a label to each pixel in the image. There are several segmentation algorithms like- Otsu’s segmentation, edge-based segmentation algorithms, region-based segmentation algorithms, clustering-based segmentation algorithms etc. We find it most appropriate to use Otsu’s Image segmentation (threshold-based segmentation) since some of them can take more time during training if the data set is huge and take huge computation time (Figure 4).

Figure 4 
                  Input image segmentation according to Otsu’s segmentation: (a) input image; (b) grayscale converted image; (c) threshold output image. Units of X and Y axes represent pixels.
Figure 4

Input image segmentation according to Otsu’s segmentation: (a) input image; (b) grayscale converted image; (c) threshold output image. Units of X and Y axes represent pixels.

2.4 Feature extraction

Features are the primary attributes that help us identify a particular image and are the properties that make it unique. While working on the image data set, you need to extract various image features. This helps to separate images based on specific features or aspects. Image features cannot be defined exactly, but shape, size, and orientation make up image features. This step represents a sequence of operations on the image matrix to measure the features of the objects. These values are given as input layers (i.e., pixels) to the neural network. Marmo et al. and Gonzales have performed various test to select different features in carbonates and related images [9, 28]. According to the authors, the final set of determined features is listed below:

  1. percentage of the most frequent gray tones;

  2. number of edge pixels in the gray areas;

  3. number of edge pixels between the gray and the white areas;

  4. number of white areas;

  5. number of pixels of white areas;

  6. number of white areas composed of more than 150 pixels;

  7. number of pixels within the white areas consisting of more than 150 pixels.

Figure 5 
                  (a) Foraminiferal grainstone; (b) image histogram of a grainstone texture shown in (a). Units of X and Y axes represent pixels.
Figure 5

(a) Foraminiferal grainstone; (b) image histogram of a grainstone texture shown in (a). Units of X and Y axes represent pixels.

Figure 6 
                  (a) Canny edge detection output in a mudstone image; (b) Canny edge detection output in a grainstone image. Units of X and Y axes represent pixels.
Figure 6

(a) Canny edge detection output in a mudstone image; (b) Canny edge detection output in a grainstone image. Units of X and Y axes represent pixels.

Figure 7 
                  (a) Mudstone composed of a few skeletal grains (ostracods) in a micritic matrix; (b) image histogram of a mudstone texture shown in (a).
Figure 7

(a) Mudstone composed of a few skeletal grains (ostracods) in a micritic matrix; (b) image histogram of a mudstone texture shown in (a).

Figure 8 
                  (a) and (b) Perimeter pixels in a grainstone.
Figure 8

(a) and (b) Perimeter pixels in a grainstone.

Features (1)–(7) were extracted from the entire image while the remaining 16 features were extracted from each of the four selected largest white areas (4 features (8)–(11) per area):

  1. number of pixels of the white area;

  2. length in pixel of the white area;

  3. number of small convex deficiencies;

  4. number of large convex deficiencies.

They represent 23 features, and each of them is described further in this article.

  1. Percentage of the most frequent gray tones

    In an image processing context, an image’s histogram refers typically to a histogram of the pixel intensity values. This histogram shows the number of pixels in an image at each different intensity value found in that image. If we use an 8-bit gray scale image, there are 256 different possible intensities, so the histogram will graphically display 256 numbers showing the distribution of pixels amongst those grayscale values. The exact output from the implementation operation is an image of the required histogram. It is composed of equally spaced bins, each representing a range of gray tones. It is necessary to sum the number of pixels of the bins chosen around the bin that corresponds to the most frequent gray tone. The value of this feature is the ratio between this sum and the sum of pixels in all bins. Since the image of a grainstone consists of many shades of gray, the histogram is distributed almost across all possible grayscale values (Figure 5). On the other side, an image of a mudstone shows a narrower and higher histogram because a very fine-grained mudstone is represented by many pixels distributed on a few shades of grayscale values (Figure 6).

  2. Number of edge pixels in the gray areas

    In Image Processing, an edge is defined as continuous pixel positions where an abrupt change of intensity (gray or color) values occurs. Edges represent boundaries between objects and backgrounds. We used the Canny Edge detector algorithm to identify edges in the whole image. The detector looks for places where the intensity changes rapidly. The resulting image is a black/white image in which a black pixel corresponds to an edge pixel in the original image. We choose this edge detector because it is more likely to detect weak edges. Canny recommended an upper and lower ratio of 2:1. The low and high thresholds are 200 and 100, respectively. The value of the feature is the number of black pixels. The resulting output image of mudstone is a few black pixels because it is composed of very fine-grained particles (<0.05 mm) as the micritic matrix (Figure 7). At the same time, a grainstone has many black pixels because it represents a grain-supported texture. It is composed of numerous grains of skeletal and non-skeletal origin that generate many edges (Figure 8).

  3. Number of edge pixels between the gray and the white areas

    A pixel is part of the perimeter if it is nonzero, and it is connected to at least one zero-valued pixel. The pixel connectivity used is an 8-connected neighborhood. In other words, a pixel is considered as a perimeter pixel if it satisfies both criteria, a white pixel in the starting image that shows one or more gray pixels in its 8 × 8 neighborhood. The value of the feature is the number of perimeter pixels. A grainstone has many perimeter pixels due to the high content of grains due to many white areas, while a mudstone shows few white areas and is characterized by few perimeter pixels (Figure 8).

  4. Number of white areas

    Grayscale images are converted to black and white, and gray pixels in the original image are converted to black. The algorithm finds and counts white areas. The feature value is the number of white areas, and grainstone has far more than mudstone.

  5. Number of pixels of white areas

    The value of this feature is the number of pixels that make up the white area used to extract the previous feature.

  6. Number of white areas composed of more than 150 pixels

    The previous black-and-white image and the image obtained from the inscription are taken into account. The number of pixels belonging to each white area is estimated, and the feature value is the number of white areas exceeding 150 pixels (Figure 8). This threshold was experimentally evaluated on thin-section without significant post-depositional features (dolomite crystals, fractures, and veins filled with sparry calcite).

  7. Number of pixels within the white areas composed of more than 150 pixels

    The value of this feature is the number of pixels in the white area that has already been used to calculate the previous feature. Mudstone and wackestone do not show large white areas.

  8. Number of pixels in the white areas

    The results of the previous labeling algorithm are considered here. The white areas are ordered according to their number of pixels. The four most significant white areas are chosen by estimating the number of pixels for each. In this way, four features are obtained. Different types of grainstones (foraminiferal grainstones, peloidal grainstones, etc.) have been used to count the number of white areas to determine the above threshold.

  9. Length in pixel of the white area

    The feature value for each of the previous four most significant white areas is the number of columns used to represent the area in the image matrix.

  10. Number of small and large convex deficiencies

    The convex hull and the corresponding convex deficiencies are computed for each of the previous four white areas [29]. A labeling algorithm locates and counts the convex deficiencies. The value of the features (j) and (k) corresponds to convex deficiencies composed of less than 100 pixels and convex deficiencies consisting of more than 1,000 pixels, respectively. The values 100 and 1,000 were determined by analysis of a wide variety of white areas in images of grainstone and packstone. Due to intergranular calcite cement, a white area has a large convex hull, a low number of minor convex deficiencies, and a high number of large convex deficiencies (Figure 9). On the contrary, a white area due to intragranular calcite cement has a small convex hull, a high number of small convex deficiencies, and a low number of large convex deficiencies (Figure 9).

Figure 9 
                  (a) Determination of convex deficiencies; (b) large convex deficiencies.
Figure 9

(a) Determination of convex deficiencies; (b) large convex deficiencies.

3 Neural networks

Artificial neural networks reflect the behavior of the human brain, allowing computer programs to recognize patterns and solve common problems in different fields. They are often just called neural networks. A perceptron is a single neuron (node) model arranged into larger networks of neurons. A row of neurons is called a layer, and one network can have multiple layers. The architecture of the neurons in the network is often called the network topology. The power of neural networks comes from their ability to learn the representation in your training data and how to best relate it to the output variable you want to predict [30]. In this sense, neural networks know mapping and can learn any mapping function mathematically. Image classification is the process of identifying and categorizing the class of an image characterized by a set of features. According to Bishop [31], to design the best neural network that obtains good mapping and training, first, we need to determine the following:

  1. neural network model and architecture;

  2. activation functions for each neuron;

  3. loss function;

  4. training model.

3.1 Neural network model and architecture

Our study restricts the number of output classes to four (mudstone, wackestone, packstone, and grainstone). Due to this, we found the most appropriate to use the multi-layer perceptron neural network (DLP). A multi-layer perceptron (MLP) represents a feedforward artificial neural network. It is composed of an input layer to receive the signal. This output layer decides or prediction about the input. Between those two, an optional number of hidden layers are the true computational engine of the MLP. In our case, we have used just one hidden layer. Each neuron relates to the neurons of the following layer (Figure 10). According to PCA (principal component analysis), which is used to reduce the number of parameters in the neural network, the input layer has 13 neurons; the hidden layer has nine neurons, while the output layer has four neurons. Each one of them corresponds to a Dunham textural class. Other parameter configurations show less than 91.0% of correct classification.

Figure 10 
                  The architecture of the proposed MLP where each layer consists of 13, 9, and 4 nodes.
Figure 10

The architecture of the proposed MLP where each layer consists of 13, 9, and 4 nodes.

3.2 Activation functions for each neuron

The activation function of a neural network defines how the weighted sum of inputs is transformed into outputs from one or more nodes in a layer of the network. The activation function used in the hidden layer is usually chosen based on the nature of the neural network architecture. We used the Rectified Linear Unit (ReLU) activation function, the most common function for hidden layers for neural network models with MLP architectures [32]. The activation function for the output layer is based on the type of prediction problem that we are solving. Since our problem is a classification problem and more than two mutually exclusive classes (multiclass classification), our output layer will have one node per class, and a softmax activation should be used [32].

3.3 Loss function

Cross-entropy is the default loss function that is used for multi-class classification problems. Cross-entropy will calculate a score that summarizes the average difference between the actual and predicted probability distributions for all classes in the problem.

3.4 Training and validation of the data set

Once configured, the neural network model needs to be trained on our data set consisting of input features and the desired class as output. The back-propagation method used the training procedure: we give the input neurons the primary pattern, and therefore, the network provides its output. If this is not equal to the desired output pattern, then the procedure computes the difference (mean square error) between these two values and changes the weights to minimize them. These operations are repeated for each. The data set was divided into training, validation, and test data set. We assigned small random values except 0 to weights utilizing 500 gray-scale images of thin sections from the data set to train the neural network, 125 for each Dunham class. The image data sets represent micro photos from previous studies carried out by different authors in the shallow-water carbonates of the Upper Cretaceous, Kruja zone (Albania) [33,34]. Thin sections affected by dolomitization and recrystallization were not taken into count by us. Our model, after each epoch, learns the data and updates the weights properly. After some iterations, the model starts memorizing the data, and even though the training error decreases, the validation error increases, causing the overfitting of the model. We used early stopping as a form of regularization to avoid overfitting (Figure 11). The validation data set is represented by 154 images (38 images for each texture class), and it was tested every 20 epochs. During the training and validation tests, the training error in continuity decreases as training proceeds, while the validation set error only decreases up to a certain point (two points). It starts to increase (Figure 11). As shown in Figure 11, after some iteration, the training is stopped early to prevent model overfitting at the minimum of the validation error that corresponds to 0.63. The related training error is 0.34.

Figure 11 
                  Training and validation error every 20 epochs.
Figure 11

Training and validation error every 20 epochs.

3.5 Test of the data set

The test set is a separate data set used to test the trained model. We utilized 348 images (87 for each class) taken from the same data set to test the technique. The MLP has classified exactly 315 (90.5%) images, and 33 (9.5%) images were incorrectly classified. Regarding mudstone class type, two images were classified as wackestone and packstone due to the secondary porosity of rounded shape filled with sparry calcite (Table 1). As for the wackestone class type, three images were classified as mudstone due to the very fine-grained bioclasts that cannot be distinguished at the used magnification. One of the wackestones was classified as packstone because of irregularly distributed empty fenestrae (Table 1). If we look at the packstone class type, we can notice that one of the images was classified as wackestone. Very fine peloidal grains are not detectable at the used magnification.

Table 1

Confusion matrix of test set from Kruja zone

True class
Predicted class M 84 3 0 0
W 2 83 1 0
P 1 1 80 3
G 0 0 6 84

M = mudstone, W = wackestone, P = packstone, G = grainstone.

On the other hand, six packstones images were classified as grainstones due to the coarse bioclast (mainly rudist fragments) occupying the entire field of view (Table 1). The last class type corresponds to grainstones, and it is the most precise classification since only three of the images were incorrectly classified as packstones. This is because of the presence of intraclasts that are mainly reworked packstones. To summarize the visualization of the algorithm’s performance, we have used a confusion matrix. It is a table where the columns represent the true classes, and the rows represent the four predicted classes (Table 1). From this table, every error that occurs with the adjacent with the correct one, except mudstone class where only one of the images is misclassified as packstone, but we can see that a grainstone is never classified as mudstone and vice-versa (Table 1 and Figure 12).

Figure 12 
                  Misclassified image in test set, green points show correct class and red points corresponding neural network output.
Figure 12

Misclassified image in test set, green points show correct class and red points corresponding neural network output.

To fulfill Table 1, we used a classification scheme where the highest output suggests the choice of the class. The problem is when the MLP’s four output values are very similar, and the highest value differs from 1. In such cases, the MLP classification of the image has a high probability of being uncertain. Only with the specialist’s help is it possible to classify the aforementioned images precisely. Those were chosen using a simple threshold rule. The specialist should classify the relevant image if the highest output value is less than or equal to the rejection threshold. Otherwise, the proposed MLP classification can be accepted (Figure 13).

Figure 13 
                  The classification percentages for each value of rejection threshold in range [0.0, 1.0].
Figure 13

The classification percentages for each value of rejection threshold in range [0.0, 1.0].

The optimal rejection threshold value is significant. If the rejection threshold value increases, more images are rejected, making fewer errors.

Each of the highest output values is compared to a rejection value in the range [0.0, 1.0] using the MLP output values for the test set. According to Figure 13, the number 0.55 appears to be the rejection threshold for classifying an appropriate percentage of images as correct, wrong, or uncertain. The threshold distinguishes 4% of the images as uncertain (14 images), 13.0% of the images as wrong (45 images), and 83% as correctly classified images (289 images). Calculating the difference between the first and second highest values is another criterion used to distinguish between uncertain classes. By additional testing, the MLP is unsure between the two classes corresponding to these two values if the difference is smaller than 0.4. Only 13 images need to be classified by direct observation under the microscope.

3.6 Geological setting

In the Triassic period, a general break-up of Adria, which was followed by the Early Jurassic disintegration of the Southern Tethyan Mega platform and the formation of the Adriatic Basin, resulted in the creation of the Apulian Carbonate Platform, Apennine Carbonate Platform, and Central Mediterranean Carbonate Platform [35]. During the Mesozoic and Paleogene, the passive margin of the Apulian Plate was bordered by broad carbonate platforms, known in Albania as the Kruja Zone or Kruja Platform. The Kruja Zone represents the most western coastal zone in the Outer Albanides. It lies in the center of Albania, and it extends northward into the Adriatic Dinaric platform (Montenegro, Croatia) and southward into the Gavrovo platform (Northern Greece) [36]. In Albania, only upper Mesozoic Paleogene deposits are exposed [37,38,39,40].

Sedimentologic and petrographic studies have been carried out on an Upper Cretaceous shallow-water carbonate succession near Burizana. This section lies northwest of the anticline structure, part of the Kruja Zone (Makareshi carbonate anticline structure) that represents the Apulian eastern passive margin [41] (Figure 14). The stratigraphic succession of Kruja is mainly composed of thick deposits of Cretaceous carbonates (about 1.5 km thick), confined in a subtidal to the supratidal environment.

Figure 14 
                  Map facies from middle-upper Lias to upper Cretaceous in the peri Adriatic zone (after Zapaterra, 1994).
Figure 14

Map facies from middle-upper Lias to upper Cretaceous in the peri Adriatic zone (after Zapaterra, 1994).

This succession is interrupted by a stratigraphic gap that begins during the late Maastrichtian and continues (depending on the zone) until the Early Eocene [42]. During this gap, bauxite formation was formed [43]. After this gap, the series continues with bioclastic limestones (Middle Eocene). Above the limestone formation, the “passing marl” horizon of Late Eocene marks the transition to the Oligocene flysch, 1500 m thick. The Upper Cretaceous carbonate deposits of the Burizana section display eight typical microfacies, ranging from subtidal to supratidal environments [44] (Figures 15 and 16).

Figure 15 
                  Lithological column of the Burizana section (Qorri, [13]).
Figure 15

Lithological column of the Burizana section (Qorri, [13]).

Figure 16 
                  Images from different microfacies of the Burizana section: (a) mudstone with sparse small benthic foraminifera (mainly miliolids) and problematic algae Thaumatoporella; (b) wackestone with horizontally oriented ostracods; (c) packstone with large bivalve sections (rudists); (d) grainstone with benthic foraminifera (Moncharmontia sp., Quinqueloculina sp.).
Figure 16

Images from different microfacies of the Burizana section: (a) mudstone with sparse small benthic foraminifera (mainly miliolids) and problematic algae Thaumatoporella; (b) wackestone with horizontally oriented ostracods; (c) packstone with large bivalve sections (rudists); (d) grainstone with benthic foraminifera (Moncharmontia sp., Quinqueloculina sp.).

3.7 Burizana section as a key study

The test set of the Burizana section (Makareshi structure, Albania) consists of a total of 250 thin sections, which include 75 mudstones (30%), 70 wackestones (28%), 46 packstones (18.4%), and 59 grainstones (23.6%). The above four Dunham textural classes contain transition textures like mudstone-wackestone, wackestone-packstone, and packstone-grainstone. There are approximately 25 thin sections that were excluded from the test set because the original texture was affected by meteoric diagenesis. Since the thin sections of the Burizana section were previously studied under the microscope, it was possible to correlate manual and automatic classification.

The MLP has correctly determined the texture with 91.3% accuracy, which means that 229 of the entire images are correctly classified. The proper confusion matrix is displayed in Table 2.

Table 2

Confusion matrix of test set from Burizana section

True class
Predicted class M 73 2 0 0
W 2 66 0 0
P 0 1 42 8
G 0 1 4 51

M = mudstone, W = wackestone, P = packstone, G = grainstone.

Sedimentologic and petrographic characteristics can complicate the primary depositional texture, which is not captured by our technique. Neomorphism and partial dolomitization have been identified in the micritic matrix of wackestones. These diagenetic processes assign higher values to the packstone texture, confusing classification. For example, a small number of well-defined dolomite crystals in mudstone caused by diagenetic dolomitization were identified as grains during feature extraction, increasing the percentage of grainy material artificially.

On the other side, even the grain-supported texture shows some complications. Micritization, fine, and densely packed grains in some packstones are other complex features that our neural network cannot determine. As a result, the fine-grained packstones appear to have mud-supported texture and can be considered wackestone. In addition, since the studied section consists of shallow-water carbonates, the presence of intraclasts and peloids is very common, and it can be considered mud. As a result, the contrast between the grains (peloids and micritized grains) and the matrix is not always visible. Increasing the contrast may not personalize the different grayscale values during feature extraction. The grains should have a well-defined internal structure and clear boundaries so that the grayscale values contrast with the values in the matrix. These conditions are necessary for all packstones to be accurately determined by the neural network.

If we compare the classification accuracy between two textures, the mud-supported texture has been more accurately determined (94.3% accuracy) than the grain-supported texture (85.1 precision), and only 21 images were error classified. It is important to remember that the accuracy of determining texture depends on the difference between the two highest values. If the difference is less than 0.2, generally, the technique determines a mixture of two textures.

4 Conclusions

This study has successfully provided a technique based on image processing and a MLP neural network that enables us to automatically identify the Dunham texture and categorize carbonate rocks using grayscale images from thin sections. On two test sets of 348 and 250 photos, the accuracy of thin-section images was 90.5 and 91.3%, respectively. This percentage is sufficient for this preliminary application of the proposed methodology. In the future, more effective training, and test sets on carbonate rocks of different depositional settings and ages may bring further improvements. Image processing techniques should be carefully selected and adapted to each type of thin section’s optical properties. In addition, there is currently no standard system for imaging processing of thin sections. Still, we can avoid some problems by using high resolution and magnification during image acquisition. Our results are promising and show that the proper selection of features and specific neural networks can perform excellent automatic texture identification/classification in a fast and accurate way. In addition, it is possible to increase the number of texture classes in the future. We can consider transitional textures classes such as packstone–wackestone or wackestone–mudstone, and thin sections showing sin and post-depositional changes. This way, the specialists can apply the methodology to all carbonate rocks. To summarize, the current results show another practical application of neural networks in the earth sciences, to understand variation in carbonate factories in different geologic timescales creating the possibility to optimize the characterization of carbonate reservoirs.


We would like to thank the reviewers for taking the necessary time and effort to review the manuscript. We sincerely appreciate all your valuable comments and suggestions, which helped us in improving the quality of the manuscript.

  1. Author contributions: O.F. and A.F. conceived of the presented idea. O.F. developed the theory and performed the computations together with M.M. A.F contributed to the thin section description and in the selection of the most representative micro photos. K. S., R.M., and J.P. verified the analytical methods. All authors discussed the results and contributed to the final manuscript. O.F. and A.F. took the lead in writing the manuscript.

  2. Conflict of interest: The authors state no conflict of interest.


[1] Radwan AE, Trippetta F, Kassem AA, Kania M. Multi-scale characterization of unconventional tight carbonate reservoir: Insights from October oil filed, Gulf of Suez rift basin, Egypt. J Pet Sci Eng. 2021 February;197:107968.10.1016/j.petrol.2020.107968Search in Google Scholar

[2] Gamil MS, Abdullah AAEA, Ahmed ER, Talha Q, Nevin A. The influence of carbonate textures and rock composition on durability cycles and geomechanical aspects of carbonate rocks. Acta Geotechnica. 2022 April;18:105.10.1007/s11440-022-01561-1Search in Google Scholar

[3] Lokier SW, Al Junaibi M. The petrographic description of carbonate facies: are we all speaking the same language? Sedimentology. 2016;63(7):1843–85.10.1111/sed.12293Search in Google Scholar

[4] Embry AFI, Klovan JE. A Late Devonian reef tract on northeastern Banks Island N.W.T. Bull Can Pet Geol. 1971;19:730–81.Search in Google Scholar

[5] Dunham RJ. Classification of Carbonate Rocks, in Ham WE, ed. Classification of Carbonate Rocks According to Depositional Texture. Tulsa: AAPG; 1962. p. 108–121.10.1306/M1357Search in Google Scholar

[6] Toms BA, Barnes EA, Uphoff IE. Physically Interpretable Neural Networks for the Geosciences: Applications to Earth System Variability. J Adv Modeling Earth Syst. 2020 June;12(9):1–20.10.1029/2019MS002002Search in Google Scholar

[7] Özlem P, Ali P, Taner E. Classification of plutonic rock types using thin section images with deep transfer learning. Turkish J Earth Sci. 2021;30(4):551–60.10.3906/yer-2007-19Search in Google Scholar

[8] Su C, Xu SJ, Zhu KY, Xiao-Can Z. Rock classification in petrographic thin section images based on concatenated convolutional neural networks. Earth Sci Inform. 2020;13:1477–84.10.1007/s12145-020-00505-1Search in Google Scholar

[9] Marmo R, Amodio S, Tagliaferri R, Ferreri V, Longo G. Textural identification of carbonate rocks by image processing and neural network: Methodology proposal and examples. Comput Geosci. 2005;31(5):649–59.10.1016/j.cageo.2004.11.016Search in Google Scholar

[10] Singh N, Singh TN, Tiwary A, Kripa M. Textural identification of basaltic rock mass using image processing and neural network. Comput Geosci. 2010;14:301–10.10.1007/s10596-009-9154-xSearch in Google Scholar

[11] Xiaokang L, Haijun S. Automatic identification of fossils and abiotic grains during carbonate microfacies analysis using deep convolutional neural networks. Sediment Geol. 2020;410:105790.10.1016/j.sedgeo.2020.105790Search in Google Scholar

[12] Xiaobo L, Huaiyuan W, Hongdi J, Anlin S, Liancheng W. Research on intelligent identification of rock types based on faster R-CNN methos. IEEE Access. 2020 January;8:21804–12.10.1109/ACCESS.2020.2968515Search in Google Scholar

[13] Koeshidayatullah A, Morsilli M, Lehrmann D, Al-Ramadan K, Payne J. Fully automated carbonate petrography using deep convolutional neural networks. Mar Pet Geol. 2020 December;122:104687.10.1016/j.marpetgeo.2020.104687Search in Google Scholar

[14] Cheng G, Guo W. Rock images classification by using deep convolution neural network. J Phys. 2017; Conference Series 887:1–6.10.1088/1742-6596/887/1/012089Search in Google Scholar

[15] Zhang Y, Li M, Han S, Ren Q, Shi J. Intelligent identification for rock-mineral microscopic images using ensemble machine learning algorithms. Sensors. 2019;19(18):3914.10.3390/s19183914Search in Google Scholar PubMed PubMed Central

[16] Joseph S, Ujir H, Hipiny I. Unsupervised classification of intrusive igneous rock thin section images using edge detection and colour analysis. IEEE International Conference on Signal and Image Processing Applications. Kuching, Malaysia; 2017. p. 530–535.10.1109/ICSIPA.2017.8120669Search in Google Scholar

[17] Tian Y, Guo C, Lv L, Li F, Gao C. Multi-color space rock thin-section image classification with SVM. IEEE 8th Joint International Information Technology and Artificial Intelligence Conference. Chongqing, China: 2019. p. 571–74.10.1109/ITAIC.2019.8785477Search in Google Scholar

[18] Patel A, Chatterjee S. Computer vision-based limestone rock-type classification using probabilistic neural network. Geosci Front. 2016;7(1):53–60.10.1016/j.gsf.2014.10.005Search in Google Scholar

[19] Młynarczuk M, Gorszczyk A, Slipek B. The application of pattern recognition in the automatic classification of microscopic rock images. Comput Geosci. 2013;60:126–33.10.1016/j.cageo.2013.07.015Search in Google Scholar

[20] Lima R, Bonar A, Coronado D, Marfurt K, Nicholson C. Deep convolutional neural networks as a geological image classification tool. Sediment Rec. 2019;17:4–9.10.2110/sedred.2019.2.4Search in Google Scholar

[21] Lima R, Marfurt K, Duarte D, Bonar A. Progress and challenges in deep learning analysis of geoscience images. 81st EAGE Conference and Exhibition; 2019. p. 1–5.Search in Google Scholar

[22] Lima R, Suriamin F, Marfurt K, Pranter M. Convolutional neural networks as aid in core lithofacies classification. Interpretation. 2019;7(3):27–40.10.1190/INT-2018-0245.1Search in Google Scholar

[23] Lima R, Duarte D, Nicholson C, Slatt R, Marfurt K. Petrographic microfacies classification with deep convolutional neural networks. Comput Geosci. 2020;142:104481.10.1016/j.cageo.2020.104481Search in Google Scholar

[24] Chatterjee S. Vision-based rock-type classification of limestone using multi-class support vector machine. Appl Intell. 2013;39:14–27.10.1007/s10489-012-0391-7Search in Google Scholar

[25] Baykan N, Yılmaz N. Mineral identification using color spaces and artificial neural networks. Comput Geosci. 2010;36(1):91–7.10.1016/j.cageo.2009.04.009Search in Google Scholar

[26] Baraboshkin E, Ismailova L, Orlov D, Zhukovskaya E, Kalmykov G, Khotylev O, et al. Deep convolutions for in-depth automated rock typing. Comput Geosci. 2020;135:104390.10.1016/j.cageo.2019.104330Search in Google Scholar

[27] Adhinga F. Section; 2021 [cited 2021 09 12]. in Google Scholar

[28] Gonzalez R, Woods R. Digital image processing. New Jersey: Prentice Hall; 2004. p. 490–560, 617–621.Search in Google Scholar

[29] Liu-Yu S, Thonnat M. Description of object shapes by apparent boundary and convex hull. Pattern Recognit. 1997;26:107–95.10.1016/0031-3203(93)90091-ASearch in Google Scholar

[30] Brownlee J. Machine Learning Mastery; 2016 [cited 2021 April 10]. in Google Scholar

[31] Bishop MC. Neural networks for pattern recognition. Neural networks for pattern recognition. Oxford: Clarendon Press; 1988. p. 255–6.Search in Google Scholar

[32] Goodfellow I, Bengio Y, Courville A. Deep learning. Massachusetts, London, England: MIT Press Cambridge; 2016. p. 184, 195, 196.Search in Google Scholar

[33] Qorri A. Analiza petrografike dhe sekuenciale sedimentologjike e depozitimeve karbonatike të Kretakut të Sipërm të rajonit të Burizanës, zona tektonike e Krujës. PhD thesis. Tirana: Polytechnic University, Department of Earth Sciences; 2016.Search in Google Scholar

[34] Schlagintweit F, Kołodziej B, Qorri A. Foraminiferan-calcimicrobial benthic communities from Upper Cretaceous shallow-water carbonates of Albania (Kruja Zone). Cretac Res. 2015 September-December;56:432–46.10.1016/j.cretres.2015.04.009Search in Google Scholar

[35] Vlahovic I, Tisljar J, Velic I, Maticec D. Evolution of the adriatic carbonate platform: Palaeogeography, main events and depositional dynamics. Palaeogeography, Palaeoclimatol, Palaeoecology. 2005 13 May;220(3–4):333–60.10.1016/j.palaeo.2005.01.011Search in Google Scholar

[36] Meço S, Aliaj S. Geology of Albania. Gebrüder Borntraeger. Berlin-Stuttgart. 2000;1:244–6.Search in Google Scholar

[37] Robertson A, Shallo M. Mesozoic–Tertiary tectonic evolution of Albania in its regional Eastern Mediterranean context. Tectonophysics. 30 January 2000;316(3–4):198–254.10.1016/S0040-1951(99)00262-0Search in Google Scholar

[38] Heba G, Prichonnet G, El Albani A. Meteoric diagenesis of upper cretaceous and paleocene–eocene shallow-water carbonates in the Kruja Platform (Albania): geochemical evidence. Geologica Carpath. 2009;60(3):165–79.10.2478/v10096-009-0011-6Search in Google Scholar

[39] Heba G, Prichonnet G. L’intervalle Crétacé terminal-Éocčne de la marge passive d’Apulie en Albanie (Massifs de Kruje-Dajt et de Makareshi, Zone de Kruja): Faciés, organismes et cycles sédimentaires d’une plate-forme carbonatée. Bull Soc Géol Fr. 2006;5:249–66.10.2113/gssgfbull.177.5.249Search in Google Scholar

[40] Le Goff J, Cerepi A, Swennen R, Loisy C, Caron M, Muska K, et al. Contribution to the understanding of the Ionian Basin sedimentary evolution along the eastern edge of Apulia during the Late Cretaceous in Albania. Sediment Geol. 2015, 15 March;317:87–101.10.1016/j.sedgeo.2014.09.003Search in Google Scholar

[41] Zapaterra E. Source-Rock Distribution of the Periadriatic Region. AAPG Bull. 1994;3(78):333–54.Search in Google Scholar

[42] Gjata T, Skela V, Ylli L, Kici V, Nika E. Sur l’absence du Paléocène, de l’Yprésien et partiellement du Lutétien ainsi que de l’existence du Priabonien carbonaté dans la zone de Kruja. Bul U SH T, Ser Shk Nat. 1968;2:39–46.Search in Google Scholar

[43] Peza L. Mise ŕ jour d’un autre niveau stratigraphique dans le zone de Kruja (la coupe continue de “Shkalla e Vajes”). Përmbledhje Studimesh; 1973;1:51–63.Search in Google Scholar

[44] Schlagintweit F, Kołodziej B, Qorri A. Microbial-foraminiferal laminites from the Campanian of Albania. 17th Czech-Slovak-Polish Palaeontological Conference. Krakow; 20–21 October 2016. p. 80.Search in Google Scholar

Received: 2022-07-19
Revised: 2022-12-14
Accepted: 2022-12-19
Published Online: 2023-02-14

© 2023 the author(s), published by De Gruyter

This work is licensed under the Creative Commons Attribution 4.0 International License.

Downloaded on 29.3.2023 from
Scroll Up Arrow