Rock lithology classification and identification method based on multi-scale convolutional neural network
Through the multi-scale convolutional neural network and the improved MobileViT model, the low accuracy problem caused by single-scale feature extraction in the existing technology is solved, and efficient and accurate identification and classification of rock thin section microscopic images are achieved.
Patent Information
- Application Number
- CN202410585628.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-09-03
AI Technical Summary
Existing deep learning models only extract features from a single scale in rock thin-section microscopic image recognition and cannot fully utilize complex feature information, resulting in insufficient recognition accuracy.
A method based on multi-scale convolutional neural networks is used to extract features from rock thin section microscopic images. Through data enhancement and improved MobileViT model, combined with multi-scale convolution and inverted residual structure, the multi-scale feature information of the image is extracted.
It significantly improves the recognition and classification accuracy of rock thin-section microscopic images, improves the recognition efficiency, reduces the influence of human factors, and can identify more complex rock types.
Smart Images

Figure CN118587702A
Abstract
Description
Technical Field
[0001] The invention relates to a method for lithology identification of rock thin section images, and specifically to a method for rock thin section image recognition based on deep learning. Technical Background
[0002] Identifying rock lithology and analyzing the evolution of geological structures and geological environments has always been an important task in the field of geology. The manual identification method requires geologists to collect rock samples and make rock slices, observe and analyze the rock slices using a polarizing microscope, and then determine the rock lithology. The manual identification method is limited by the experience and expertise of the identification personnel. For large-scale rock thin section microscopic image recognition work, manual identification is time-consuming, labor-intensive and inefficient. With the promotion of computer vision technology in the fields of geology and lithology identification, manual identification methods are gradually being replaced.
[0003] At present, deep learning has played a great role in the field of image classification and recognition. Deep learning methods can automatically extract features from rock thin section microscopic images and identify different rock thin section images through different features. Compared with other types of images, the feature information in rock thin section microscopic images is more complex and more difficult to identify. These complex feature information have higher requirements for the feature extraction method of deep learning models, and deep learning models are required to capture as much detailed information as possible in rock thin section microscopic images. Existing deep learning models often only extract features from rock thin section microscopic images from a single scale, and cannot fully utilize the complex feature information in rock thin section microscopic images, resulting in the model's recognition accuracy is not high enough.
[0004] Chinese patent application CN113657492A discloses a classification method for graptolite fossil images. This classification and recognition method uses the EfficientNet convolutional neural network and transfer learning technology to process images, innovatively combining the ideas of deep transfer learning and biological classification to solve the difficulties in graptolite fossil image classification and improve the speed and accuracy of classification. However, this technology only extracts features from images at a single scale, and cannot extract feature information from images at multiple scales, resulting in insufficient precision of processed images. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a rock lithology identification method based on a multi-scale convolutional neural network. The method extracts features of rock thin section microscopic images at multiple scales through a convolutional neural network, effectively utilizes the complex feature information in the rock thin section microscopic images, and greatly improves the recognition and classification accuracy of rock thin section microscopic images.
[0006] In order to achieve the above object, the present invention proposes a rock lithology identification method based on a multi-scale convolutional neural network, and the rock lithology identification method specifically comprises the following steps:
[0007] Step S1, performing data enhancement on a rock thin section microscopic image dataset to obtain a data enhanced rock thin section microscopic image dataset;
[0008] Step S2, dividing the data-enhanced rock thin section microscopic image dataset into a training dataset and a test dataset in a ratio of 8:2;
[0009] Step S3: constructing a lightweight network MobileViT model, and modifying the structure of the lightweight network MobileViT model to obtain an improved MobileViT model;
[0010] Step S4, input the training data set into the improved MobileViT model for training, and verify the training effect through the test data set until the model accuracy converges, thereby obtaining a trained rock thin section microscopic image classification model;
[0011] Step S5: using the trained rock thin section microscopic image classification model to identify and classify the rock thin section microscopic image to obtain the name and confidence of the rock type.
[0012] Preferably, the rock thin section microscopic image dataset includes 10 different categories, namely, Olivine olivine, Pyroxene pyroxene, Hornblende hornblende, Biotite biotite, Plagioclase plagioclase, Andalusite andalusite, Staurolite, Garnet garnet, Orthoclase actinolite and Oolite oolite, with a total of 1249 rock thin section microscopic images.
[0013] Optionally, the data enhancement operation includes: sequentially performing size scaling, random rotation, random horizontal flipping, random vertical flipping, and random grayscale processing on each of the rock thin section microscopic images.
[0014] Optionally, the scaling includes: locking the aspect ratio of each of the rock thin section microscopic images, setting the width and height of each of the rock thin section microscopic images to 224 pixels, and obtaining scaled image data;
[0015] Optionally, the random rotation includes: randomly selecting a degree in the range of negative 20 degrees to 20 degrees to rotate each of the scaled images in turn to obtain rotated image data;
[0016] Optionally, the random horizontal flipping includes: sequentially flipping each of the rotated images horizontally with a probability of 50% to obtain horizontally flipped image data;
[0017] Optionally, the random vertical flipping includes: vertically flipping each of the horizontally flipped images in sequence with a probability of 50% to obtain vertically flipped image data;
[0018] Optionally, the random grayscale processing includes: performing random grayscale processing on each of the vertically flipped images in turn with a probability of 10% to obtain the enhanced rock thin section microscopic image data set;
[0019] Preferably, S3 is specifically:
[0020] A lightweight network MobileViT model was constructed, and the input layer image size and Loss function learning rate of the MobileViT model were set. The 3x3 convolution at the head of the MobileViT model was replaced with a multi-scale convolution. According to the number of categories of the rock thin section microscopic image being 10, the last fully connected layer FC1000 of the MobileViT model was changed to FC10 to obtain an improved MobileViT model.
[0021] Preferably, the expression of the Loss loss function is:
[0022] Multi-classification cross entropy loss function:
[0023] In the formula, N is the number of samples, c represents the current category, M is the number of categories, and p ic represents the predicted probability that sample i belongs to category c, y ic is the true label of sample i belonging to category c, which is a binary indicator function, which is 1 when the sample belongs to category c and 0 otherwise.
[0024] Preferably, S4 is specifically:
[0025] The training data set is input into the improved MobileViT model for training, and the model accuracy is continuously optimized by adjusting the deep learning hyperparameters until the model accuracy converges, thereby obtaining a trained rock thin section microscopic image classification model.
[0026] Preferably, the expression for calculating the model accuracy is:
[0027] Accuracy: Accuracy = (TP + TN) / (TP + FP + TN + FN)
[0028] In the formula, TP (True Positives) represents the number of positive samples predicted as positive; TN (True Negative) represents the number of negative samples predicted as negative; FP (False Positives) represents the number of negative samples predicted as positive; FN (False Negatives) represents the number of positive samples predicted as negative.
[0029] Preferably, the deep learning hyperparameters include: training batch size, number of iterations, initial learning rate, and MobileViT model parameters.
[0030] Preferably, S5 specifically includes: identifying and classifying the rock thin section microscopic image by using the improved MobileViT model, and selecting the category with the highest confidence as the rock lithology result identified by the improved MobileViT model according to the output result of the fully connected layer.
[0031] Preferably
[0032] The advantages of the present invention are:
[0033] 1) The proposed model extracts features from each pixel in the rock thin section microscopic image without manual operation, thus avoiding the influence of subjective factors.
[0034] 2) Compared with the traditional technology, the present invention is not affected by human factors, has high efficiency in identifying rock thin section microscopic images, and requires almost no additional cost.
[0035] 3) Compared with the prior art, the present invention greatly improves the recognition accuracy of rock thin section microscopic images by combining a multi-scale method, can recognize more complex rock thin section microscopic images, analyze the lithology of rock thin section microscopic images in real time, and output the results of rock thin section microscopic image classification and recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. It is obvious that the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0037] Figure 1 is a flow chart of the method of the present invention;
[0038] Figure 2 This is a multi-scale convolution structure diagram of the present invention;
[0039] Figure 3This is a structural diagram of the improved MobileViT model of the present invention;
[0040] Figure 4 This is the inverted residual structure diagram of the present invention;
[0041] Figure 5 This is an example diagram of the rock thin section microscopic image recognition results of the present invention. Figure 6 The improved MobileViT model recognition step diagram of the present invention DETAILED DESCRIPTION
[0042] The present invention is described clearly and completely below in conjunction with the accompanying drawings. A person skilled in the art will be able to implement the present invention based on these descriptions. Before describing the present invention in conjunction with the accompanying drawings, it should be particularly noted that:
[0043] The technical solutions and technical features provided in each part of the present invention, including the following description, may be combined with each other if there is no conflict.
[0044] In addition, the embodiments of the present invention involved in the following description are generally only a part of the embodiments of the present invention, rather than all the embodiments. Therefore, based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0045] About the terms and units in the present invention: The term "comprises" and any variations thereof in the description and claims of the present invention and related parts are intended to cover non-exclusive inclusions.
[0046] Example 1
[0047] Reference Figure 1 As shown, the present invention proposes a rock lithology classification and identification method based on a multi-scale convolutional neural network, which specifically includes the following steps:
[0048] Step S1, performing data enhancement on a rock thin section microscopic image dataset to obtain a data enhanced rock thin section microscopic image dataset.
[0049] This step is used to expand the rock thin section microscopic image dataset to prevent poor model fitting due to a small dataset and to further improve the generalization ability of the model.
[0050] In this embodiment, the data enhancement in step S1 includes: sequentially performing size scaling, random rotation, random horizontal flipping, random vertical flipping, and random grayscale processing on each of the rock thin section microscopic images.
[0051] In this embodiment, the data enhancement operation includes: sequentially performing size scaling, random rotation, random horizontal flipping, random vertical flipping, and random grayscale processing on each of the rock thin section microscopic images.
[0052] In this embodiment, the size scaling includes: locking the aspect ratio of each of the rock thin section microscopic images, setting the width and height of each of the rock thin section microscopic images to 224 pixels, and obtaining scaled image data;
[0053] In this embodiment, the random rotation includes: randomly selecting a degree within a range of negative 20 degrees to 20 degrees to rotate each of the scaled images in turn to obtain rotated image data;
[0054] In this embodiment, the random horizontal flipping includes: sequentially flipping each of the rotated images horizontally with a probability of 50% to obtain horizontally flipped image data;
[0055] In this embodiment, the random vertical flipping includes: vertically flipping each of the horizontally flipped images in turn with a probability of 50% to obtain vertically flipped image data;
[0056] In this embodiment, the random grayscale processing includes: performing random grayscale processing on each of the vertically flipped images with a probability of 10% in turn to obtain the enhanced rock thin section microscopic image dataset. The enhanced rock thin section microscopic image dataset includes 10 different categories of olivine, common pyroxene, amphibole, biotite, plagioclase, andalusite, staurolite, garnet, actinolite and oolite, with a total of 12092 rock thin section microscopic images.
[0057] Step S2: divide the data-enhanced rock thin section microscopic image dataset into a training dataset and a test dataset at a ratio of 8:2. The training dataset includes 9714 rock thin section microscopic images, and the test dataset includes 2378 rock thin section microscopic images.
[0058] Step S3: constructing a lightweight network MobileViT model, and modifying the structure of the lightweight network MobileViT model to obtain an improved MobileViT model;
[0059] The 3x3 convolution in the head of the MobileViT model is replaced with a multi-scale convolution. The structure of the multi-scale convolution is as follows: Figure 2As shown in the figure, multi-scale features are extracted in parallel in four different dimensions, 1x1 convolution is used to extract detail information in rock thin section microscopic images, 3x3 convolution is used to extract local information in rock thin section microscopic images, 5x5 convolution is used to extract global information in rock thin section microscopic images, and 1x1 convolution is used to extract small area information in rock thin section microscopic images after dimensionality reduction by downsampling. According to the number of categories of the rock thin section microscopic images being 10, the last fully connected layer FC1000 of the MobileViT model is changed to FC10 to obtain the improved MobileViT model.
[0060] The structure of the improved MobileViT model is as follows Figure 3 As shown in the figure, Conv is a convolutional layer for convolution processing, Global pool Linear is a global pooling and fully connected layer, MV2 is an inverted residual structure, and the MV2 with a downward arrow includes a downsampling operation. MobileViT Block combines the advantages of convolutional neural networks and visual attention mechanisms to encode local and global information of rock thin section microscopic images. Figure 4 The figure shows the internal structure of the inverted residual structure. The inverted residual structure can increase and reduce the dimension of the model, effectively capture and retain the important features of the image, and improve the performance of the model.
[0061] Step S4, input the training data set into the improved MobileViT model for training, adjust the deep learning hyperparameters, and verify the training effect through the test data set until the model accuracy converges to obtain a trained rock thin section microscopic image classification model;
[0062] The expression for calculating the accuracy of the model is:
[0063] Accuracy: Accuracy = (TP + TN) / (TP + FP + TN + FN)
[0064] In the formula, TP (True Positives) represents the number of positive samples predicted as positive; TN (True Negative) represents the number of negative samples predicted as negative; FP (False Positives) represents the number of negative samples predicted as positive; FN (False Negatives) represents the number of positive samples predicted as negative.
[0065] The deep learning hyperparameters include: training batch size, number of iterations, initial learning rate, and MobileViT model parameters.
[0066] Step S5: using the trained rock thin section microscopic image classification model to identify and classify the rock thin section microscopic image to obtain the name and confidence of the rock type.
[0067] The improved MobileViT model recognizes and classifies rock thin section microscopic images, calculates the confidence of each category corresponding to the rock thin section microscopic image, and selects the category name with the highest confidence as the final recognition result. Given rock thin section microscopic images of Andalusite, Staurolite, Biotite and Pyroxene, respectively, Figure 5 As shown in the figure, the recognition results of the improved MobileViT model are Andalusite, Staurolite, Biotite and Pyroxene, and the improved MobileViT model recognizes correctly. In the figure, class represents the category recognized by the improved MobileViT model for a given rock thin section microscopic image, prob represents the highest confidence corresponding to the category, and the horizontal and vertical axes are the pixel values of the rock thin section microscopic image.
[0068] The embodiments described above are only descriptions of the preferred modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A rock lithology classification and identification method based on a multi-scale convolutional neural network, characterized in that: The specific steps include: Step S1, performing data enhancement on a rock thin section microscopic image dataset to obtain a data enhanced rock thin section microscopic image dataset; Step S2, dividing the data-enhanced rock thin section microscopic image dataset into a training dataset and a test dataset in a ratio of 8:2; Step S3: constructing a lightweight network MobileViT model, and modifying the structure of the lightweight network MobileViT model to obtain an improved MobileViT model; Step S4, input the training data set into the improved MobileViT model for training, and verify the training effect through the test data set until the model accuracy converges, thereby obtaining a trained rock thin section microscopic image classification model; Step S5: using the trained rock thin section microscopic image classification model to identify and classify the rock thin section microscopic image to obtain the name and confidence of the rock type.
2. The rock lithology classification and identification method based on a multi-scale convolutional neural network according to claim 1 is characterized in that: The rock thin section microscopic image dataset includes 10 different categories, including Olivine, Pyroxene, Hornblende, Biotite, Plagioclase, Andalusite, Staurolite, Garnet, Orthoclase and Oolite, with a total of 1,249 rock thin section microscopic images.
3. The rock lithology classification and identification method based on a multi-scale convolutional neural network according to claim 1 is characterized in that: The data enhancement operation includes: sequentially performing size scaling, random rotation, random horizontal flipping, random vertical flipping and random grayscale processing on each of the rock thin section microscopic images.
4. The rock lithology classification and identification method based on a multi-scale convolutional neural network according to claim 1 is characterized in that: The S3 is specifically: A lightweight network MobileViT model was constructed, and the input layer image size and Loss function learning rate of the MobileViT model were set. The 3x3 convolution at the head of the MobileViT model was replaced with a multi-scale convolution. According to the number of categories of the rock thin section microscopic image being 10, the last fully connected layer FC1000 of the MobileViT model was changed to FC10 to obtain an improved MobileViT model.
5. The rock lithology classification and identification method based on a multi-scale convolutional neural network according to claim 4 is characterized in that: The expression of the Loss loss function is: Multi-classification cross entropy loss function: In the formula, N is the number of samples, c represents the current category, M is the number of categories, and p ic represents the predicted probability that sample i belongs to category c, y ic is the true label of sample i belonging to category c, which is a binary indicator function, which is 1 when the sample belongs to category c and 0 otherwise.
6. The rock lithology classification and identification method based on a multi-scale convolutional neural network according to claim 1 is characterized in that: The S4 is specifically: The training data set is input into the improved MobileViT model for training, and the model accuracy is continuously optimized by adjusting the deep learning hyperparameters until the model accuracy converges, thereby obtaining a trained rock thin section microscopic image classification model.
7. The rock lithology classification and identification method based on a multi-scale convolutional neural network according to claim 5 is characterized in that The expression for calculating the accuracy of the model is: Accuracy: Accuracy = (TP + TN) / (TP + FP + TN + FN) In the formula, TP (True Positives) represents the number of positive samples predicted as positive; TN (True Negative) represents the number of negative samples predicted as negative; FP (False Positives) represents the number of negative samples predicted as positive; FN (False Negatives) represents the number of positive samples predicted as negative. The deep learning hyperparameters include: training batch size, number of iterations, initial learning rate, and MobileViT model parameters.
8. The rock lithology classification and identification method based on a multi-scale convolutional neural network according to claim 1 is characterized in that: The S5 is specifically: The improved MobileViT model is used to identify and classify rock thin section microscopic images, and according to the output result of the fully connected layer, the category with the highest confidence is selected as the rock lithology result identified by the improved MobileViT model.
Citation Information
Cited By
Rock slice identification method, apparatus and device, and storage medium
CN120318578A
